What steps does the system go through when handling an SSH connection?   1. We try to log in via ssh   2. `sshd` starts pam and pam module to authenticate us   3. Depending on pam configuration, we need to provide username and password (pam checks `passwd` and `shadow` files)   4. pam checks for `hosts.allow/deny`, `/etc/shells`, and other things   5. If everything goes fine we are logged in   6. ???   7. Shell is started So my question is what mechanism is responsible for checking which shell is assigned to the user in their `passwd` file (in step 6)? Is it pam itself, some specific pam module, `sshd`, or something else? I know that I can replace the `passwd` file (for checking username and password) by writing a pam module, but how can I replace the `passwd` file for the shell entry?


Big tab spacings with Kate

Is there a way to configure Kate to use tab spaces of more than 16 spaces? I am using Kate to make up a tab separated file for import into a database and some of the data needs about 30 spaces between tab stops.


Why must loopback traffic be authorized using iptables to get web access?

I thought the following was necessary was necessary for outgoing HTTP on a desktop (non-server):               iptables -A INPUT  -p tcp -m multiport --sports 80,443 -m conntrack --ctstate ESTABLISHED -j ACCEPT     iptables -A OUTPUT -p tcp -m multiport --dports 80,443 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT      But, it turns out I need these two to make it work. I don't know why:               iptables -A INPUT -i lo -j ACCEPT     iptables -A OUTPUT -o lo -j ACCEPT      I know the last rule allows UDP to the `lo` interface. But, I thought all I needed was `outgoing TCP for NEW/ESTABLISHED connections` \+ `incoming TCP for ESTABLISHED connections`. It seemed counter-intuitive to me (because I'm still learning).


Is it safe to assume the tar.gz file is healthy?

I have a rather large tar.gz file (17GB) which is a tar.gz version of a directory. The problem here is I got the following message after the tar operation.               tar: Error exit delayed from previous errors      Now since it takes a long time to download, I just want to be sure that the file is healthy before downloading it. Is there a way to make sure of the file's integrity which does not take a lot of time? Currently all the checking solutions that I found take a lot of time to complete.


What would make the Simple Emacs Spreadsheet more newbie-friendly?

I am familiarizing myself with `ses` and I find that it's not very welcoming towards a new user. I am preparing to submit some sort of bug report or improvement suggestion, but I'm not really sure what would improve it. So far, things that I find unobvious, or confusing, or disturbing;   * `M-x apropos spreadsheet` returns nothing at all.      * I knew I had seen something about a built-in spreadsheet in Emacs somewhere recently. But what was it called again?     * Of course, most people have Google everywhere now, which is a good workaround. But what if you're trapped on a sinking submarine and all you have is Debian stable and no network?     * I'm not a heavy user of `finder-by-keyword` but I couldn't find it there either. It's not in "data" nor in "files". In desperation, I also looked in "tools" and "wp" but it's also not there.   * Running `M-x ses` in an existing buffer returns a disappointing error message.      * Not very surprising, but it would be nice if it could offer to create a new buffer?   * The link to `ses-example.ses` is not very helpful for finding out how to use it.      * This is the only "documentation" in the mode help! I expected the file to contain a simple tutorial, or at least a few lines of text explaining how to get started.     * Also, the fact that the file is in a read-only location makes it open in a mode where you can't edit it, thus cannot see how formulas etc. are done (without resaving in `/tmp` or something).   * It wasn't obvious at first how to enter text into a cell.      * (My sloppy brief check in the) Mode help indirectly suggested using the minus key to open up the cell's value for editing.     * Just typing something there results in `#######` though.     * Copy/paste from a piece of text I had in the clipboard did the same thing.     * For the record, `"` opens up the cell for text entry.     * Now that I know the answer, I see that in the mode help, I see that it's bound to `ses-read-cell` just like the minus and digit keys. But that's hardly very obvious!   * It wasn't obvious how to enter a formula into a cell.      * Now that I know the answer, I'm not entirely surprised ... but also not totally miffed.        * It would be nice if it knew that `=sum(` is something a naïve user might try?     * `(apply #'+ (ses-range A2 G2))` also resulted in `#######`       * ... because I had some empty cells in the range. Putting zeros there fixed it. To my mild surprise, I find that some spreadsheet conventions are firmly entrenched in my muscle memory, after actively doing everything in my power to avoid spreadsheets in general and Excel in particular since approcimately 1998. Still, my fingers expect `RET` to move to the next cell and `F2` to edit. But strictly speaking, I guess that's outside the scope of this discussion. I am on `emacs23` at the moment, so I will check whether any of this has improved in Emacs 24 before actually submitting anything anywhere. My strike plan so far:   * Revise the mode help documentation to add a few lines of basic instructions.   * Maybe also revise `ses-example.ses` to include some beginner notes?   * Propose an alias `spreadsheet-mode` to `ses-mode` in order to fix apropos.   * See if it's feasible to make empty cells count as zero?   * Maybe see if it wouldn't be too hard to put it somewhere reasonable in `finder-by-keyword`.   * Maybe try to live with the fact that `ses-mode` in an existing buffer works the way it does. Dear U.SE, thanks for being my rubber duck, and looking forward to any improvement suggestions from you. I hope this slightly fringe use of this site is tolerable.


Why is the output of find sorted in Cygwin but not in Solaris?

I wonder why `find` does not behave in the same way in Solaris as in Cygwin or Linux. I have a bunch of directories that have files called `CS##########`. Each `#` is a digits but there are always 10 digits after CS. When using `find` in Cygwin the list comes out ordered: `CS000000001` to `CS00002345`. When using `find` in Solaris the list come out completly unordered. I wonder if this is actually OS-related, or if it is due to the implementation of find.


How do I enable options for installed Ports in FreeBSD?

I installed the Vim editor using Ports and in the process didn't enable GTK2 or GNOME option. I assume that either these 2 options will let me use `gvim`. Here's my `pkg info vim`:               vim-7.4.430_1     Name           : vim     Version        : 7.4.430_1     Installed on   : Sun Sep  7 13:30:57 PHT 2014     Origin         : editors/vim     Architecture   : freebsd:10:x86:32     Prefix         : /usr/local     Categories     : editors     Maintainer     : sunpoet@FreeBSD.org     WWW            : http://www.vim.org/     Comment        : Improved version of the vi editor     Options        :             ATHENA         : off             CONSOLE        : on             CSCOPE         : on             EXUBERANT_CTAGS: on             GNOME          : off             GTK2           : off             LUA            : on             MOTIF          : off             NLS            : on             PERL           : on             PYTHON         : on      Now, I want to enable either the `GNOME` or `GTK2` option. I've tried `make deinstall` followed by `make reinstall` but I don't get the dialogs for choosing the options to enable just like I did when I installed Vim the first time. I've also tried `make deinstall` then `make install` but still no go.


Start different applications on second, third and fourth monitor

I've read some questions about running an application on the second monitor but none of the suggested options has worked for me. Besides that, I'm trying to run different applications no only in the second but also in the third and fourth monitor. I've tried               export DISPLAY=:0.1     export DISPLAY=:0.2     export DISPLAY=:0.3     export DISPLAY=:0.4     export DISPLAY=:1.1     export DISPLAY=:1.2     export DISPLAY=:1.3     export DISPLAY=:1.4      But none of them worked. Only               export DISPLAY=:0      works for monitor 1 However I found out that 'export DISPLAY:0' is relative to the monitor the mouse is located in. So if the mouse is in monitor 4 and I run 'export DISPLAY=:0' followed by, let say, 'eog image.jpg' it runs on that same monitor. Here is my running xorg.conf file. Perhaps someone can get some usefull information from it. It was generated by                   # nvidia-settings: X configuration file generated by nvidia-settings     # nvidia-settings:  version 304.64  (pbuilder@cake)  Wed Nov  7 10:04:06 UTC 2012          # nvidia-xconfig: X configuration file generated by nvidia-xconfig     # nvidia-xconfig:  version 304.48  (buildd@murphy)  Wed Sep 12 11:32:28 UTC 2012          Section "ServerLayout"              #Screen      4  "Screen4" RightOf "Screen3"         #Screen      5  "Screen5" RightOf "Screen4"         #Screen      6  "Screen6" RightOf "Screen5"         #Screen      7  "Screen7" RightOf "Screen6"     # Removed Option "Xinerama" "1"     # Removed Option "Xinerama" "0"         Identifier     "X.org Configured"         Screen      0  "Screen0" 0 0         Screen      1  "Screen1" RightOf "Screen0"         Screen      2  "Screen2" RightOf "Screen1"         Screen      3  "Screen3" RightOf "Screen2"         InputDevice    "Mouse0" "CorePointer"         InputDevice    "Keyboard0" "CoreKeyboard"         Option         "Xinerama" "1"     EndSection          Section "Files"         ModulePath      "/usr/lib/xorg/modules"         FontPath        "/usr/share/fonts/X11/misc"         FontPath        "/usr/share/fonts/X11/cyrillic"         FontPath        "/usr/share/fonts/X11/100dpi/:unscaled"         FontPath        "/usr/share/fonts/X11/75dpi/:unscaled"         FontPath        "/usr/share/fonts/X11/Type1"         FontPath        "/usr/share/fonts/X11/100dpi"         FontPath        "/usr/share/fonts/X11/75dpi"         FontPath        "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"         FontPath        "built-ins"     EndSection          Section "Module"         Load           "record"         Load           "extmod"         Load           "dbe"         Load           "dri2"         Load           "glx"     EndSection          Section "InputDevice"         Identifier     "Keyboard0"         Driver         "kbd"     EndSection          Section "InputDevice"         Identifier     "Mouse0"         Driver         "mouse"         Option         "Protocol" "auto"         Option         "Device" "/dev/input/mice"         Option         "ZAxisMapping" "4 5 6 7"     EndSection          Section "Monitor"         Identifier     "Monitor0"         VendorName     "Unknown"         ModelName      "LG Electronics LG TV"         HorizSync       30.0 - 83.0         VertRefresh     58.0 - 62.0     EndSection          Section "Monitor"         Identifier     "Monitor1"         VendorName     "Unknown"         ModelName      "LG Electronics LG TV"         HorizSync       30.0 - 83.0         VertRefresh     58.0 - 62.0     EndSection          Section "Monitor"         Identifier     "Monitor2"         VendorName     "Unknown"         ModelName      "LG Electronics LG TV"         HorizSync       30.0 - 83.0         VertRefresh     58.0 - 62.0     EndSection          Section "Monitor"         Identifier     "Monitor3"         VendorName     "Unknown"         ModelName      "LG Electronics LG TV"         HorizSync       30.0 - 83.0         VertRefresh     58.0 - 62.0     EndSection          Section "Monitor"         Identifier     "Monitor4"         VendorName     "Unknown"         ModelName      "LG Electronics LG TV"         HorizSync       30.0 - 83.0         VertRefresh     58.0 - 62.0     EndSection          Section "Device"         Identifier     "Device0"         Driver         "nvidia"         VendorName     "NVIDIA Corporation"         BoardName      "GeForce GT 610"         BusID          "PCI:1:0:0"         Screen          0     EndSection          Section "Device"         Identifier     "Device1"         Driver         "nvidia"         VendorName     "NVIDIA Corporation"         BoardName      "GeForce GT 610"         BusID          "PCI:1:0:0"         Screen          1     EndSection                    Section "Device"         Identifier     "Device2"         Driver         "nvidia"         VendorName     "NVIDIA Corporation"         BoardName      "GeForce GT 610"         BusID          "PCI:2:0:0"         Screen          0     EndSection                    Section "Screen"         Identifier     "Screen0"         Device         "Device0"         Monitor        "Monitor0"         DefaultDepth    24         Option         "Stereo" "0"         Option         "nvidiaXineramaInfoOrder" "DFP-0"         Option         "metamodes" "DFP-0: 1920x1080 +0+0; DFP-0: nvidia-auto-select +0+0; DFP-0: nvidia-auto-select +0+0; DFP-0: nvidia-auto-select +0+0; DFP-0: 1920x1080_60 +0+0; DFP-0: 1920x1080_60_0 +0+0; DFP-0: 1920x1080_60_1 +0+0; DFP-0: 1920x1080_60_2 +0+0; DFP-0: 1920x1080_30 +0+0; DFP-0: 1920x1080_24 +0+0; DFP-0: 1920x1080_60i +0+0; DFP-0: 1920x1080_60i_0 +0+0; DFP-0: 1360x768 +0+0; DFP-0: 1360x768_60 +0+0; DFP-0: 1280x1024 +0+0; DFP-0: 1280x1024_60 +0+0; DFP-0: 1280x720 +0+0; DFP-0: 1280x720_60 +0+0; DFP-0: 1280x720_60_0 +0+0; DFP-0: 1152x864 +0+0; DFP-0: 1152x864_60 +0+0; DFP-0: 1024x768 +0+0; DFP-0: 1024x768_60 +0+0; DFP-0: 800x600 +0+0; DFP-0: 800x600_60 +0+0; DFP-0: 720x480 +0+0; DFP-0: 720x480_60 +0+0; DFP-0: 640x480 +0+0; DFP-0: 640x480_60 +0+0; DFP-0: 640x480_60_0 +0+0; DFP-0: 640x480_60_1 +0+0"         SubSection     "Display"             Depth       24         EndSubSection     EndSection          Section "Screen"         Identifier     "Screen1"         Device         "Device1"         Monitor        "Monitor1"         DefaultDepth    24         Option         "Stereo" "0"         Option         "metamodes" "DFP-1: 1920x1080 +0+0; DFP-1: nvidia-auto-select +0+0"         SubSection     "Display"             Depth       24         EndSubSection     EndSection          Section "Screen"         Identifier     "Screen2"         Device         "Device2"         Monitor        "Monitor2"         DefaultDepth    24         Option         "nvidiaXineramaInfoOrder" "CRT-1"         Option         "Stereo" "0"         Option         "metamodes" "DFP-1: 1920x1080 +0+0; DFP-1: nvidia-auto-select +0+0"         SubSection     "Display"             Depth       24         EndSubSection     EndSection          Section "Screen"         Identifier     "Screen3"         Device         "Device3"         Monitor        "Monitor3"         DefaultDepth    24         Option         "Stereo" "0"         Option         "metamodes" "DFP-0: 1920x1080 +0+0"         SubSection     "Display"             Depth       24         EndSubSection     EndSection               Section "Extensions"         Option         "Composite" "Disable"     EndSection


