title: HSPA+ USB Modem Alcatel X600 1bbb:0195

text: The Modem Does anyone have this modem in Linux? I do not get to configure the device. I have tried other tutorials similar devices without success. I can't get the device /dev/ttyUSB0 My System:   * Debian testing 32 bits.   * kernel 3.14-1-686-pae More detailed device description: (Pay attention to the word UNRECOGNIZED)               Bus 003 Device 018: ID 1bbb:0195 T & A Mobile Phones      Device Descriptor:       bLength                18       bDescriptorType         1       bcdUSB               2.00       bDeviceClass            2 Communications       bDeviceSubClass         0        bDeviceProtocol         0        bMaxPacketSize0        64       idVendor           0x1bbb T & A Mobile Phones       idProduct          0x0195        bcdDevice            0.00       iManufacturer           3 USBModem       iProduct                2 3G PlugLink Dongle       iSerial                 0        bNumConfigurations      1       Configuration Descriptor:         bLength                 9         bDescriptorType         2         wTotalLength           75         bNumInterfaces          2         bConfigurationValue     1         iConfiguration          1 USBModem Configuration         bmAttributes         0xe0           Self Powered           Remote Wakeup         MaxPower              500mA         Interface Association:           bLength                 8           bDescriptorType        11           bFirstInterface         0           bInterfaceCount         2           bFunctionClass        224 Wireless           bFunctionSubClass       1 Radio Frequency           bFunctionProtocol       3 RNDIS           iFunction               0          Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber        0           bAlternateSetting       0           bNumEndpoints           1           bInterfaceClass       224 Wireless           bInterfaceSubClass      1 Radio Frequency           bInterfaceProtocol      3 RNDIS           iInterface              0            ** UNRECOGNIZED:  05 24 00 00 01           ** UNRECOGNIZED:  05 24 01 00 01           ** UNRECOGNIZED:  04 24 02 00           ** UNRECOGNIZED:  05 24 06 00 01           Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x81  EP 1 IN             bmAttributes            3               Transfer Type            Interrupt               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0040  1x 64 bytes             bInterval               4         Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber        1           bAlternateSetting       0           bNumEndpoints           2           bInterfaceClass        10 CDC Data           bInterfaceSubClass      0 Unused           bInterfaceProtocol      0            iInterface              0            Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x82  EP 2 IN             bmAttributes            2               Transfer Type            Bulk               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0200  1x 512 bytes             bInterval               0           Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x01  EP 1 OUT             bmAttributes            2               Transfer Type            Bulk               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0200  1x 512 bytes             bInterval               0     Device Qualifier (for other device speed):       bLength                10       bDescriptorType         6       bcdUSB               2.00       bDeviceClass            2 Communications       bDeviceSubClass         0        bDeviceProtocol         0        bMaxPacketSize0        64       bNumConfigurations      1     Device Status:     0x0000       (Bus Powered)      **dmesg output** :               [29031.944017] usb 3-1.2: new high-speed USB device number 19 using ehci-pci     [29032.039363] usb 3-1.2: New USB device found, idVendor=1bbb, idProduct=f017     [29032.039368] usb 3-1.2: New USB device strings: Mfr=3, Product=2, SerialNumber=4     [29032.039370] usb 3-1.2: Product: 3G PlugLink Dongle     [29032.039372] usb 3-1.2: Manufacturer: USBModem     [29032.039374] usb 3-1.2: SerialNumber: 1234567890ABCDEF     [29032.042753] usb-storage 3-1.2:1.0: USB Mass Storage device detected     [29032.042909] scsi12 : usb-storage 3-1.2:1.0     [29033.081320] usb 3-1.2: USB disconnect, device number 19     [29033.279534] usb 3-1.2: new high-speed USB device number 20 using ehci-pci     [29033.378130] usb 3-1.2: New USB device found, idVendor=1bbb, idProduct=0195     [29033.378134] usb 3-1.2: New USB device strings: Mfr=3, Product=2, SerialNumber=0     [29033.378137] usb 3-1.2: Product: 3G PlugLink Dongle     [29033.378139] usb 3-1.2: Manufacturer: USBModem     [29033.385558] rndis_host 3-1.2:1.0 eth1: register 'rndis_host' at usb-0000:00:1a.0-1.2, RNDIS device, 00:a0:c6:00:00:00     [29033.407898] systemd-udevd[11230]: renamed network interface eth1 to eth2


title: SVN wants to commit everything after server re-install

