title: Does a high "used" value for a device in "btrfs filesystem show" pose a problem? Should a balance operation be performed?

text: I have a laptop with a Samsung 840 500 GB SSD, and I've installed openSUSE 12.3 with btrfs as the filesystem. A few days ago I first got a message from my web browser about it not being able to save its bookmark file. Shortly thereafter my computer became unstable and was unable to boot properly again. Booting into a live system and deleting some of the earlier snapshots (taken automatically by snapper) fixed the problem so that I was again able to boot. Before the crash the filesystem was roughly 70 % full as reported by both df, btrfs filesystem show and btrfs filesystem df /. I was under the impression that when df and btrfs filesystem df agree that the filesystem has plenty of space left, then everything should be fine. The output of btrfs filesystem show _after_ deleting the snapshots was:               Label: none  uuid: 9eeb0c9b-c419-49f1-8476-ea0f19d262b4         Total devices 1 FS bytes used 252.33GB         devid    1 size 449.61GB used 449.61GB path /dev/dm-1      The amount of FS bytes used is lower than before the crash (which is as expected since snapshots are counted into this total from what I understand), while the device bytes used (449.61GB) is still showing as full. So my question is whether it should be considered problematic when the device bytes used approaches the total size of the device? I am currently running a balance operation just to be safe, but I was under the impression that the device bytes used only really represented how much of the device had been claimed by btrfs thus far, and that the FS bytes used value was the real measure of how much is actually being used right now. Since a balance operation is quite time consuming, and subjects a TLC NAND based SSD like the Samsung 840 to a significant amount of wear, this is kind of important and it's a fairly big problem of btrfs requires such operations regularly to remain stable.


title: How to change cVLC prompt?

text: I use `cvlc`, that is command-line version of VLC media player a lot. It has default prompt of '`>`' sign. I wonder if it is changeable, and if it is how can I reconfigure it ?


title: Autocomplete doesn't work for file parameters to jarsigner

text: I'm using Lubuntu 12.10. Assume I've got a file called test.apk in my current folder. 1.) In LXTerminal/bash if I type,               adb install t<TAB>      the terminal autocompletes it correctly to "test.apk" 2.) However if I try,               jarsigner -verify t<TAB>      it doesn't work. Why is the behavior so? Is it possible to get it to work in the second scenario?


title: How to automatically generate .desktop file?

text: There's a `.deb` software that doesn't have a `.desktop` file, I created that file. I want to create another package for that software, when the user installs it, I want the `.desktop` file to be generated automatically and placed in `/usr/share/applications/` How to do so?


title: I am getting nova issue when i ran #nova image-list

text: I am newer to the openstack, and I am following the link http://openstins.tiddlyspot.com, everything goes smooth but when I ran below command I got error as below. `[root@centos6-2 init.d]# nova image-list ERROR: Not found (HTTP 404)` Someone please help me in this.


title: Use a Linux directory as a USB-OTG device to an Android phone?

text: I have a really strange idea and I was wondering if I could do it. Many Android custom recoveries allow placing backups in both the internal storage, the external (ie: microSD) storage, and additionally to a USB-OTG device. While I don't own a OTG cable, is there a way that I could "fake" an OTG device to my Android phone using my Ubuntu Linux desktop? I'd like to be able to do backups right to my computer in this manner, rather than doing it to an external storage location, then copying it to my computer. Can I fake a USB-OTG device to my Android device using a local directory in Linux?


title: How did `git pull` eat my homework?