ASCII art generator

I'm looking for an ASCII art generator (text is preferred, but images will do too) in the `sl` style, but with text instead of trains. Any suggestion?


Setting permissions for specific programs to run as guest

How do I set permissions for an HTTP server (nodejs) to run programs in `/usr/local/share/npm/` safely? My use case is to setup my OSX box to run cloud9 and use titanium to build iOS apps for iPhone/iPad. I got cloud9 running and am able to build an iPhone app from the browser, locally as an admin user. But while I can access the cloud9 instance from outside (via HTTP), I can not build apps as what-ever-user is when using cloud9 from afar. It's not clear to me what user account the cloud9 instance is using because I don't know how to look that up. I'm also a little uneasy with setting executable permissions as I'm new to unix security.


bash: Redirect IO , but not with suffixes

usually I use `XX 2>error.log` , but for debug purposes , I prefer the following syntax:               function XX()     {         redirect_io_to "error.log"     }      Is there such syntax available ? It's convenient because I setup my VIM to comment / uncomment a line with some shortcut key , I could easily comment this out / uncomment it.


grep and directories containing spaces

I would like to search all files containing an association of strings (here the files should contain 'arthur' AND ('déni' OR 'deni') for instance) in a directory and subdirectories. After some search I came up with the following code:               egrep -li 'arthur' `egrep -lir 'déni|deni' /path/to/files/`      the trouble is I get error messages because many files and directories contain spaces. Is there a way to go round this issue?


debian: aptitude install sshfs > Couldn't find any package whose name

Why aptitude don’t found sshfs? And how can I install sshfs via aptitude? Pleas, without 3rd-Partys. https://packages.debian.org/en/wheezy/sshfs I typed this:               root@s18:~# aptitude update     Hit http://security.debian.org wheezy/updates Release.gpg     Hit http://security.debian.org wheezy/updates Release     Hit http://ftp.de.debian.org wheezy Release.gpg     Hit http://security.debian.org wheezy/updates/main Sources     Hit http://ftp.de.debian.org wheezy Release     Hit http://security.debian.org wheezy/updates/contrib Sources     Hit http://security.debian.org wheezy/updates/non-free Sources     Hit http://security.debian.org wheezy/updates/main amd64 Packages     Hit http://ftp.de.debian.org wheezy/main Sources     Hit http://security.debian.org wheezy/updates/contrib amd64 Packages     Hit http://security.debian.org wheezy/updates/non-free amd64 Packages     Hit http://ftp.de.debian.org wheezy/contrib Sources     Hit http://security.debian.org wheezy/updates/contrib Translation-en     Hit http://security.debian.org wheezy/updates/main Translation-en     Hit http://ftp.de.debian.org wheezy/non-free Sources     Hit http://security.debian.org wheezy/updates/non-free Translation-en     Hit http://ftp.de.debian.org wheezy/contrib amd64 Packages     Hit http://ftp.de.debian.org wheezy/non-free amd64 Packages     Hit http://ftp.de.debian.org wheezy/contrib Translation-en     Hit http://ftp.de.debian.org wheezy/non-free Translation-en          root@s18:~# aptitude dist-upgrade     No packages will be installed, upgraded, or removed.     0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.     Need to get 0 B of archives. After unpacking 0 B will be used.          root@s18:~# aptitude install sshfs     Couldn't find any package whose name or description matched "sshfs"     Couldn't find any package whose name or description matched "sshfs"     No packages will be installed, upgraded, or removed.     0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.     Need to get 0 B of archives. After unpacking 0 B will be used.          root@s18:~# cat /etc/debian_version      7.5     root@s18:~#       My sources:               root@s18:~# cat /etc/apt/sources.list     deb http://ftp.de.debian.org/debian/ wheezy contrib non-free     deb-src http://ftp.de.debian.org/debian/ wheezy main contrib non-free     deb http://security.debian.org/ wheezy/updates main contrib non-free     deb-src http://security.debian.org/ wheezy/updates main contrib non-free     root@s18:~# ls /etc/apt/sources.list.d/     root@s18:~#      And               root@s18:~# aptitude search sshfs     root@s18:~# apt-cache search sshfs            root@s18:~# apt-get -s install sshfs     Reading package lists... Done     Building dependency tree            Reading state information... Done     E: Unable to locate package sshfs     root@s18:~#


Why should I build a custom kernel?

Several of my coworkers have been building custom kernels for their workstations and servers. What advantages/disadvantages are there to building a custom kernel? Why should I build a custom kernel?


allow mails to one address only from local server

On my companies mail server there is a mail address everyone@example.org which sends a mail to every user which is useful for internal communication etc. I want to restrict this recipient to only allow mails from our mail server and reject any mail from outside to this address. What is the best way to do this in postfix?


kernel panic Hardware Error - what hardware is responsible?

I'm having kernel panics every other day. below is a transcript of a photo of the console. How do I determine what hardware is responsible for the problem? (or is it software) Ubuntu 12.04 LTS server               [Hardware Error]: CPU:2   MC0_STATUS[-|UE|-|-|AddrV|UECC]: 0xb400200055000145     [Hardware Error]: MC0_ADDR: 0x0000000164fe77b0     [Hardware Error]: Data Cache Error: Data/Tag DWR error.     [Hardware Error]: cache level: L1, tx: DATA, mem-tx: DWR     [Hardware Error]: CPU:3 MC0_STATUS[-|UE|-|PCC|AddrV|CECC]: 0xb66b400000000135     [Hardware Error]: MC0_ADDR: 0x0000000164fe77b0     [Hardware Error]: Data Cache Error: Data/Tag DWD error.     [Hardware Error]: cache level: L1, tx: DATA, mem-tx: DRD     [Hardware Error]: CPU 3: Machine Check Exception: 4 Bank 0: b66b400000000135     [Hardware Error]: TSC bc02bd350de4 ADDR 164fe7bb0     [Hardware Error]: PROCESSOR 2:100f42 TIME 1378965147 SOCKET 0 APIC 3 microcode 10000c6     [Hardware Error]: CPU:3 MC0_STATUS[-|UE|-|PCC|AddrV|CECC]: 0xb66b400000000135     [Hardware Error]: MC0_ADDR: 0x0000000164fe77b0     [Hardware Error]: Data Cache Error: Data/Tag DWD error.     [Hardware Error]: cache level: L1, tx: DATA, mem-tx: DRD     [Hardware Error]: Machine Check: Invalid     Kernel panic - not syncing: Fatal machine check on current CPU     Shutting down cpus with NMI      Here is some additional logging that I found:               kernel: [58495.948100] ------------[ cut here ]------------     kernel: [58495.948108] WARNING: at /build/buildd/linux-lts-quantal-3.5.0/net/sched/sch_generic.c:255 dev_watchdog+0x272/0x280()     kernel: [58495.948109] Hardware name: MS-7576     kernel: [58495.948110] NETDEV WATCHDOG: eth0 (r8169): transmit queue 0 timed out     kernel: [58495.948111] Modules linked in: nfsd nfs lockd fscache auth_rpcgss nfs_acl sunrpc xfs vesafb radeon ttm drm_kms_helper snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_intel drm snd_hda_codec wmi i2c_algo_bit snd_hwdep snd_pcm snd_timer snd soundcore snd_page_alloc lp shpchp r8169 sp5100_tco i2c_piix4 firewire_ohci parport firewire_core kvm_amd edac_core k10temp edac_mce_amd serio_raw kvm mac_hid microcode crc_itu_t raid10 raid456 async_pq async_xor xor async_memcpy async_raid6_recov raid6_pq async_tx raid1 raid0 multipath linear pata_atiixp     kernel: [58495.948136] Pid: 0, comm: swapper/3 Tainted: G   M         3.5.0-23-generic #35~precise1-Ubuntu     kernel: [58495.948137] Call Trace:     kernel: [58495.948138]  <IRQ>  [<ffffffff81052c9f>] warn_slowpath_common+0x7f/0xc0     kernel: [58495.948144]  [<ffffffff81052d96>] warn_slowpath_fmt+0x46/0x50     kernel: [58495.948146]  [<ffffffff815a05b2>] dev_watchdog+0x272/0x280     kernel: [58495.948149]  [<ffffffff8101be03>] ? native_sched_clock+0x13/0x80     kernel: [58495.948151]  [<ffffffff810702d0>] ? __queue_work+0x330/0x330     kernel: [58495.948153]  [<ffffffff815a0340>] ? pfifo_fast_dequeue+0xe0/0xe0     kernel: [58495.948154]  [<ffffffff815a0340>] ? pfifo_fast_dequeue+0xe0/0xe0     kernel: [58495.948156]  [<ffffffff81062ce6>] call_timer_fn+0x46/0x160     kernel: [58495.948158]  [<ffffffff815a0340>] ? pfifo_fast_dequeue+0xe0/0xe0     kernel: [58495.948159]  [<ffffffff81064632>] run_timer_softirq+0x132/0x2a0     kernel: [58495.948162]  [<ffffffff810a4105>] ? ktime_get+0x65/0xe0     kernel: [58495.948164]  [<ffffffff8105ba88>] __do_softirq+0xa8/0x210     kernel: [58495.948166]  [<ffffffff810ab264>] ? tick_program_event+0x24/0x30     kernel: [58495.948168]  [<ffffffff816a841c>] call_softirq+0x1c/0x30     kernel: [58495.948170]  [<ffffffff81016245>] do_softirq+0x65/0xa0     kernel: [58495.948172]  [<ffffffff8105be6e>] irq_exit+0x8e/0xb0     kernel: [58495.948174]  [<ffffffff816a8d5e>] smp_apic_timer_interrupt+0x6e/0x99     kernel: [58495.948176]  [<ffffffff816a7aca>] apic_timer_interrupt+0x6a/0x70     kernel: [58495.948177]  <EOI>  [<ffffffff8103ff56>] ? native_safe_halt+0x6/0x10     kernel: [58495.948180]  [<ffffffff8101c993>] default_idle+0x53/0x1f0     kernel: [58495.948182]  [<ffffffff8101d8a9>] cpu_idle+0xd9/0x120     kernel: [58495.948184]  [<ffffffff8167b237>] start_secondary+0xc3/0xc5     kernel: [58495.948185] ---[ end trace ef52dc6dad6ceea1 ]---              # dmidecode -t 1 -t 3 -t 4 | egrep '(Manufacturer|Product|Serial|Socket|Version)'     Manufacturer: MICRO-STAR INTERNATIONAL CO.,LTD     Product Name: MS-7576     Version: 1.0     Serial Number: To Be Filled By O.E.M.     Manufacturer: MICRO-STAR INTERNATIONAL CO.,LTD     Version: 1.0     Serial Number: To Be Filled By O.E.M.     Socket Designation: CPU1     Manufacturer: AMD     Version: AMD Phenom(tm) II X4 B50 Processor     Serial Number: To Be Filled By O.E.M.