text: the motherboard of a dedicated server I'm renting since five years went south and the motherboard got replaced by a new one. The very old (Debian) distro couldn't keep up with all the new hardware on the motherboard so I decided to re-install a new distro (Debian Wheezy) from scratch (even doing an upgrade was kinda problematic seen that the old Debian wouldn't recognize the ethernet chipset of the new motherboard as far as I can tell, so I went for a re- install from scratch). I re-installed SVN and did get all the repositories by doing a:               tar -xzf repoBackups.tgz      And it "works". The problem is that although, say, Eclipse recognizes the SVN repositories, it wants to commit every single file, even though they are identical. Could this be related to timestamps on the files? Either way, do you have an idea as to what caused this and how to solve the issue? I _could_ simply ask everybody to re-commit every single file of every project and I think everything would be ok but some of these projects are quite big and it would be a bit painful for the developers. As a bonus (and less important) question: would another VCS like Git or Mercurial not "suffer" from this problem?


title: How does Linux know the Location of File Data on Disk

text: related to: What is a Superblock, Inode, Dentry and a File? None of the famous metadata structures hold onto to location data for the actual file. Dentry maps names to inodes, and inodes store information about the files -- how does the system know where the file's actual data bits are located on the disk? Is there some sort of default mapping of inode integers to disk location?


title: move the search content to different directory

text: I am on Oracle Solaris. I am using:               grep "searchstring" filename.*      above command returns my search result. Now I want to move the all the files in above search result (all the files not the search result) into a specific directory `../mydir/`. How can I accomplish this in one command (search and move both should be done in one line command).


title: On OS X, how do I log in interactively as root starting from my normal user account?

text: I have been doing this for a while:               sudo su -      but it uses 'sh' rather than 'bash', which is what I'd like to do. Which command will log me in as root and get me a bash shell even if that's not the default the system gives me?


title: How to use wget to download from hosting sites?

text: wget is a very useful tool to download stuff on the internet quickly, but can I use it to download from hosting sites, like FreakShare, IFile.it Depositfiles, Uploaded, Rapidshare? If so, how can I do that?


title: Bash Process Substitution does not work as 'root' on OS X

text: OS X 10.6.8, if I use Bash Process Substitution as 'root', it just doesn't work.   * Is it supposed to be so?   * Why? Note: here's what I mean... "<(list)"               mysql -D robottinosino < <(echo 'select robot from tino_sino;')       /* a contrived example, admittedly, as you could swap the echo and mysql using a simple pipe... I could not think of a better one off the top of my head */ EDIT:   * I am logging on as root like so: "sudo su -" (incidentally, is there a better way if I want to _stay_ logged on?)   * I am _not_ on Bash so my question is really stupid and the comment below caught the problem instantly! :( echo $0 yields "-sh" :( I guess this question could just be deleted at this point or metamorphosed into: "how to I properly log in as 'root' using bash?" (perhaps editing /private/etc/passwd? that does not seem to work. or... sudo bash -l?)


title: Unable to access an http sevice forwarded using ssh

text: I forwarded a port from a remote server (which has Tomcat running on it) to a local port on my machine. Say, if the remote server address is http://myremoteserver.com:8080, I forwarded the port to localhost this way: ssh -L 8080:myremoteserver.com:8080 -N watson Note: Access to myremoteserver is possible only through watson. After forwarding, if I run localhost:8080 on my browser, I can see the output. But if I try to access this localhost from any other machine on my network (DNS of localhost is server1) through browser, say server1:8080, it does not load at all. Strangely, if I run tomcat on localhost (instead of port forwarding through ssh), and access it through browser from another machine on network, server1:8080, it works. Please help. I thought it has to do something with iptables; but it doesn't work even after turning it off.


title: SSH session pauses mid datastream; resumes with a keypress

text: I've had this problem occur at random, intermittently, across boxes at multiple companies, multiple distros, and multiple kernel revs. I think that I'm just cursed. What happens is that I'll have a new box loaded, and I'll be doing something inside ssh, like a yum update or an apt-get. Everything will be progressing fine and then the session just stops. The ssh doesn't disconnect, it's almost as if someone sent a scroll lock keypress to the session. If I hit enter, or space, or just about any keystroke in the ssh session, the session wakes back up and its as if nothing went wrong. I once upon a time tracked down an issue like this and found that the interactive processes were entering SLEEP status. I can't confirm that this is the same behavior in this case, but I will amend the question if I can pinpoint that specific cause. Regardless, I was never able to figure out why the processes were randomly going into sleep. Has anyone had this or a similar issue and have any insight into what might be causing it?


title: How to set a callback to NFS to allow scripting?

text: **The context** I have two servers: a NAS and a client server. They are both small machines (Raspberry, OLinuXino) and are plugged to the same power strip (which has a power button). The client server mounts the NFS volumes from NAS at startup. **The problem** When I switch on the power strip, both servers startup at the same time. But at the time the client tries to mount NFS volumes, they are not yet available from the NAS. So I have to mount them manually and I want to automate this. I use fstab to mount the volumes on a Debian Wheezy distribution.               nas.local:/media/myshare  /media/myshare nfs defaults 0 0      **How I would solve it** So I thought I could add a script on the NAS that calls a ssh command to tell the client "mount your NFS volumes, they are ready now !". Something like `ssh -i idFile login@clientServer 'sudo mount -a'` from the NAS side. **The question** What would be the best place where to put that kind of script ? A NFS hook ? Something like a callback ? **Extra question** Or is there another and better way to do this ?


title: Trying to update Bugzilla on Fedora 16 using YUM

text: I am currently running Bugzilla version 4.0.6 and would like to update to 4.2. I have tried `yum check-update` and `yum update bugzilla` but it is not updating. Am I doing something wrong? If not, is there a way to force the update?


title: Is Ubuntu LTS binary compatible with Debian?

text: RedHat and CentOS are binary compatible. So everything that works on the one will most propably work on the other (same RPMs, same libs, same versions, same dependencies)... Does the same hold true when comparing Ubuntu LTS with Debian? When trying to build up a mirror for Ubuntu LTS I noticed that the packages were coming from a Debian repository... Will everything work the same in the same sense it does with RH/CO, or is this a day/night difference (like OpenSuSE compared with SLES)?


title: Vim powerline plugin colour of Normal mode

text: I installed vim-powerline and was wondering how to change the backlground colour of the normal mode -- currently set to `#adf000` according to the Gimp -- to something else. I assume that the change will be in `autoload/Powerline/Colorschemes/XXX.vim` somewhere, I just cannot find it.


title: Network file sharing between Linux and OS X

text: I want to share a drive/folder over the internet from my Debian machine back home, such that I can mount it on my Macbook when I am on the move. Basically I want to store my music at home and just access it over the network, instead of having two separate libraries, one on each computer. I will not go into _why_ I would prefer a shared drive as opposed to a streaming application (that would be another question). What I want to know is, what do you think would be the best and/or easiest way to do this? NFS? Samba? Are there security risks involved, since I want to share over a public network as opposed to sharing over LAN, and if so, what are they? **[Update]** The answers indicated I should use sshfs, since it is easy to set up and uses an already established ssh connection. I have tried this, but I am having bad latency problems on file access. In other words, the transfer speed is ok, but applications have to wait until the file is fully downloaded to access it. This is very inconvenient behavior: if I try and play music off the mounted drive I will have about 20 seconds of pause before every song. Now, I have tested the same setup on a linux machine on the same network as the OS X machine. The latency problem is almost non-existent, that is I cannot distinguish it from regular throughput bottle necking. This makes me think it is an OS X specific issue. Which brings me back to my original question: what is a good way to mount a remote folder that's on a linux server under an OS X client?


title: Can selinux log an application owner name?

text: So I've set up selinux to log all file access operations in a certain directory. Here's some sample log output when doing an ls from sftp:               type=AVC msg=audit(1338465611.221:356): avc:  granted  { getattr } for  pid=5973 comm="sftp-server" path="/polog" dev=dm-0 ino=1966081 scontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:polog_t:s0 tclass=dir      sftp in this case is running as user1, is there a way to have selinux log this username as well or should I be taking a different approach? Here's my policy files: ---polog.te---               policy_module(polog, 1.0.14)          require {         type fs_t;             type unconfined_t;             type sshd_t;             type setfiles_t;             class filesystem associate;             class dir relabelto;     }          type polog_t;          #============= polog_t ==============          allow polog_t fs_t:filesystem associate;     allow unconfined_t polog_t:dir relabelto;     allow setfiles_t polog_t:dir relabelto;          #====================================          auditallow unconfined_t polog_t : file *;     auditallow unconfined_t polog_t : dir *;          allow unconfined_t polog_t : file *;     allow unconfined_t polog_t : dir *;      * * * ---polog.fc---               /polog(/.*)?            gen_context(system_u:object_r:polog_t)


title: How can sed output be formatted like printf's formatted printing?

text: Can sed replace text with a string formatted like printf's formatted printing? The following sed command replaces a line starting with the current value of "$domain" with several values specified in variables.               /bin/sed  "s/\(^${domain} *${limittype} * ${limititem}.*\)/$EXPL#\1\n${domain} ${limittype} ${limititem} ${value}/" /etc/security/limits.conf      However the output will not be properly aligned because the length of the values of domain etc. are not the same. So the output would be something like               #oracle   hard   nproc    131072     oracle hard nproc 666      While valid, it is difficult to read. I would prefer to get something like               #oracle   hard   nproc    131072     oracle   hard   nproc    666      The best I can come with to get the desired output is:               /bin/sed  "s/\(^${domain}\)\( *\)\(${limittype}\)\( *\)\(${limititem}\)\( *\)\(.*\)/$EXPL#\1\2\3\4\5\6\7\n${domain}\2${limittype}\4${limititem}\6${value}/" /etc/security/limits.conf      But I believe there must a more elegant way to do this. The sed one liners document contains some examples that use a specified number of characters, e.g.               sed -e :a -e 's/^.\{1,78\}$/ &/;ta'  # set at 78 plus 1 space      But this is in the `regexp` section not in the `replacement` section.


title: Can non-canonicalized forms of filesystem paths be significant? (eg. "foo//bar", "foo/./bar", and "foo/../bar")

text: I have a script for building a particular flavor of GCC cross-compiler. Throughout the script there are many paths that are not in canonical form, such as duplicate path separators (`/xxx/foo//bar/yyy`) and intervening "this" directories (`/xxx/foo/./bar/yyy`). I was about to canonicalize all of them, but I wonder if these forms are significant rather than just a case of the script not being cleaned up. In addition to the forms just mentioned, I am also curious whether including an "up directory" in a path can also be significant in any particular situation (ie. "`/xxx/foo/../bar/yyy` instead of `/xxx/bar/yyy`). For example, I came across a path like `/xxx/foo/.//bar/yyy`. The only potential situation that I can think of is when links are involved. I can imagine that the `..` form might behave differently, but how about the other two forms above? Perhaps there is also platform-specific reasons for constructing paths in this way..?


title: Error, some other host already uses address IPADDRESS

text: I have the following scenario on my Centos 6.2 server: `eth0` : has IP `192.168.50.10` `eth0:5` : has IP `10.0.0.1` When I boot the system, everything is up and working. When I run: `ifdown eth0:5` and after `ifup eth0:5`, I get this error: `Error, some other host already uses address 10.0.0.1`. After I run `ifdown eth0:5`, I can ping the `10.0.0.1` host, but I cannot connect to it via `ssh` (from the same host). Before of `ifdown` command, I can ping the `10.0.0.1` and connect to it via `ssh` (from the same host). If I type `service network restart`, everything is ok again. **Question** : Can anyone infer why that behavior? N.B. I don't have the `NetworkManager` installed, and I don't have another host with this IP on the LAN (`10.0.0.1`). EDIT: The result of `$arp -na` command: > ? (82.208.147.126) at 00:07:0e:5c:99:26 [ether] on eth0


title: How to count the number of lines in a UTF-16LE/CR-LF/BOM file?

text: The immediate thought is `wc`, but then the next not-so-immediate thought is... Is *nix's `wc` purely for *nix line endings \x0a?... It seems so. I've semi-wangled my way around it, but I feel there may/must be a simpler way than working on a hex-dump of the original. Here is my version, but there is still a mysterious discrepancy in the tallies. `wc` reports 1 more `0a` than the sum of this script's `CRLF` + `0a`.                file="nagaricb.nag"      echo Report on CR and LF in UTF-16LE/CR-LF      echo =====================================      cat "$file" | # a useles comment, courtesy of cat         xxd -p -c 2 |          sed -nr '            /0a../{                /0a00/!{                    i ‾‾`0a:   embedded in non-newline chars                           b                }            }            /0d../{                /0d00/!{                    i ‾‾`0d:   embedded in non-newline chars                           b                }            }            /0a00/{                i ‾‾`CR: found stray 0a00                       b             }            /0d00/{                N                /0d00\n0a00/{                    i ‾‾`CRLF: found as normal newline pairs                    b                }                i ‾‾`LF: found stray 0d00             }' |              sort |                uniq -c      echo "  ====="      printf '  %s ‾‾`wc\n' $(<"$file" wc -l)      Output               Report on CR and LF in UTF-16LE/CR-LF     =====================================         125 ‾‾`0a:   embedded in non-newline chars                407 ‾‾`0d:   embedded in non-newline chars              31826 ‾‾`CRLF: found as normal newline pairs       =====       31952 ‾‾`wc      * * * Is there some more standard/simple way to do this?


title: How to manually restore Mandriva's "drakbackup" backups?

text: I'm currently migrating a production environment from Mandriva 2010.1 to Debian 7.0 Wheezy. The old environment used the `drakbackup` tool provided with Mandriva for hourly backups. I'm planning on using `bacula` as a more permanent and distro-agnostic solution for the Debian environment. The problem is, I need to provide continuity in terms of being able to restore the previous Mandriva backups. Usually, I could restore them easily from within `mcc` (Mandriva Control Center); however, I'm not sure how to accomplish this manually. **What I know so far**   * Mandriva keeps lists of every archive's contents in `gzipped` text files.   * Mandriva has `gzip` archives for base and incremental backups named after their creation time.   * I can thus easily locate a certain file from the list files and extract the version I need from the base and incremental archives **What I need to know**   * How do I merge the base and incremental backups to form the "complete" file?


title: Persistent blockdev setra read ahead setting

text: I've got some SSDs mounted up on `/dev/sda1` and `/dev/sdb1` on a SLES 11 SP2 server, and I was able to tweak the read ahead setting with `blockdev --setra`:               sudo blockdev --setra 4096 /dev/sda     sudo blockdev --setra 4096 /dev/sdb     sudo blockdev --getra /dev/sda     4096     sudo blockdev --getra /dev/sdb     4096      How do I persist this setting on boot? Specifically, is there a corresponding setting in `sysctl.conf`, or will I have to settle for an rc script to make this happen?


title: Missing control icons in Totem (Gnome Videos)

text: I just did an update in Arch Linux, and now the Videos app (Totem) is using the same icon for every control: ![Totem screenshot](http://i.stack.imgur.com/z9zTw.png) The controls still work; you just can't tell them apart without hovering over the control until the tooltip shows up. This worked fine before the upgrade. I've reinstalled `totem`, `gnome-icon-theme`, `gnome-icon-theme-extras`, `gnome-icon-theme-symbolic`, and `hicolor-icon-theme`, but that made no difference. Arch is currently on Gnome 3.6. I'm using `x86_64`. How do I get the controls labelled with the right icons? **Update:** When I start `totem` on the command line, I see the following lines added to `~/.cache/gdm/session.log`:               Window manager warning: Buggy client sent a _NET_ACTIVE_WINDOW message with a timestamp of 0 for 0x280000b (Videos)     Window manager warning: meta_window_activate called by a pager with a 0 timestamp; the pager needs to be fixed.      and the following lines on the terminal:               (totem:3232): Grilo-WARNING **: [registry] grl-registry.c:434: Could not open plugins' info directory '/usr/lib/grilo-0.2': Error opening directory '/usr/lib/grilo-0.2': No such file or directory     (totem:3232): Totem-WARNING **: Failed to load grilo plugins: All configured plugin paths are invalid. Failed to load plugins.      The grilo warnings I've seen before this problem started; I don't have it installed.


title: Are there any discussions about proposing a new filesystem hierarchy standard?

text: Are there any current discussions about switch to a different standard directory hierarchy for Linux? The only thing I currently know of is GoboLinux, which looks quite outdated.


title: Linux Mint 16: Android Device not listed with lsusb

text: I've installed Linux Mint 16 on my new PC and found out that my plugged in Huawei U8850 Android 2.3.5 device is not listed with the lsusb command: phone plugged in:               $ lsusb     Bus 002 Device 002: ID 8087:8000 Intel Corp.      Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 006 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub     Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 001 Device 002: ID 8087:8008 Intel Corp.      Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub     Bus 003 Device 011: ID 057c:6201 AVM GmbH AVM Fritz!WLAN v1.1 [Texas Instruments TNETW1450]     Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub      using the -v option with the lsusb command i get one different line: plugged in:               Port 7: 0000.0101 power connect      not plugged in:               Port 7: 0000.0100 power      I ensured that all is set up correctly:   1. device has usb debugging enabled   2. usb cable is ok   3. usb port on desktop PC is ok; a usb flash memory stick is recognized; the system was booted and installed via the same port. The same hardware configuration was working ok 3 days ago, when I used the same PC with a now uninstalled elementary OS (based on ubuntu 12.04). The phone and cable is today working on a Windows 8 system. * * * I am not absolutely sure about it, but I think successful listing with lsusb is the basis for the next step: set up a rules file. Anyway, in case the above step is not essential, I've created such a file (steps below done as root):               /etc/udev/rules.d/51-android.rules      with this content, using 12d1 as the vendor id (Huawei):               SUBSYSTEM=="usb", ATTR{idVendor}=="12d1", MODE="0666", GROUP="plugdev"      (I am in the plugdev group) Restart udev:               # restart udev      -> nothing changed. adb shows also nothing:               $ adb devices     * daemon not running. starting it now on port 5037 *     * daemon started successfully *     List of devices attached       killing, restarting of adb changes nothing (tested as root and as a normal user):               $ adb kill-server     $ adb start-server     * daemon not running. starting it now on port 5037 *     * daemon started successfully *     $ adb devices     List of devices attached         * Rebooting the phone and PC doesn't change anything.   * Plug out / in doesn't change anything These are the messages created in syslog, when the phone is plugged in:               Mar 11 13:07:01 rupert kernel: [ 2638.923967] usb 3-7: new high-speed USB device number 20 using xhci_hcd     Mar 11 13:07:01 rupert kernel: [ 2638.941035] usb 3-7: Dual-Role OTG device on non-HNP port     Mar 11 13:07:01 rupert kernel: [ 2638.941141] usb 3-7: can't set HNP mode: -32     Mar 11 13:07:01 rupert kernel: [ 2639.107756] usb 3-7: new high-speed USB device number 21 using xhci_hcd     Mar 11 13:07:01 rupert kernel: [ 2639.124664] usb 3-7: Dual-Role OTG device on non-HNP port     Mar 11 13:07:01 rupert kernel: [ 2639.124717] usb 3-7: can't set HNP mode: -32     Mar 11 13:07:01 rupert kernel: [ 2639.291545] usb 3-7: new high-speed USB device number 22 using xhci_hcd     Mar 11 13:07:01 rupert kernel: [ 2639.308422] usb 3-7: Dual-Role OTG device on non-HNP port     Mar 11 13:07:01 rupert kernel: [ 2639.308473] usb 3-7: can't set HNP mode: -32     Mar 11 13:07:01 rupert kernel: [ 2639.475327] usb 3-7: new high-speed USB device number 23 using xhci_hcd     Mar 11 13:07:01 rupert kernel: [ 2639.492305] usb 3-7: Dual-Role OTG device on non-HNP port     Mar 11 13:07:01 rupert kernel: [ 2639.492373] usb 3-7: can't set HNP mode: -32     Mar 11 13:07:01 rupert kernel: [ 2639.492419] hub 3-0:1.0: unable to enumerate USB device on port 7      * * * **EDIT**   Just tested a bit. I've created 2 USB boot sticks, one with ubuntu 13, the other one with elementary OS. I did not change or add anything, just booted from usb, opened a terminal and entered the lsusb command. Ubuntu 13: same as Mint 16; lsusb returns nothing, syslog looks similar. Elementary Luna: lsusb shows the Huawei, with Vendor ID 12d1.   When plugging in the phone, numerous errors appears in syslog. However, this does not seem to affect the detection of the phone.


title: Disable sticky keys

text: Sometimes my X behaves like it has «sticky keys» turned on. I have no idea how I activated it. Usually hitting the "sticky" key multiple times solves the problem, but it is nevertheless annoying. I thought I had disabled sticky keys and other accessibility options with `xkbset -a`, but it still happens. Here are the relevant pieces from `xkbset q`:               Accessibility Features (AccessX) = Off     Sticky-Keys = Off     Two Keys Mask = On     Latch to Lock Mask = On     Slow-Keys = Off     Slow Keys Delay = 300     Bounce-Keys = Off     Debounce Delay = 300     AccessX Feedback = On     Use Fixed Pitch Bell = On      Any other places I should check? I'm running Debian testing, xmonad window manager, and many gnome and kde applications. I suspect that it could be a gnome or kde feature.


title: why there are six getty processes running on my desktop?

text: My desktop system is:               $ uname -a     Linux xmachine 3.0.0-13-generic #22-Ubuntu SMP Wed Nov 2 13:25:36 UTC 2011 i686 i686 i386 GNU/Linux      By running `ps a | grep getty`, I get this output:                 900 tty4     Ss+    0:00 /sbin/getty -8 38400 tty4       906 tty5     Ss+    0:00 /sbin/getty -8 38400 tty5       915 tty2     Ss+    0:00 /sbin/getty -8 38400 tty2       917 tty3     Ss+    0:00 /sbin/getty -8 38400 tty3       923 tty6     Ss+    0:00 /sbin/getty -8 38400 tty6       1280 tty1     Ss+    0:00 /sbin/getty -8 38400 tty1       5412 pts/1    S+     0:00 grep --color=auto getty      I think ttyX processes is for input/ouput devices but I am not quite sure. Based on this I am wondering that why there are 6 ttyX processes running? I have only one input devices(keyboard) actually.


title: What is the purpose of -e in sed command?

text: I can't find any documentation about the `sed` `-e` switch, for simple replace, do I need it? e.g.               sed 's/foo/bar/'      VS               sed -e 's/foo/bar/'


title: Check if filename exist from inline command

text: I have a file named input.txt with this contents: > ...   >  FILE "Edie - Realities.txt" TXT   >  ... And I want to read it, then strip filename path from line that starts with FILE, and check if it exists, so: `[ -f $(cat input.txt | grep FILE | grep -o "\".*\"") ] && echo "exist" || echo "does not exist"` but this outputs:               [: too many arguments       does not exist      If I run:               echo $(cat input.txt | grep FILE | grep -o "\".*\"")      I get what I expected:               "Edie - Realities.txt"      So why is this, or how can I solve this problem?


title: GNU Emacs; Does the GUI version offer anything more than the ability to have a GUI menu?

text: I've been _looking_ at GNU Emacs for a few months now, on and off (mainly off), and I've really only gone as far as testing a few basic things which I especially want in an editor... I'm slowly getting to realize its topography, and it is starting to make (good) sense.... The main thing I've noticed is that it _seems_ to work exactly the same in the X-GUI version as it does in the X-Terminal version (and I suspect it would be pretty much the same in a non-GUI environment... I originally thought that I would feel very uncomfortable working in a non-GUI editor, and that has been the case, but the more I dabble in the Emacs waters, the less significant that **need** becomes... so I am now looking at it from the other end of the stick... I'm turning my focus to working primarily in the Terminal version.. My question is: Aside from the obvious GUI-menu (which has turned out to be quite unnecessary), is there any notable difference between the versions (X-GUI, X-Terminal, and no-GUI) ?*


title: USB Drive Software Disk Mirroring - Is this the right approach?

text: I have a 1TB NTFS USB Data Drive (no boot, etc...) that I would like to keep a mirror of as a backup in case of hardware failure. It is always connected to my raspberry pi running the raspbian (debian) based raspmc. After reviewing this question... How to set up disk mirroring in Ubuntu? This seems like a good solution to mirror the drive.   * Will this work as expected for USB drives?   * Am I looking at any performance loss by mirroring the drive?   * Anything I'm not considering that I should be?


title: head command options and reading man files

text: I have two environments: Mac and Linux. I wonder about the head command: it can show just 2 lines of text if I invoke it like so:               vim --version | head -2      I saw this online and ran to the man page to learn more only to discover that neither the osx nor the linux pages have any information that I could decipher describing the possibility of using `-2` directly to get _just 2 lines_ of text from stdin. So my questions are:   * am I reading the man pages wrong?   * if so, what indicates the possibility of specifying `-2` directly?   * if not, is it common for recognised options not to be explicitly outlined in the man page?   * if not in man, where should I look for _full disclosure_ on a command's options?   * are there many other _convenient_ features like this, which objectively make head much nicer and direct to use, that I am oblivious to and can't learn about by studying `-h` output and/or a man page? * * * ### Mac osx **OS X v10.8.3 (build 12D78)** * * * ### Linux linux **GNU/Linux (kernel 3.5.0-25-generic) Ubuntu 12.10** coreutils **GNU coreutils 8.12.197-032bb** * * *


title: ntop versus mrtg

text: I'm evaluating tools for measuring network activity and although mrtg seems to be the most highly regarded, I'm really impressed by ntop. Are there any reasons that mrtg is preferred to ntop?


title: what is the difference between cross-compiling and native compiling

text: What is the exact difference between cross-compiling and native compiling?


title: How to move files with specific extensions to newly created directories

text: I want to `mv` files with specific extensions to newly created directories. This script moves files with all the extentions in all the newly created folders, which is not the intent. Instead, it should move extension-specific files to specific folders. How can I accomplish that?               for i in 1 2 3     do         mkdir -p backup/ch0${i}         if [ $? -eq ]; then             echo "directory backup/ch0${i} created"             for j in c h sh             do                 count=0                 count=`expr $count + 1`                 if [ $count==i ]; then                     cp /home/owner/*.${j} backup/ch0${i}                     if [ $count!=i ]; then                         continue;                     elif [ $? -ne 0 ]; then                         break 2;                     fi             done         else             echo "could not back up directory!!"         fi      done


title: Has OpenBSD's ntpd replacement been ported to other BSDs? Or Linux?

text: I know the OpenBSD team wrote a from-scratch replacement for `ntpd`—OpenNTPD—that is available via `pkgsrc`/`ports`. My question is more about the base system: Is OpenNTPD the default `ntpd` in the base system in NetBSD or FreeBSD? For that matter, what about Linux distros, some of which (Gentoo or Arch, for example) are more "BSDish"?


title: In what directory can I find the list of terminal commands or the set of scripts that give each one its purpose/power?

text: Is it hidden or accessible? Also, can you create a new script and define a new command to execute system- wide by adding it to this directory and giving it the same privileges?


title: How to get my USB stick to auto-mount?

text: I used to be able to have my USB stick auto-mount when I plugged it in, on my GNOME desktop. After some fiddling with my system, it doesn't happen anymore. I now have to resort to doing this using the command line. Here's the Window that appears when I stick it in: ![enter image description here](http://i.stack.imgur.com/oBxkO.png) Here's the end of `dmesg` output:               [20500.548090] usb 2-3: new high speed USB device using ehci_hcd and address 6     [20500.703390] usb 2-3: New USB device found, idVendor=8564, idProduct=1000     [20500.703399] usb 2-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3     [20500.703406] usb 2-3: Product: Mass Storage Device     [20500.703411] usb 2-3: Manufacturer: JetFlash     [20500.703416] usb 2-3: SerialNumber: 64V6ZJ34LRL69IU1     [20500.703868] usb 2-3: selecting invalid altsetting 1     [20500.704828] scsi8 : usb-storage 2-3:1.0     [20502.122302] scsi 8:0:0:0: Direct-Access     JetFlash Transcend 8GB    1100 PQ: 0 ANSI: 0 CCS     [20502.123693] sd 8:0:0:0: Attached scsi generic sg2 type 0     [20502.125043] sd 8:0:0:0: [sdb] 15826944 512-byte logical blocks: (8.10 GB/7.54 GiB)     [20502.125774] sd 8:0:0:0: [sdb] Write Protect is off     [20502.125782] sd 8:0:0:0: [sdb] Mode Sense: 43 00 00 00     [20502.125789] sd 8:0:0:0: [sdb] Assuming drive cache: write through     [20502.132333] sd 8:0:0:0: [sdb] Assuming drive cache: write through     [20502.133529]  sdb: sdb1     [20502.135252] sd 8:0:0:0: [sdb] Assuming drive cache: write through     [20502.135257] sd 8:0:0:0: [sdb] Attached SCSI removable disk     [20502.658377] UDF-fs: No anchor found     [20502.658380] UDF-fs: Rescanning with blocksize 2048     [20502.682376] UDF-fs: No anchor found     [20502.682379] UDF-fs: No partition found (1)     [20502.738750] ISOFS: Unable to identify CD-ROM format.


title: Can't boot system with systemd version above 208

text: I recently upgraded systemd from version 208 to 212 (also tried any other version between these two numbers) And the system can't boot anymore. Looks like it cannot mount `/tmp`, but in emergency shell `mount /tmp` just works fine, so does every other file system. (including a LUKS volume) Pretty sure this is not about initramfs or kernel modules, if I simply downgrade systemd again, everything is just fine. Also, `mkinitcpio -p linux- custom` doesn't help either **UPDATE** Looks like dbus connection is broken, when I try to run `systemd-analyze blame` it says failed to get dbus connection or something **EDIT** Other method I tried:   1. Disable plymouth target (not even present in systemctl list-units)   2. Disable the `tmp.mount` target, does not help either **Logs** I'm running Arch Linux, here's the fstab structure about `tmpfs`:               /dev/zram0 /tmp tmpfs       nodev,size=512M,nosuid,noatime,nodiratime   0       0     /dev/zram0 /var/tmp     tmpfs   nodev,size=256M,nosuid,noexec,noatime,nodiratime        0       0      Here's the attached journal log (only systemd part)               systemd-journal[198]: Runtime journal is using 8.0M (max allowed 388.0M, trying to leave 582.1M free of 3.7G available → current limit 388.0M).     systemd-journal[198]: Runtime journal is using 8.0M (max allowed 388.0M, trying to leave 582.1M free of 3.7G available → current limit 388.0M).     systemd-udevd[148]: starting version 212     systemd[1]: RTC configured in localtime, applying delta of 480 minutes to system time.     systemd 212 running in system mode. (+PAM -AUDIT -SELINUX -IMA -SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ +SECCOMP -APPARMOR)     systemd[1]: Detected architecture 'x86-64'.     systemd[1]: Failed to insert module 'ipv6'     systemd[1]: No hostname configured.     systemd[1]: Set hostname to <localhost>.     systemd[1]: Cannot add dependency job for unit display-manager.service, ignoring: Unit display-manager.service failed to load: No such file or directory.     systemd[1]: Starting Forward Password Requests to Wall Directory Watch.     systemd[1]: Started Forward Password Requests to Wall Directory Watch.     systemd[1]: Starting Remote File Systems.     systemd[1]: Reached target Remote File Systems.     systemd[1]: Starting Arbitrary Executable File Formats File System Automount Point.     systemd[1]: Set up automount Arbitrary Executable File Formats File System Automount Point.     systemd[1]: Starting Dispatch Password Requests to Console Directory Watch.     systemd[1]: Started Dispatch Password Requests to Console Directory Watch.     systemd[1]: Starting Paths.     systemd[1]: Reached target Paths.     systemd[1]: Starting Swap.     systemd[1]: Reached target Swap.     systemd[1]: Expecting device dev-zram0.device...     systemd[1]: Expecting device dev-disk-by\x2duuid-fc660063\x2d302d\x2d4c49\x2d9a69\x2d3ffcf9217590.device...     systemd[1]: Expecting device dev-sdb3.device...     systemd[1]: Expecting device dev-sdb5.device...     systemd[1]: Expecting device dev-sdb7.device...     systemd[1]: Expecting device dev-mapper-secure.device...     systemd[1]: Expecting device dev-sda2.device...     systemd[1]: Expecting device dev-sda1.device...     systemd[1]: Starting Root Slice.     systemd[1]: Created slice Root Slice.     systemd[1]: Starting User and Session Slice.     systemd[1]: Created slice User and Session Slice.     systemd[1]: Starting Device-mapper event daemon FIFOs.     systemd[1]: Listening on Device-mapper event daemon FIFOs.     systemd[1]: Starting Delayed Shutdown Socket.     systemd[1]: Listening on Delayed Shutdown Socket.     systemd[1]: Starting /dev/initctl Compatibility Named Pipe.     systemd[1]: Listening on /dev/initctl Compatibility Named Pipe.     systemd[1]: Starting Syslog Socket.     systemd[1]: Listening on Syslog Socket.     systemd[1]: Starting udev Control Socket.     systemd[1]: Listening on udev Control Socket.     systemd[1]: Starting udev Kernel Socket.     systemd[1]: Listening on udev Kernel Socket.     systemd[1]: Starting LVM2 metadata daemon socket.     systemd[1]: Listening on LVM2 metadata daemon socket.     systemd[1]: Starting Journal Socket.     systemd[1]: Listening on Journal Socket.     systemd[1]: Starting System Slice.     systemd[1]: Created slice System Slice.     systemd[1]: Starting File System Check on Root Device...     systemd[1]: Starting system-getty.slice.     systemd[1]: Created slice system-getty.slice.     systemd[1]: Starting Apply Kernel Variables...     systemd[1]: Starting Load Kernel Modules...     systemd[1]: Mounting Huge Pages File System...     systemd[1]: Mounting POSIX Message Queue File System...     systemd[1]: Starting Setup Virtual Console...     systemd[1]: Starting udev Coldplug all Devices...     systemd\x2dcryptsetup.slice.     systemd\x2dcryptsetup.slice.     systemd[1]: Starting Set Up Additional Binary Formats...     systemd[1]: Mounted Debug File System.     systemd[1]: Starting Create list of required static device nodes for the current kernel...     systemd[1]: Starting Journal Service...     systemd[1]: Started Journal Service.     systemd-journal[198]: Journal started     systemd-modules-load[191]: Module 'acpi_cpufreq' is builtin     systemd-modules-load[191]: Module 'acpi_call' is builtin     systemd-modules-load[191]: Module 'aesni_intel' is builtin     systemd-modules-load[191]: Module 'coretemp' is builtin     systemd-modules-load[191]: Module 'microcode' is builtin     systemd-modules-load[191]: Module 'tp_smapi' is builtin     systemd-modules-load[191]: Module 'uinput' is builtin     systemd-sysctl[189]: Overwriting earlier assignment of kernel/sysrq in file '/etc/sysctl.d/99-sysctl.conf'.     systemd[1]: Starting Slices.     systemd[1]: Reached target Slices.     systemd-binfmt)     systemd-modules-load[191]: Inserted module 'vboxdrv'     systemd[1]: Mounted POSIX Message Queue File System.     systemd[1]: Mounted Arbitrary Executable File Formats File System.     systemd[1]: Started udev Coldplug all Devices.     systemd-modules-load[191]: Inserted module 'vboxnetadp'     systemd-modules-load[191]: Inserted module 'vboxnetflt'     systemd[1]: Started Set Up Additional Binary Formats.     systemd-modules-load[191]: Inserted module 'vboxpci'     systemd-modules-load[191]: Module 'zram' is builtin     systemd-modules-load[191]: Module 'fuse' is builtin     systemd[1]: Started Load Kernel Modules.     systemd[1]: Mounting Configuration File System...     systemd[1]: Mounting FUSE Control File System...     systemd[1]: Starting Create Static Device Nodes in /dev...     systemd[1]: Mounted FUSE Control File System.     systemd[1]: Mounted Configuration File System.     systemd[1]: Started Apply Kernel Variables.     systemd-fsck[188]: ArchRoot: clean, 281073/812800 files, 1963679/3249138 blocks     systemd[1]: Started File System Check on Root Device.     systemd[1]: Starting Remount Root and Kernel File Systems...     systemd[1]: Started Remount Root and Kernel File Systems.     systemd[1]: Starting Load/Save Random Seed...     systemd[1]: Started Load/Save Random Seed.     systemd[1]: Started Setup Virtual Console.     systemd[1]: Started Create Static Device Nodes in /dev.     systemd[1]: Starting udev Kernel Device Manager...     systemd[1]: Starting Local File Systems (Pre).     systemd[1]: Reached target Local File Systems (Pre).     systemd[1]: Mounting /run/shm...     systemd[1]: Mounted /run/shm.     systemd[1]: Started udev Kernel Device Manager.     systemd-udevd[234]: starting version 212     systemd-sysctl[253]: Overwriting earlier assignment of kernel/sysrq in file '/etc/sysctl.d/99-sysctl.conf'.     systemd-sysctl[295]: Overwriting earlier assignment of kernel/sysrq in file '/etc/sysctl.d/99-sysctl.conf'.     systemd-udevd[239]: error opening ATTR{/sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.3/1-1.3:1.0/power/control} for writing: No such file or directory     systemd-journal[198]: Forwarding to syslog missed 40 messages.     systemd[1]: Job dev-sda1.device/start timed out.     systemd[1]: Timed out waiting for device dev-sda1.device.     systemd[1]: Dependency failed for /data.     systemd[1]: Dependency failed for Local File Systems.     systemd[1]: Triggering OnFailure= dependencies of local-fs.target.     systemd[1]: Job dev-sda2.device/start timed out.     systemd[1]: Timed out waiting for device dev-sda2.device.     systemd[1]: Dependency failed for /vm.     systemd[1]: Job dev-sdb7.device/start timed out.     systemd[1]: Timed out waiting for device dev-sdb7.device.     systemd[1]: Dependency failed for Cryptography Setup for secure.     systemd[1]: Dependency failed for Encrypted Volumes.     systemd[1]: Dependency failed for dev-mapper-secure.device.     systemd[1]: Dependency failed for /secure.     systemd[1]: Job dev-sdb5.device/start timed out.     systemd[1]: Timed out waiting for device dev-sdb5.device.     systemd[1]: Dependency failed for /ubuntu_ssd_vm.     systemd[1]: Job dev-sdb3.device/start timed out.     systemd[1]: Timed out waiting for device dev-sdb3.device.     systemd[1]: Dependency failed for /win7_ssd_vm.     systemd[1]: Job dev-disk-by\x2duuid-fc660063\x2d302d\x2d4c49\x2d9a69\x2d3ffcf9217590.device/start timed out.     systemd[1]: Timed out waiting for device dev-disk-by\x2duuid-fc660063\x2d302d\x2d4c49\x2d9a69\x2d3ffcf9217590.device.     systemd[1]: Dependency failed for /Application.     systemd[1]: Job dev-zram0.device/start timed out.     systemd[1]: Timed out waiting for device dev-zram0.device.     systemd[1]: Dependency failed for /tmp.     systemd[1]: Dependency failed for /var/tmp.     systemd[1]: Dependency failed for /home/USER/.cache.     systemd[1]: Dependency failed for /var/log.     systemd[1]: Dependency failed for Update UTMP about System Boot/Shutdown.     systemd[1]: Requested transaction contradicts existing jobs: Transaction is destructive.     systemd[1]: syslog.socket failed to queue service startup job (Maybe the service file is missing or not a non-template unit?): Transaction is destructive.     systemd[1]: Unit syslog.socket entered failed state.     systemd[1]: Stopped Daily Cleanup of Temporary Directories.     systemd[1]: Stopped Getty on tty1.     systemd[1]: Stopped Getty on tty3.     systemd[1]: Stopped target Graphical Interface.     systemd[1]: Stopped target Multi-User System.     systemd[1]: Stopped Initialize hardware monitoring sensors.     systemd[1]: Stopped Set brightness.     systemd[1]: Stopped Restore pax attributes.     systemd[1]: Stopped sets battery thresholds.     systemd[1]: Stopped Name Service Cache Daemon.     systemd[1]: Stopped Periodic Command Scheduler.     systemd[1]: Stopped Network Manager.     systemd[1]: Stopped My GoAgent Service.     systemd[1]: Starting Network.     systemd[1]: Reached target Network.     systemd[1]: Stopped Run my.local script.     systemd[1]: Stopped Load apparmor profiles.     systemd[1]: Stopped Login Service.     systemd[1]: Starting Login Prompts.     systemd[1]: Reached target Login Prompts.     systemd[1]: Stopped ACPI event daemon.     systemd[1]: Closed ACPID Listen Socket.     systemd[1]: Stopped D-Bus System Message Bus.     systemd[1]: Closed D-Bus System Message Bus Socket.     systemd[1]: Stopped System Logger Daemon.     systemd[1]: Stopped Permit User Sessions.     systemd[1]: Starting Trigger Flushing of Journal to Persistent Storage...     systemd[1]: Stopped target Basic System.     systemd[1]: Starting Timers.     systemd-journal[198]: Forwarding to syslog missed 26 messages.     systemd[1]: Reached target Timers.     systemd[1]: Starting Sockets.     systemd[1]: Reached target Sockets.     systemd[1]: Stopped target System Initialization.     systemd[1]: Started Manage Sound Card State (restore and store).     systemd[1]: Starting Restore Sound Card State...     systemd[1]: Starting Create Volatile Files and Directories...     systemd[1]: Starting Emergency Shell...     systemd[1]: Started Emergency Shell.     systemd[1]: Starting Emergency Mode.     systemd[1]: Reached target Emergency Mode.     systemd[1]: Started Restore Sound Card State.     systemd-journal[198]: Runtime journal is using 8.0M (max allowed 388.0M, trying to leave 582.1M free of 3.7G available → current limit 388.0M).     systemd[1]: Started Trigger Flushing of Journal to Persistent Storage.     systemd[1]: Started Create Volatile Files and Directories.     systemd[1]: Startup finished in 2.835s (kernel) + 1min 30.235s (userspace) = 1min 33.070s.     systemd[884]: Failed at step EXEC spawning /bin/plymouth: No such file or directory


title: Accidentally typed crontab with just the dash

text: What happens when I type just "crontab -"? The "e" didn't take before I hit Enter. It just moved the cursor to the next line and I had to Ctrl+C to exit, but I'm not sure what it did exactly. I'm on Linux CentOS 6.3.


title: Cannot create a partition after the 4th

text: When using `cfdisk` to partition for Arch Linux, I found that after the 4th partition, I can't make any more. ![enter image description here](http://i.stack.imgur.com/Ic2yG.png) I'm using VMWare Player as a VM, and I'm using a single fake HD file. Earlier I thought it was that I was using split HD files, but I'm wrong. Is there any way around this?


title: whats a good tool to search tail -f output

text: I am dumping some debug info into a text file that I am using tail -f to monitor. Is there a tool that I can then pipe that tail -f data into to be able to search the text on screen using regular expression commands like search in vim.


title: How can I reserve a block of memory from the Linux kernel?

text: I have a device that needs a block of memory that is reserved solely for it, without the OS intervening. Is there any way to tell BIOS or the OS that a block of memory is reserved, and it must not use it? I am using this device on an openSUSE machine.


title: vmware/Parallels and Backtrack 5

text: After endless hours of debugging and trying different things, I can't seem to get Backtrack 5 R3 to cooperate as guest OS on my OSX Lion host. What I'm trying to do is to setup BT as guest OS on my Lion and then use my Alfa AWUS036NH with it.   * My adapter is supported by BT   * I am able to use it on VMware on Windows, but it's a major pain and I need it on my mac   * My adapter is installed and working on OSX just fine   * BT does not indicate it at all, I ran lsusb and it doesn't even show it (either running on VMware or Parallels)   * I tried both live CD and full install, still no luck   * I have the USB modules installed and set up, no dice   * Both of virtual machines pick up a USB storage device just fine What could be the reason behind it not working? I've been wrapping my head around this for two weeks now, any help would be much appreciated!


title: Finding correct information to update mtab and fstab?

text: Is there an automated way to update my `mtab` and `fstab`? Or a command I can run so that I can copy the output into these files? I'm just nervous about tampering with these files because I know they are critical. I previously had a `md0` and `md1` array but they "disappeared." Now my `mtab` and `fstab` is stale and it is giving me problems trying to run this automatic RAID utility, raider. ### fstab               # /etc/fstab: static file system information.     #     # <file system> <mount point>   <type>  <options>       <dump>  <pass>     proc            /proc           proc    defaults        0       0     /dev/md0       /               ext3    errors=remount-ro 0       1     /dev/md1       none            swap    sw              0       0     /dev/scd0       /media/cdrom0   udf,iso9660 user,noauto     0       0      ### mtab               /dev/md0 / ext3 rw,errors=remount-ro 0 0     tmpfs /lib/init/rw tmpfs rw,nosuid,mode=0755 0 0     proc /proc proc rw,noexec,nosuid,nodev 0 0     sysfs /sys sysfs rw,noexec,nosuid,nodev 0 0     udev /dev tmpfs rw,mode=0755 0 0     tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0     devpts /dev/pts devpts rw,noexec,nosuid,gid=5,mode=620 0 0      ### /proc/mounts               rootfs / rootfs rw 0 0     none /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0     none /proc proc rw,nosuid,nodev,noexec,relatime 0 0     none /dev devtmpfs rw,relatime,size=1547340k,nr_inodes=215947,mode=755 0 0     none /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0     /dev/sda1 / ext3 rw,relatime,errors=remount-ro,data=ordered 0 0     tmpfs /lib/init/rw tmpfs rw,nosuid,relatime,mode=755 0 0     tmpfs /dev/shm tmpfs rw,nosuid,nodev,relatime 0 0      ## Here's what I think based on observation ### My proposed update to fstab (should it be sda or sda1?)               # /etc/fstab: static file system information.     #     # <file system> <mount point>   <type>  <options>       <dump>  <pass>     proc            /proc           proc    defaults        0       0     /dev/sda1       /               ext3    errors=remount-ro 0       1     /dev/scd0       /media/cdrom0   udf,iso9660 user,noauto     0       0      ### My proposed update to mtab (should it be sda or sda1?)               /dev/sda1 / ext3 rw,errors=remount-ro 0 0     tmpfs /lib/init/rw tmpfs rw,nosuid,mode=0755 0 0     proc /proc proc rw,noexec,nosuid,nodev 0 0     sysfs /sys sysfs rw,noexec,nosuid,nodev 0 0     udev /dev tmpfs rw,mode=0755 0 0     tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0     devpts /dev/pts devpts rw,noexec,nosuid,gid=5,mode=620 0 0


title: Best Disk Partitioning Scheme for a Linux-based Developer Machine

text: Is there some kind of "best disk partitioning scheme" for a Linux-based web and application **developer machine** , in terms of performance, organization or others?


title: Solving Ethernet watchdog timer deadlocks

text: I have a debian linux box (Debian Squeeze) that deadlocks every few hours if I run a python script that sniffs an interface... The stack trace is attached to the bottom of this question. Essentially, I have a Broadcom ethernet interface (`bnx2` driver) that seems to die when I start a sniffing session and then it tries to transmit a frame out the same interface. From what I can tell, a kernel watchdog timer is tripping...               NETDEV WATCHDOG: eth3 (bnx2): transmit queue 0 timed out      I think there is a way to control watchdog timers with `ioctl` (ref: EmbeddedFreak: How to use linux watchdog). ## Questions (Original): ~~How can I find which watchdog timer(s) is controlling eth3? Bonus points if you can tell me how to change the timer or even disable the watchdog...~~ ## Questions (Revised): How can I prevent the ethernet watchdog timer from causing problems? * * * ## Stack trace               Apr 30 08:38:44 Hotcoffee kernel: [275460.837147] ------------[ cut here ]------------     Apr 30 08:38:44 Hotcoffee kernel: [275460.837166] WARNING: at /build/buildd-linux-2.6_2.6.32-41squeeze2-amd64-NDo8b7/linux-2.6-2.6.32/debian/build/source_amd64_none/net/sched/sch_generic.c:261 dev_watchdog+0xe2/0x194()     Apr 30 08:38:44 Hotcoffee kernel: [275460.837169] Hardware name: PowerEdge R710     Apr 30 08:38:44 Hotcoffee kernel: [275460.837171] NETDEV WATCHDOG: eth3 (bnx2): transmit queue 0 timed out     Apr 30 08:38:44 Hotcoffee kernel: [275460.837172] Modules linked in: 8021q garp stp parport_pc ppdev lp parport pci_stub vboxpci vboxnetadp vboxnetflt vboxdrv ext2 loop psmouse power_meter button dcdbas evdev pcspkr processor serio_raw ext4 mbcache jbd2 crc16 sg sr_mod cdrom ses ata_generic sd_mod usbhid hid crc_t10dif enclosure uhci_hcd ehci_hcd megaraid_sas ata_piix thermal libata usbcore nls_base scsi_mod bnx2 thermal_sys [last unloaded: scsi_wait_scan]     Apr 30 08:38:44 Hotcoffee kernel: [275460.837202] Pid: 0, comm: swapper Not tainted 2.6.32-5-amd64 #1     Apr 30 08:38:44 Hotcoffee kernel: [275460.837204] Call Trace:     Apr 30 08:38:44 Hotcoffee kernel: [275460.837206]  <IRQ>  [<ffffffff81263086>] ? dev_watchdog+0xe2/0x194     Apr 30 08:38:44 Hotcoffee kernel: [275460.837211]  [<ffffffff81263086>] ? dev_watchdog+0xe2/0x194     Apr 30 08:38:44 Hotcoffee kernel: [275460.837217]  [<ffffffff8104df9c>] ? warn_slowpath_common+0x77/0xa3     Apr 30 08:38:44 Hotcoffee kernel: [275460.837220]  [<ffffffff81262fa4>] ? dev_watchdog+0x0/0x194     Apr 30 08:38:44 Hotcoffee kernel: [275460.837223]  [<ffffffff8104e024>] ? warn_slowpath_fmt+0x51/0x59     Apr 30 08:38:44 Hotcoffee kernel: [275460.837228]  [<ffffffff8104a4ba>] ? try_to_wake_up+0x289/0x29b     Apr 30 08:38:44 Hotcoffee kernel: [275460.837231]  [<ffffffff81262f78>] ? netif_tx_lock+0x3d/0x69     Apr 30 08:38:44 Hotcoffee kernel: [275460.837237]  [<ffffffff8124dda3>] ? netdev_drivername+0x3b/0x40     Apr 30 08:38:44 Hotcoffee kernel: [275460.837240]  [<ffffffff81263086>] ? dev_watchdog+0xe2/0x194     Apr 30 08:38:44 Hotcoffee kernel: [275460.837242]  [<ffffffff8103fa2a>] ? __wake_up+0x30/0x44     Apr 30 08:38:44 Hotcoffee kernel: [275460.837249]  [<ffffffff8105a71b>] ? run_timer_softirq+0x1c9/0x268     Apr 30 08:38:44 Hotcoffee kernel: [275460.837252]  [<ffffffff81053dc7>] ? __do_softirq+0xdd/0x1a6     Apr 30 08:38:44 Hotcoffee kernel: [275460.837257]  [<ffffffff8102462a>] ? lapic_next_event+0x18/0x1d     Apr 30 08:38:44 Hotcoffee kernel: [275460.837262]  [<ffffffff81011cac>] ? call_softirq+0x1c/0x30     Apr 30 08:38:44 Hotcoffee kernel: [275460.837265]  [<ffffffff8101322b>] ? do_softirq+0x3f/0x7c     Apr 30 08:38:44 Hotcoffee kernel: [275460.837267]  [<ffffffff81053c37>] ? irq_exit+0x36/0x76     Apr 30 08:38:44 Hotcoffee kernel: [275460.837270]  [<ffffffff810250f8>] ? smp_apic_timer_interrupt+0x87/0x95     Apr 30 08:38:44 Hotcoffee kernel: [275460.837273]  [<ffffffff81011673>] ? apic_timer_interrupt+0x13/0x20     Apr 30 08:38:44 Hotcoffee kernel: [275460.837274]  <EOI>  [<ffffffffa01bc509>] ? acpi_idle_enter_bm+0x27d/0x2af [processor]     Apr 30 08:38:44 Hotcoffee kernel: [275460.837283]  [<ffffffffa01bc502>] ? acpi_idle_enter_bm+0x276/0x2af [processor]     Apr 30 08:38:44 Hotcoffee kernel: [275460.837289]  [<ffffffff8123a0ba>] ? cpuidle_idle_call+0x94/0xee     Apr 30 08:38:44 Hotcoffee kernel: [275460.837293]  [<ffffffff8100fe97>] ? cpu_idle+0xa2/0xda     Apr 30 08:38:44 Hotcoffee kernel: [275460.837297]  [<ffffffff8151c140>] ? early_idt_handler+0x0/0x71     Apr 30 08:38:44 Hotcoffee kernel: [275460.837301]  [<ffffffff8151ccdd>] ? start_kernel+0x3dc/0x3e8     Apr 30 08:38:44 Hotcoffee kernel: [275460.837304]  [<ffffffff8151c3b7>] ? x86_64_start_kernel+0xf9/0x106     Apr 30 08:38:44 Hotcoffee kernel: [275460.837306] ---[ end trace 92c65e52c9e327ec ]---


title: Permissions/ownership of /usr/local/bin

text: From what I understand, the right place to put your own scripts is `/usr/local/bin` (for instance a script I use to back up some files). I notice that this folder is currently (by default) owned by root, and my normal user has no access to it. I am the only user on this computer. Shall I change this whole folder to my own user? Or is there another proper way to arrange permissions of `/usr/local/bin`?


title: Hostname not changing on Centos 6.4

text: We have centos machine. We have tried both the /etc/hosts and also /etc/sysconfig/network. Edited both files and service network restart. Yet the hostname is showing as localhost.localdomain. How to resolve on this? Googling almost all talking about the same method too.


title: Maintain different Dropbox locations for one Dropbox account on different hosts

text: We've got a user who is asking if it's possible to keep two config.db's, and use one or the other based on the host name, for _the same_ Dropbox account (not two Dropbox accounts). For example:               ~/.dropbox/box123/config.db     ~/.dropbox/box456/config.db      The primary goal is so that the location of the Dropbox folder can be different on different hosts. For example, on box123, Dropbox contents could be set to /somelocation/Dropbox while on box456, Dropbox contents for the same account could be set to /anotherlocation/Dropbox My initial thought was a script that modifies config.db upon login, to change the 'dropbox_path' to whatever it needs to be for that machine. But that would get nasty and cause all sorts of problems if the user is logged into more than one machine at a time. Let me know if any clarification is needed.


title: Radeon HD 6570 Display Problem

text: I recently upgraded my graphics card by buying and installing an AMD Radeon HD 6570. My Windows partition works fine, but my OpenSUSE 12.1 Linux partition is having a strange issue. When I try to boot into SUSE it appears to load fine at first, giving me the green screen with the OpenSUSE name and the chameleon.   However, right around the time the chameleon's eyes would move, the screen switches to what I can only describe as green and black bars. It loads this way for a while then switches to blue and black bars, which I assume is the login screen. I had been using LXDE before, and it was working fine before I switched GPUs. Is there any way for me to fix this, or should I try a different Linux distro? If the latter, is Lubuntu compatible with my GPU? Also, I've tried using Ctrl+Alt+F2 (I believe that's the correct combo, haven't been able to use Linux in almost a month) to get to a command line but that won't work either.


title: After re-compiling the kernel, my grub stop after the bios

text: After recompiling my kernel, I copied the corresponding files to `/boot`, and my `/boot` directory looks like: ![enter image description here](http://i.stack.imgur.com/iapa2.jpg) Then, I inserted a new item in `grub`, and `/boot/grub/menu.lst` now looks like: ![enter image description here](http://i.stack.imgur.com/ZyWz5.jpg) After searching a lot, I found that someone mentions that maybe ACPI settings matter. So, I set ACPI to off. But it still does not work.   When I reboot my OS, it still stops, like this: ![enter image description here](http://i.stack.imgur.com/9tKgz.jpg) As you can see, I have another `grub` item, `grub-ide`. And if I choose it, I can successfully log into it. How can I get my system to boot with my new kernel?


title: How to install ia32-libs in Debian Wheezy?

text: I would like to install `ia32-libs` in Debian Wheezy however it seems it is deprecated. The solution in this question works when installing 32-bit packages from Debian repositories, but there are some external applications I would like to install (in `/opt/`) that are 32-bit. Is there a way to force-install `ia32-libs`?


title: Execute Script in Syslinux

text: I want to execute a script in Syslinux. Is this possible? To be more specific: I want to write a one-time-windows-boot-script that does the following:   1. reboot into windows,   2. on the next reboot: reboot into Linux. I thought, this should be possible by writing for (1) a script that sets my Windows partition as default in `syslinux.cfg` and for (2) a script that sets the Linux partition as default again. As far as I understand Syslinux, I can only set options in the configuration but not execute scripts.. would something like this be possible with Syslinux or another bootmanager? PS: I intent to use this with MBR.


title: Is there any way to get an HTML page rendered through Chrome/Chromium from a console?

text: Is there any way to get (into a file, for example) a rendered HTML page from Google Chrome/Chromium, but from a console. For example, SSHed into a machine that has Chrome/Chromium installed on Debian/Ubuntu. I want to be able to see the page from the console, but with all Javascripts executed and for example some JSON data parsed/rendered.


title: Is /sbin/sulogin safe?

text: Lately my machine's authentication system broke twice: once because I messed up with PAM/LDAP and the other one because I messed up with `/etc/passwd` or `/etc/shadow`. In order to recover things I had to boot from a live system, but I found it quite annoying (longer boot times, on the live system I had a different kernel, different insalled tools and so on). Since I'm having lots of fun with PAM/LDAP in these days (...) this is likely to happen again. I was thus thinking of permanently putting `/sbin/sulogin -p` on `tty1`, instead of `/sbin/agetty`, through `/etc/inittab`, in order to be able to log in even if something brokes. At least in some circumstances. Is it safe to do that, or is there any side effect?   I need to specify that other people can physically log in on this machine.


title: What settings can I use to maximize FFMpeg performance?

text: I'm trying to do some screencasting, but since my computer is much too old and slow the video being produced is laggy and the application I'm trying to record becomes unresponsive due to the CPU consumption. Since I can't upgrade at the moment, I'm looking to optimize what I have.   I switched from GNOME to OpenBox, and I've killed unnecessary processes, etc. Still no good. I've also optimized the application I'm recording, so the only thing left would be the recorder itself, which is FFMpeg. What are some options and flags that can be used to get the best performance out of FFMpeg? Are there any specific codecs that are easier to process than others? I'll be recording about 10-15 mins at a time, so something that doesn't produce HUGE files sizes would also be appreciated. Any ideas?


title: Installing libxml2 on secure Debian box

text: I have a very stripped Debian distro on a small custom computer that I purchased (don't know much about this distro as it was recommended on some site). The name is 'sid' and runs 2.6.37.1 kernel. Unfortunately it doesn't have any PPA's in the sources.list file so I cannot apt-get any software. I am trying to get libxml2 (Gnome package) for a program called xmllint. Since I cannot apt-get this software I need to get each debian package. Going further it needs: libxml2 depends > multiarch (the computer is i586 not i386) > libc > libc-dev > ... and so on until infinity. This distro has the build-essentials installed but I can't instal libc and libc-dev alone as it leads to 100's of more dependencies. Where can I go from here?


title: Logrotate doesn't rotate logs

text: I'm new to Linux, and I want to use logrorate. The logs are written to `/var/log/curLog/log.log`. As mentioned in the documentation, I create a new file in `/etc/logrotate.d/` with name `currentLog`. The content of `currentLog` is:               /var/log/curLog/log.log{         size 100k,         rotate 10,         daily,         compress,         notifempty         missingok     }      But the logs increase above the 100k size, and nothing happens. Should I restart some service or do some other operations?


title: multitail - custom config (multitail.conf) location

text: Is it possible to provide a custom location for `multitail.conf` - or are my only options `/etc/multiltail.conf` or `~/multitail.conf`? I'd like to provide a specific config file that has regexes specific to our app defined, but I can't put this in the accounts home directory, or `/etc`. I care most about the colors, so if it's possible to reference those from a seperate file, then that would work well too.


title: What does "make install" do in the Makefile that comes with the kernel?

text: I'm trying to identify what does `make install` do with the kernel and what does the actual "install" of the kernel once it's been compiled means. The problem is I can't really identify the target ( _Makefile reference_) for "install" in the `Makefile`.               user@user-VirtualBox:~/Downloads/linux-3.14.1$ grep install: Makefile      firmware_install: FORCE     headers_install: __headers     modules_install: _modinst_ _modinst_post     modules modules_install: FORCE     modules_install: _emodinst_ _emodinst_post      What should I conclude from that?


I need to print the directory structure of our production system and I would like to remove some specific directories from the tree? How do we specify multiple ignore patterns for `tree` command?


title: Xming does not show an xclock window

text: I am new to Xming. I have installed and have connected to a server using Putty. But when I type "xclock" for testing there is no output. It just remains like that.


title: How to get cpu usage for every core with a bash script using standard *nix tools

text: I'm writing a bash script to print system stats to my `dwm` status bar using `xsetroot`. Everything works as expected. What I'm currently missing is an easy way that just uses standard `*nix` tools to give me the current load for every core on my system (I have 4 cores.). I can't figure out how to do this e.g. using `top`. All other posts I found on this site so far just deal with average load. Has anybody done this before? The main reason that I want it for every single core is to have a cheap and rough tool to check if a program is running some code I wrote in parallel (e.g. a for each loop).


title: How do I get simple scripts which seem to need root priveliges to run via the www-data user?

text: I am programming a small webinterface to control samba on Debian (kernel 2.6.32-5-686). I started by writing simple scripts to add users, create folders, etc. They worked fine when run as root. However, when run via web (apache + php) by using `php: shell_exec()` some of them didn't work. They look like this:               #!/bin/sh     #archive the userprofile     cp /home/samba/profile/$1 /home/samba/archive/$1     smbpasswd -LU $1 -x     userdel $1      exit 0      I tried using sudo to run the scripts, which doesn't seem to work. I added this line: (jupiter is the servers name)               %sudo jupiter=(ALL)NOPASSWD:/bin/<script>      to the /etc/sudoersfile, gave my www-data user the sudo group, nothing. Then I read somewhere I should `chmod 4755` and `chown` the scripts. It still didn't work. At this point I was curious what the problem was and I redirected the STDERR to a file. I ran one of the small scripts, which would call `cp`, `smbpasswd`and `userdel` to delete the user and archive his share. All calls returned the exitcode 1, which AFAIK indicates that _something_ went wrong. STDERR gave me a little clue:               userdel: cannot lock /etc/passwd; try again later.      This seems to be caused by some *.lock files, but there are none in my /etc/ folder. At this point I got kinda frustrated and tried giving the www-data more root rights by adding it to the root group. Things still didn't work. So far for my progress, I have no idea what to do next. My question is: **How do I get simple scripts which seem to need root priveliges to run via the www- data user?** I think it might be a problem with the /etc/passwd file, as I can imagine only the root-user has the right to alter it.


title: Fast elimination of duplicate lines across multiple files

text: I have a huge amount of data in which each (data-)line should be unique. There are a lot of files in one folder in which this is already true. It is about 15GB splitted into roughly 170 files with 1000000 lines. Let's call that folder `foo`. Now there is a second folder (`bar`) with even more data: In each file, there are no multiple entries. The intersection of two files in `bar` is not necessarily empty. There are roughly 15k lines in each of the files there (and there are several thousands of files in `bar`). Right now I'm using               awk 'NR==FNR{a[$0]=$0;next}!a[$0]' foo/file bar/file > tmp     mv tmp bar/file      and a loop over all files in `foo` and a loop over all files in `bar`. I break the loop over `foo` if the `bar/file` is empty. I have parallelized this by locking (for use on several nodes) and parallel execution (on each node). But still, this needs a heck of a long time. What are possibilities of improving performance? What is the ideal file size of files in `foo`? Of course this is machine dependent (RAM/CPU/storage), but what is a good rule of thumbs here? **tl;dr** : `foo` contains unique data lines, `bar` contains data lines which can appear multiple times in `bar`and `foo`. Eliminate duplicates in `bar` such that they can be merged with `foo` **[Update]** There are no empty lines **[/Update]**


title: How should I install software from source so that I can make my configuration manageable and reproducible?

text: I work with a lot of scientific software on Linux distributions (normally Debian variants and Red Hat variants). In order to maximize performance and get access to the latest features, it's often preferable to compile software from source. However, doing so is messy, and can lead to conflict with the package manager. I looked at all of the suggestions in the Unix & Linux question "How to compile and install programs from source" and the Unix & Linux question Where should I put software I compile from source? for some guidance. These questions are a good place to start, but it's not clear to me how I can manage dependencies easily. For example, if I build the development branch of NumPy from source using something like checkinstall, how should I detect dependencies so that I can add them correctly into the package built by checkinstall? My goal here is to make installing and uninstalling software relatively painless without cluttering my configuration. I'd also like to make my configuration repeatable. By that, I mean, I'd like to set up a workflow for installing software on my machine so that I could repeat it exactly on a fresh OS install. Is there a best practice for that? When it comes to standard packages in a package manager, the simplest method for repeating a software install is to make a script containing the appropriate `apt-get install <package>` (or equivalents). However, when installing software from source, I could see this method getting very complicated. Is there a better way?


title: Lowres application icon on window switching (alt-tab)

text: I manually downloaded and installed Sublime Text 2 (instead of adding the repository and installing via `apt-get install`) and I'm having some trouble getting gnome to find the high res icons for sublime. I extracted the application to `/usr/lib/sublime-text` Added the following executable script as `/usr/bin/sublime`               #!/bin/sh     export SUBLIME_HOME="/usr/lib/sublime-text"     $SUBLIME_HOME/sublime_text $*      The `/usr/lib/sublime-text/Icon` directory contains icons for various resolutions in subdirectories (16x16, 32x32, 48x48, 128x128, 256x256), and I used the 256x256 one when I added the menu item to the cinnamon menu. How does Gnome locate the icon for an application? I renamed the `/etc/lib/sublime-text/Icon` directory and then I didn't get an icon at all (default gnome icon) so Gnome's obviously using an icon from the `/usr/lib/sublime-text` folder, but if so why how do I get it to use a highres one? Also how does Gnome match the application to the image name? Currently the script in `/usr/bin` is named `sublime`, the directory in `/usr/lib` is named `sublime-text`, the executable in `/usr/bin/lib/sublime-text` is named `sublime_text` and the menu item is defined in a file named `Sublime Text.desktop`. I seriously don't understand how the system manages to match all of this... * * * I'm running Linux Mint 13 (Cinnamon)


title: Placement of kernel binary and sources for kernel module building?

text: I'm trying to setup an environment for kernel module development in Linux. I've built the kernel in the home folder and would like to place the sources and binaries to the correct place so include correctly. The example for building the kernel module has the following includes:               #include <linux/init.h>     #include <linux/module.h>      What are the absolute paths that the linker looks for these headers?


title: How to convert a 32-bit (x86) Debian Wheezy system to 64-bit

text: I have a 32-bit system which runs on a 64-bit processor. How do I convert it to be all-64-bit, without re-installing? I have seen somewhere that it is doable as a result of the new Multiarch framework.


title: sed and awk challenge

text: Here is a great challenge for someone to attack! Is there a way to achieve the following using sed and/or awk. Please see myfile.txt below:               $cat myfile.txt:          entry          "entry-header"          entry-top          name          !udwd870kdjll   --  random string          Derek          code=nsmssdllskpdp          code=nassmdllskpdp          name          !ueo0000kdjll   --  random string          name          Moss          !ueo3870kdjll   --  random string          choice=Pear comments="Great"          choice=Pineapple comments="Not quite the best"          choice=Apple comments="OK"          choice=Grapes comments="OK"          choice=Grapefruit comments="OK"          /entry-top          /entry                    entry          "entry-header"          entry-top          !udwd870kdjll   --  random string          name          !udwd870kdjll   --  random string          Sarah          code=nsmsstyyukpdp          code=nalmdllskpdpx          !ueo0000kdjll   --  random string          name          Zimmerman          !ueo3870kdjll   --  random string          choice=Orange comments="These are awesome"          choice=Pineapple comments="Nice"          choice=Mango comments="Pretty good"          /entry-top          /entry           etc... This is a huge list of peoples favorite fruits, and their entries are in order, with the one at the top being the favorite. I need to be able to assign a number to each entry so I can collate the results. I also need to differentiate between the two name lines given, the surname always appeasr second. As long as I can update the labels (to be name1 and name2 rather than name and name), I will be able to manipulate the text how I want to. The required output is below, and should show you exactly what I am after:               entry          "entry-header"          entry-top          name1          !udwd870kdjll   --  random string          Derek          code=nsmssdllskpdp          name2          code=nassmdllskpdp          !ueo0000kdjll   --  random string          Moss          !ueo3870kdjll   --  random string          choice1=Pear comments="Great"          choice2=Pineapple comments="Not quite the best"          choice3=Apple comments="OK"          choice4=Grapes comments="OK"          choice5=Grapefruit comments="OK"          /entry-top          /entry                    entry          "entry-header"          entry-top          name1          !udwd870kdjll   --  random string          Sarah          code=nsmsstyyukpdp          name2          code=nalmdllskpdpx          !ueo0000kdjll   --  random string          Telford          !ueo3870kdjll   --  random string          choice1=Orange comments="These are awesome"          choice2=Pineapple comments="Nice"          choice3=Mango comments="Pretty good"          /entry-top          /entry


title: Switch debian install from legacy to UEFI

text: I have Debian 7 installed on my laptop on the ssd and windows 8 on the hdd. Currently to boot Windows I go into the bios and change a boot setting from legacy to UEFI, which means to boot Debian I am using the legacy option. When I originally installed Debian I recall it being a pain to work with UEFI so that is why I did it this way. My question is, now that I have more time, is it possible to switch the Debian install so that it can dual boot with windows under UEFI?


title: CheckInstall on CentOS

text: I am attempting to make CheckInstall on a clean version of CentOS however I am having difficulty, I receive the following error:               [root@host checkinstall-1.6.2]# make     for file in locale/checkinstall-*.po ; do \             case ${file} in \                 locale/checkinstall-template.po)  ;; \                 *) \                     out=`echo $file | sed -s 's/po/mo/'` ; \                     msgfmt -o ${out} ${file} ; \                     if [ $? != 0 ] ; then \                         exit 1 ; \                     fi ; \                 ;; \             esac ; \         done         /bin/sh: line 5: msgfmt: command not found     make: *** [all] Error 1      How can fix these dependency errors? Without using 'yum' if at all possible.


title: Shell script testing through terminal simulation

text: I am developing a generic bash script which could be executed in different distro. I have only a CentOS virtual machine and I would be interested to test my script on a virtual terminal (online or as a software, without writing access, just able read some standard files from the OS) but like I am running it in a different distro (possibility to switch between distro). One example is to make a distro detection and I do not know what will be the expected info I will get from other distro. For example on my VM I get:               $> test.sh     Your linux distribution is: CentOS     $>      I just do not know what will be the result in RedHat, Ubuntu, Debian, etc... The code for the test.sh is here. This idea comes from the front-end development where you have similar tools to test your web pages in different browsers without having all really installed. I know an OS is quite more complex than just a browser, but the question remains after few searches on Google.


title: Navigating the CLI: replace text from specific character to specific character

text: I am a VIM user learning Emacs commands for use in Bash. I know that on my systems I can use Vim-keybindings in Bash but I'd like to learn how to use it effectively in its default configuration. Consider the following command which uploads a file to a web service:               $ time curl -F "status_file=@under1meg.txt" -F "baz=777&bin=123&alice=bob" http://somesite.com/internal/project/status/foo/add_status.php      I have a bunch of files to upload with different parameters. Here are some questions:   1. How might I easily **go back from the end of the line to _before_ the `http` part**? The combination `Alt``B` only goes back per [a-z] block, so I must to this for each directory in the URL. Is `Ctrl``R``Space` the preferred way to go back? Notice that `Ctrl``W` does delete back to the previous whitespace, so the idea of `<something> until whitespace` seems to exist.   2. How might I **delete back to the`@` character from the current cursor position**? Pressing `Ctrl``W` deletes until whitespace, so that won't help as the `@` character is buried in non-whitespace. I could `Ctrl``R``@` and then `Alt``D` to delete words until I get to where I need to be, but this is rather obtuse. Is there not a `delete until previous <something>` command? Note that I am interested in learning how to use the default Bash configuration as I am more often than not SSHed into some webserver. I don't want to configure Zsh, Vim keybindings, or `.bash_profile`.


title: IgnorePkg doesn't work for gvim and vim-runtime package

text: I use a modified vim in Arch Linux, so I blocked gvim and vim-runtime from upgrading: In /etc/pacman.conf I have: `IgnorePkg = gvim , vim-runtime, vim, ...` But when I do `pacman -Syu`, it still checks if gvim could be upgraded:               looking for inter-conflicts...     error: failed to prepare transaction (could not satisfy dependencies)     :: gvim: requires vim-runtime=7.4.86-1      Any ideas?


title: How to monitor or kill a process which has been started by cron?

text: I have some bots, which are run by the System scheduler at given time interval. But sometimes due to some logical error I have to stop these bots manually. How can I find these processes run by the scheduler and kill them?


title: Limiting the Size of Apache HTTPD Memory Footprint

text: I have a web server running Cent OS 5 with Apache. I have over 1GB of Ram and the MaxSpareServers set to 15. This would be fine under most situations, but for some reason my httpd processes are ballooning to over 150 mb a piece. I was googling around and saw a program called GTop and tried that, but I couldn't find any good tutorials on how to install it. Are there any simple ways to accomplish this? Am I headed in the right direction or is there a better way to solve this problem?


title: Can't open shell after changing default shell

text: I changed my default shell to zsh from bash in Ubuntu. I used the steps explained in http://github.com/sorin-ionescu/prezto and ran `chsh -s zsh`. After this, I couldn't able to log in to any shell as it pops out as soon as I try to login. I tried from gnome terminal, xterm and trying to log in from tty1 (`Alt`+`Ctrl`+`F1`). It closes as soon as I try to open.


title: raid 1/LVM at the level of directories (aka mknodding a directory)

text: I just experienced data loss, so I am interested in some form of data **duplication**. I was thinking of **mdadm** and companions to raid 1 through software. However, I just want a given, not too big directory to be covered. I have no real experience with this sort of tools, however I understand that both **LVM** and **mdadm** require real block devices which therefore must be cleared of any existing data. That's not what I want. Of the 16Gb of my usb flash drive I just want to duplicate a tiny fraction, say 10Mb, possibly on a smaller usb flash drive, say 1Gb. Something that saves me to do a cron rsync. I am stuck at this point. So:   1. Is there some other tool which will work like raid 1 but using logical directories as a backend, rather than block devices (drives, partitions etc...)?   2. Alternatively, I could employ mdadm if only I could make look directories as block devices to the OS, reminiscent of a loop device. However, I do not want to pack the target directory inside, say, an image file, because this is clumsy (it is annoying to resize it if it grows in size) and not portable (I happen to work on many different OSes, Microsuck too: when I plug the usb flash inside a Win Os, I want to be able to access the target directory).


title: Is there any useful metadata inside shared objects, and if so, how do I extract it?

text: I have a file called `mod_dav_svn.so`. I would like to find out if this is a custom version of the file or a standard one. I have tried searching Google for the md5sum of the file, but nothing has turned up, suggesting it is a custom compilation. Is there a way to extract any metadata from this file, such as compilation time/options/etc?


title: Debian 6 - Disk partitioning too long

text: I just got a new pc that comes with an empty `250GB 3G SATA Non-Hot Plug 7,200rpm HDD`. I decided to install Debian 6 from a USB, I chose the partition to be `Guided - use entire disk and set up encrypted LVM`, however, so far is taking about 9 hours and is at 93% (erasing), the progress bar is moving, but really slowly. Is this normal? or could it be some hardware issues? Thanks


title: emacs can't open display

text: Just recently this has started happening; I run: `/usr/bin/emacsclient --alternate-editor="" --no-wait -c` and get: > ERROR: Display :0.0 can't be opened No other applications do this. The output from `xdpyinfo`:               name of display:    :0.0     version number:    11.0     vendor string:    The X.Org Foundation     vendor release number:    10707000     X.Org version: 1.7.7     .....      **Edit:** I discovered that old emacs servers/daemons are still running.               $ps ux | grep [e]macs     richard   2642  0.0  0.8  38788 24984 ?        Ss   Jun22   0:25 emacs --daemon     richard   7512  0.0  0.6  33896 19720 ?        Ss   Jun23   0:05 emacs --daemon     richard  15458  0.0  0.6  32836 19076 ?        Ss   09:40   0:01 emacs --daemon      Does anyone have any ideas how these can be shut-down when I log-off?


title: arch linux installation, "could not create filesystems"

text: im installing arch linux, the x86-64 net install. during the part where the hard drive is being processed/erased, i get: "Warning: Could not create all needed filesystems. Either the underlying blockdevices didn't become available in 10 iterations, or process filesystem failed." How do i fix that? How do i know which filesystem to use?


title: Are there any advanced clipboard managers for Linux?

text: Are there any "advanced clipboard" managers for Linux that can store several things at one time? For example I might wnat to collect several things in the clipboard:   * a .jpg file   * some text   * etc. Then when I press (for example) `Ctrl`+`V`+`1` just the first "thing" would be pasted. (In this example the .jpg file) If I press `Ctrl`+`V`+`2`, then it pastes the text, etc. Are there any clipboard manager that support such "layers"?


title: Open any kind of application with BASH

text: I have made a Java program that could open any application. Suppose there is a file name "*.jpg", the it would allow the OS to recognize the type of application and then open the default application. Another example: Suppose the file's name is "*.flv", then it would open up the default media player just like when you click an icon in nautilus but the only difference was that it was in command line. Here is the java program for that:               import java.awt.*;     import java.io.*;     public class OpenFile{         public static void main(String args[]){           try{               String filename = args[0];               System.out.println(args[0]);               Desktop.getDesktop().open(new File(filename));           }           catch(Exception e){               System.out.println("Sorry an exception occured. Could not perform the operation.");           }         }      }      Now this script leads to performance issues. Now I want to write a BASH script to do this task ??


title: Ethernet NIC power usage on laptop?

text: I was wondering if the ethernet NIC draws any power at all when using Wifi? If it does, since I rarely use it, so is there a way to completely turn off the power from the device? I know some devices can be powered off by writing into some variable in the /sys folder. My guess is that unloading the driver module is not enough. I'm running Fedora 16 with a 3.3 series kernel.


title: "Destination Host Unreachable" when pinging wireless router

text: I'm a little new to all the intricacies of Linux workings, so please bear with me if this is a dumb question. I'm using Linux Mint 12 and I have an Asus PCE-N15 wireless card, which is running the Windows driver. Anyway, periodically I completely lose my connection, though Network Manager and iwconfig still claim that it's fine. If I ping my wireless router continually, I get something like the following:               64 bytes from 192.168.1.1: icmp_req=2368 ttl=64 time=132 ms     64 bytes from 192.168.1.1: icmp_req=2369 ttl=64 time=1239 ms     64 bytes from 192.168.1.1: icmp_req=2370 ttl=64 time=1098 ms     64 bytes from 192.168.1.1: icmp_req=2371 ttl=64 time=848 ms     From 192.168.1.119 icmp_seq=2408 Destination Host Unreachable     From 192.168.1.119 icmp_seq=2409 Destination Host Unreachable     From 192.168.1.119 icmp_seq=2412 Destination Host Unreachable     From 192.168.1.119 icmp_seq=2415 Destination Host Unreachable      The connection strength should not be an issue, nor do I believe that the router itself is the problem, as I do not have similar symptoms on any other computers. Interestingly, the problem seems to be correlated with my usage of the computer. When I'm not making any TCP requests, the continuous ping hums along fine, with an average latency of less than 10 ms. But when I start making requests, the average latency jumps way up and I start getting "Destination Host Unreachable". For reference here are the outputs of route, ifconfig, and iwconfig. None of these seems to be any different when I'm unable to ping the router.               Kernel IP routing table     Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     default         192.168.1.1     0.0.0.0         UG    0      0        0 wlan0     link-local      *               255.255.0.0     U     1000   0        0 wlan0     192.168.1.0     *               255.255.255.0   U     2      0        0 wlan0               wlan0     Link encap:Ethernet  HWaddr 14:da:e9:f2:4b:b4                 inet addr:192.168.1.119  Bcast:192.168.1.255  Mask:255.255.255.0               inet6 addr: fe80::16da:e9ff:fef2:4bb4/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:610537 errors:0 dropped:0 overruns:0 frame:0               TX packets:594181 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:511435072 (511.4 MB)  TX bytes:81176260 (81.1 MB)          wlan0     IEEE 802.11bgn  ESSID:"Network"                 Mode:Managed  Frequency:2.437 GHz  Access Point: C0:C1:C0:53:A9:DA                  Bit Rate=144.4 Mb/s   Tx-Power=20 dBm                  Retry  long limit:7   RTS thr=2347 B   Fragment thr:off               Power Management:off               Link Quality=51/70  Signal level=-59 dBm                 Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0               Tx excessive retries:0  Invalid misc:14   Missed beacon:0      Thanks so much for your help.


title: Why do I need to use newgrp or su (or logout and login again) to have new group memberships applied?

text: What is it that makes new group membership require a new login (or new login shell as started by `su` or `newgrp`) to be visible? Just running another bash (or whatever other shell) instance with `\--login` doesn't work, but something which is suid root like su or newgrp works. Is something inherited from the parent shell or cached which hides new group memberships?


title: How can I make git status --short be the default

text: I can use   `git status` to see a verbose listing (also `git status --verbose`) and   `git status --short` to see a short listing. How I can I change   `git status --short` be the _default_ instead of the current default of `git status --verbose`.


title: Debugging shell scripts: Syntax checking without executing

text: Is there some option I can give to just check the syntax of a [bash] shell script to check the syntax of it, but not actually execute anything nor cause any potential damage?


title: Install apache2-mod-mono-2.10

text: I am trying to install mod-mono for apache so that I can run C# asp.net websites from my server. The project I have is a .net 4 project. When I go into yast and select apache2-mod-mono for install it then says there is a problem that needs resolving. The problem is: > nothing provides libc.so.6(GLIC_2.11)(64bit) needed by mono- > core-2.10.1-32.1.x86_64 Yast suggests the solutions are either: >   * do not install apache2-mod-mono >   * break mono-core by ignoring some of its dependencies. > I assume if I select break mono-core by breaking it dependencies that mono isn't going to work correctly anyway so this isn't really a solution. How do I get around this issue. I am running openSUSE 11.2 (x86_64)


title: customizing size of emacs windows in twm, depending on the vnc session

text: I connect to the same Unix system (that runs tab windows manager, twm) via vnc. I connect from a laptop with a small screen and from a workstations with a large screen. I have started two different vnc sessions with two different `\--geometry` setting because of the different screens (I like to use the full screen in both cases). The two sessions share the same emacs initialisation file. The size of emacs window I like on the workstation screen is too large for fitting the laptop screen. The part of the configuration file where I set the size is like the following:               ;; set font     (cond      ((string-equal system-type "windows-nt") ; Microsoft Windows       (progn         nil )       )      ((string-equal system-type "darwin")   ; Mac OS X       (progn         (add-to-list 'default-frame-alist '(font . "Monaco-20"))         )       )      ((string-equal system-type "gnu/linux") ; linux       (progn        (add-to-list 'default-frame-alist '(font . "DejaVu Sans Mono-20")) )       )      )     (set-face-font 'menu "-*-*-*-*-*-*-20-*-*-*-*-*-*-*")     (set-face-font 'default "-*-*-*-*-*-*-20-*-*-*-*-*-*-*")          (add-to-list 'default-frame-alist '(height . 60))     (add-to-list 'default-frame-alist '(width . 120))      I think I should set the size of the emacs window relatively to the size of the screen but I don't know how to do it in twm, or maybe I should put a switch depending on the vnc session. does anybody know how to do that?