text: I feel like a kid in the principal's office explaining that the dog ate my homework the night before it was due, but I'm staring some crazy data loss bug in the face and I can't figure out how it happened. I would like to know how git could eat my repository whole! I've put git through the wringer many times and it's never blinked. I've used it to split a 20 Gig Subversion repo into 27 git repos and filter-branched the foo out of them to untangle the mess and it's never lost a byte on me. The reflog is always there to fall back on. This time the carpet is gone! From my perspective, all I did is run `git pull` and it nuked my entire local repository. I don't mean it "messed up the checked out version" or "the branch I was on" or anything like that. I mean _the entire thing is gone_. Here is a screen-shot of my terminal at the incident: ![incident screen shot](http://i.stack.imgur.com/KZEiL.png) Let me walk you through that. My command prompt includes data about the current git repo (using prezto's vcs_info implementation) so you can see when the git repo disappeared. The first command is normal enough:                 » caleb » jaguar » ~/p/w/incil.info » ◼  zend ★ »     ❯❯❯ git co master     Switched to branch 'master'     Your branch is up-to-date with 'origin/master'.      There you can see I was on the 'zend' branch, and checked out master. So far so good. You'll see in the prompt before my next command that it successfully switched branches:                 » caleb » jaguar » ~/p/w/incil.info » ◼  master ★ »     ❯❯❯ git pull     remote: Counting objects: 37, done.     remote: Compressing objects: 100% (37/37), done.     remote: Total 37 (delta 25), reused 0 (delta 0)     Unpacking objects: 100% (37/37), done.     From gitlab.alerque.com:ipk/incil.info      + 7412a21...eca4d26 master     -> origin/master  (forced update)        f03fa5d..c8ea00b  devel      -> origin/devel      + 2af282c...009b8ec verse-spinner -> origin/verse-spinner  (forced update)     First, rewinding head to replay your work on top of it...     >>> elapsed time 11s      And just like that it's gone. The elapsed time marker outputs before the next prompt if more than 10 seconds have elapsed. Git did not give any output beyond the notice that it was rewinding to replay. No indication that it finished. The next prompt includes no data about what branch we are on or the state of git. Not noticing it had failed I obliviously tried to run another git command only to be told I wasn't in a git repo. Note the PWD has not changed:                 » caleb » jaguar » ~/p/w/incil.info »     ❯❯❯ git fetch --all     fatal: Not a git repository (or any parent up to mount point /home)     Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).      After this a look around showed that I was in a completely empty directory. Nothing. No '.git' directory, nothing. Empty. My local git is at version 2.0.2. Here are a couple tidbits from my git config that might be relevant to making out what happened:               [branch]             autosetuprebase = always             rebase = preserve     [pull]             rebase = true     [rebase]             autosquash = true             autostash = true     [alias]             co = checkout      For example I have `git pull` set to always do a rebase instead of a merge, so that part of the output above is normal. I can recover the data. I don't think there were any git objects other than some unimportant stashes that hadn't been pushed to other repos, but **I'd like to know what happened**. I have checked for:   * Messages in dmesg or the systemd journal. Nothing even remotely relevant.   * There is no indication of drive or file system failure (LVM + LUKS + EXT4 all look normal). There is nothing in lost+found.   * I didn't run anything else. There is nothing in the history I'm not showing above, and no other terminals were used during this time. There are no `rm` commands floating around that might have executed in the wrong CWD, etc.   * Poking at another git repo in another directory shows no apparent abnormality executing `git pull`s. What else should I be looking for here?


title: When are spaces around the = sign forbidden?

text: I know that in ~/.bashrc one must **not** put spaces around `=` signs in assignment:               $ tail -n2 ~/.bashrc      alias a="echo 'You hit a!'"     alias b = "echo 'You hit b!'"          $ a     You hit a!          $ b     b: command not found      I'm reviewing the MySQL config file `/etc/my.cnf` and I've found this:               tmpdir=/mnt/ramdisk     key_buffer_size = 1024M     innodb_buffer_pool_size = 512M     query_cache_size=16M      How might I verify that the spaces around the `=` signs are not a problem? **Note that this question is not specific to the`/etc/my.cnf` file, but rather to *NIX config files in general.** My first inclination is to RTFM but in fact `man mysql` makes no mention of the issue and if I need to go hunting online for each case, I'll never get anywhere. **Is there any convention or easy way to check?** As can be seen, multiple people have edited this file (different conventions for `=` signs) and I can neither force them all to use no spaces, nor can I go crazy checking everything that may have been configured and may or may not be correct. **EDIT:** My intention is to ensure that currently-configured files are done properly. When configuring files myself, I go with the convention of whatever the package maintainer put in there.


title: Does BIOS device whitelist affect Linux?

text: Starting with 2002, Lenovo (actually, it was IBM back then) started whitelisting the wireless adapters and other devices allowed to be used in their ThinkPad laptops. Some other manufacturers are probably doing this, too. The exact list of allowed hardware was never publicly documented. Some enthusiasts have modified BIOS to remove these restrictions. Do I need such modifications to be able to use the non-whitelisted hardware if I'm only going to run Linux/Unix variant on my laptop? (not Windows). Is the answer any different if I'm only going to run Windows in a virtual machine of some sort?


title: Issue with network interfaces in Fedora 20

text: I am using Fedora 20 with NetworkManager disabled and the **network** service enabled. I am creating virbr0 with eth0 binded to it and using dhcp. I have disabled current network interface naming convention used by Fedora 20 using `net.ifnames=0 biosdevname=0` in the kernel boot options. Everything works fine if I boot the guest machine with a single NIC. But when I boot my guest machine with multiple NICs then as per logs systemd- udevd is renaming the eth2 as virbr0 and everything is messy.


title: Re-installing apps after a fresh install?

text: I'm on Debian and I want to re-partition my drive and reinstall. Is there an easy way to restore all currently installed packages after a fresh installation? I'm thinking of doing it by making a backup app list:               #generate list of installed packages     dpkg -l | awk '{ print $2 }' ORS="\n" | tail -n +6 > reinstallList.txt      and then after doing a fresh install I should be able to do:               #install from backup at reinstallList.txt     sudo apt-get  install $(< reinstallList.txt)      Is there a better way of doing this?


title: smbclient fails with message 'protocol negotiation failed: NT_STATUS_INSUFFICIENT_RESOURCES', what does it mean and how to fix it?

text: I'm trying to access a Windows share with smbclient and I'm getting this NT_STATUS_INSUFFICIENT_RESOURCES error, regardless of correct or incorrect credentials. The command was about listing the shares:               smbclient -L //computer.domain -U domain/username      It asks for password but fails after it. If try to open a share on it the same happens:               smbclient //computer.domain/sharename -U domain/username      I looked around the web and found nothing relevant. Other Samba clients fail with similar meaningless error messages. I can access the share from Windows 7. I can also access other shares from Linux, except the ones stored on that particular computer. So how can I access this problematic Windows share with smbclient? Is it possible? If not, are there workarounds? (I'm using an Ubuntu Server 12.04)


title: Remove scientific notation bash script

text: When I convert MB to GB I'm getting below output. I want this output in normal format. When I use `bc` I'm getting an error. The text file contains nearly 100 such lines like this. I want to print this in normal output, (without notation):               1.14441e-07     4.95911e-07     3.05176e-07     1.90735e-07     3.05176e-07      Commands:               $ DIVISOR=104857600     $ sudo  du --max-depth=1 /home/xxx | tail -1 | \           awk -v DIVISOR=104857600 '{print $1/DIVISOR}'     1.14441e-07


title: A service is failing to start on permissions denied--which files is it failing on?

text: I'm attempting to start a service that our company created. In one particular environment, it's failing to start on three "permission denied" errors. I'm not sure which files it is failing on, so I would like to log all permissions- related errors while I attempt to start the daemon. I've found auditd, but I've been unable to place a watch on the whole disk for specifically permissions-related errors. What is the best way to audit all permissions-related errors?


title: Unable to install LAN driver in RedHat (*** /lib/modules/2.6.32-358.el6.i686/build: No such file or directory)?

text: I tried to install the Realtek LAN driver on my RHEL Server (running version 6.4). In the folder extracted: `autorun.sh` `log.txt` `Makefile` `README` `src`               \>type command: ./autorun.sh          \>output:              check old driver and unload it.         build the module and install             make: \***  /lib/modules/2.6.32-358.el6.i686/build: No such file or directory. Stop.             make[1]: \*** [clean] Error 2             make: *** [clean] Error 2       But there is a file named "build" in `/lib/modules/2.6.32-358.el6.i686/`. No "build" directory though.


title: How to blacklist an errpt entry? (so that it will now show up in errpt)

text: On an AIX 6.1 OS:               LABEL:          CONSOLE     IDENTIFIER:     7F88E76D      If we need to blacklist these kind of errpt entries then how can we do it?


title: Remove duplicate mp3 with different name, size, and hash

text: I have a massive music library (all mp3), but I some of the music is almost the same but:   1. Maybe one or two second longer   2. About 97% the same as another song   3. Or another bitrate. Is there a way to find these duplicates? As mentioned they don't have the same size, name, or SHA1-hash.


title: Delete whole argument in current bash command-line

text: Using `^W` (unix-word-rubout) I can easily delete a single "word" from the current command in my bash shell. However, when dealing with quoted arguments that contain spaces (or unquoted arguments containing backslash-escaped spaces) this doesn't work nicely as it only deletes one word and not the whole argument. So I'm looking for a way to delete a whole argument. Example (cursor is always at the end):               $ foo --bar "foo bar" meow     [black magic]     $ foo --bar "foo bar"     [black magic]     $ foo --bar     [black magic]     $ foo


title: list files by symlink target

text: How do I get list of files (and then do something with that list) by filtering through the symbolic link _target_ name, and not the symlink name? For example from the following list I'm only interested in the first four files (target contains `bar`):               foo ->  /tmp/bar     bar ->  /home/me/bartoo     baz ->  /home/me/public/barthree     zoo ->  /usr/share/bar     moo ->  /tmp/foo     roc ->  /tmp/roc


title: How do I override rw-r--r-- root/wheel for a all files in a directory?

text: I am trying to delete a directory on OS X. I do `rm -r /path/dir` but I keep getting many, many messages like this:               override rw-r--r--  root/wheel for cron/migrate.php?       I type y for one message, but then another one pops up. I would like to override the message for the whole directory in one command. How do I do that?


title: SSH tunnel with VNC?

text: In theory:   * I have a low-power consuption machine: eee pc, ok.   * I need to run a virtualized windows xp on it. (Because of a windows-only program..)   * I need to reach it from a smartphone (Android).   * The smartphone connects with mobile broadband to the internet.   * Sound is needed too. (The windows-only program gives sound when a notification window comes up from it, and I HAVE to see it a few minutes - my phone is always next to me)   * So I need to connect to the remote virtualized guest persistently. (all day..)   * I need this in a secure way. I was thinking about: > NetBSD on the eee pc -> XEN -> Windows XP   >  <\-->   >  ConnectBot <\- VNC Viewer <\- Android phone Are there any better solutions for this?


title: Can Yum express a preference for x86_64 over i386 packages?

text: I run a 64-bit version of CentOS5. At the moment, when I run Yum updates or installs, unless Yum is purged of i386 packages prior, it will install i386 packages when x86_64 are available. Is it possible for Yum to install x86_64 packages as first preference and then if no 64-bit packages are available, install i386 packages instead? I know that I can set preferences so that _only_ 64-bit packages are installed, but I don't want to do this, as it prevents 32-bit packages from being installed if they're the only option.


title: mp3 extraction with avconv or ffmpeg doesn't work properly anymore

text: Before upgrade to the latest Ubuntu I used the following command to extract mp3 from an avi file:               $ for x in *.avi; do ffmpeg -vol 100 -ab 160k -ar 44100 -i "$x" "`basename "$x" .avi`.mp3"; done      This worked. But since Ubuntu 12.04 I get **Option sample_rate not found.** when I try to execute this command. If I omit **-ar 44100** (or -sample_rate 44100) it does extract the mp3, but in most cases the length of the extracted mp3 doesn't fit anymore. That means that they've got a length of 43min or something although the avi has a length of only 5min. It's the same problem with both ffmpeg and avconv. Any ideas how to solve these problems?


title: Kubuntu - GUI context menu sudo/root

text: A couple of years ago I found something in a package manager that added a context menu item that allowed me to open files and save them normally without being harassed about file permissions. Can anyone remind me what the name of it was please?


title: Why does export not seems to affect child shells?

text: if I have               $ x='This is a String'     $ export x          $ xterm &     [3] 14089      The child process doesn't seem to respond to               $echo $x     $      **Update:** The FIRST time I export the variable it seems to span a process? -               $ export xb     [1]+  Done                    xterm     durrantm.../durrantm$ export xb     durrantm.../durrantm$      # Note second export didn't say anything.


title: OpenBSD, NVIDIA, and Xorg

text: I've installed OpenBSD 5.2 i386 on my desktop however I hit a wall when it came to running X at my native resolution (1920x1200). All of the hardware is working normally except for the video card: an NVIDIA Geforce 560 TI. I don't need 3D support or anything special from the card, just native resolution for doing work. It is my understanding that these cards are supported by the `nv` driver, however being a newer card, `nv` doesn't pick up on it and defaults to `vesa` which doesn't have widescreen support. Here's my `xrandr` output:               $ xrandr                                                                                xrandr: Failed to get size of gamma for output default     Screen 0: minimum 640 x 480, current 1600 x 1200, maximum 1600 x 1200     default connected 1600x1200+0+0 0mm x 0mm        1600x1200       0.0*         1280x1024       0.0          1024x768        0.0          800x600         0.0          640x480         0.0       Here's the relevant portion of my `dmesg`:               pci0 at mainbus0 bus 0: configuration mode 1 (bios)     pchb0 at pci0 dev 0 function 0 "Intel 82G33 Host" rev 0x02     ppb0 at pci0 dev 1 function 0 "Intel 82G33 PCIE" rev 0x02: apic 2 int 16     pci1 at ppb0 bus 1     vga1 at pci1 dev 0 function 0 vendor "NVIDIA", unknown product 0x1200 rev 0xa1     wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)     wsdisplay0: screen 1-5 added (80x25, vt100 emulation)     azalia0 at pci1 dev 0 function 1 vendor "NVIDIA", unknown product 0x0e0c rev 0xa1: msi     azalia0: no supported codecs      The manual recommends generating a new `xorg.conf` by running `X --configure` as root, but it fails with a segfault:               ... loading modules, etc ...     [    94.206] (WW) Falling back to old probe method for dummy     [    94.206] (WW) Falling back to old probe method for glint     [    94.211] (WW) Falling back to old probe method for i128     [    94.211] (WW) Falling back to old probe method for i740     [    94.211] (WW) Falling back to old probe method for neomagic     [    94.211] (II) NV: driver for NVIDIA chipsets: RIVA 128, RIVA TNT, RIVA TNT2,         Unknown TNT2, Vanta, RIVA TNT2 Ultra, RIVA TNT2 Model 64,         Aladdin TNT2, GeForce 256, GeForce DDR, Quadro, GeForce2 MX/MX 400,         GeForce2 MX 100/200, GeForce2 Go, Quadro2 MXR/EX/Go,         GeForce2 Integrated GPU, GeForce2 GTS, GeForce2 Ti, GeForce2 Ultra,         Quadro2 Pro, GeForce4 MX 460, GeForce4 MX 440, GeForce4 MX 420,         GeForce4 MX 440-SE, GeForce4 440 Go, GeForce4 420 Go,         GeForce4 420 Go 32M, GeForce4 460 Go, Quadro4 550 XGL,         GeForce4 440 Go 64M, Quadro NVS, Quadro4 500 GoGL,         GeForce4 410 Go 16M, GeForce4 MX 440 with AGP8X,         GeForce4 MX 440SE with AGP8X, GeForce4 MX 420 with AGP8X,         GeForce4 MX 4000, GeForce4 448 Go, GeForce4 488 Go, Quadro4 580 XGL,         Quadro4 NVS 280 SD, Quadro4 380 XGL, Quadro NVS 50 PCI,         GeForce4 448 Go, GeForce4 MX Integrated GPU, GeForce3,         GeForce3 Ti 200, GeForce3 Ti 500, Quadro DCC, GeForce4 Ti 4600,         GeForce4 Ti 4400, GeForce4 Ti 4200, Quadro4 900 XGL, Quadro4 750 XGL,         Quadro4 700 XGL, GeForce4 Ti 4800, GeForce4 Ti 4200 with AGP8X,         GeForce4 Ti 4800 SE, GeForce4 4200 Go, Quadro4 700 GoGL,         Quadro4 980 XGL, Quadro4 780 XGL, GeForce FX 5800 Ultra,         GeForce FX 5800, Quadro FX 2000, Quadro FX 1000,         GeForce FX 5600 Ultra, GeForce FX 5600, GeForce FX 5600XT,         GeForce FX Go5600, GeForce FX Go5650, Quadro FX Go700,         GeForce FX 5200, GeForce FX 5200 Ultra, GeForce FX 5200,         GeForce FX 5200LE, GeForce FX Go5200, GeForce FX Go5250,         GeForce FX 5500, GeForce FX 5100, GeForce FX Go5200 32M/64M,         Quadro NVS 55/280 PCI, Quadro FX 500/600 PCI,         GeForce FX Go53xx Series, GeForce FX Go5100, GeForce FX 5900 Ultra,         GeForce FX 5900, GeForce FX 5900XT, GeForce FX 5950 Ultra,         GeForce FX 5900ZT, Quadro FX 3000, Quadro FX 700,         GeForce FX 5700 Ultra, GeForce FX 5700, GeForce FX 5700LE,         GeForce FX 5700VE, GeForce FX Go5700, GeForce FX Go5700,         Quadro FX Go1000, Quadro FX 1100, GeForce 6800 Ultra, GeForce 6800,         GeForce 6800 LE, GeForce 6800 XE, GeForce 6800 XT, GeForce 6800 GT,         GeForce 6800 GT, GeForce 6800 GS, GeForce 6800 XT, Quadro FX 4000,         GeForce 6800 GS, GeForce 6800, GeForce 6800 LE, GeForce 6800 XT,         GeForce Go 6800, GeForce Go 6800 Ultra, Quadro FX Go1400,         Quadro FX 3450/4000 SDI, Quadro FX 1400, GeForce 6600 GT,         GeForce 6600, GeForce 6600 LE, GeForce 6600 VE, GeForce Go 6600,         GeForce 6610 XL, GeForce Go 6600 TE/6200 TE, GeForce 6700 XL,         GeForce Go 6600, GeForce Go 6600 GT, Quadro NVS 440, Quadro FX 550,         Quadro FX 550, Quadro FX 540, GeForce 6200, GeForce 6500,         GeForce 6200 TurboCache(TM), GeForce 6200SE TurboCache(TM),         GeForce 6200 LE, GeForce Go 6200, Quadro NVS 285, GeForce Go 6400,         GeForce Go 6200, GeForce Go 6400, GeForce 6250, GeForce 7100 GS,         GeForce 6800, GeForce 6800 LE, GeForce 6800 GT, GeForce 6800 XT,         GeForce 6200, GeForce 6200 A-LE, GeForce 7800 GTX, GeForce 7800 GTX,         GeForce 7800 GT, GeForce 7800 GS, GeForce 7800 SLI, GeForce Go 7800,         GeForce Go 7800 GTX, Quadro FX 4500, GeForce 7350 LE,         GeForce 7300 LE, GeForce 7300 SE, GeForce Go 7200, GeForce Go 7300,         GeForce Go 7400, GeForce Go 7400 GS, Quadro NVS 110M,         Quadro NVS 120M, Quadro FX 350M, GeForce 7500 LE, Quadro FX 350,         GeForce 7300 GS, GeForce 7650 GS, GeForce 7600 GT, GeForce 7600 GS,         GeForce 7300 GT, GeForce 7600 LE, GeForce 7300 GT, GeForce Go 7700,         GeForce Go 7600, GeForce Go 7600 GT, Quadro NVS 300M,         GeForce Go 7900 SE, Quadro FX 550M, Quadro FX 560, GeForce 7900 GTX,         GeForce 7900 GT, GeForce 7900 GS, GeForce 7950 GX2, GeForce 7950 GX2,         GeForce 7950 GT, GeForce Go 7950 GTX, GeForce Go 7900 GS,         GeForce Go 7900 GTX, Quadro FX 2500M, Quadro FX 1500M,         Quadro FX 5500, Quadro FX 3500, Quadro FX 1500, Quadro FX 4500 X2,         GeForce 6150, GeForce 6150 LE, GeForce 6100, GeForce Go 6150,         Quadro NVS 210S / NVIDIA GeForce 6150LE, GeForce Go 6100,         GeForce 6150SE, GeForce 6100 nForce 405, GeForce 6100 nForce 400,         GeForce 6100 nForce 420, GeForce 7150M / nForce 630M,         GeForce 7000M / nForce 610M, GeForce 7050 PV / nForce 630a,         GeForce 7050 PV / nForce 630a, GeForce 7025 / nForce 630a,         GeForce 8800 GTX, GeForce 8800 GTS, GeForce 8800 Ultra,         Quadro FX 5600, Quadro FX 4600, GeForce 8600 GTS, GeForce 8600 GT,         GeForce 8600 GT, GeForce 8600 GS, GeForce 8400 GS, GeForce 9500M GS,         GeForce 8300 GS, GeForce 8600M GT, GeForce 9650M GS,         GeForce 8700M GT, Quadro FX 370, Quadro NVS 320M, Quadro FX 570M,         Quadro FX 1600M, Quadro FX 570, Quadro FX 1700, GeForce GT 330,         GeForce 8400 SE, GeForce 8500 GT, GeForce 8400 GS, GeForce 8300 GS,         GeForce 8400 GS, GeForce 8600M GS, GeForce 8400M GT,         GeForce 8400M GS, GeForce 8400M G, Quadro NVS 140M, Quadro NVS 130M,         Quadro NVS 135M, GeForce 9400 GT, Quadro FX 360M, GeForce 9300M G,         Quadro NVS 290, GeForce GTX 295, GeForce GTX 280, GeForce GTX 260,         GeForce GTX 285, GeForce GTX 275, GeForce GTX 260, GeForce GTX 295,         Quadroplex 2200 D2, Quadroplex 2200 S4, Quadro CX, Quadro FX 5800,         Quadro FX 4800, Quadro FX 3800, GeForce 8800 GTS 512,         GeForce 9800 GT, GeForce 8800 GT, GeForce GT 230, GeForce 9800 GX2,         GeForce 9800 GT, GeForce 8800 GS, GeForce GTS 240, GeForce 9800M GTX,         GeForce 8800M GTS, GeForce GTX 280M, GeForce 9800M GT,         GeForce 8800M GTX, GeForce 8800 GS, GeForce GTX 285M,         GeForce 9600 GSO, GeForce 8800 GT, GeForce 9800 GTX/9800 GTX+,         GeForce 9800 GTX+, GeForce 9800 GT, GeForce GTS 250,         GeForce 9800M GTX, GeForce GTX 260M, Quadro FX 4700 X2,         Quadro FX 3700, Quadro VX 200, Quadro FX 3600M, Quadro FX 2800M,         Quadro FX 3700M, Quadro FX 3800M, GeForce 9600 GT, GeForce 9600 GS,         GeForce 9600 GSO 512, GeForce GT 130, GeForce GT 140,         GeForce 9800M GTS, GeForce 9700M GTS, GeForce 9800M GS,         GeForce 9800M GTS, GeForce 9600 GT, GeForce 9600 GT,         GeForce GTS 160M, GeForce GTS 150M, GeForce 9600 GSO,         GeForce 9600 GT, Quadro FX 1800, Quadro FX 2700M, GeForce 9500 GT,         GeForce 9400 GT, GeForce 9500 GT, GeForce 9500 GS, GeForce 9500 GS,         GeForce GT 120, GeForce 9600M GT, GeForce 9600M GS, GeForce 9600M GT,         GeForce 9700M GT, GeForce 9500M G, GeForce 9650M GT, GeForce G 110M,         GeForce GT 130M, GeForce GT 120M, GeForce GT 220M, GeForce 9650 S,         Quadro FX 380, Quadro FX 580, Quadro FX 1700M, GeForce 9400 GT,         Quadro FX 770M, GeForce 9300 GE, GeForce 9300 GS, GeForce 8400,         GeForce 8400 SE, GeForce 8400 GS, GeForce 9300M GS, GeForce G100,         GeForce 9300 SE, GeForce 9200M GS, GeForce 9300M GS, Quadro NVS 150M,         Quadro NVS 160M, GeForce G 105M, GeForce G 103M, GeForce G105M,         Quadro NVS 420, Quadro FX 370 LP, Quadro NVS 450, Quadro FX 370M,         Quadro NVS 295, GeForce 9100M G, GeForce 8200M G, GeForce 9200,         GeForce 9100, GeForce 8300, GeForce 8200, nForce 730a, GeForce 9200,         nForce 980a/780a SLI, nForce 750a SLI, GeForce 8100 / nForce 720a,         GeForce 9400, GeForce 9400, GeForce 9400M G, GeForce 9400M,         GeForce 9300, ION, GeForce 9400M G, GeForce 9400, nForce 760i SLI,         GeForce 9400, GeForce 9300 / nForce 730i, GeForce 9200,         GeForce 9100M G, GeForce 8200M G, GeForce 9400M, GeForce 9200,         GeForce G102M, GeForce G102M, ION, ION, GeForce 9400, ION, ION LE,         ION LE, GeForce GT 220, GeForce 315, GeForce 210, GeForce GT 230M,         GeForce GT 330M, GeForce GT 230M, GeForce GT 330M, NVS 5100M,         GeForce GT 320M, GeForce GT 240M, GeForce GT 325M, Quadro FX 880M,         GeForce G210, GeForce 205, GeForce 310, ION, GeForce 210,         GeForce 310, GeForce 315, GeForce G105M, GeForce G105M, NVS 2100M,         NVS 3100M, GeForce 305M, ION, GeForce 310M, GeForce 305M,         GeForce 310M, GeForce 305M, GeForce G210M, GeForce 310M,         Quadro FX 380 LP, Quadro FX 380M, GeForce GT 330, GeForce GT 320,         GeForce GT 240, GeForce GT 340, GeForce GT 330, GeForce GTS 260M,         GeForce GTS 250M, GeForce 315, GeForce GT 335M, GeForce GTS 350M,         GeForce GTS 360M, Quadro FX 1800M     [    94.213] (WW) Falling back to old probe method for s3     [    94.213] (WW) Falling back to old probe method for s3virge     [    94.213] (WW) Falling back to old probe method for siliconmotion     [    94.213] (WW) Falling back to old probe method for sis     [    94.213] (WW) Falling back to old probe method for trident     [    94.213] (WW) Falling back to old probe method for wsudl     [    94.213] (II) VESA: driver for VESA chipsets: vesa     [    94.269] (EE) Unable to locate/open config file: "/root/xorg.conf.new"     [    94.269] (==) Using system config directory "/usr/X11R6/share/X11/xorg.conf.d"     [    94.269] (==) No Layout section.  Using the first Screen section.     [    94.269] (==) No screen section available. Using defaults.     [    94.269] (**) |-->Screen "Default Screen Section" (0)     [    94.269] (**) |   |-->Monitor "<default monitor>"     [    94.270] (==) No monitor specified for screen "Default Screen Section".         Using a default monitor configuration.     [    94.270] (==) Disabling SIGIO handlers for input devices     [    94.270] (==) Automatically adding devices     [    94.270] (==) Automatically enabling devices     [    94.270] (==) FontPath set to:         /usr/X11R6/lib/X11/fonts/misc/,         /usr/X11R6/lib/X11/fonts/TTF/,         /usr/X11R6/lib/X11/fonts/OTF/,         /usr/X11R6/lib/X11/fonts/Type1/,         /usr/X11R6/lib/X11/fonts/100dpi/,         /usr/X11R6/lib/X11/fonts/75dpi/     [    94.270] (==) ModulePath set to "/usr/X11R6/lib/modules"     [    94.270] (II) The server relies on wscons to provide the list of input devices.         If no devices become available, reconfigure wscons or disable AutoAddDevices.     [    94.270] Segmentation fault at address 0x14     [    94.270]      Fatal server error:     [    94.270] Caught signal 11 (Segmentation fault). Server aborting     [    94.270]      [    94.270]      Please consult the The X.Org Foundation support           at http://wiki.x.org      for help.      [    94.270] Please also check the log file at "/var/log/Xorg.0.log" for additional information.     [    94.270]      [    94.271] Server terminated with error (1). Closing log file.      Without `X --configure` working, I'm not sure how else to get a valid `xorg.conf`. X is running right now but even so it doesn't keep a copy of it's configuration anywhere that I'm aware of (I looked with `find`). I did manage to get a promising looking modeline:               Modeline "1920x1200"x0.0  154.00  1920 1968 2000 2080  1200 1203 1209 1235 +hsync -vsync (74.0 kHz eP)      ... but it isn't using it automatically and it otherwise goes in `xorg.conf` which I'm not able to generate. Any suggestions or pointers would be really appreciated, I've been Googling similar issues for a while and am coming up short of a good "next step".