Automount post-unmount script

My intention is to spin-down an external USB drive after 20 minutes of not being used. In the normal case I would use hdparm for this but unfortunately this doesn't work on my external USB drive. It gives me errors like this:               hdparm -S240 /dev/sdc          /dev/sdc:      setting standby to 240 (20 minutes)     SG_IO: bad/missing sense data, sb[]:  70 00 05 00 00 00 00 0a 00 00 00 00 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00      Then I head of sgparm.               sdparm --flexible -C stop /dev/sdc         /dev/sdc: SAMSUNG   HD153WI       It spins down the disk for less than one second and then immediately spins up again. Even if the filesystem is not mounted. Then I found out that               eject /dev/sdc      indeed spins down the disk but also unmounts it. The next idea was to use automount to mount the drive when someone accesses its mount-path in the filesystem. Mounting works but after the drive unmounts, it doesn't spin down. What I want to do is to execute the eject command as above _after_ automount unmounts the drive. Do you have any ideas how to do that? Or even better do you have an easier solution?


saving output of another command

I need to select certain lines from the log file and also save them to a text file. I tried the following but none of them are working as expected. The file "todel.txt" shows 0 bytes.               tail -f general.log | grep Some_word > >(tee -a todel.txt)          tail -f general.log | grep Some_word ; tee  todel.txt          tail -f general.log | grep Some_word | tee -a todel.txt


How to resolve when the IP of a NFS server changes

I have a Windows NFS server and several CentOS linux servers which were mounting volumes from it. The Windows server moved to a new network and even though DNS works and the NFS mount was mounted by hostname, it appears the NFS client also makes note of the ipaddr value, which is no longer valid. This causes the typical hanging mounts, df, issues one would expect. How do I resolve this retroactively?


bash_completion for initscripts

I have writen my own initscript `/etc/init.d/myscript`. I can start and stop my script with the service command               service myscript start     service myscript stop      When I type `service <TAB>`, bash_completion displays all my initscripts from `/etc/init.d/`, including `myscript`. But when I type `service myscript <TAB>` nothing happens. I would like bash_completion to offer me `start`, `stop` as with other initscripts. For example, bash_completion works for `service cups <TAB>`, but I don't know where this is defined. There is no `/usr/share/bash- completion/completions/cups` or `/etc/bash_completion.d/cups`. So where does `service` get the info from? Where should I add my script info?


Concatenating fields from lines with different numbers of fields

Given input like this:               x y a b c t     p q w w t     a b c d     p q r      I'd like to concatenate fields from field 3 up to but not including the last one. If field 3 is the last field, I'd like to insert a placeholder. So given the input above, this is the preferred output:               x y a_b_c t     p q w_w t     a b c d     p q _ r      The end result is that all lines will have four fields. Is this possible in awk or cut or sed, etc?


Pipe Python Shell to source-highlight

When I try to make the Python shell get color:               python 2>&1 | source-highlight --failsafe -f esc -s python      the `>>>` prompt seems to be always _delayed_ by 1 command. Why is this happening, and how do I fix this?


Wine installation problems in CentOS

Every time I use...               yum install wine      I get a message saying the package isn't found. I have used `yum update` but that does not work either. Moreover I accidentally ran `chmod user:user /etc/yum`... The system is 64bit.


OpenWRT mount/boot ethernet HDD

I'm thinking about buying a cheap router and setting up OpenWRT with apache and ftp on it. My idea is to buy an ethernet enclosure & a HDD and hook it up to OpenWRT to replace flash root filesystem. Will this enclosure work as I expect? Or perhaps I can abuse ethernet port with "etnernet to USB" connector, hook up an USB HDD, boot OpenWRT and mount the HDD as USB HDD?


linux with 3.2.x kernel

Is there a major Linux distribution that uses 3.2.x kernel?


How do you install a GUI like GNOME on a Linux machine via PuTTY?

1. I installed PuTTY on my Windows machine    2. I've been able to do remote login to my Linux machine (it is not local) via PuTTY command prompt With that in mind, how do I install a GUI like GNOME and then log into it remotely?


Can I have different desktop directories on different workspaces on Gnome?

I am running Linux Mint with "Gnome Classic", I guess it's Gnome 2. I am currently using 3 workspaces, and I have nautilus handling my desktop. The problem is that my desktop is overloaded with files. And I prefer not having to store them in directories, as that would make one more window to open before accessing the file, I already have too many open. Can I change the "Desktop" directory for each workspace? Or maybe extend the desktop on the 3 workspaces, so that I can move each icon on the workspace I need? Do I have to change desktop managers? Or let another file browser than nautilus do the job (how would I do that?) ? Thanks. (and btw I'm new to using linux, if there's a better approach, please do say so) **EDIT:** This is what `env | grep XDG` gave me (nothing about a desktop):               jad@jad-PC ~ $ env | grep XDG     XDG_SESSION_COOKIE=95dcb1ee36841dd22e3633040000000d-1337336042.360588-45732386     XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0     XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0     XDG_CONFIG_DIRS=/etc/xdg/xdg-gnome-classic:/etc/xdg     XDG_DATA_DIRS=/usr/share/gnome-classic:/usr/share/gnome:/usr/local/share/:/usr/share/     XDG_CURRENT_DESKTOP=GNOME      I also tried `env | grep Desktop`, which gave me nothing.


using Set uid to run a root command from non-root user

Consider the following two files. `summarize`'s executable UID bit has been set, so that another user belonging to another group can execute the summarize executable that uses the customers.dat file.               -rw-------  steve  sales  customers.dat     -rwsr-xr-x  steve  sales  summarize      Now consider the following two files:               -rwxrwx--- 1 root   root   5974 May 17 13:53 1.out     -rwsrwsrwx 1 root   root   5970 May 17 14:03 a.out      Both are executables, and I want that some other user runs `a.out`, which calls `1.out` within itself using the `system("./1.out");` call. But I am always getting permission denied error               sh: ./1.out: Permission denied      To me, both scenarios look the same. Why do I get the permission denied error? Am I missing something?


Suggestions for a Linux distribution for a dedicated SFTP server

I have a desktop which has more than 16GB of memory that I want to dedicate as an SFTP server. Many people have suggested that I install Linux, so I have decided to go with Linux. I am puzzled and unable to judge which distribution to install. I have no ideas or exposure to Linux before. Are there any suggestions to help me meet my requirement?


Booting Operating System from bootable secondary Hard disk via VirtualBox

I have attached a new bootable Hard Disk to my computer. I can boot to an operating system from each one. When I boot into an Ubuntu system in one Hard Disk, is it possible to boot into the other Hard Disk from virtualbox so that I have both operating systems running at the same time?


Difference between sudo -s and sudo su -

It might be a duplicate and I'm pretty sure I already show an answer to that somewhere, but I wondered what are the difference in term of right and variable and other stuff between `sudo -s` and `sudo su -`.   As far as I'm concern they both open a root shell where I can do whatever I want but I wondered if I could experience some differences one day. Also this question on askUbuntu does not address my concerns


Gnome, KDE, XFCE... which is most simple and customizable?

This'll be my first Linux install, so I've never had to choose between a desktop environment (I come from OS X) -- forgive me if I'm not fully literate on where exactly the OS ends and the desktop manager begins. My needs are:   * Customizability (I like my work environment to look and function a particular way) -- especially being able to move and organise windows using keyboard commands and shortcuts.   * Simplicity: I like as little real estate to be taken up by graphical widgets and toolbars as possible (as I said, I tend to avoid the mouse). If it were up to me, windows would just show content, not even a scrollbar.    * Performance: I hear Gnome can be slow and bloated. Is this the case? I will be using the environment as an IDE. I was going to go with Arch at first, but being a Linux newb with not that much time on my hands, it looked pretty daunting. Fedora looks like a good choice too.   * Side question: just how much does one's choice of windows manager affect which applications one can run?


SSH login to remote machine from another remote machine - How to manage connections?

Due to some security policy I had to ssh into a remote machine using another remote machine to which I ssh-ed. Here is the situation. I have access to BSD box at work and the access is only available on wired office network. Apart from this BSD box I have my own RHEL dev box which is wired network and I can access it even from home using VPN. So when am at home I remote ssh to my RHEL dev box and then ssh to my BSD box. There are times when my connection to this RHEL is dropped. What happens to my connection to BSD box when my connection to RHEL is dropped? How can I manage these connections?


Are there websites that allow one to search for which package contains a particular file?

I want to write some generic instructions on how to find the package that installs a particular file (the exact context is TeX packages: find the package in the Unix distribution that contains a particular TeX package). I might not know the precise path but will know the exact file name. Ubuntu has the package search facility which allows me to do precisely this: search for the packages containing a particular file. Which other Unix distributions have the same online search capability, and where are they? (I found a few related questions, but none seemed to give the answer I'm looking for (though my search skills are distinctly poor, I freely admit). In particular, I couldn't get the method described by What is the Fedora equivalent to the Debian/Ubuntu package search pages? to work for, say, `amsmath.sty` or `latex.ltx`.)


Terminate script using zenity progress bar

(GNOME2, Ubuntu 10.04 LTS) I've made a nautilus script, so that if I have a directory full of various codecs, then I just need to right click in that folder -> Scripts -> THISSCRIPT.txt, then presto, it recursively converts all the video files (identified by video mimetype) to x.264 codec with 128 Kbit mp3 to avi. So that they will have small size+good quality. This works, great! **QUESTION** : If I press "Cancel" on the Zenity progress bar, then the mencoder doesn't terminates.. How can I do this? I mean I need that If I press "Cancel" on the Zenity progress bar, it would terminate mencoder. How to do this?               #!/bin/bash          which mencoder > /dev/null 2>&1; if [[ $? -ne 0 ]]; then echo -e '\nerror, no mencoder package detected'; exit 1; fi     which zenity > /dev/null 2>&1; if [[ $? -ne 0 ]]; then echo -e '\nerror, no zenity package detected'; exit 1; fi          HOWMANYLEFT=0     find . -type f | xargs -I {} file --mime-type {} | fgrep "video/" | rev | awk 'BEGIN {FS="/oediv :"} { print $NF}' | rev | while read ONELINE         do         if file "$ONELINE" | egrep -qvi "x.264|h.264"             then echo $ONELINE         fi     done | sed 's/^.\///' | tee /tmp/vid-conv-tmp.txt | while read ONELINE         do         HOWMANY=`wc -l /tmp/vid-conv-tmp.txt | cut -d " " -f1`         mencoder "$ONELINE" -o "OK-$ONELINE.avi" -ovc x264 -x264encopts bitrate=750 nr=2000 -oac mp3lame -lameopts cbr:br=128 > /dev/null 2>&1         HOWMANYLEFT=`expr $HOWMANYLEFT + 1`         echo "scale=10;($HOWMANYLEFT / $HOWMANY) * 100" | bc | cut -d "." -f1     done | zenity --progress --text="Processing files ..." --auto-close --percentage=0


Daemon not running when started over ssh