title: Fix keyboard chattering/bouncing on the software side

text: I have a mechanical keyboard (Noppoo Choc Mini with Cherry MX Blue switches) and after a few weeks, some key presses are getting sent two times even though I press a single time. I found out that this is a common problem on mechanical keyboards and is called 'chattering' (or 'bouncing'). This comes likely from a hair inside the mechanics of the switch, so my posssibilities are limited here:   * Replace the switch manually (soldering, reordering single parts from beyond, ...)   * Buy a new one   * ... or fix it on the software side. So my question: is there a simple (or complicated, I'll take it all) way to fix this? Is there a kernel-patch, keyboard driver option, smart tool or a hidden settings in X11 to prevent my OS from registering the same key in a very short period of time?


title: iptables: multiple exclusions on port forwarding

text: I have an existing iptables setup that does port forwarding. In this port forwarding scenario there are some instances where I do not want it to port forward. So, for instance I have this defined:               iptables -A PREROUTING -t nat -i eth0 '!' -s 10.200.0.0/16 -p tcp --dport 80 -j DNAT --to 10.200.30.11      This will prevent 10.200/16 from accessing this rule. As it turns out, I need to add multiple exclusions. However, there does not seem to be a way to do this:               iptables -A PREROUTING -t nat -i eth0 '!' -s 10.200.0.0/16,192.168.0.0/16 -p tcp --dport 8080 -j DNAT --to 10.200.30.11:80     iptables v1.4.8: ! not allowed with multiple source or destination IP addresses      I'm going to assume I have to approach this differently, but I do not know how. Any suggestions?


title: Restrict two way SSH and Apache authentication to non-local networks

text: I am using Google's open-source PAM module for two-way authentication for SSH logins and certain Apache directives. It works great, however I would like to use this only when trying to log in from an outside network, resorting only to basic username/pass for inside the network. Basically whitelisting a network. How can I accomplish this? I can't seem to find an answer...


title: Does UEFI increase battery life?

text: I've heard about a better power management when using UEFI instead of BIOS. Is that true? It was about energy consumption being more efficient or something like that. If it is true, has the functionality been implemented in Linux yet? I mean, does a driver exist for that? And do I have improved speed with GPT-formated disk or just a quicker boot due to my UEFI usage?


title: Adjust mouse wheel sensitivity in Fedora / Gnome

text: ## Short Question Is there a way to adjust the mouse wheel scroll sensitivity in Fedora 18? ## Long Question I'm running Fedora 18, with the standard Gnome desktop. I use a Logitech M705 mouse with the free-scrolling mouse wheel, which I love. In windows, I'm able to configure how many lines to scroll per notch of the mouse wheel. In Fedora, though, there doesn't appear to be any analogous configuration option. The default is quite sensitive for this this mouse, scrolling approximately 3 lines per notch. Since the wheel is free-spinning, even small motions trigger several notches, making it hard to use in Fedora. Is there a way for me to reduce the sensitivity of the mouse wheel? **Windows Mouse Configuration** ![Windows Mouse Configurtion](http://i.stack.imgur.com/v2LLJ.png) **Fedora Mouse Configuration** ![Fedora Mouse Configuration](http://i.stack.imgur.com/M4Ztz.png)


title: Installing CentOS and Kali as dual boot?

text: I'm going to install a machine with both CentOS and Kali. What are the steps to follow? Which should I install first CentOS or Kali? The issue I tried to run Kali as virtual machine however, it just failed to start. I also tried running via USB, but it runs and then each time it loses all my previous settings. Please advise.


title: Sources to learn about performing certain tasks on command line?

text: Can someone transform it into community wiki please? I guess I've got no privileges for that. Let's list practical sources for learning about performing certain tasks on *nix command line. E.g. I want to delay execution of a script and I don't know about `sleep(1)`. I can do `apropos delay`, spot there `sleep(1)` and finally `man 1 sleep`. What else comes to your mind?


title: How can get a list of all scheduled cron jobs on my machine?

text: My sysadmin has set up a bunch of cron jobs on my machine. I'd like to know exactly what is scheduled for what time. How can I get that list?


title: How to re-mount a USB stick after unmounting from Nautilus without disconnecting it?

text: I find that in order to re-mount a USB stick, I have to physically disconnect it, and then re-connect it. How can I do this without such tiring physical action?


title: How do you run a dry run of rm to see what files will be deleted?

text: I want to see what files will be deleted when performing an 'rm' in linux. Most commands seem to have a dry run option to show just such information, but I can't seem to find such an option for rm. Is this even possible?


title: Booting linux image using u-boot SPL

text: **OS:** petalinux **Board:** Xilinx z702 evaluation board having ARM Cortex A9 and FPGA on the zc700 SoC **Relevant question:** : Why u-boot starts so late after I give power **Background:** I observed that first message on the console comes after 1 second. It is the message from u-boot. Why this was happening? Because I had to use a fsbl (first stage boot loader) for initialization of hardware. I suspected that it is this fsbl that is consuming 1 second initializing useless hardware which I will not use at all. in fact I am not going to use any fpga bitstream also. So I am trying to boot my Linux image using uboot-SPL method bypassing fsbl. The main advantage I can get is perhaps fastest possible boot. I found this document that explains how to work with SPL. However I have following question wrt to the this passage in the document: > The building of SPL images can be with: > > # define CONFIG_SPL > > Because SPL images normally have a different text base, one has to be > configured by defining CONFIG_SPL_TEXT_BASE. The linker script has to be > defined with CONFIG_SPL_LDSCRIPT. Questions: 1- In which file I should define #define CONFIG_SPL and CONFIG_SPL_TEXT_BASE? 2-Where is the linker script? Do I need to define CONFIG_SPL_LDSCRIPT in the linker script ? Source code of SPL enabled u-boot for xilinx board I am using is this


title: How to automatically encrypt, sign, and forward root's email?

text: I've recently been teaching myself about the BSDs and decided to pick up a NetBSD VPS. I don't always log in to this box every day (it's not actually doing anything that important), but I'd still like to monitor `root`'s mail. To that end, I started looking into how to forward `root`'s mail to an external account. I learned a little about the `/etc/aliases` file, and it looks like I might be able to build up a pipeline to do this for me, but I'm treading into unfamiliar territory. Is there a tutorial that covers this sort of thing? Is it even a good idea? Thanks.


title: Syslinux , what does '--' do?

text: What does the '--' do in a normal syslinux config ? I used to see "quiet" after that , but don't know why. Here's an example from Ubuntu 12.04:               label install         menu label ^Install         menu default         kernel ubuntu-installer/amd64/linux         append vga=788 initrd=ubuntu-installer/amd64/initrd.gz -- quiet


title: Route and "e" flag

text: k# route -6     Destination                    Next Hop        Flag   Met  Ref   Use  If     ::/0                           fe80::8001      UGDAe  1024 0     0    eth0     [...]      What does flag "e" mean?


title: Configure autocomplete for the first argument, leave the others alone

text: I have a utility that takes a load of different arguments. For now, I want to autocomplete the first argument, but leave all the others to fall through to normal autocompletion. How do I do that?               function _my_autocomplete_()     {         case $COMP_CWORD in             1) COMPREPLY=($(compgen -W "$(get_args_somehow)" -- ${COMP_WORDS[COMP_CWORD]}));;             *) # What goes here?         esac     }          complete -F _my_autocomplete_ mycommand


title: Buffer overrun on Fedora 16 serial

text: I got a brain smashing problem with Fedora 16 and my serial port. I use the serial to monitor an STB on which I'm developping. The STB runs on Linux and when booted, I launch the program I'm working on through the serial interface. Now, my program outputs lots of traces when I'm debugging, and I get loads of `buffer overrun` errors in `dmesg`. This makes debugging the application a mess, because the serial output gets unreadable. So, what's bothering me is that when I was running on Fedora 15, there was no buffer overrun _at all_! Some more details on my setup:   * Fedora Core 16 under Cinnamon / gnome-terminal for the serial. Uname: `3.2.6-3.fc16.x86_64`   * to connect the serial port, I use this command: `screen -R -d -t "Serial" /dev/ttyS0 115200` Any idea of how I could fix that? (some more details:)               $ cat /proc/tty/driver/serial     serinfo:1.0 driver revision:     0: uart:16550A port:000003F8 irq:4 tx:3395 rx:11899157 fe:6 brk:4 oe:3496 RTS|DTR     ###                                                               ^^^^^^^     ###                                                            overflow errors     1: uart:16550A port:0000EC98 irq:17 tx:32 rx:0 CTS|DSR|CD     2: uart:unknown port:000003E8 irq:4     3: uart:unknown port:000002E8 irq:3      Typical dmegs output:               [370425.080452] ttyS0: 24 input overrun(s)     [370426.092382] ttyS0: 30 input overrun(s)     [370427.109291] ttyS0: 36 input overrun(s)     [370428.173344] ttyS0: 28 input overrun(s)     [370429.583198] ttyS0: 26 input overrun(s)     [370430.638700] ttyS0: 32 input overrun(s)          :( :( :(      Output of `sudo setserial -v -a -g /dev/ttyS0`:               /dev/ttyS0, Line 0, UART: 16550A, Port: 0x03f8, IRQ: 4         Baud_base: 115200, close_delay: 50, divisor: 0         closing_wait: 3000         Flags: spd_normal skip_test low_latency


title: How to move to last character of the file in vim?

text: File:               i am someone1.     i am someone2.     i am someone3     ~     ~      Documentation says `G` takes me end of the file, but it only takes me to the beginning of last line. I want to be able to come to last character of the file, 3 in this case, and press `a` and type a period. How do I do that?


title: How can I rename photos, given the EXIF data?

text: Let's say I have a bunch of photos, all with correct EXIF information, and the photos are randomly named (because of a problem I had). I have a little program called `jhead` which gives me the below output:               $ jhead IMG_9563.JPG          File name    : IMG_9563.JPG     File size    : 638908 bytes     File date    : 2011:02:03 20:25:09     Camera make  : Canon     Camera model : Canon PowerShot SX210 IS     Date/Time    : 2011:02:03 20:20:24     Resolution   : 1500 x 2000     Flash used   : Yes (manual)     Focal length :  5.0mm  (35mm equivalent: 29mm)     CCD width    : 6.17mm     Exposure time: 0.0080 s  (1/125)     Aperture     : f/3.1     Focus dist.  : 0.29m     ISO equiv.   : 125     Exposure bias: -1.67     Whitebalance : Manual     Light Source : Daylight     Metering Mode: pattern     Exposure Mode: Manual      Now I need to rename all the photos in the folder in the next format:               001.JPG     002.JPG     003.JPG     ...      Where the minor number would be the older image, and the maximum the newer. I'm not so good scripting, so I'm asking for help. I think a bash script is enough, but if you feel more comfortable, you can write a python script. I thought in something like:               $ mv IMG_9563.JPG `jhead IMG_9563.JPG | grep date`      but I don't know how to do that for all the files at once.


title: qemu: how to access host via sftp

text: I started a guest vm with               qemu-system-x86_64 -net user -net nic -redir tcp:10022::22 -m 500 -hda op.img      From the guest, I'm able to `ssh` the host machine, but can't connect via `sftp` The command I use for `ssh` is               ssh -R 10022:localhost:22 user@10.0.2.2      Tried to play with `sftp -oBindAddress` and also `-P`, but with no success.


title: Arch Linux: Newbie's problem just in the installation process(bug like)

text: I go through AIF (installation framework) till "Install packages". In that step, I get the error: `error: failed to commit transaction (conflicting files)` and then follows the list of every single package that pacman has ever seen + `exists on system`. My search all over the net just centered me on pacman's package list, but I'm absolutely new to Arch gang and don't know what to do. I'm not able to step through installation any further.


title: Can I command 7z to skip compression (but not inclusion) of specific files while compressing a directory with its subs?

text: There is a feature of the WinRAR (for Windows) archiver I love a lot: it can be set up to skip trying to compress particular files (based on their extension (name pattern)) while including them into a compressed archive. When it comes to backing up a user home directory it saves tons of time to give up trying to compress mp3, jpg, zip, etc. files and just add them to a (non- solid) archive untouched while compressing text, xls, database etc. files being added. Having switched to Linux I still strongly prefer non-solid compressing archivers (like zip and 7z, I mostly use 7z I have switched to even before switching to Linux) over traditional tar.gz for my own convenience reasons (tar.gz advocates use to say it is needed to save rights/ownership information and links but I don't use any in my non-system files). But I miss the WinRAR's feature to skip specific files compression a lot. May you happen to be a 7z fan too, maybe you know the way to achieve the effect?


title: Linux /proc/sys/kernel: where are the files sysrq-sticky, sysrq-key, and sysrq-timer?

text: Documentation for Red Hat Enterprise Linux 3 (section 5.3.9.3) mentions these files in `/proc/sys/kernel/`:   * `sysrq`   * `sysrq-key`   * `sysrq-sticky`   * `sysrq-timer` The documentation for RHEL 5 also mentions them. Documentation for RHEL 6 does not mention any files except for `sysrq`. If these files are mentioned in Ubuntu documentation, I can't find it. I also searched some of the Red Hat 5.x Release Notes, and I cant find it in there either. The patch (against 2.4.11) to support these files (except `sysrq-timer`) was submitted to the kernel mailing list by Crutcher Dunnavant back in 2001; I don't know if it was ever officially accepted. Checking current systems, I can't find the files (except for the `sysrq` file) on a RHEL 5.6 system nor on an Ubuntu Server Lucid Lynx 10.04. What is the status of these files? Are they Red Hat-specific? Are they part of the kernel? Was the support removed? When?


title: How to make sendmail write to new maillog

text: I want to rotate my maillog, but I want to make sure the newly rotated log contains the last 2M lines from the previous log:                   # write the last 2M lines to a new log         tail -n 2000000 /var/log/maillog > /var/log/maillog.new              # move the existing log to datestamped backup         datestamp=`date "+%Y%m%d"`         mv /var/log/maillog /var/log/maillog.$datestamp              # move the new log to normal log         mv /var/log/maillog.new /var/log/maillog              # tell sendmail to reload         killall -HUP sendmail      This all works, except for the fact that sendmail continues to write to the backup log file "maillog.yyyymmdd" instead of the proper "maillog"! What is the correct way to do this without having to stop sendmail first, rotate, then start again?


title: Fixing CTRL-* in vim under GNU screen

text: When running vim under GNU screen, I'm finding that combinations of `CTRL` with the arrow and Pg* keys don't work as expected. I'm using the Ubuntu 10.10 `vim-gnome` package. On a different machine, also running Ubuntu, this did work without problems; unfortunately I don't have that configuration available to me now. There is a related question here: How to fix Ctrl + arrows in Vim? However, the suggested solution there is to remap vim's keybindings to work with the terminal emulator, in that case PuTTY. I don't recall doing anything of the sort, and suspect that there is a screen configuration option which will resolve this issue. There's also a thread on the gnu-screen mailing list which suggests that running vim via `$ TERM=xterm vim` is an appropriate fix or workaround. This does work, but I'm a bit concerned that there might be side effects. It also doesn't sound familiar enough to be the solution I set up on the other machine (if a solution was necessary).


title: Is there a GUI alternative to GParted?

text: GParted 0.7.0 is less than ideal, so am looking for something else. Is there a credible alternative? [ **update** ] The two issues I was having had nothing to do with GParted.


title: lsof compares to pfiles, difference?

text: pfiles in Solaris suspends files for a short period while examining them, however, lsof does not. How does lsof work that allows it to retrieve information while not suspending files?


title: How can I kill the top CPU/IO process quickly?

text: I find that sometimes my Linux will stop responding, so I need to switch to another terminal with `Ctrl``Alt``F2`, and type a command to kill the `top` CPU usage process or `top` IO usage process, so that the system can be responsive again. This command should be short and execute quickly. I know the command `kill`, but I do not know how to get the `top`-est process PID or name. I will add this command into shell alias or function.


title: How to reduce size of swap after a system is already installed?

text: I'm running Debian Squeeze 6.0.5. Does the use of swap memory make my computer run slower? If so, how can I reduce the size of the swap memory after the system is already installed?


title: Discovering the Cause of tcp rcvpruned?

text: I get a few rcv pruned packets on my load balancers a day and I would like to know what the cause is: ![enter image description here](http://i.stack.imgur.com/oIUcL.png) However, based on my tcp_mem vs tcp_mem usage I don't understand why some packets are being pruned:               cat /proc/sys/net/ipv4/tcp_mem     6178080 8237440 12356160      ![enter image description here](http://i.stack.imgur.com/ryorh.png)


title: Udev rule to match multiple node USB device

text: I have a 3G/GPS device that creates 5 tty nodes, although it's only one physical USB connection. Basically, a multi port usb-serial adapter. I'm trying to create some `udev` rules to make sure those nodes always have the same name, or at least a symlink to them. I can indeed find the device at `/sys/devices/platform/pxa27x-ohci/usb1/1-2/1-2.2/`. Inside are `1-2.2:1.0/` to `1-2.2:1.4/`, for the 5 nodes it creates. I can also find it at `/sys/bus/usb/devices/1-2.2` . The udev info for the device is as follows:               udevadm info -a -p /sys/bus/usb/devices/1-2.2/1-2.2\:1.0     looking at device '/bus/usb/devices/1-2.2/1-2.2:1.0':     KERNEL=="1-2.2:1.0"     SUBSYSTEM=="usb"     DRIVER=="option"     ATTR{bInterfaceNumber}=="00"     ATTR{bAlternateSetting}==" 0"     ATTR{bNumEndpoints}=="03"     ATTR{bInterfaceClass}=="ff"     ATTR{bInterfaceSubClass}=="01"     ATTR{bInterfaceProtocol}=="01"     ATTR{modalias}=="usb:v12D1p1506d0000dc00dsc00dp00icFFisc01ip01"     ATTR{supports_autosuspend}=="0"      From this point on, all the nodes have the same info. And the only thing varying between nodes is the bInterfaceNumber property, and the device path. So, I thought of writing a rule by dev path. Now, for some reason, the following rule gets matched by all those nodes.               ACTION=="add", DEV="/devices/platform/pxa27x-ohci/usb1/1-2/1-2.2/1-2.2:1.0" SYMLINK+="huawey0"      So basically, `huawey0` points to the last node enumerated. The device created nodes from ttyUSB2 to 6, and this link points to USB6. So, I tried by kernel node:               ACTION=="add", KERNEL=="1-2.2:1.0" SYMLINK+="huawey0"      Now, nothing appears on /dev. After this, I tried using the bInterfaceNumber to separate them. I used the following rule               ACTION=="add", DEV="/devices/platform/pxa27x-ohci/usb1/1-2/1-2.2/1-2.2:1.[0-4]" ATTR{bInterfaceNumber}=="00" SYMLINK+="huawey0"      And still, nothing happens. I even tried a trimmed down version of the rule..               ACTION=="add", ATTR{bInterfaceNumber}=="00" SYMLINK+="huawey0"      And still nothing happens. Why is it not matching?


title: Any way to encode the url in curl command?

text: I have some url which has space in it's query param. I want to use this in curl, e.g.               curl -G "http://localhost:30001/data?zip=47401&utc_begin=2013-8-1 00:00:00&utc_end=2013-8-2 00:00:00&country_code=USA"      which gives out               Malformed Request-Line      As per my understanding o/p is due to the space present in query param. Is there any away to encode the url automatically before providing it to curl command?


title: How do I loop through only directories in bash?

text: I have a folder with some directories and some files (some are hidden, beginning with dot).               for d in *; do      echo $d     done      will loop through all files, but I want to loop only through directories. How do I do that?


title: Can I create a virtual ethernet interface named eth0?

text: I am running Arch based on the Linux 3.10.5-1 kernel. The system uses the new de-facto naming conventions of ethernet interfaces enp*s* and wlp* etc. This is a problem however, as my educational institution is using a program called Maple 17. Maple's licensing system is dependant on the existence of an interface named eth0 because it must retrieve the MAC address of it to verify the license. It's a bad solution, but I have to work around it. This means I will need an eth0 interface with any MAC address at all (As I can retrieve a new license file for the new MAC address) that doesn't necessarily have to work. In fact, it should just be down at all times. I reckon there are several ways to attempt to solve this issue, but I haven't been able to find anything about any of the ideas.   * Creating an adapter without connectivity   * Creating an alias for enp3s0 named eth0   * Renaming enp3s0 or the loopback interface. The things I was able to find only covered changing to the newer conventions and on older versions of udev. They only worked on RHEL and SuSe anyway. I tried it without luck though. (persistent-net-names.rules and net-name- slot.rules, both of them just made my actual interface stop working and my wlan interface disappear)


title: Installing GnuPG on Solaris ---- failed

text: i have Solaris **SunOS 5.10 Generic_147441-01 i86pc i386 i86pc Solaris** trying to install GnuPG on it i have referred these sites for it http://gnupg.org/ http://www.blastwave.org/pkg/search.ftd?qs=gnupg \--- package build for Solaris http://www.blastwave.org/jir/blastwave.fam \--- steps to install in Steps to install , it gives error there no package as textutils please guide me to install this on my Solaris box properly


title: Piping paths with different types of quotes for slash substitution

text: I would like to use `sed` to convert a path with backslashes to the same path with forward slashes: E.g. I would like to pipe `\\path\to\file\` and obtain `/path/to/file` **None** of the following commands work, and I can't tell why: ### First attempt:               > echo '\\path\to\file\' | sed 's/\\/\//g'     /path   o              ile/      ### Second attempt:               echo \\path\to\file\ | sed 's/\\/\//g'      /pathtofile      ### Third attempt:                echo "\\path\to\file\" | sed 's/\\/\//g'     dbquote>      I get a similar behavior if I try piping to `| tr '\' '/'` I am looking for the correct answer and, if possible, for an explanation of why none of the attempts above worked. Not sure if it matters, but this is all on `zsh 4.2.6 (x86_64-redhat-linux-gnu)` Thanks!


title: Is there a simple command for outputting tab-delimited columns in bash?

text: E.g. I have a file (produced with `echo -e "var1\tvar2\t\var3\tvar4" > foo`) that are output (in bash):               $ cat foo     case    elems   meshing nlsys     uniform 2350    0.076662        2.78     non-conformal   348     0.013332        0.55     scale   318     0.013333        0.44     smarter 504     0.016666        0.64     submodel        360     .009999 0.40     unstruct-quad   640     0.019999        0.80     unstruct-tri    1484    0.01    0.88      I'd prefer the output like this (here I used `vim` and `:set tabstop=14`):               case          elems         meshing       nlsys     uniform       2350          0.076662      2.78     non-conformal 348           0.013332      0.55     scale         318           0.013333      0.44     smarter       504           0.016666      0.64     submodel      360           .009999       0.40     unstruct-quad 640           0.019999      0.80     unstruct-tri  1484          0.01          0.88      I can get the same functionality with `cat` if I use `$ tabs=15` in bash (see this question). Is there a program that does this kind of formatting automatically? I don't want to experiment with the `tabs` value before `cat`ing a file.


title: Is there something like `time` that also records I/O and CPU?

text: I can pretty quickly monitor the running time of a process with `time`:               x@y ~ $ time foo          real        0m14.299s     user        0m4.770s     sys         0m0.440s      Is there a way I can get the same data for I/O and CPU usage of an argument, recorded to STDOUT? A simple command or utility like `time` would be ideal, where I just pass the argument of the thing I want to run:               x@y ~ $ stats foo          wallclock runtime     0m14.299s     I/O reads             290,420 KB     I/O writes            239,429 KB     peak CPU usage        18.62%     mean CPU usage        1.44%     # etc.


title: Why has the ANSI 3.64 standard been withdrawn?

text: From the Wikipedia "ANSI escape code" article: > The name "ANSI escape sequence" dates from 1981 when ANSI adopted ECMA-48 as > the standard ANSI X3.64 (and later, in 1997, withdrew it). Does anybody know why the standard has been withdrawn. I tried to follow the link in the article but didn't find anything.


title: Mon Configuration

text: I am trying to get the hang of the mon daemon, in linux. I was wondering, can you set up dependencies in mod, if so how. As far as I understand it the script below will run `ping` then `http` regardless. How to I make it so it only runs `http` if `ping` passes.               hostgroup test test.shahmirj.com          watch test        service ping             interval 5m             monitor ping.monitor             period wd {Mon-Fri}                 alert mail.alert email@example.com                 alertevery 5m        service http             interval 5m             monitor http.monitor             period wd {Sun-Sat}                 alert mail.alert email@example.com                 upalert mail.alert -S "web server is back up" mis                 alertevery 45m      If the above runs `ping` only then `http`, How to you get it to run the different ones regardless. Thanks in advance


title: Beginning shell scripting

text: I am a new user of this community. I want to learn Unix shell scripting. So please guide me on how to start for the same.


title: Recover a reiserfs hard disk

text: I'm unable to mount my 300GB external (in external enclosure) HDD's single partition. None of the fsck tools add anything, they cannot even recognize the partition. I had forgotten whether I had used ext4 or reiserfs myself. The HDD seems ok. Testdisk saw a linux partition but didn't give any more details. Until ... I followed Recovering ext4 superblocks and tried the `sudo losetup -v -o $i /dev/loop1 /dev/sdc` command. Now testdisk at least gives me a green label, tells me it's a reiserfs 3.6 partition and gets the correct device label! I especially had luck with `i=32768`:               $ dmesg     [10147.132161] REISERFS (device loop1): found reiserfs format "3.6" with standard journal     [10147.132204] REISERFS (device loop1): using ordered data mode     [10147.132206] reiserfs: using flush barriers     [10147.132335] REISERFS (device loop1): journal params: device loop1, size 8192, journal first block 18, max trans len 1024, max batch 900, max commit age 30, max trans age 30     [10147.132745] REISERFS (device loop1): checking transaction log (loop1)     [10147.133630] REISERFS warning: reiserfs-5090 is_tree_node: node level 61404 does not match to the expected one 4     [10147.133638] REISERFS error (device loop1): vs-5150 search_by_key: invalid format found in block 67403788. Fsck?     [10147.133644] REISERFS (device loop1): Remounting filesystem read-only     [10147.133652] REISERFS error (device loop1): vs-13070 reiserfs_read_locked_inode: i/o failure occurred trying to find stat data of [1 2 0x0 SD]     [10147.133660] REISERFS (device loop1): Using r5 hash to sort names      I can't mount it as you see but to me it seems I'm getting close:               $ sudo mount -t reiserfs /dev/loop1 /mnt     mount: /dev/loop1: can't read superblock      Am I seeing ghosts just because I skip some bytes? Why doesn't testdisk see this from the raw /dev/sdc1? I mostly used readonly tools but I might have asked testdisk to write once (to the partition table?) so I could have lost parts, though I don't doubt most can be recovered. **And most of all, how do I continue from here?** I could run reiserfsck on the raw /dev/sdc1, but if there's a reason why the offset works better, how do I consolidate it onto my HDD first? Please indicate the implications of your solution appropriately (how clean? if it writes I want to know). I am ok with giving up the data on the disk (nothing personal), but if it's easy to fix I'd like that. Also, Foremost seems to be able to recover my files, but I have no space to write them to. UPDATE1: Weird that I' m seeing less results on my actual laptop rather than on the Ubuntu LiveCD (perhaps this is the cause of my troubles). I tried some stuff and I only get some smartness from reiserfsck if I use the losetup from above and then run `reiserfsck --check /dev/loop1`. However it aborted replaying transactions it seems. I get:               [  682.743728] ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen     [  682.743734] ata1.00: ST-ATA: DRQ=0 without device error, dev_stat 0x50     [  682.743740] ata1.00: failed command: DEVICE CONFIGURATION OVERLAY     [  682.743747] ata1.00: cmd b1/c2:00:00:00:00/00:00:00:00:00/40 tag 0 pio 512 in     [  682.743749]          res 50/00:00:00:00:00/00:00:00:00:00/40 Emask 0x202 (HSM violation)     [  682.743753] ata1.00: status: { DRDY }     [  682.743763] ata1.00: hard resetting link     [  683.060965] ata1.01: hard resetting link     [  684.087234] ata1.01: failed to resume link (SControl 0)     [  684.243064] ata1.00: SATA link up 3.0 Gbps (SStatus 123 SControl 300)     [  684.243086] ata1.01: SATA link down (SStatus 0 SControl 0)     [  684.283150] ata1.00: configured for UDMA/133     [  684.283860] ata1: EH complete     [  727.846495] usb 2-1.3.1: reset high-speed USB device number 6 using ehci_hcd     [  766.757684] usb 2-1.3.1: reset high-speed USB device number 6 using ehci_hcd      Is this a drive failure? Doesn't look like it. UPDATE2: It had to recreate the journal header, then had to recreate the superblock, and it is now rebuilding the tree (but at least it is doing something). From my experience that means I won't get to my data in a coherent fashion :-). But it is all doing this in the loop device. This brings me back to my initial question: **How will I ever get back from a working partition in a loop device to a directly accessible working partition (63 cylinders off I suppose)?** UPDATE3: I rebuilt the tree and got a lost+found with some stuff back. When trying to mount it the next day, it again could not be mounted. Overall it showed random behavior. I think the hard disk actually has died. SMART data was the first thing I tried but it could never be accessed, I - wrongly? - assumed this was because of the enclosure. I tried to format it with a new partition but even that wouldn't stick very long beyond the formatting.


title: OSX : rmdir "permission denied" but directory removed

text: This is a question from a newbie trying to learn UNIX commands. I was trying to test the `rmdir` command by removing a `test` directory located in my `Downloads` directory. I have read and write rights on `Downloads`. I issued `rmdir -p /Users/myself/Downloads/test` and got `rmdir: /Users/myself/Downloads: Permission denied` , but the `test` directory was deleted. So why do I have this message? Should I care? I'm using OSX Lion 10.7.3.


title: attr man page missing?

text: How does one search for certain manpages (such as http://linux.die.net/man/5/attr)? Trying: > man attr and > man -K attr don't seem to work. Any ideas why?


title: Disable ATI HDMI sound device - Fedora with PulseAudio

text: I want to disable the ATI HDMI sound device. I have nothing connected to it and for some reason, although it isn't the default sound device, it sometimes kicks in and grabs my sound, leaving the real sound device silent. How can I block the system from using it? I'm using Fedora 20 with PulseAudio. I don't use any DE, I prefer answer that doesn't include GUI configuration tool.


title: Is route add ... the best way of directing traffic through a vpn

text: I have set up a VPN on a remote ubuntu machine using `pptp-linux` and the instructions found here. After set up no traffic seemed to be going through the VPN and the VPN network devices were not visible (on a tested and working VPN server). This command               route add -net 192.168.11.0/24 ppp0      maps the correct the devices correctly. Is the following the best method for forwarding all traffic through the VPN?               route add -net 0.0.0.0/0 ppp0


title: How to specify which interface an application uses?

text: Imagine this example: you have direct access to the internet on `eth0`, and you have a VPN on `tun0`. You want one application to access the internet directly through `eth0` (using X public IP address) and another application to access the internet through `tun0` (using Y public IP).


title: How to check dependencies of a package under OpenBSD?

text: AFAIK this is the way that I can install for ex.: XYZ on OpenBSD:               pkg_add -Uvi XYZ      How can I get a list for all the dependencies regarding XYZ package? -> So I need a list about .tgz filenames that pkg_add will download/install/update when I need to install given XYZ package. What is the command to generate a list for XYZ package?


title: Linux Fedora 20:How to use microsoft word, possibly with wine?

text: I have searched the Internet for answers to this question, and find a lot of confusing answers. I have had Linux Fedora 20 installed on my wife's computer, dual boot with Windows, and suggested LibreOffice as an alternative to the Microsoft Word that she has been using. Unfortunately there is no LibreOffice equivalent of the font she likes. She had bought Word on a disk with the computer, so it seems that the obvious way out is for her to use Word from within Linux, possibly with "wine". I have not used wine before. I am reluctant for her to want to go back to Windows, after having Linux installed, with the speed, freedom from attack, and stability she now enjoys. So, my question is: please, how do we go about this?


title: Switching to `zsh`: Are all bash scripts compatible with `zsh`?

text: I'm looking to switch from bash to zsh but concerned about compatibility of bash scripts. Are all bash scripts/functions compatible with zsh? Therefore, if that is true is zsh just an enhancement to bash?


title: How can I configure Yast to switch languages completely?

text: I have an installation of openSUSE 11.4 which was installed in German. I started Yast2 (which displayed in German, like "Netzwerkdienste") and switched the language to English under "System" -> "Sprache". Yast2 downloaded some files, installed something and remained German ("Netzwerkdienste" can still be seen instead of, presumably, "Network Services"). I rebooted the machine, same result. I un-installed the German Yast language pack. Yast2 persists in displaying in German. I don't know how many of Yast2's screens are supposed to be translated, but I think it might only be the main screen that is in German. However, it is annoying. How can I change it? Update: I checked environment variables (for the root user). There are several variables that refer to language settings and all remain set to German.               declare -x LANG="de_DE.utf8"     declare -x LANGUAGE="de_DE.utf8"     declare -x LC_ALL="de_DE.utf8"      Shouldn't Yast2 have modified them? Update: I just started vi and it's also in German... does the language setting in Yast2 do anything at all?


title: How to run another installed system from within Linux?

text: I have Windows Server and Android X86 triple-booting with Kubuntu. How can I run either of them directly from within Kubuntu (without using virtual image files)?


title: Why sed wont remove my empty lines?

text: Can someone PLEASE explain to me why this sed command wont remove the empty lines?               sed -e 's/\r//g' -e '/^{$/d' -e '/^}$/d' -e ':begin;$!N;/^state-text: {[[:space:]]\n/s/\n//;tbegin;P;D' -e "s/'/''/g" -e '/^$/d' <<< $myvar      This command all works fine except the last part -e '/^$/d' for removing the empty lines which appears to be doing nothing at all. Here is a sample of my content:               begin dump          Ctrl_ID:100      This is the same content viewed with cat -A               begin dump$     $     Ctrl_ID:100$      Examining the empty line with an Hex editor shows that all it contains is one single char with the hex value               0A      Which is exactly the same code at the end of each lines. I dont understand whats going on here. `^$` should match no?


title: grep to see if a line ends with a particular string

text: Hello I have a file that has a lot of lines that end with `main.css">`, and some of them are repeated. I want to keep only one copy of these lines and delete the repeated line. Could I use grep to search if a file has a line that ends with `main.css">` ? So far I have :                grep ' main.css' file.txt |sort | uniq -u      This does nothing as I expected, it just gives me a blank output. Please help? This did not


title: Is it possible to run a 10.04 or 12.04 or earlier LTS containerized under LXC or Docker on Trusty?

text: Is it possible to have a vanilla installation of Ubuntu 14.04 (Trusty) and run inside it containerized older Ubuntu versions that originally came with older kernels? For example for 12.04 I'd assume the answer is yes as it has `linux-image` packages for subsequent Ubuntu releases, such as `linux-image-generic-lts- saucy` and `linux-image-generic-lts-quantal`. For 10.04 that isn't the case, though, so I'm unsure. But is there documentation available that I can use to deduce what's okay to run? The reason I am asking is because the kernel interface undergoes updates every now and then. However, it's sometimes beneficial to run newer versions of the distro and at the same time keeping a build environment based on a predecessor.


title: Unable to use OfflineIMAP to sync Gmail

text: I'm trying to setup OfflineIMAP to sync my Gmail account to `~/Mail/Gmail`. I'm using a pretty basic `~/.offlineimaprc` from here. But OfflineIMAP doesn't connect to Gmail at all. This is the debug message I'm getting (by running OfflineIMAP as `offlineimap -o -d imap`:               OfflineIMAP 6.3.4     Copyright 2002-2011 John Goerzen & contributors.     Licensed under the GNU GPL v2+ (v2 or any later version).          Debug mode: Forcing to singlethreaded.     Now debugging for imap: IMAP protocol debugging     Now debugging for : Other offlineimap related sync messages     Account sync Gmail:     ***** Processing account Gmail     Copying folder structure from IMAP to Maildir     Establishing connection to imap.gmail.com:993.     DEBUG[imap]:   06:28.69 Account sync Gmail imaplib2 version 2.24     DEBUG[imap]:   06:28.69 Account sync Gmail imaplib2 debug level 5, buffer level 3     WARNING: Error occured attempting to sync account 'Gmail':     Traceback (most recent call last):     File "/usr/lib/pymodules/python2.7/offlineimap/accounts.py", line 177, in syncrunner         self.sync()     File "/usr/lib/pymodules/python2.7/offlineimap/accounts.py", line 235, in sync         remoterepos.syncfoldersto(localrepos, [statusrepos])     File "/usr/lib/pymodules/python2.7/offlineimap/repository/Base.py", line 124, in syncfoldersto         srcfolders = src.getfolders()     File "/usr/lib/pymodules/python2.7/offlineimap/repository/IMAP.py", line 276, in getfolders         imapobj = self.imapserver.acquireconnection()     File "/usr/lib/pymodules/python2.7/offlineimap/imapserver.py", line 323, in acquireconnection         elif isinstance(e, socket.error) and e.args[0] == errno.ECONNREFUSED:     NameError: global name 'errno' is not defined          ***** Finished processing account Gmail      In the beginning I thought this could be due to my ISP blocking `imap.gmail.com/imap.googlemail.com`, but I'm able to connect to it using `telnet imap.googlemail.com 993`:               telnet imap.googlemail.com 993     Trying 173.194.79.16...     Connected to googlemail-imap.l.google.com.     Escape character is '^]'.      Any ideas? **EDIT 1:** From this answer on SuperUser, I tried connecting to `imap.googlemail.com` via SSL using `openssl s_client -connect imap.googlemail.com:993`. This gives me:               CONNECTED(00000003)     3078125768:error:140790E5:SSL routines:SSL23_WRITE:ssl handshake failure:s23_lib.c:177:     ---     no peer certificate available     ---     No client certificate CA names sent     ---     SSL handshake has read 0 bytes and written 226 bytes     ---     New, (NONE), Cipher is (NONE)     Secure Renegotiation IS NOT supported     Compression: NONE     Expansion: NONE     ---      This looks like a missing certificate problem in OpenSSL. Could the same be happening to OfflineIMAP too? **EDIT 2:** I tried the same OpenSSL commands on another server (on the same network) running Mandriva Linux release 2009.1 and apparently the connection worked (debug output). I'm running Ubuntu 12.04 with OpenSSL/LibSSL 1.0.1-4ubuntu5.5. Could this be distro related?


title: Concatenate lines by first column (AWK or SED)

text: How can I use AWK in the following situation? I want to concatenate lines that start with the same column. Only the first column is kept after the join (in this case `aaa`, `www`, `hhh`). The file may be space- or tab-separated. **Example input:**               aaa bbb ccc ddd NULL NULL NULL     aaa NULL NULL NULL NULL NULL NULL     aaa bbb ccc NULL NULL NULL NULL     www yyy hhh NULL NULL NULL NULL     hhh 111 333 yyy ooo hyy uuuioooy     hhh 111 333 yyy ooo hyy NULL      **Desired output:**               aaa bbb ccc ddd NULL NULL NULL NULL NULL NULL NULL NULL NULL bbb ccc NULL NULL NULL NULL     www yyy hhh NULL NULL NULL NULL     hhh 111 333 yyy ooo hyy uuuioooy 111 333 yyy ooo hyy NULL      The background to this is that I want to set up a very simple file-based database, where the first column is always the identifier for the entity. All lines based on the same identifier column are concatenated.


title: define own time in linux

text: how to set time in linux in that way: 1 second define as 10 seconds (10 second = 1 secods of own time) I want fool all processes runned there to use 10x faster time. so `sleep(1)` will last 0.1 real seconds. how to achieve it?


title: Where sysv-rc-conf gets information about daemons?

text: Recently I deleted an init-script of my program both from filesystem and with `update-rc.d`:               update-rc.d foobar remove      But `sysv-rc-conf` still lists it, though I can't see links in `/etc/rc*` directories (`for dir in /etc/rc*; do find $dir -name '*foobar*'; done`). Am I doing it wrong? Is it expected behavior?


title: Start systemd service after mysql

text: I am working on a project which is a mono EmailServer. I have tried adding a service to the systemd so that it starts up automatically during boot but I am having a problem. I have created the script and added to `/lib/systemd/system/emailserver.service` and then run `ln -s /lib/systemd/system/emailserver.service /etc/systemd/system/emailserver.service`. I have then executed `systemd reload-daemon` followed by `systemctl start emailserver.service` and then when I run `ps -ef |grep -i emailserver` I can then see that `mono EmailServer.exe` is running, all looking good so far. However, when I reboot the server in the `/var/log/messages` file it then contains the following error message               Jul 16 19:41:02 dev-server systemd[1]: emailserver.service holdoff     time over, scheduling restart. Jul 16 19:41:02 dev-server systemd[1]:     emailserver.service holdoff time over, scheduling restart. Jul 16     19:41:03 dev-server systemd[1]: emailserver.service holdoff time over,     scheduling restart. Jul 16 19:41:03 dev-server systemd[1]:     emailserver.service holdoff time over, scheduling restart. Jul 16     19:41:03 dev-server systemd[1]: emailserver.service holdoff time over,     scheduling restart. Jul 16 19:41:04 dev-server systemd[1]:     emailserver.service holdoff time over, scheduling restart. Jul 16     19:41:04 dev-server systemd[1]: emailserver.service start request     repeated too quickly, refusing to start.      In my emailserver.service script I have the following               [Unit]     Description=Boardies Email Server Startup Script          [Service]     ExecStart=/home/bits/EmailServer/start.email     Restart=always          [Install]     WantedBy=multi-user.target      I'm using OpenSuse 12.1 What am I doing wrong, thanks for any help you can provide. **UPDATE** I have found out what is causing the program to stop working at bootup but I am not sure how I can fix this problem. My program relies on a MySQL database and I think my program is starting up before MySQL has started, how can I make my service not load until after MySQL has started up.


title: Bash shell script to locate and remove substring within a filename

text: I am trying to write a bash shell script in Mac OS X 10.6 (which is called by an Automator Action) to rename TV show DVD rips that I have named badly over the years. I want to remove part of the text in the filenames. I want to remove the text that appears after a specific series of characters that I know will always appear in the filename. But I do not know how many characters will appear before or after the known series of characters. I also don't know if the before or after text will contain multiple periods or dashes. An example would probably help: **The.Big.Bang.Theory.S01E01.xxxxxxxxxxx.mp4** I know that each file will always contain a string in the format of SxxExx where the x's are always numbers. But I do not know what the numbers will be. I want to get the filename up to and including the SxxExx string and the file extension but strip out everything else. So for the above example I would end- up with: **The.Big.Bang.Theory.S01E01.mp4** I have tried using bash's built-in string replacement commands. I thought the expr index command would give me the start point of the SxxExx string and then I could use ${filename:offset:length} to extract only the required part of the filename (I already know the extension so that can be re-added). But it seems the OS X version of expr doesn't include the index functionality. I have only scripted in Basic and LotusScript before. In those environments this would have been fairly easy using commands such as 'Like' and 'Instr' or 'Mid'. But in bash I just can't figure it out. I have spent hours googling trying to understand how to use regular expressions to locate the 'SxxExx' substring in the filename but I just can't figure it out. I hope some clever UNIX scripters will be able to help me!


title: How can I count lines with title-case words of certain length?

text: How can I create a shell script in unix/linux to find the number of lines in a text file that have words which are 5 to 10 character long and begin with a capital letter?


title: Getting a window's PID by clicking on it

text: Is there any package which shows PID of a window by clicking on it?


title: Context menu won't show unless right mousebutton is kept held down

text: I have posted this as a bug here, but I am looking for a workaround. So, I will re-post the bug here. I am in Linux Mint 15 (Olivia) Xfce version, with Thunar 1.6.2 The bug consists in the context menu being absent (not always, but very often) when just right-clicking. It always appears if the right mouse is pressed (held) longer than for a normal click. Sometimes the menu appears after multiple clicks. This affects right-clicking on the desktop, on files and folders, but also in Firefox when right-clicking links, selected text, tabs etc. This bug looks similar with this (https://bugs.launchpad.net/ubuntu/+source/thunar/+bug/127372) but is different by the fact that:   * the file named ".gtkrc-2.0" already existed in ~/   * it contained no line "gtk-menu-popup-delay = " - with any value: that line was absent altogether   * the bug appears with all themes, and none contains the line in their gtk-2.0/gtkrc file (The file "/usr/share/themes/Default/gtk-2.0-key/gtkrc" from the default theme contains only this line: "# Default keybinding set. Empty because it is implemented inline in the code.")


title: lpr: How to specify the page range "3 to end"?

text: The CUPS doc does not say how to specify a page range such as "3 to end". Can this be done without knowing the number of pages of the document? So something like `lpr -o page-ranges=3-end -P myprinter`?


title: How to make OpenWrt Makefile compile faster?

text: I have recorded that it took 50 minutes for an initial compilation of the OpenWrt firmware image, assuming all the necessary packages have been installed via `sudo apt-get install`. My BuildRoot Root Dir is `openwrt`. Subsequently, I found that if I rename the directory above the `openwrt` folder, with a minor change in a file say `wifi.lua` the next **make** (in `openwrt` folder) takes 21 minutes to compile successfully. However, if I don't rename the directory above the `openwrt` folder, with a similar minor change in the same file, the next **make V=99** takes only 3 minutes to compile successfully. When I now rename the directory above and do the same as above again, the **make** takes 21 minutes to compile successfully. With **make V=99** , I can see that there were many more compilation steps taken compared to the case where I did not rename the top directory. I can see that the Makefile compilation is much faster if I do not rename the top directory. This brings me to the related question: In Linux, will renaming or moving a directory change the times of the files in subdirectories? I know that the Makefile does not build a target again if the modification time of the target is more recent than all its dependencies. I was also reading about some issues with the GNU Makefile: http://www.conifersystems.com/whitepapers/gnu-make/ Does the OpenWrt Makefile, supposed to be much more advanced than the original Linux Makefile, address some or all of these issues? (To get the Makefile to compile faster, I also have the `openwrt/dl` as a symbolic link to a folder in my home directory, so that the user-space package tarballs don't need to be downloaded again.)


title: Debian Lenny on Asus sabertooth X58 won't detect hard drive

text: I have been trying to install Debian Lenny on my new machine, alongside Windows 7 64-bit. When I get to the part where it detects my disks, it can't find any. I have a 1GB FAT32 flash drive that it detects if it is in, but it doesn't see my Hitachi drive or my USB Seagate. I partitioned a 100GB partition on the internal Hitachi drive as FAT32. Does anyone have any ideas? MOBO: Asus X58 Sabertooth HDD: Hitachi HDT721010SLA360 SCSI Disk Drive


title: It's possible to make XTERM and Gnome-keyring work together?

text: When I'am connecting to ssh with **gnome-terminal** application opens gnome- keyring dialog, so I am entering password only once per session and I can reconnect to same ssh more than once without asking the password. But this doesn't work in xterm. Maybe someone can help to make this work?


title: How to disconnect a remote volume in dolphin

text: I understand how I can mount a distant volume in Dolphin, through the `Network` place and the `Add Network Folder` command, but how can I disconnect from such a remote file system? I want to ensure a manual disconnect, not a mere timeout.


title: Can a VM swap to host main memory.?

text: While my developer machine has a lot of memory, my vmware VM is 32 bit only and needs some swap space. Can I make it to swap into the host memory? If so, is it possible to use compressed swap space for this in case the host memory gets exhausted? I want to avoid swapping to disk as it's damn slow compared to anything else.


title: How to correct error where 2 out of 3 users on chrooted network cannot gain write access?

text: I have an SFTP server running on Debian. The directory is chrooted and is set up with privileges as such:               /sftp/+---testagent2----writespace      750  |      755           755           +---testagent3----writespace           |      755           755            +---testagent4----writespace                  755           755       All agents can log in without issues. The problem is only `testagent2` can write within his `writespace`, the rest cannot, even though `testagent3` and `testagent4` can still download files. I have experimented with various permission settings, such as `750`,`755`,`775`, and `777` but it doesn't make a difference. How can I correct this error?


title: rsync only leaves partial files?

text: I am trying to copy files from my hard drive to a networked external disk (WDMyCloud). I have enabled the FTP access to the hard drive and mounted it to a local directory using curlftpf to a local directory. Now I created the directory I wanted to copy the files to in the mounted directory and tried               rsync -avzP /media/Windows7_OS/Work/* .      which resulted in `rsync` copying for a long time, showing progress and very good transfer speeds, but at the end the target directory only contained `.Files.ext.kE5WT` or something similar, that corresponded to the names of the files in the source folder but all of them had 0 length. cp copies without problem, although the transfer rate is slow. I am on CentOS 6.4. Where did I go wrong?


title: Change eth0 to em1 on Scientific Linux

text: The aim is to standardize the Ethernet adapter type on all production servers. One of these servers disposes an **em1** , rather than **eth0**. Today, an attempt has been done to change it, without success. Before executing a second attempt, this conversion will be tested first. A Vagrant box has been created and **eth0** is the current adapter. To mimic the production setting, the eth0 needs to be changed to em1. Biosdevname has been installed (`sudo yum install biosdevname -y`), `70-persistent-net.rules` removed (`sudo rm /etc/udev/rules.d/70-persistent- net.rules`), `biosdevname=1` executed and added to `/etc/grub.conf` as follows:               # grub.conf generated by anaconda     #     # Note that you do not have to rerun grub after making changes to this file     # NOTICE:  You have a /boot partition.  This means that     #          all kernel and initrd paths are relative to /boot/, eg.     #          root (hd0,0)     #          kernel /vmlinuz-version ro root=/dev/mapper/VolGroup-lv_root     #          initrd /initrd-[generic-]version.img     #boot=/dev/sda     default=0     timeout=5     splashimage=(hd0,0)/grub/splash.xpm.gz     hiddenmenu     title Scientific Linux (2.6.32-431.el6.x86_64)             root (hd0,0)             kernel /vmlinuz-2.6.32-431.el6.x86_64 ro root=/dev/mapper/VolGroup-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD rd_LVM_LV=VolGroup/lv_swap SYSFONT=latarcyrheb-sun16 crashkernel=auto rd_LVM_LV=VolGroup/lv_root  KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet             initrd /initramfs-2.6.32-431.el6.x86_64.img          biosdevname=1      However, once the system has been rebooted and `ifconfig` has been executed the eth0 adapter persists. How to change `eth0` to `em1`?


title: Count lines with alphabet in linux

text: I have a file with a number of lines in a file filename. I want to count how many lines start with character 'a', with 'b' and so on in one go. What command i should execute.?


title: remove title bar of another program

text: I have developed a program with glut library and want to remove its title bar. Since its impossible to remove the title bar from glut library I have to use an external tool to remove its title bar. Regarding the fact that it is possible to manipulate other windows decoration in Windows operating system I hope to find a similar remedy for this obstacle. Do you have any Idea about how to remove specific window title bar with a script or a simple X11 application ?


title: how to set up ldap and trac

text: I have set up kerberos authentication with `trac` which works well. Now I want to use AD groups and users for `trac` permissions using the `trac` plugin Configuration for `LdapPlugin`. I have been following this guide but it is not working. I am using `trac 0.10.4`. In my apache, I have the following:               <LocationMatch "/trac/[^/]+/login">             AuthType Kerberos             AuthName Trac             KrbServiceName HTTP/intranet.domain.com             KrbMethodNegotiate On             KrbMethodK5Passwd On             KrbAuthRealms DOMAIN.COM             Krb5KeyTab /etc/httpd/conf/intranet.keytab             AuthzLDAPAuthoritative off             require valid-user             Options Indexes MultiViews FollowSymLinks             AllowOverride All             Order allow,deny             Allow from all             SetOutputFilter DEFLATE     </LocationMatch>      My `trac` configuration:               [root@hero plugins]# cat ../conf/trac.ini      [components]     ldapplugin.* = enabled          [notification]     always_notify_owner = true     always_notify_reporter = true     always_notify_updater = true     mime_encoding = base64     smtp_always_bcc =     smtp_always_cc = sharif.uddin@domain.com     smtp_default_domain = domain.com     smtp_enabled = true     smtp_from = trac@domain.com     smtp_password =     smtp_port = 25     smtp_replyto = support@domain.com     smtp_server = hero.uk.domain.com     smtp_subject_prefix = __default__     smtp_user =     use_public_cc = false     use_short_addr = false     use_tls = false     #ignore_domain= domain.com          [ldap]     global_perms = true     enable = true     use_tls = false     host = echo     port = 389     basedn = dc=domain,dc=com          # Relative DN for users (defaults to none)     user_rdn = ou=TechSupport,ou=Woking,ou=Sites          # Relative DN for group of names (defaults to none)     group_rdn = cn=users          # objectclass for groups     #groupname = groupofnames          # dn entry in a groupname      #groupmember = member          # attribute name for a group     #groupattr = cn          # attribute name for a user     #user_name_attr = uid          # objectclass for user ; customize to your needs     #user_class = sambaSamAccount          # attribute name to store trac permission     #permattr = tracperm          # filter to search for dn with 'permattr' attributes     #permfilter = objectclass=*          # time, in seconds, before a cached entry is purged out of the local cache.     #cache_ttl = 900          # maximum number of entries in the cache     #cache_size = 100          # whether to perform an authenticated bind for group resolution     #group_bind = false          # whether to perform an authenticated bind for permision store operations     store_bind = true          # user for authenticated connection to the LDAP directory     bind_user = cn=administrator,cn=users,dc=domain,dc=com          # password for authenticated connection     bind_passwd = ********          # global permissions (vs. per-environment permissions)     #global_perms = false          # group permissions are managed as addition/removal to the LDAP directory groups     #manage_groups = true          # whether a group member contains the full dn or a simple uid     #groupmemberisdn = true          [trac]     permission_store = LdapPermissionStore      If I change the httpd configuration to `ldap` I get the following error:               [Mon Dec 02 14:13:33 2013] [warn] [client 172.16.0.85] [19659] auth_ldap authenticate: user sharifu authentication failed; URI /trac/paradox/login [ldap_search_ext_s() for user failed][Operations error], referer: http://intranet/trac/paradox/          <LocationMatch "/trac/[^/]+/login">             AuthType Basic             AuthName Trac             AuthBasicProvider ldap             Order allow,deny             Allow from all             AuthLDAPURL "ldap://echo:389/dc=domain,dc=com?uid"             AuthzLDAPAuthoritative on             require valid-user     #               Options Indexes MultiViews FollowSymLinks     #        AllowOverride All     #               SetOutputFilter DEFLATE     </LocationMatch>      I believe I am doing something wrong in the `trac.ini` file if I use kerberos authentication in apache. I have now done the following and managed to get authentication working using `ldap` in apache. I just need some help implementing this into `trac` to use permission on AD groups etc.               <LocationMatch "/trac/[^/]+/login">             AuthType Basic             AuthName Trac             AuthBasicProvider ldap             Order allow,deny             Allow from all                  AuthLDAPURL "ldap://echo.uk.domain.com akutan.usa.domain.com/ou=Sites,dc=domain,dc=com?sAMAccountName"             AuthLDAPBindDN cn=Administrator,cn=Users,dc=domain,dc=com             AuthLDAPBindPassword **********                  AuthzLDAPAuthoritative off             require valid-user     </LocationMatch>          [root@hero trac]# trac-admin paradox permission list          User             Action              --------------------------------     @Administrators  TRAC_ADMIN          anonymous        CHANGESET_VIEW      anonymous        FILE_VIEW           anonymous        LOG_VIEW            anonymous        MILESTONE_VIEW      anonymous        REPORT_SQL_VIEW     anonymous        REPORT_VIEW         anonymous        ROADMAP_VIEW        anonymous        SEARCH_VIEW         anonymous        TICKET_VIEW         anonymous        TIMELINE_VIEW       anonymous        WIKI_VIEW                Available actions:      BROWSER_VIEW, CHANGESET_VIEW, CONFIG_VIEW, FILE_VIEW, LOG_VIEW,      MILESTONE_ADMIN, MILESTONE_CREATE, MILESTONE_DELETE, MILESTONE_MODIFY,      MILESTONE_VIEW, REPORT_ADMIN, REPORT_CREATE, REPORT_DELETE, REPORT_MODIFY,      REPORT_SQL_VIEW, REPORT_VIEW, ROADMAP_ADMIN, ROADMAP_VIEW, SEARCH_VIEW,      TICKET_ADMIN, TICKET_APPEND, TICKET_CHGPROP, TICKET_CREATE, TICKET_MODIFY,      TICKET_VIEW, TIMELINE_VIEW, TRAC_ADMIN, WIKI_ADMIN, WIKI_CREATE,      WIKI_DELETE, WIKI_MODIFY, WIKI_VIEW      I have forgotton to enable the plugins, however I am having trouble `trac` talking to `ldap`. In the log, I get the following:               Trac[paradox:api] ERROR: LDAP error: Operations error     Trac[paradox:api] ERROR: LDAP error: Operations error     Trac[paradox:api] DEBUG: Updating wiki page index      Current config:               [notification]     always_notify_owner = true     always_notify_reporter = true     always_notify_updater = true     mime_encoding = base64     smtp_always_bcc =     smtp_always_cc = sharif.uddin@domain.com     smtp_default_domain = domain.com     smtp_enabled = true     smtp_from = trac@domain.com     smtp_password =     smtp_port = 25     smtp_replyto = support@domain.com     smtp_server = hero.uk.domain.com     smtp_subject_prefix = __default__     smtp_user =     use_public_cc = false     use_short_addr = false     use_tls = false     #ignore_domains = domain.com          [ldap]     enable = true     host = echo     basedn = dc=domain,dc=com     user_rdn = ou=Sites,dc=domain,dc=com     group_rdn = cn=Users,dc=domain,dc=com     store_bind = true     bind_user = Administrator@domain.com     bind_passwd = ******          [trac]     permission_store = LdapPermissionStore          [logging]     #log_file = /var/log/trac.log     log_format = Trac[$(basename)s:$(module)s] $(levelname)s: $(message)s     #log_level = DEBUG     #log_type = file          [components]     webadmin.* = enabled     ldapplugin.* = enabled


title: cp doesn't work in script but works in terminal

text: Now, this is a strange problem, I have this kind of script:               CWD="$(cd -P -- "$(dirname -- "$0")" && pwd -P)"     RESOURCES_PATH="${CWD}/resources"          PROJECT_NAME="something"          DRUSH_ALIASES_EXAMPLE_PATH="${RESOURCES_PATH}/example.aliases.drushrc.php"     DRUSH_ALIASES_PATH="~/.drush/${PROJECT_NAME}.aliases.drushrc.php"          cp ${DRUSH_ALIASES_EXAMPLE_PATH} ${DRUSH_ALIASES_PATH}     echo "cp ${DRUSH_ALIASES_EXAMPLE_PATH} ${DRUSH_ALIASES_PATH}"      When I'm trying to run that kind of script, I'm getting error: "cp: Cannot create regular file "~/.drush/something.aliases.drushrc.php". There is no such file or directory" But the funny thing is, that if I will copy the output of "echo" and paste in directly into terminal, the command will work just fine. I'm confused, any ideas what can be wrong with above script?


title: Simulate bitrot/corrupt files (for BTRFS)

text: Is it possible to intentionally corrupt a file so that BTRFS will report a checksum error? I want to test a script that's supposed to find file names with checksum errors, but I don't have any corrupt files. EDIT: After a long time of searching I found the same question on AskUbuntu with some solutions. Unfortunately, I don't see any `btrfs-corrupt-block` utility, despite the fact that I have `btrfs-progs` installed.