I'm trying to start the rngd daemon by remotely starting it via ssh. Unfortunately it does not seem to run until I log onto the machine. The command I'm using is:               ssh -n -o StrictHostKeyChecking=no -i ... user@host "sudo rngd \            -r /dev/urandom -o /dev/random -t 10"`      When I call `cat /proc/sys/kernel/random/entropy_avail` I get low (150ish) values which makes me think that rngd is not running. However if I log onto the box, wait a few seconds and check, the pool is full (3000s).


Granting access to a restricted git shell

I tried setting up `git-shell` on our CentOS (6.4) system (after getting this working correctly on Ubuntu 13.10, maybe cross platform hot mess?) my /etc/passwd shows               git:x:500:500:Web Archive VCS:/home/git:/usr/bin/git-shell      and my shell commands are in /home/git/git-shell-commands               [root@domain git]# cd /home/git/git-shell-commands/ && tree     .     ├── addkey     ├── create     ├── drop     ├── help     └── list      But ssh'ing in is still giving me               Last login: Fri Nov 15 12:14:49 2013 from localhost     fatal: What do you think I am? A shell?     Connection to localhost closed.      I am working off of this resource http://planzero.org/blog/2012/10/24/hosting_an_admin- friendly_git_server_with_git-shell There was some confusion that this was licensed GIT commands (push/pull etc) but this is a restricted shell with pre set commands! Please anyone reading this make note ;) Installer script if you want to see steps https://github.com/ehime/bash-tools/blob/master/git-server-setup.sh **EDIT** I still have not been able to resolve this over the weekend, I HAVE added               # add to shells     echo '/usr/bin/git-shell' >> /etc/shells          # Prevent full login for security reasons     chsh -s /usr/bin/git-shell git      And have double checked that GIT Shell actually exists in /usr/bin               [root@domain bin]# ll /usr/bin | grep git     -rwxr-xr-x. 105 root root    1138056 Mar  4  2013 git     -rwxr-xr-x.   1 root root    1138056 Mar  4  2013 git-receive-pack     -rwxr-xr-x.   1 root root     457272 Mar  4  2013 git-shell     -rwxr-xr-x.   1 root root    1138056 Mar  4  2013 git-upload-archive     -rwxr-xr-x.   1 root root     467536 Mar  4  2013 git-upload-pack      This IS a root account that I am dealing with though, could that have something to do with it?


Using globbing/wildcards when Opening Files from Terminal

I have a folder `A`. Inside the folder, there are some files `a,b,c,d` and there is a subfolder, `B`, containing files `e,f,g`. Suppose I want to open files `a,b,c,d`: then I just type `xdg-open *`. However, this also goes into subfolder `B` and opens `e,f,g` as well. What's the easiest way to open just `a,b,c,d`? EDIT: what I really mean with the question is how to open all files in a folder, but not those contained in any subfolders.


Control character STTY issue

I am changing control character (e.g- ^C) using               stty intr ^_      under root privileges. It changes successfully. But when I am closing terminal and opening terminal again to check whether same control character is saved or not, its actually not. It shows its default value. How can I solve this issue?


How to check what is running in a server?

1. Is there any particular command to find out what servers (like: apache2, mysql-server, backup-server etc) are running inside a dedicated server?   2. If I will reboot my dedicated server will they all start automatically?   3. What is the safe way of reboot a dedicated server with all its applications server running inside it? Note: I am in a dedicated Debian server.


XFCE Cursor themes not installing

I know this is probably a bit of a newbie question but I'm having a little trouble installing any cursor themes. I extract the archives contents to `/usr/share/themes` but when I go to Menu>Settings>Mouse and touchpad>themes all I see is default. Using Archlinux, XFCE.


I want to modify root files while also being able to create non-root files in a single text editor session.

Catch 22: If I open my text editor **without** using `sudo`, I don't have permission to save any changes. If I open it **with** root privileges, any files I create are owned by root. I want to be able to create files that are owned by me (non-root user), and also edit files that require root access in the same session. Possible? Is this a Linux thing or a text editor setting? I'm using Sublime Text 2.


Book or online article on analysis and tuning Linux system performance

I am looking for a good book or online article on analysis and tuning Linux system performance. So far I've found openSUSE 12.2 System Analysis and Tuning Guide which looks promising. Any other recommendations?


Why does activation of LVM partition with large snapshot takes long time?

After creating large snapshot (I assume it drifted about 30GB from the original) I noticed that `vgchange -ay` took noticeable longer (to the point I thought computer hanged). What does the activation involves any why it takes so much to activate lvm snapshot?


X11 on server without forwarding

I'm running a java application on my ubuntu server which refuses to open if it cannot open a window (the content of the windows is of no interest for me). Since the server is not connected to any screen I don't want to have a full running x11 environment like openbox. Currently I'm forwarding this window over ssh to my pc but this way the program closes whenever I'm rebooting the pc. What could be a good solution for this? (I'll never need to see the content of the window)


Pattern matching exception for shell script

So I have the following shell script for batch renaming the episodes of some given TV series:               #!/bin/bash     #script for renaming files of form "*01*.ext" to "Episode 01.ext";     counter=0     for all_files in * ; do       counter=$(( $counter+1  )) #increments $counter by 1;       #creates counter "number" with two digit format (eg: 01):       if [[ 1 = $(( $counter<10 )) ]] ; then         number=0$counter       else         number=$counter       fi       #checks all file names for presence of $number and renames those files:       for numbered_file in *$number* ; do          ext=${numbered_file##*.}         mv "$numbered_file" "Episode $number.$ext"       done     done      I now want to improve the script to account for some quite common exceptions. In particular I don't want the "20" in "720p" to be interpreted as referring to "Episode 20". What I want then, is a way to refine the `*$number*` pattern from the inner for loop. (`number` is a variable assigned to `01`, `02`, `03` and so forth.) How do I achieve something along the lines of: `*` no "7" here `$number` no "0" or "p" here `*` Please feel free to point out anything else about the above script that is awkwardly done. It is my first attempt at a vaguely useful script and as such it is probably full of stylistic monstrosities. ;-)


Why does a bash here-string add a trailing newline char?

The following examples show that a newline is added to a _here-string_.   Why is this done?               xxd -p <<<'a'       # output: 610a          xxd -p <<<'a     '     # output: 610a0a


Change user and load entire environment in shell script

I'm having some trouble with an upstart script of ours that changes user and starts up a few ruby daemon processes. In the past i would simply `bash -c "do the business" -l someuser` making sure to use the `-l` flag to emulate a login. This has worked great until now, our ruby process has been throwing the following error: `require: no such file to load -- rubygems (LoadError)` after some investigation I found this error only occurs when I run the script as the root user, i.e. (when I `sudo su` or when being run by upstart). I think this is a PATH issue as when I manually set the path first it resolves the issue. Is there a way to change user and load the **entire** environment? I have also tried `su user -c` and `sudo`. * * * To make it easier to test I'm "rooting up" (`sudo su`) and running `which bundle` (bundle is a ruby thing). Here's what I get:   * `sudo -i -u webuser which bundle` # => no output   * `su -l webuser -c which bundle` # => no output   * `sudo su - webuser -c which bundle` # => no output But ssh'd in as webuser   * `which bundle` # => /opt/ruby/bin/bundle


Query USB current

How can I obtain information about the amount of current negotiated by a device attached to a USB port? I am looking for information similar to this presented by OS X in terms of current available and current required.


How to fix speckled flash videos in Linux Mint 14?

I have recently installed Linux Mint 14 and youtube and other flash based videos are displaying lots of yellow and red specks. It doesn't matter which browser is being used either. I've tried turning off hardware acceleration which didn't fix it. Any ideas? Hardware is an old Lenovo Thinkpad X61 Onboard video is using the driver for Intel 965GM ** Update ** I just thought I'd try the HTML5 video trial on youtube. Instead of using flash it instead uses HTML5 to render the video stream. However, the problem remains only the speckles are now all a red colour. ![speckles](http://i.stack.imgur.com/CoB5G.png)


Nginx + PHP + FTP - user permission issue

I have a wordpress copy installed on /home/username/public_html/site, and now the problem is :   1. Nginx running PHP with "www-data" identity   2. The site folder owner and group are "username", not "www-data"   3. So wordpress had no permission to create folder   4. I changed owner and group of "site" to "www-data", wordpress is working ok   5. But ftp can't create a folder - ftp is login as username/pass Is it possible to have a /home/username/public_html/site, and both working on PHP side and ftp side. Any advice is appreciated!


Moving unallocated space from Extended partition to create a Primary partition

This is my partition structure : ![Partition List](http://i.stack.imgur.com/oH5TA.png) I want to create another primary partition from that unallocated space. If I shrink sda2 to a size less than what I needed for to create another primary partition, will it move entire extended partition to right or just slices off extended space from it as it is contiguous ?


Best way to determine piped command to shell script?

Given `tree /some/directory | print.sh` Is there any way for _print.sh_ to know that "tree -f /some/directory" was called, without trying to parse `pid` processes?


chainload multiple grub2 bootloaders

This is the context: I have a laptop with one hd which contains 4 partitions:   * 2 for windows: (hd0,1), (hd0,2) -> For windows 7   * 2 for linux: (hd0,3), (hd0,4) -> For linux (logical partitions). The current "real" bootloader (in the MBR I mean) is the windows one. Behind, I use grub2win for specific purposes, and I would use it to chainload grub2 which is on (hd0,3). Here is the entry I added in grub.cfg to do this:               menuentry 'Chainloader 3' {        insmod chain        set root=(hd0,3)        chainloader +1     }      Unhappily, when I try to use it, I just have "nothing", a black screen without any error, and I really don't know what to do more. Here is the result of `fdisk -l`:               Disk /dev/sda: 320.1 GB, 320072933376 bytes     255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0xa2c2c4f8          Device Boot      Start         End      Blocks   Id  System     /dev/sda1   *        2048   209717247   104857600    7  HPFS/NTFS/exFAT     /dev/sda2       209717248   420339711   105311232    7  HPFS/NTFS/exFAT     /dev/sda3       420341758   625141759   102400001    5  Extended     Partition 3 does not start on physical sector boundary.     /dev/sda5       420341760   615651327    97654784   83  Linux     /dev/sda6       615653376   625141759     4744192   82  Linux swap / Solaris


Writing raw images safely to USB sticks

Trying lots of different linux, on all kinds of hardware I find my self typing commands like this quite often:               sudo dd if=xubuntu-13.10-desktop-amd64.iso of=/dev/sdc bs=10240      Needless to say, sooner or later I will mistype the destination and wipe a harddrive instead of the intended USB drive. I would like not to use `sudo` everytime here. On my system, a fairly modern Ubuntu, permissions on `/dev/sdc` are like: (when a stick is present):               $ ls -al /dev/sdc*     brw-rw---- 1 root disk 8, 32 Apr  6 22:10 /dev/sdc      **How do I grant my regular user write access to random USB sticks but not other disks present in my system?**


Why are web servers traditionally started as superuser?

Thinking about a future web server setup, it struck me that for some reason web servers usually start as root and then drop certain rights (`setuid`) for the worker processes. In addition there is often `chroot` involved, which isn't exactly meant as a security measure. What I was wondering, why can web servers (I have administrated everything from Apache, lighttpd to nginx) not use the capability system (`capabilities(7)`), such as `CAP_NET_BIND_SERVICE`, on Linux and simply start as non-root user? ... this way still listening on a privileged port below 1024. Or better, I think most of them could, but why isn't that common practice? Why not ...   * use `setcap(8)` with `CAP_NET_BIND_SERVICE` on the binary being run?   * set up the log folders to allow the (non-root) user to write there   * ..., if you felt like `chroot` helps at all, use `chroot` or `lxc` to "jail" the web server? There is nothing other than (worker) child process may kill parent that I could come up with that would make this less beneficial than starting outright as `root`. **So why are they traditionally being started as root when afterwards everything is done to get rid of implied security issues that come with it?**


Convert a date format

I have one problem with my date format. I want to change from one format to the other and vice verse. My date formats are:   * Format1 : 1/24/2014    * Format2 : Jan 24  How can I do this?


What can I do if I got locked out by cphulk?

Is there any way in Linux to create another user with root rights?   I got locked out by cphulk and I need some other way to log in. Notice many ways to fix this involve logging in to root or whm. CPHulk prevented that. So to fix this I need to loggin into root. To loggin into root I need this fixed first. So chicken and eggs problem.


Peer to peer~ish LAN storage

I have a distributed application that consists in a main CMS server where "human" users can upload videos, pictures (media content, basically) and a bunch of "players" that play those videos or pictures at certain times. Right now, each and every player connects via HTTP/SFTP to the CMS to grab the content it needs to play (erm... and plays it... if nothing is broken). It won't connect to the CMS again if the player has already downloaded the video it needs to play. I mean... is not that the CMS is streaming the videos or anything fancy like that... the player says " _Oh, I need to play the video Jenna_Jameson_meets_the_plumber.avi_ (to say something) _in 5 minutes. Do I have it already?_ " If yes, just play it when it should. Otherwise, connect to the CMS, download it and play it when it should. The players act more like a "cache" for the media to display. Now, there's a chance that a big number of those players are in the same private LAN, connected among themselves with a fast Ethernet connection (Much faster than the cheapy-weepy DSL connection that they may have with the CMS) So I was considering to implement something so the Players request the content from their neighbors before going to the CMS (both Players and CMS are coded in Python and use Ubuntu as O.S.) but then I thought that maybe there's something like that in place (and I that I could do it using pre-existing tools which I trust way more than anything I could implement myself). Does any of you know something that may work the way I want? One of the issues is that I'm not even too sure how to call that kind of application. I've taken a look to NFS file systems, but then (if I understood correctly) I would need to mount one NFS directory per "other" player, and every time I need one of those educational documentaries I want to play, I would need to traverse all those NFS directories, check if the video is in any of them and if not, go grab it from the CMS... That sounds a bit slow, right? Also, I don't know how to handle very well that the computers in the LAN may not be my players. I don't know how could I handle with a distributed filesystem the discovery of "my" players. If anyone could point me in the right direction, I'd appreciate it. Thank you in advance.


openvpn server doesn't NAT the incoming traffic

It's couple of days that I'm having hard time figuring out what's wrong with openVPN. Few days ago, I installed and configured openVPN on a Debian server and also on my Ubuntu client. I am facing a weird behavior: OpenVPN server NATs the incoming traffic whenever it wants, but not always! It looks that the **_iptables_** rules on the Debian server get deleted at some specified time every day (I'm not sure though), because **the next day if I re-enter the iptable rules (for NAT & DNS queries forwarding) like following,**               iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE     iptables -t nat -A PREROUTING -i tun+ -p udp --dport 53 -j DNAT --to-destination 8.8.8.8      **and force-reload openvpn daemon and restart openvpn (at both ends), the traffic gets routed as it should.** I've saved iptables rules in the file _/etc/iptables.conf_ and I reload it at boot ( _/etc/rc.local_ ), but nevertheless the problem still persists. Here is the content of my **_/etc/iptables.conf_** :               # Generated by iptables-save v1.4.14 on Tue Apr 15 13:50:46 2014     *security     :INPUT ACCEPT [166249:16762540]     :FORWARD ACCEPT [3659:1318578]     :OUTPUT ACCEPT [165776:17724102]     COMMIT     # Completed on Tue Apr 15 13:50:46 2014     # Generated by iptables-save v1.4.14 on Tue Apr 15 13:50:46 2014     *raw     :PREROUTING ACCEPT [169911:18081298]     :OUTPUT ACCEPT [165776:17724102]     COMMIT     # Completed on Tue Apr 15 13:50:46 2014     # Generated by iptables-save v1.4.14 on Tue Apr 15 13:50:46 2014     *nat     :PREROUTING ACCEPT [42:2524]     :INPUT ACCEPT [1:40]     :OUTPUT ACCEPT [24:1504]     :POSTROUTING ACCEPT [24:1504]     -A PREROUTING -i tun+ -p udp -m udp --dport 53 -j DNAT --to-destination 8.8.8.8     -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE     COMMIT     # Completed on Tue Apr 15 13:50:46 2014     # Generated by iptables-save v1.4.14 on Tue Apr 15 13:50:46 2014     *mangle     :PREROUTING ACCEPT [169911:18081298]     :INPUT ACCEPT [166249:16762540]     :FORWARD ACCEPT [3659:1318578]     :OUTPUT ACCEPT [165776:17724102]     :POSTROUTING ACCEPT [169435:19042680]     COMMIT     # Completed on Tue Apr 15 13:50:46 2014     # Generated by iptables-save v1.4.14 on Tue Apr 15 13:50:46 2014     *filter     :INPUT ACCEPT [166249:16762540]     :FORWARD ACCEPT [3659:1318578]     :OUTPUT ACCEPT [165776:17724102]     COMMIT     # Completed on Tue Apr 15 13:50:46 2014      Here I've posted my config files. The differences in my working client.conf & server.conf with those in that post are as follows:               # client.conf          user nobody     group nogroup         redirect-gateway def1 #bypass-dns bypass-dhcp      server:               # server.conf          ; duplicate-cn #not needed, commented out         user nobody     group nogroup          I'll be deeply grateful if you save me from this chaos!


Send text/input to all tabs

I'm using the Gnome terminal and am logged into different servers on each tab. Is there a way to send the same text/command to all the tabs at once?


Removing configured PROXY in fedora?

Some time back I configured proxy for fedora to install packages through yum. I forgot how exactly I did it. Now I don't need proxy any more.How can I reconfigure my proxy settings?


Installing AMD Radeon HD 7400M series fedora 20

I just installed fedora 20 on my second pc and its running pretty hot, I found a driver on the site http://support.amd.com/en- us/download/desktop?os=Linux%20x86_64. And i unpack it and i try sh sudo sh amd-driver- installer-13.35.1005-x86.x86_64.run and I get this Supported adapter detected. Check if system has the tools required for installation. fglrx installation requires that the system have kernel headers for 3.7 release. /lib/modules/3.11.10-301.fc20.i686+PAE/build/include/generated/uapi/linux/version.h cannot be found on this system. One or more tools required for installation cannot be found on the system. Install the required tools before installing the fglrx driver. Optionally, run the installer with --force option to install without the tools. Forcing install will disable AMD hardware acceleration and may make your system unstable. Not recommended. and I dont know what to do to het this right i have already tried:               yum install kernel-devel kernel-headers gcc -y      http://www.amd.com/US/PRODUCTS/NOTEBOOK/GRAPHICS/7000M/7400M/Pages/radeon-7400m.aspx


tmux, Vim and Solarized

# Premises Browsing around _tmux_ , _Vim_ and _Solarized_ I can find lots of complains about 256 colours and "user experience". Well, I'm having the opposite "problem", i.e. _Vim_ works well with a full _Solarized_ theme **only** in _tmux_. # Background I've been tweaking and tuning around for a bit now with my _Ubuntu_ terminal's and _Guake_ 's colour scheme and I almost got to the perfection which is reached when I'm using _tmux_ , which in turn means always. I'm trying now to understand **why** this is happening. Here below there are two Terminals, the one on the left is running only _Vim_ (showing the current `.vimrc`) whereas the other is running _Vim_ inside a _tmux_ session. As you can clearly see, only in the _tmux_ session the fonts are bold, which I guess is _correct_ (or not?). ![enter image description here](http://i.stack.imgur.com/MR44w.png) # Question Why does _tmux_ allow for bold font whereas the terminal, where _tmux_ is running, does not? Is it a bug or a feature?


Wireless bridged networking in KVM. Why is it so complicated?

I've been using VirtualBox (and sometimes VMWare) for years and I've never had any problem with the virtual network adapters, no matter if the physical ones were wired or not. I also played some time ago with KVM in a wired set-up and, although I had to edit some configuration files to get it working, I could also create a bridged adapter without any major problems. Today I decided (wrongly, it seems) to try to use KVM in a laptop running Ubuntu 13.10 and tried to create a virtual machine with bridged networking over a wireless interface. It was extremely painful to set this up. After following all the tutorials I found (for example) and having to reboot my laptop several times to get the connection back I just gave up and went back to my old well-known VirtualBox. And, actually, the first thing I noticed when I looked into the official KVM documentation was that they discourage from trying to bridge a wireless adapter since, according to them: > The here shown method, will not work with most(all?) wireless drivers, as > these do not support bridging. So, my question is:   * How come they say that most wireless adapters do not support bridging if it works in VirtualBox and VMWare just "out-of-the-box"?   * And what's the difference between these hypervisors that makes it so complicated in KVM, if it works at all?


Traffic getting routed through Apache

for some reason, certain outgoing traffic on my server gets routed to the apache webserver i am running. this problem just started happening. i have the webserver set up to use vhosts, the webserver config hasn't been changed for probably a month. if i try to open a connection to say google.com (note their is no www in the address), the page that shows is the default page for my webserver (meaning the site doesn't have a vhost). if i would have used www.google.com, it would show the expected google homepage. i don't know why this started happening, it is really weird. any help? running centos 6.3 x64 edit: i see the default page for my webserver if i use the webserver as a socks proxy for my computer at home. i just downloaded vnc and firefox on the server and tried navigating on there, it goes to the default webserver page too. if i use wget, it gets the proper page from the real google website. other processes on the server that try to open a connection to google.com (as well as other websites) show up in apache log files as well. from the machine, i can ping google.com and get the proper ip address it maps to.


Elementary OS only booting from USB, cannot boot to partitions on SSD (Windows and eOS)

I previously had Linux Mint Petra and Windows 7 installed on my Asus UX31a. This worked fine until I ran into some Wi-fi issues after messing around with NetworkManager. I decided since I didn't have too many files I should just re- install Mint, but then decided that eOS looked nicer so I'd try that. So, I used UUI to put eOS on my flash drive, tried the demo first, didn't really do much but everything seemed ok. I then used the full installation option and put it on /dev/sda3 where my old mint installation was (windows on sda1 and windows recovery on sda4 or something). The first time I didn't give it swap space but I tried that later on after trying a couple of other things. After the installation finished, the computer rebooted but would only boot into the USB through grub, and went to the grub rescue menu when I tried to boot without it in. I remember having a similar problem with Mint and resolved it with boot-repair. First I tried re-installing a couple of times, same thing, no luck. Then I got boot-repair again and tried that. However during `apt-get update` I get the warning `Failed to fetch cdrom://elementary OS 0.2 _Luna_ - Stable amd64 (20130810)/dists/precise/restricted/binary-amd64/Packages please use apt-cdrom to make this CD-ROM recognized by APT.` and similar warnings for /binary-i386 and the same two for /main/binary-XXX. I understand that Luna is based on Ubuntu and precise pangolin is a version of Ubuntu, is this the correct version? Also other postings online suggested using update manager to disable the "source" that was the cd I had installed. I didn't see that option in update manager. There weren't any issues adding the boot-repair repo or installing it so that seemed fine. Incidentally while typing this, I tried to install boot-repair again to verify that I had no errors but this type I got the error 'unable to locate package boot-repair' Edit: boot-repair installed after another apt-get update. (Is there no option for strike-through?) Boot-repair opens fine, I can run the standard fix and it gives me "grub-pc purge cancelled". Another thing I noticed about Boot-repair was that the "advanced settings" tabs displayed different things than the default that was listed here https://help.ubuntu.com/community/Boot-Repair in most cases, my options were grayed out or non-existent and sometimes grayed out options differed from what the wiki said. I'm sorry I don't have a screenshot, again I can't get grub- repair back Edit: Under the GRUB options tab the wiki has "Purge GRUB before reinstalling it" de-selected whereas mine is grayed out and selected. Under the MBR options tab, I have nothing. Finally under the Other Options tab, they have "Repair Windows boot files" checked, mine is grayed out and unchecked. I did run the boot-info thing, here is my paste; paste.ubuntu.com/7279707 Next I found a tutorial on re-installing grub from a liveCD. I can't find the tutorial now, but I'd seen it when fixing this with mint, I believe it was on the ubuntu community forums, I'm really sorry I can't locate it. The basic steps however were to mount the other partition, use chroot to uninstall grub and then re-install it. Everything worked fine up until the re-install grub step (the tutorial made me check I had internet so that wasn't it) where apt- get complained that the files/packages `grub-pc, grub-common` didn't exist. It told me that grub2-common did exist so I tried installing that and things seemed to work although I have no idea what it did. Nothing changed the next time I rebooted however and so now I'm back in a live session with no idea what to do. I have access to the school's lab computers so at worst I can give my USB some other distro and try to use that to fix it, but hopefully it won't come to that.


What are the world writable directories by default?

In a standard Linux filesystem, which of these common directories are world- writable **by default**?                /tmp       /etc      /var       /proc       /bin       /boot      /....      ....      Why are they world-writable? Does that pose a security risk?


Using exec in find over ssh from shell script

So, I am attempting to execute the following from within a shell script;               ssh -q $CUR_HOST "cd $LOGS_DIR; echo cd $LOGS_DIR; find . -name *.log -mmin +1440 -exec gzip {} \; exit"      When this runs, it generates the following error;               find: paths must precede expression     Usage: find [-H] [-L] [-P] [path...] [expression]      I've tried numerous variations based on things found on Google, but none seem to resolve this problem. Could anyone tell me what is wrong with this? _As a side note, when I manually login to the target host and run the same find command there, it works just fine. So, I'm led to think that it's something to do with the command being embedded in the double quotes of the ssh command._


How to create a file with the name specified in ASCII encoding?

I want to create a file that is called ascii 007, which is the bell symbol, which is not printable. I tried `nano $'\007'`, but that just created a file called ?; `cat ?` print the test content, that I placed in the file. So how do I create a file, with a name set by the ascii encoding and not plainly spelled out?


How to auto log on with root user in Fedora?

I'm a newbie in Linux, and I want to enable auto log on with root user for specific purpose. It's so bored when every time I power on my PC to study and I have to input user and password.


why won't x11 display work through ssh login?

I have logged in to a remote server and am trying to display an x application(e.g. firefox). but an error message appears. the below are my attempts to open firefox               Black@Black-PC ~     $ ssh -X kwagjj@$labserver -p 122     [kwagjj@James5 ~]$ firefox     Error: no display specified     [kwagjj@James5 ~]$ exit     logout     Connection to 143.248.146.204 closed.          Black@Black-PC ~     $ ssh -Y kwagjj@$labserver -p 122     [kwagjj@James5 ~]$ firefox     Error: no display specified     [kwagjj@James5 ~]$       I used -X, -Y because I read somewhere that these two options are related with credentials regarding X11 and these switches will do the job for me. Even without the -X, -Y switches, my attempt failed. What does the 'no display speicified' error mean? P.S. The weird thing is that if I connect to the remote server through my PUTTY and repeat the command 'firefox' it works?!?!(firefox is displayed on local computer) P.S. my local computer is Windows 7 so I have Xming running on background in order to allow X11 display. As for the attempt written on the upper part, the commands were typed in at Cygwin terminal.


Is it *really* possible to directly steal a private key if it uses no passphrase?

I've read in various places, such as in this question that using an ssh key pair without a passphrase allows attackers to steal your private key if they gain access to your account. I assumed that by "steal" it meant they could fairly easily do a brute-force attack to try every possible private key until they found one that matched the public key stored in your account. But the accepted answer on the question above assumes that the private keys are essentially stored in plain text somewhere. This is contrary to what I've always understood to be the case: that since (normally) you wouldn't store your private key on the server--only your public key--the main security risk posed by not using a passphrase is that someone could steal the private key off of your local machine and then use it without needing to also know the passphrase. Which view is correct? Are private keys somehow easily lifted from a server on which you only placed your public key?


Extract a sub-string out of a variable's value

I have a string in the form of `segment_78787` which is stored in a variable called `$ID` in my shell script. I need to get the second part "78787" and assign it to another variable. I tried like               batchname=`ID|cut -d_ -f1`      It didn't gave me any result.


How to backup KVM images? Is it possible to backup whole VM?

I need to backup all (9 VMs) my KVM VMs. I would like to backup them in the night for example once a week. For example VMware server and VMware server 2 used to have possibility to create live backups using creating images with backups. Let me give you a following questions: 1) Is there any good possibility how to live migrate and backup virtual machines on KVM? I found some tutorials, but they were not working with debian squeeze. 2) Could you recommend live backup (at night) of KVM VM, or should I rather backup INSIDE of VMs ? 3) VMware can also do Image backup, when VM is freezed, backed up and UNfreezed back again to work properly. Is it possible to do something like that with KVM VM? Thank you for answers and opinions


Debian + KVM: Which version to use? Stable or "new"?

I have Debian 6.0.4 (Squeeze) x64. Nowadays I use KVM stable package from apt- get. Could you recommend me using a compiled newest or newer version instead of using the old one KVM package from Debian repository? My opinion is, that more secure option is to use older "stable" versions from apt-get repo, instead of any newer versions. What do you think about this?


Why can't I resize or maximize Firefox 17 under Sawfish?

I just upgraded from Firefox 16 to Firefox 17.0.1, and my Firefox windows lost their maximize button. The `maximize-window` command does nothing either. Switching to full screen mode in Firefox makes its menus and toolbars disappear, but the window decorations remain and the window remains the same size. Also, I can't resize the window to anything other than 18x108. All of this worked with Firefox 16. I'm running Debian squeeze, with Firefox binaries from http://mozilla.org. My window manager is Sawfish 1.3.5. If I run an X session with Fvwm, I can maximize Firefox, so Firefox 17 is doing something that Sawfish doesn't like, but what?


Send copy of a script's output to a file

Say I have a Zsh script and that I would like to let it print output to `STDOUT`, but also copy (dump) its output to a file in disk. Moreover, the script starts with the following option               set -o xtrace      which forces it to be verbose and print what commands it runs. I would like to capture this output as well in a file in disk. My understanding is that if I do               ./my_script.sh > log.txt      it will just send `STDOUT` to `log.txt`, but what if I want to also be able to see the output in the terminal? I have read about `tee` and the `MULTIOS` option in Zsh, but am not sure how to use them. When I do:               ./my_script | tee log.txt      I can see the output on the terminal, but the file `log.txt` doesn'tseem to be capturing everything (in fact it captures barely anything).


Undervolting in Linux

Could you recommend me something different like Linux-PHC for undervolting in Linux? I would like to undervolt my AMD Phenom 9850 CPU. I am using Debian squeeze x64. For underclocking I use cpufrequtils, it is great CLI utility for lowering power consumption when you don't need power and want to insure yourself, that computer won't take more than XYWatts. Is there anything better? I prefer more CLI utility.


Virtual file made out of smaller ones (for mac-like sparse bundle solution)

I'd like to recreate a feature of Mac OS X called  sparse bundles (disk images made out of smaller files, making them easy to backup after a small change). For that I'm looking for a way to 'virtually' create a single file made by concatenation of smaller ones (big.file shouldn't use all this space, just _link_ to .files):               4096 0.file     4096 1.file     4096 2.file     4096 3.file     4096 4.file     20480 big.file      so that I'd be able to mount big.file using loop device, format as btrfs and upon writing to this disk, data should be written only to certain .files, allowing me to backup easily. Any suggestions how I could accomplish that? Perhaps something FUSE-related?


Mysql LOG only specific users

I need to set up some logging on my debian squeeze x64 mysql 5.1 Server: 1) logging when users logged in and logged off 2) logging only specific users commands set up logging which will not slow down performance of mysql server or harddrives. Is it possible to set logging only last month? Is it possible to set up logging only in specific hours in a day? I don't want gigabytes of useless logs, just logs of specific users in one file.


Which Fedora CPU architecture should I choose? i386 or i686?

I have an old Thinkpad X32 which has an `Intel(R) Pentium(R) M processor 1.80GHz` based on the result of `cat /proc/cpuinfo` and I was wondering which is better to use on it, the `i386` or the `i686` version of the Fedora ISO found here. Basically, I don't know how to determine if my CPU is an `i386` or an `i686`. If you could also tell me how I can get this data, please let me know.


Forcing font size based on language in .fonts.conf

I can specify the default font family used to display a particular language in X by editing `.fonts.conf` in my user directory (or editing the global `/etc/fonts/fonts.conf`). However, I've not been able to force a particular font size in the same way. For example, the following forces the Russian language to be displayed in Linux Libertine:               <fontconfig>         <match>             <test name="lang">                 <string>rus</string>             </test>              <edit mode="prepend" name="family">                 <string>Linux Libertine</string>             </edit>         </match>     </fontconfig>      I have tried adding the following XML tag, but it does not work:                        <edit mode="assign" name="size">                  <int>18</int>              </edit>


how to check for disk in use on rhel

How to check if a disk is in use? If in use, How to check free, used space before I can start using it? I'm trying this in Perl and Any help is appreciated.


backup kmail in command prompt

How to take kmail backup mails from command mode as GUI mode got crashed in fedora12? Found the location of mails, But how to take backup to another system to configure?


Force users to change email password every six months

I'm going to build an experimental mail server with Postfix + Dovecot and Mysql for user accounts. The server will offer SMTP + POP3 + IMAP. Is there a way to force users to change their mail account passwords every six months?


Xen Domain0 cannot access internet while DomainU can

I am Using all this setup on VirtualBox VM with network interface NATing with original Windows machine. I have installed Xen on Ubuntu 12.04. From Dom0, I could access internet before I installed DomU Ubuntu 12.04. Both machines have single eth0 interface each with dhcp enabled. **Ifconfig output of Dom0** : ![enter image description here](http://i.stack.imgur.com/Q3uMI.png) Domain0 can't even ping gateway 10.0.2.2, which is strange :( And **ifconfig output for DomU** : ![enter image description here](http://i.stack.imgur.com/BWJ4f.png) Multiple Mac addresses is not a problem from my ISP, I can access internet from my Windows, virtualbox host machine. Is Virtualbox in anyway responsible for it or its something I need to change in xen config?


How can I change the screen resolution of Slax?

Slax uses X.org for managing its GUI. However, when I boot Slax (specifically in a VM), the resolution gets capped at 1024x768. How can I increase the resolution to more fully utilize the screen estate available on my display? I have already attempted to follow the old advice from the following sources:   * http://old.slax.org/forum.php?action=view&parentID=25516   * http://www.linuxquestions.org/questions/mandriva-30/changing-screen-resolution-552768   * http://slaxlive.blogspot.com/2005/07/slax-linux-step-by-step-first-step.html


Choose kernel version in OpenEmbedded

I want to build Angstrom kernel on _Ubuntu 13.04 host machine_ using OpenEmbedded.               git clone git://github.com/Angstrom-distribution/setup-scripts.git     cd setup-scripts     MACHINE=beagleboard./oebb.sh config beagleboard     MACHINE=beagleboard./oebb.sh update     MACHINE=beagleboard./oebb.sh bitbake virtual/kernel      The reason of building kernel is to be able to cross-compile a kernel driver on host machine, targeting on Angstrom distribution _(BeagleBoard)_. Beagleboard runs a prebuilt image of 2.6.32. As I know, the cross-compile must target not only the Angstrom distribution, but the same kernel version that BeagleBoard runs. How does OE choose "preferred" version? Is there any way I can choose the kernel version that BitBake will build?


Symbol that will show up first in output of `ls`?

I want a folder called `DELETED` to be first in my output of `ls`. Is there a symbol I can add to the front that can cause this? I've tried `^` and `-` and neither works.


Changing gui for particular user in ubuntu 13.10

I want to change the gui for particular user in ubuntu. Even if I change the session menu in login screen, I dont get ubuntu classic gui and it remains same for all the options. However, it happens for partiular user. For other user, I have ubuntu classic gui. How can I solve this issue?


Split a line into columns with some of the columns right-justified?

Is there an easy way to split comma-delimited lines of text into columns with some of the columns right-justified? As a bonus, it would be nice to format numbers, but this probably isn't too hard with sed.


Keeping config files synced across multiple pc's

I have a few different linux machines and a lot of **config** files _(and folders)_ on each. For example:               ~/.ssh/config     ~/.config/openbox/rc.xml     ~/.config/openbox/autostart.sh     ~/.scripts/ ( folder )     ~/.bashrc     ...etc      Is there a simple and elegant method to keep these files synced between my machines _( one has no internet access )_? Also, some files will need a more advanced syncing process, as they will have to differ slightly... for example: My desktop keybaord has a range of hotkeys, where my laptop has almost none. I use **XF86Mail** to open thunderbird on my desktop, but **Meta+M** on my laptop. My Home Desktop and Work Desktop are both more "multiple user" orientated, where my Laptop is just for me. So on my laptop, I tend to keep the 'rc.xml' file for openbox at `/etc/xdg/openbox/rc.xml` but on the desktops at `~/.config/openbox/rc.xml`


Linux boot with broken partition

I have two ext partition on my linux   * One for `/`   * And one for `/home` I wanted to reduce (with this method) the home partition (which was only something like 10% filled) to create a new partition for Windows. Unfortunately it failed and when I wanted to reboot, linux went in rescue mode, which could have been helpfull unless this rescue mode was not working (It showed two password prompt, and then was working like there was two command prompt at the same time [I had to double every letter to make a command like : `ccwwdd //eettcc`], so not really doable). My question is : Can I boot to this linux anyway without going in rescue mode? Like for example disabling this partition (`/etc/fstab`?). Also is it possible to repair this partition ? (When I try to mount it with Ext2Fs it says `RAW` in partition type) Here is the parted info :               Model: ATA ST9640320AS (scsi)     Disk /dev/sda: 640GB     Sector size (logical/physical): 512B/512B     Partition Table: msdos          Number  Start   End    Size    Type      File system     Flags      1      1049kB  100GB  100GB   primary   ext4      2      100GB   420GB  320GB   extended      5      100GB   110GB  9999MB  logical   linux-swap(v1)      6      110GB   420GB  310GB   logical      3      420GB   420GB  367MB   primary   ntfs            boot      4      420GB   640GB  220GB   primary   ntfs      I think the `/home` partition is `/dev/sda6` Fsck output :               ubuntu@ubuntu:~$ sudo fsck.ext4 /dev/sda6     e2fsck 1.42.9 (4-Feb-2014)     ext2fs_open2: Bad magic number in super-block     fsck.ext4: Superblock invalid, trying backup blocks...     fsck.ext4: Bad magic number in super-block while trying to open /dev/sda6          The superblock could not be read or does not describe a valid ext2/ext3/ext4     filesystem.  If the device is valid and it really contains an ext2/ext3/ext4     filesystem (and not swap or ufs or something else), then the superblock     is corrupt, and you might try running e2fsck with an alternate superblock:         e2fsck -b 8193 <device>      or         e2fsck -b 32768 <device>      Command output :               ubuntu@ubuntu:~$ findmnt;lsblk -f;sudo partx -svb /dev/sda -oNR,START,END,SECTORS,NAME,FLAGS,SCHEMETARGET                           SOURCE     FSTYPE          OPTIONS     /                                /cow       overlayfs       rw,relatime,lowerdir=//filesystem.squashfs,upperdir=/cow     ├─/sys                           sysfs      sysfs           rw,nosuid,nodev,noexec,relatime     │ ├─/sys/fs/cgroup                          tmpfs           rw,relatime,size=4k,mode=755     │ │ └─/sys/fs/cgroup/systemd     systemd    cgroup          rw,nosuid,nodev,noexec,relatime,name=systemd     │ ├─/sys/fs/fuse/connections                fusectl         rw,relatime     │ ├─/sys/kernel/debug                       debugfs         rw,relatime     │ ├─/sys/kernel/security                    securityfs      rw,relatime     │ └─/sys/fs/pstore                          pstore          rw,relatime     ├─/proc                          proc       proc            rw,nosuid,nodev,noexec,relatime     ├─/dev                           udev       devtmpfs        rw,relatime,size=1977152k,nr_inodes=207544,mode=755     │ └─/dev/pts                     devpts     devpts          rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000     ├─/run                           tmpfs      tmpfs           rw,nosuid,noexec,relatime,size=397492k,mode=755     │ ├─/run/lock                               tmpfs           rw,nosuid,nodev,noexec,relatime,size=5120k     │ ├─/run/shm                                tmpfs           rw,nosuid,nodev,relatime     │ └─/run/user                               tmpfs           rw,nosuid,nodev,noexec,relatime,size=102400k,mode=755     │   └─/run/user/999/gvfs         gvfsd-fuse fuse.gvfsd-fuse rw,nosuid,nodev,relatime,user_id=999,group_id=999     ├─/cdrom                         /dev/sdb1  vfat            ro,noatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro     ├─/rofs                          /dev/loop0 squashfs        ro,noatime     ├─/tmp                           tmpfs      tmpfs           rw,nosuid,nodev,relatime     └─/media/ubuntu/04A874F6A874E796 /dev/sda4  fuseblk         rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096     NAME   FSTYPE LABEL MOUNTPOINT     sda                      ├─sda1                   ├─sda2                   ├─sda3                   ├─sda4              /media/ubuntu/04A874F6A874E796     ├─sda5              [SWAP]     └─sda6                   sdb                      └─sdb1              /cdrom     sr0                      loop0               /rofs     partition: none, disk: /dev/sda, lower: 0, upper: 0     /dev/sda: partition table type 'dos' detected     NR     START        END   SECTORS NAME FLAGS SCHEME      1      2048  195311615 195309568      0x0   dos      2 195313662  820317176 625003515      0x0   dos      3 820318208  821035007    716800      0x80  dos      4 821035008 1250260991 429225984      0x0   dos      5 195313664  214843391  19529728      0x0   dos      6 214843455  820317176 605473722      0x0   dos


/etc/hosts for Debian

I was trying to get a perl script that contacts a PostgreSQL database to work on a server. This script was mysteriously failing. I then realised that `localhost` was not in the `/etc/hosts` file. The file for this machine (currently running Debian lenny) currently looks like               127.0.0.1       machinename.domain   machinename     xxx.xx.x.xxx    machinename.domain   machinename      The `xxx.xx.x.xxx` is the IP address. The file for my current home machine, which is a slightly older installation (currently running Debian squeeze) is               127.0.0.1       machinename          localhost     127.0.1.1       machinename.domain   machinename      My home machine sits behind a router and is not directly exposed to the internet. In any case, I'm on DSL and have no static IP address. I've kept `/etc` under version control for my machines (using etckeeper) for some time, and I see that for this server, the following change was made by some mastermind (possibly myself) on Dec 17th 2009.               -127.0.0.1      localhost     +127.0.0.1      machinename.domain  machinename      I've wondered before why this file is set up the way this is, but the answer is not obvious. Some questions:   1. Why `127.0.1.1`? This might be a Debian-specific bit of history. I did a bit of searching on the net, and found some vague mutterings about Gnome, but little of any substance.   2. Where in Debian is the template this file is set from?   3. Is there currently considered to be a correct/best form for this file?   4. Is the order of the names in the line significant? I hope not. More generally, what is the explanation of why these two lines are structured the way they are? For now, I think I'll change the server `/etc/hosts` to               127.0.0.1       machinename.domain  machinename localhost     xxx.xx.x.xxx    machinename.domain  machinename      Comments?


Attempts to unify Linux and other free Unix?

It's such a pain when you don't know what distribution to choose. It's such a waste of time and effort for developers to port stuff from one distribution to another. It makes Linux/Unix more complicated (and scary) than it should be. While I know there are certain reasons why the situation became the way it is now, I wonder if anyone has ever thought of reunifying the worlds of Linux and other (free) Unix? **This is still a question** : Have there been any (failed) attempts to unify Linux/Unix?


filename and pathname of a file

It is said that the filename of a file is a pointer pointing to the inode of the file. Before knowing that, I thought it was the pathname of a file that does that job. I am not sure how a pathname and a filename are defined in Unix. For example, is it correct that `/home/tim/tim.pdf` is the pathname of the file with file name `tim.pdf`. I wonder what the difference between the filename and the pathname of a file? Thanks.


How to copy every 4th file in a folder

I have a lot of files in a folder, named like `00802_Bla_Aquarium_XXXXX.jpg`. Now I need to copy every **4th** file to a subfolder, saying in `selected/`.               00802_Bla_Aquarium_00020.jpg <= this one     00802_Bla_Aquarium_00021.jpg     00802_Bla_Aquarium_00022.jpg     00802_Bla_Aquarium_00023.jpg     00802_Bla_Aquarium_00024.jpg <= this one     00802_Bla_Aquarium_00025.jpg     00802_Bla_Aquarium_00026.jpg     00802_Bla_Aquarium_00027.jpg     00802_Bla_Aquarium_00028.jpg <= this one     00802_Bla_Aquarium_00029.jpg      How do I do this?


How to stop GUI apps spam the terminal?

I start a gui app from a konsole window and it writes out totally useless information. I do not need that. Is there a way to stop this, once and for all? I tried disown, doesnt help. I guess 2>&1 >/dev/null might help but that's rather tedious :( Edit: OK, let's get creative. One half of the answer is to use preexec (I use zsh but the net is full of bash preexec tricks) and use `ldd` to detect libX11 (and what else?). Then http://stackoverflow.com/a/9188571/308851 shows how to create redirects to /dev/null. How can we expand this solution to work with programs having a shell script wrapper?


Missing menu on Mint host using RDP unless logged in on host console

Using Remote Desktop from a Windows 7 PC to connect to a Mint 17 VM with MATE, the Show Desktop icon displays, but the Menu button does not. However, if I go to the Linux machine and log in, leave the session logged in, RDP works and the menu displays correctly. It seems like logging in on the Mint machine starts something that X11RDP does not. Is there something that I need to configure or add to .xsession so I don't need to be logged into the physical machine to connect via RDP? Setup: PC 1: Windows 7 PC using Remote Desktop PC 2: Ubuntu 14.04 LTS running LXDE and VirtualBox as the VM host. Mint 17 VM guest running X11RDP (from X11RDP-o-Matic). .xsession contains only one line: mate-session


Compile mkvtoolnix for router with customized firmware

I am using my router (asus-rt66u with customized firmware (tomato) as a media server. To get the tools I need, I have been using the optware package manager which has has bunch of cross-compiled applications available. Now I need the mkvtoolnix tool, which is unfortunately not in the package list. The router is using the mipsel architecture. Probably a stupid question but do I need to build `mkvtoolnix` on my own on the router or is it possible to use a pre/cross-compiled package like this one (Debian package)? If I need to compile on my own, how do I proceed with that?


Can't use QWERTY layout after make IBus work with Dvorak layout after reboot

To keep my Input Method (Bogo or Unikey) of IBus working with Dvorak keyboard layout after reboot, I use `sudo dpkg-reconfigure keyboard-configuration` to set keyboard as Dvorak, and go to tab Advance in IBus Preferences to check Use system keyboard layout. The problem is, sometimes my friends want to borrow my laptop and I can not easily switch to Qwerty layout because any Input Method will use Dvorak. The English - English (US) is the same as English - English (Dvorak) one. Any idea? Info: I'm use IBus 1.5.3 and it says this is the newest version. So do Cinnamon.


Limits on the number of file descriptors

I'm trying to install `389-ds`, And it gives me this warning :               WARNING: There are only 1024 file descriptors (hard limit) available, which     limit the number of simultaneous connections.      I understand about file descriptors, but i don't understand about soft and hard limits. When i do                cat /proc/sys/fs/file-max      I get : `590432` That means, i can open up to 590432 files, meaning i can have up to 590432 file descriptors. Right ? But what does that men ?               ulimit      Gives me : `unlimited` And               ulimit -Hn       Gives : `4096` I guess the hard limit is 4096, but what does hard limit mean ? The               ulimit -Sn      Gives : `1024` That means the soft limit is 1024 but what does soft limit mean too ?


How to limit aria2 connections to one server but enable concurrent connections to multiple servers?

I have a long list urls to download with aria2 from a variety of servers, with some urls from the same server. Here's a snippet of urls.txt:               ftp://93.190.206.160/public/c/camaro/%E1%D7%D4%CF%CC%C5%C7%C5%CE%C4%D9/net.ods     ftp://93.190.206.160/public/3/389743v/%E6%CC%C5%DB%CB%C1/%D5%DE%C5%C2%C1/Oktyabr2013.xlsx     ftp://93.190.206.160/public/m/modesti/=))/%E7%E0%E4%E0%F7%E0%203.ods     ftp://93.190.206.160/public/c/camaro/%E1%D7%D4%CF%CC%C5%C7%C5%CE%C4%D9/net.ods      I need to be able to limit the number of connections to any individual server to 1, but allow concurrent connections to different servers. Here's how I would expect to do that:               aria2c -iurls.txt -x1 -s1      However, at least one of the four urls above fails to download because of too many concurrent connections. I can download all files successfully by adding a -k1 flag, but that will prevent concurrent downloads on other servers.


how do I get the response ouput from the url .download it in file,not download the code

My file like this with some number or id                404000847307897      404000857827460      404001044194601      404000835511595      404000338418501      404000338654003      404000290144612      404000344175621      404000290144612      404000844713523      this my url                url= http://203.90.117.109/wds_cdma/wds.aspx?min=       now by using this url get the response from url and download output of the url. not the code. example take the url and add the `min = file id` number at end of the url.               (http://203.90.117.109/wds_cdma/wds.aspx?min=404000847307897)     (http://203.90.117.109/wds_cdma/wds.aspx?min=404000857827460)      this url hit the server get the response of the url ouput below                404000847307897|-101| Requested MIN not found.      404000857827460|9225534526|2|Prepaid|2       finally this output store in one file. can you do this `curl` with `awk` or `wget`?


How to reduce ncurses terminfo size

I notice that ncurses's terminfo database on `/usr/share/terminfo` is about 7MB (I compiled it myself). This is too large if I want to deploy it on an embedded Linux of 64MB disk space. Is there a way to reduce its size by deleting unneeded entries and keep the most-used ones? And what's is this actually for? **EDIT** : Is there any info or reference for commonly used terminfo for regular PCs or SSH clients?


How can I use ffmpeg to split MPEG video into 10 minute chunks for YouTube upload?

There is often a need in the open source or active developer community to publish large video segments online. (Meet-up videos, campouts, tech talks...) Being that I am a developer and not a videographer I have no desire to fork out the extra scratch on a premium Vimeo account. How then do I take a 12.5 GB (1:20:00) MPEG tech talk video and slice it into 00:10:00 segments for easy uploading to YouTube?


sed whitespace matching confusion

echo ' 1 2     3  '|sed 's/[[:space:]]*/_/g'      I want to see `_1_2_____3__` as the output. Instead, I am seeing `_1_2_3_` as the output. What am I doing wrong?? **EDIT**   The other thing confusing me, which I forgot to put in the above example, is why this:               echo ' test1 test2  ' | sed 's/[[:space:]]*/_/g'      shows this:               _t_e_s_t_1_t_e_s_t_2_      How can `[[:space:]]` match between `t` and `e` and `s`...?


Remove all files/directories except for one file

I have a directory containing a large number of files. I want to delete all files except for file.txt . How do I do this? There are too many files to remove the unwanted ones individually and their names are too diverse to use * to remove them all except this one file. Someone suggested using               rm !(file.txt)      But it doesn't work. It returns:               Badly placed ()'s       My OS is Scientific Linux 6. Any ideas?


Linux distribution with remote desktop?

I have a old computer, where I want to install Linux. It will be server but I want to use as normal operating system. But I have problem, because I don't have display for this computer, because this display is for another computer. I will have monitor only during installation time. For configurating and using Linux I want to have remote desktop. For example "FreeNAS" have this option; I type 192.168.xxx.xxx and I can config server. But I want full Linux, not only NAS server - for example Ubuntu. Is there a Linux Distribution with remote desktop by default?


Is there a convenient way to wrap a bash command list into rlwrap?

Thanks to a question on superuser.com, I found out about this utterly convenient `rlwrap` tool. It satisfies my needs (i.e. add command history to another cmdline tool), but I was wondering how I can use it to add command history to a 'compound' shell command, like the prototypical               $> while read line; do echo "i read $line"; done     hi     i read hi     ^D      When I put the `while` loop inside a shell script, and execute it like `rlwrap ./whilereadline.sh`, it's ok. But I'm wondering how I can do this _without_ the need for an additional file, somewhat like               $> rlwrap (while read line; do echo "line: $line"; done)     bash: syntax error near unexpected token `while'      Any ideas?