title: Remapping keys for workspaces in Xmonad

text: Xmonad uses 1) `Mod`+`2` for switching to workspace 2   2) `Mod`+`Shift`+`2` for moving window to workspace 2 How would you remap 1) to `Mod`+`k` and 2) to `Mod`+`Shift`+`k` in `~/xmonad/xmonad.hs`?


title: Is it possible to get process group ID from /proc?

text: In "http://stackoverflow.com/questions/13038143/how-to-get-pids-in-one- process-group-in-linux-os" I see all answers mentioning `ps` and none mentioning `/proc`. "ps" seems to be not very portable (Android and Busybox versions expect different arguments), and I want to be able list pids with pgids with simple and portable tools. In /proc/.../status I see `Tgid:` (thread group ID), `Gid:` (group id for security, not for grouping processes together), but not `PGid:`... What are other (not using `ps`) ways of getting pgid from pid?


title: bash completion on posix mode

text: I would like to use an interactive posix bash shell but the autocompletion feature doesn't work. When i type the tab character it simply prints a tab. The tab completion only works when i'm on a non posix interactive shell or on a posix interactive shell with emacs input mode. I find emacs input mode very awkward and i am used to vi input mode. The problem only arises when i am on posix mode and vi input mode in which case the tab key only prints a tab space on my shell. Also, the same problem arises when i invoke bash with the sh command. Here is my /etc/inputrc :               # do not bell on tab-completion     set bell-style audible          set meta-flag on     set input-meta on     set convert-meta off     set output-meta on          # Completed names which are symbolic links to     # directories have a slash appended.     set mark-symlinked-directories on          set editing-mode vi     set keymap vi-insert     set mark-modified-lines on          $if mode=emacs          # for linux console and RH/Debian xterm     "\e[1~": beginning-of-line     "\e[4~": end-of-line     # commented out keymappings for pgup/pgdown to reach begin/end of history     #"\e[5~": beginning-of-history     #"\e[6~": end-of-history     "\e[5~": history-search-backward     "\e[6~": history-search-forward     "\e[3~": delete-char     "\e[2~": quoted-insert     "\e[5C": forward-word     "\e[5D": backward-word     "\e[1;5C": forward-word     "\e[1;5D": backward-word          # for rxvt     "\e[8~": end-of-line     "\eOc": forward-word     "\eOd": backward-word          # for non RH/Debian xterm, can't hurt for RH/DEbian xterm     "\eOH": beginning-of-line     "\eOF": end-of-line          # for freebsd console     "\e[H": beginning-of-line     "\e[F": end-of-line     $endif


title: How to do "if variable a has pattern 'abc' do x, otherwise do y" (in 1 line)

text: I want to set an alias depending on an environmental variable pattern match in 1 line. I am trying:               [[$HOSTNAME =~ 'q20' ]] && alias a='cd ~/a1' || alias a='cd ~/a99'      but I get `-bash: [[uscamwebq20.boston.zipcar.com: command not found` I also tried:               $ [ -z $HOSTNAME =~ q20 ] && alias a='cd ~/a1' || alias a1='cd ~/a99'      but I get `-bash: [: too many arguments`


title: Trying to automake gnome-terminal

text: I am on Fedora 20. I am trying to make gnome-terminal. The automake does not find certain packages. I do not understand why. Here is the part I do not understand.               checking which gtk+ version to compile against... 3.0     checking for TERM... no     configure: error: Package requirements (vte-2.91 >= 0.37.0        glib-2.0 >= 2.40.0        gio-2.0 >= 2.33.2        gtk+-3.0 >= 3.9.9        gsettings-desktop-schemas >= 0.1.0        dconf >= 0.14.0        uuid         x11) were not met:          No package 'vte-2.91' found     Requested 'glib-2.0 >= 2.40.0' but version of GLib is 2.38.2     No package 'uuid' found      **\--** No page 'vte-2.91' found. Is it looking for package vte-2.91 or package vte? I have vte installed, but not package vte-2.91. Fedora names the package vte. What am I to do? Current thoughts: I need to download the source for vte version 2.91 and compile. **\--** No package 'uuid' found. When I attempt to install uuid, yum install says the package is installed.               # yi is an alias for yum install      me $ yi uuid.i686  uuid-devel.i686     [sudo] password for me:           Loaded plugins: langpacks, refresh-packagekit     Package uuid-1.6.2-21.fc20.i686 already installed and latest version     Package uuid-devel-1.6.2-21.fc20.i686 already installed and latest version     Nothing to do     me $       How do I fix the uuid problem?


title: Is it bad/dangerous/inappropriate to put arbitrary backups in /var/backups?

text: There's a system-created `/var/backups` directory on Debian-based systems. I need a place to store backups of several git repositories (the primaries are on bitbucket). If I store them in /var/backup/git will that break apt-get, or will they get automatically deleted at inopportune times? Is there any reason I shouldn't use /var/backup? If there is, what is a reasonable alternative?


title: How to find out the right String syntax for my bash?

text: I am getting an error message for this alias:               alias ejectall='osascript -e 'tell application "Finder" to eject (every disk whose ejectable is true)''      And here is the error message:               -bash: .bashrc: line 15: syntax error near unexpected token `('     -bash: .bashrc: line 15: `alias ejectall='osascript -e 'tell application "Finder" to eject (every disk whose ejectable is true)'''      I got many aliases there, but i cannot understand this message! **I found many websites with lots of different suggestions of the syntax of the String.** _I am on OS X Mavericks (10.9.3)._ My question is: > How to find out my bash version, and depending on that, the right syntax for > my bash files?


title: Will WPA or WEP BT crackers perform well on Galaxy Tab?

text: I checked some videos on YouTube, and it talks about how to install BT on different Linux tablets, like the Galaxy Tab and really wonder if `reaver`, `aircrack` or whatever other tools would work just fine or lets say detecting the wireless adapter (`wlanXX`) embedded in the tablet as a normal WiFi device to start the work? If yes, will I expect the same performance as with Laptops and PC's? Because I'm really thinking of buying one but need to make sure that it does the necessary work first.


Sometimes I notice that I am unable to connect via SSL with `curl` and `wget` to websites that have certificates that should be valid. One example might be `https://squareup.com/` which has a Verisign class 3 certificate - I assume a large banking-related site has a certificate that should be widely accepted. However when I try and run:               wget -O - https://squareup.com/   #grab the homepage and send it to stdout      I get the error:               Unable to establish SSL connection.      Does this mean my system's certs, perhaps one of the `cacert.pem` files, is out of date? I'm on Ubuntu 12.04.1. Yes, I know I can use `no-check-certificate` but I'm more curious about why this is happening in the first place. How can I update certificates on my system to fix wget's error: "Unable to establish SSL connection."?


title: ls colors for permissions

text: Is there a way to control the color output of ls to highlight specific permissions on files? (e.g. **write** permissions). ![enter image description here](http://i.stack.imgur.com/kvafj.png) Any options in `LS_COLORS` that would do this? (the image above is from Dired+ on Emacs 24.1, not from the output of `ls`)


title: nginx + php5-fpm + htdocs on USB

text: None of the configurations that I've looked up can help with setting up Nginx to serve PHP files on a mounted USB folder. I'm currently getting `file not found` when I try and access a PHP file on the USB but PHP displays correctly when accessing it on the default folder `/usr/share/nginx/www`. In other words, If I have a `test.php` in `/media/usb/downloads/` and try to access `sitename.com/usb/test.php` I get `file not found`. But, if i place it in `/usr/share/nginx/www/` it works. In both cases, static files work fine. I have installed nginx and php5-fpm with defaults but added the following changes: **nginx/sites-enabled/default**               location /usb/ {         alias /media/usb/downloads/;         autoindex on;         allow 127.0.0.1;         allow ::1;         #deny all;     }          location ~ \.php$ {         fastcgi_pass unix:/var/run/php5-fpm.sock;         include fastcgi_params;     }


title: rsync is very slow (factor 8 to 10) compared to cp on copying files from nfs-share to local dir

text: I have a freshly installed ubuntu-server which is ought to be the new backup- server for our VM-storage. The server has 4 nics, 2 of them 10Gbit (in fact an intel x540-T2 with the newest driver available) which ar eused to connect to the SAN. I have the nfs-share mounted localy and compared speed-differences while copying a directory with ~30 files, around 15 vm-images and corresponding logfiles. The Images are between 8 GB and 600 GB in size. Using:               cp -rf /mnt/nfs-share /backup-storage/      bmon shows consequently around 600 MiB/s. Using               rsync -av /mnt/nfs-share /backup-storage/      bmon shows some packets in the first seconds, halts for about 30 seconds and than builds up to about 60-75 MiB/s. CPU is around 60%. What should/could I change to use `rsync` with the same performance as cp?


title: M-x ansi-term colors in Emacs 24.x

text: I have noticed that some colors in `LS_COLORS` don't work when running a shell inside `M-x-ansi-term` in Emacs. For exmaple;               di 00 94       is supposed to turn on bold on light blue on directories on `LS_COLORS` (see a list of the codes here), but `ansi-term` in Emacs does not show it in color. In fact, only the simple colors listed on that website seem to work under `ansi-term` in Emacs, while they work perfectly well on my regular gnome terminal. Is there a way to get `ansi-term` to recognize the so called **extra** colors? Where/how can I look up the colors supported by `ansi-term` in Emacs?


title: How is sudo set to not change $HOME in Ubuntu and how to disable this behavior?

text: On Ubuntu 12.04, when I `sudo -s` the $HOME variable is not changed, so if my regular user is `regularuser`, the situation goes like this:               $ cd     $ pwd     /home/regularuser     $ sudo -s     # cd     # pwd     /home/regularuser      I have abandoned Ubuntu a long time ago, so I cannot be sure, but I think this is the default behavior. So, my questions are: Q1. How is this done? Where is the config? Q2. How do I disable it? **Edit:** Thanks for the answers, which clarified things a bit, but I guess I must add a couple of questions, to get the answer I am looking for. Q3. In Debian `sudo -s`, changes the $HOME variable to `/root`. From what I get from the answers and `man sudo` the shell ran with `sudo -s` is the one given in `/etc/passwd`, right? Q4. However, on both Ubuntu and Debian the shell given in `/etc/passwd` for root is `/bin/bash`. In either system also, I cannot find where the difference in `.profile` or `.bashrc` files is, as far as $HOME is concerned, so that the behavior of `sudo -s` differs. Any help on this?


title: Is it possible to use a VMWare VDI as a proxy for SSH?

text: I'm currently working for a company with quite strict security measures. 90% of my work takes place on a Linux machine, but to access this machine I first have to connect to a VPN, access a Windows VDIs, and from this I can access the Linux server via Putty. This is fine for small tasks, but the majority of my work takes place on the shell this is slowing me down somewhat; I'm used to running multiple terminal windows and accessing servers via Emacs/Tramp. I'm wondering whether it's possible to access the remote Linux server using my local SSH via the VDI, but I'm out of my territory when it comes to this sort of thing. I believe I can use Putty on the Windows VDI to act as a proxy for getting onto the Linux system, but it's the step before that to access the VDI using SSH where I'm getting stuck. **Should it be possible? If so, what sort of google searches should I be making?** **Updated information:**   * I'm using the built-in OS X VPN tool.   * The linux server can only be accessed via a machine on the same network, which is why we have to connect to a VDI first. I believe I can use Putty to open a connection to the linux server and make it act as a proxy on whatever port I wish, I just need to tell SSH to a) use the VPN settings and b) connect to the VDI.


title: zsh: What does the command "time + number" do in zsh

text: When I type time + number in zsh:               # atupal at local in /tmp/atupal/setup/bin [10:01:49]     $ time 1     /tmp/atupal/setup/bin/lib/python2.7     # atupal at local in /tmp/atupal/setup/bin/lib/python2.7 [10:01:54]     $ time 2     /tmp/atupal/setup     # atupal at local in /tmp/atupal/setup [10:01:59]     $ time 3     /tmp/atupal/setup/app     # atupal at local in /tmp/atupal/setup/app [10:02:03]     $ time 3     /tmp/atupal/setup/bin     # atupal at local in /tmp/atupal/setup/bin [10:02:04]     $ time 3     /tmp/atupal/setup/bin/lib/python2.7     # atupal at local in /tmp/atupal/setup/bin/lib/python2.7 [10:02:05]     $       But when I type `time 10` is says `command not found: 10` My zsh version is :zsh 5.0.2-4 And my `uname` result:`Linux 3.12.5-1-ARCH #1 SMP PREEMPT Thu Dec 12 12:57:31 CET 2013 x86_64 GNU/Linux`


title: Does the (source) device in a tmpfs type mount mean anything?

text: I just went into `/etc/fstab` (Linux) and changed my line for `/tmp` (on which a specific `ext4` partition was previously mounted) to `tmpfs`. This was clearly a bit silly, but I wasn't thinking. Anyway, I rebooted, and everything is working and all, but I'm confused about the following. When issuing `mount` I see this:               /dev/sda8 on /tmp type tmpfs      Does this mean that `/dev/sda8` is mounted as `tmpfs`? If there were any files in `/tmp`, I can't access them any more, but I can create files in there. When I reboot, mounting as `ext4` I can see that there were in fact files on the partition (that weren't visible when `tmpfs` was mounted). Is the device file meaningless in this context?


title: Trying to close firefox but can't find the lock file

text: I get a message roughly like this: > Firefox is already running, close it or restart I am on a network so don't have permissions to do anything with sudo and so cannot restart it so I went looking for the `.lock` file in `.mozilla/firefox`. All that is inside is a               .profile.ini       In the file it says               [General]     StartWithLastProfile=1          [Profile0]     Name=default     IsRelative=1     Path=o4k6tgim.default      This is maddening. Does anyone know how I can find this lock file? Or another way to get Firefox working again?


title: linux/solaris + manipulation of Standard Output

text: I run the following line on linux/solaris machine ( all output will write in to /tmp/Log from application.bin )                ./application.bin 1>>/tmp/Log      We can see the content of the /tmp/Log file                more /tmp/Log          /etc/opt/OA/share/conf/OpC/mgmt_sv/ui/registration/C/opc_op /etc/opt/OA/share/conf/analysis/system_odbc.iniaaaa     /etc/opt/OA/share/conf/ovspmd.authaaaa     /etc/opt/OA/share/conf/ovwdb.authaaaa     /etc/opt/OA/share/conf/ovw.authaaaa       My question: what I need to change or add in the syntax:                  "1>>/tmp/Log" ?       in order to add space between each line as the following example                      /etc/opt/OA/share/conf/OpC/mgmt_sv/ui/registration/C/opc_op       .            /etc/opt/OA/share/conf/analysis/system_odbc.iniaaaa       .            /etc/opt/OA/share/conf/ovspmd.authaaaa       .            /etc/opt/OA/share/conf/ovwdb.authaaaa       .            /etc/opt/OA/share/conf/ovw.authaaaa       Remark – the option to add space between each line after /tmp/Log was created isn’t relevant


title: GNU Screen Caption

text: I have this line in my `.screenrc` file:               caption string " %{kw}%-w%{ky}%n-%t%{-}%+w"      This is the caption output, where 0 is the active screen:               0-bash  1 bash  2 bash      How do I customise `%-w` and `%+w` such that it outputs with a dash as well?


title: org-mode How to link to an rmail message

text: I want to link to an rmail message in an org file. I know I use rmail:folder#, but how do I find the folder name and the id # number? There's plenty of information on the Internet telling me that org-mode supports linking to rmail, but I've not found any _real_ examples of how to do it.


title: How to merge patches

text: Sometimes I need to merge two patches. I can apply them but often it is not convenient (coping, temporary files etc.). Is there a tool to merge patches (assuming they are not conflicting)?


title: file transfer with SCP to Virtual Machine

text: I am trying to transfer files over to my virtual machine I tried the command `scp files user@xxx.xx.xx.xxx:/home/user/directory` I am later asked to enter the password for `user@xxx.xx.xx.xxx` When I enter the password the output is: `scp: /home/user/directory/filename: Permission denied` I thought perhaps I don't have the correct permissions or rights to the files? So I checked rights for each file and it is `-rwxr-xr-x` Not really sure what I need to do to correctly SCP my files over to my virtual machine


title: Is Port 13330 a standard-port?

text: I saw some programs using the port 13330. What is the meaning of this port? Is this port used by a special program?


title: Calibre in Debian 7.3 KDE doesn't have cover browser?

text: Can someone please help me to activate the **cover browser** of Calibre in Debian 7.3 KDE desktop (32 bit architecture)? I've tried toggling the arrow button in the bottom-right corner but unlike the other buttons, it yields nothing, not even a tool-tip when I hover over it. I've tried also clicking `Preferences > Look&feel > Cover Browser tab` but there's nothing usable there. Please see the pictures below. ![missing cover browser](http://i.stack.imgur.com/IhNFQ.png) ![enter image description here](http://i.stack.imgur.com/Wu6IQ.png) **NOTE:** I'm using version 0.8.51.


title: Why is this network connection so slow?

text: I am having some problems with network performance speed on a Linux server running Ubuntu 9.10. Transfer speeds on all types of traffic are around 1.5MB/s on a 1000mbit/s wired ethernet connection. This server has achieved 55MB/s over samba in the recent past. I have not changed the hardware or network set-up. I do run updates on a regular basis and the latest and greatest from Ubuntu's repositories is running on this machine. ## Hardware set-up Desktop Windows PC - 1000 switch - 1000 switch - Linux server All switches are netgear, and they all show a green light for their connections which means the connection is 1000mbit/s. The lights are yellow when the connection is only 100mbit/s. Other diagnostic information:               root@server:~# ifconfig     eth0      Link encap:Ethernet  HWaddr 00:0c:6e:3e:ae:36               inet addr:192.168.1.30  Bcast:192.168.1.255  Mask:255.255.255.0               inet6 addr: fe80::20c:6eff:fe3e:ae36/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:28678 errors:0 dropped:0 overruns:0 frame:0               TX packets:73531 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000               RX bytes:2109780 (2.1 MB)  TX bytes:111039729 (111.0 MB)               Interrupt:22          lo        Link encap:Local Loopback               inet addr:127.0.0.1  Mask:255.0.0.0               inet6 addr: ::1/128 Scope:Host               UP LOOPBACK RUNNING  MTU:16436  Metric:1               RX packets:113 errors:0 dropped:0 overruns:0 frame:0               TX packets:113 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0               RX bytes:23469 (23.4 KB)  TX bytes:23469 (23.4 KB)               root@server:~# ethtool eth0     Settings for eth0:             Supported ports: [ TP ]             Supported link modes:   10baseT/Half 10baseT/Full                                     100baseT/Half 100baseT/Full                                     1000baseT/Full             Supports auto-negotiation: Yes             Advertised link modes:  10baseT/Half 10baseT/Full                                     100baseT/Half 100baseT/Full                                     1000baseT/Full             Advertised auto-negotiation: Yes             Speed: 1000Mb/s             Duplex: Full             Port: Twisted Pair             PHYAD: 0             Transceiver: internal             Auto-negotiation: on             Supports Wake-on: pg             Wake-on: g             Current message level: 0x00000037 (55)             Link detected: yes          root@server:~# mii-tool     eth0: negotiated 1000baseT-FD flow-control, link ok      The server thinks its got a 1000mbit/s connection. I have tested the speed of transfer by copying files using Samba. I have also used netcat (nc target 10000 < aBigFile) on the server to transfer to Windows (nc -l -p 10000) and saw similar levels of poor performance. I tested the speed of the hard drives using hdparm and got:               root@server:~# hdparm -tT /dev/md0     /dev/md0:      Timing cached reads:   1436 MB in  2.00 seconds = 718.01 MB/sec      Timing buffered disk reads:  444 MB in  3.02 seconds = 147.24 MB/sec      Reading the same file for transfer using DD produced the following:               paul@server:/home/share/Series/New$ dd if=aBigFile of=/dev/null     3200369+1 records in     3200369+1 records out     1638589012 bytes (1.6 GB) copied, 12.7091 s, 129 MB/s      I am stumped. What could be causing the poor network performance which is 2 orders of magnitude lower than what the network is capable of?


title: How to start process as a specific user on boot

text: _I am using Arch Linux._ I need to start my web application automatically should the server should restart. I need to run it as user 'www'. How can I do this?


title: how do I use rtorrent with a socks5 proxy?

text: How do I get rtorrent to use a socks5 proxy? I've tried to get socks5 to work with rtorrent, but it doesn't seem to have any impact. Setup the socks5 proxy on port 9800:               ssh -ND 9800 user@otherhost      in .rtorrent.rc               http_proxy=127.0.0.7:9800     proxy_address=127.0.0.7:9800      It cannot download any data from tracker.               Tracker: [Server returned nothing (no headers, no data)]      And my ip does not appear to use the IP from "otherhost" when I check with http://www.checkmytorrentip.com/ I also tried using tsocks rtorrent               server = 127.0.0.1     eserver_type = 5     server_port = 9800      This shows my IP as coming from 'otherhost', but after a few seconds rtorrent freezes up. I am using rTorrent 0.9.2/0.13.2


title: Changing permissions for files in linux

text: I have started using Linux recently for development of a project and currently facing some issues with file permissions in the directories. I have some libraries `.so` files that I need to access from the folder `/usr/local/lib`. When I check the files manually in the folder, the files show that I am not the owner and `root` is the owner. However, in a different directory, where I subsequently tried installing the same libraries at `/home/jade/cb/lib/`, if I check the libraries, I do have the permission. My C++ program has been stuck since it cannot access the libraries from these. I tried changing the permissions using `sudo chmod 777 -R *.*` while inside `usr/local/lib` but the permissions or anything don't change. How do I get rid of this problem? (Distro: Ubuntu 12.10)


title: Control Dropbox upload rate on the command line

text: I'm using Dropbox without the GUI in Linux. I would like to limit the upload rate, sometimes large files eats my internet bandwidth. Anyone knows how I do that?


title: Difference between vmlinuz-2.6.32-34-generic and vmlinuz-2.6.32-34-generic-pae

text: Can someone please tell me the difference between these two vmlinuz images ?


title: kdb5_ldap_util fails with cryptic error

text: Supposedly, in order to set up Kerberos, I need to run `kdb5_ldap_util`, though I'm not sure why. However, it fails with:               # kdb5_ldap_util -D cn=admin,dc=example,dc=com create -subtrees dc=example,dc=com -r EXAMPLE.COM -s -H ldapi:///     Password for "cn=admin,dc=example,dc=com":     Initializing database for realm 'EXAMPLE.COM'     You will be prompted for the database Master Password.     It is important that you NOT FORGET this password.     Enter KDC database master key:     Re-enter KDC database master key to verify:     kdb5_ldap_util: Invalid syntax while creating realm 'EXAMPLE.COM'      I have no idea what that error means. Googling about has lead me to believe that it's a cryptic way of telling that the "kerberos schema" hasn't been "loaded" into the LDAP server yet. Checking `/etc/ldap/schema`, there isn't a `kerberos.schema` or anything equally obvious. There is, as some resources point out, a `/usr/share/doc/krb5-kdc-ldap/kerberos.schema.gz` and `/usr/share/doc/krb5-kdc-ldap/kerberos.ldif.gz`. (Why are these gzipped, other than to be obtuse to use?) `gunzip`ing those two files into `/etc/ldap/schema` and running the following:               # ldapadd -Y EXTERNAL -H ldapi:/// -f kerberos.ldif     SASL/EXTERNAL authentication started     SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth     SASL SSF: 0     ldapadd: invalid format (line 5) entry: "cn=schema"      Line 5 is a comment. This is the same command that I had to run on all the other LDIF files in that directory in order to get OpenLDAP working in the first place. Why doesn't this schema work? The error tells me nothing about what's going wrong, but this seems to be a close match (but implies that the Kerberos schema is broken out of the box): do I need to edit it as suggested there? Some other resources seem to also suggest the LDIF needs a `cn:` entry for each part: is that needed as well/


title: Is there an alternative to OpenLDAP / Kerberos?

text: Are there ways to do centralized secure network-based authentication & authorization and user management that aren't OpenLDAP and Kerberos? Frankly, Kerberos is a nightmare to configure, leaving cryptic errors that require digging through strace to debug. OpenLDAP isn't exactly great either, and most “tutorials” consist of cryptic, unexplained commands that you should run, and a lot of the tutorial contain incorrect advice about editing the non- existent “slapd.conf” file. I've (mostly) gotten the hang of OpenLDAP, so it isn't too much of a problem to keep, but I've been thoroughly unsuccessful in configuring Kerberos. Is there something a bit more super-user friendly out there?


title: Unable to see Fedora 20, when triple booting it with Debian 7, and openSuSe 13.1

text: I just don't understand why I cannot see my Fedora 20 having it planned to triple boot it with Debian 7 and openSuSe 13.1. Initially I partitioned my system to: /dev/sda1 for openSuSe 13.1 /dev/sda2 for Debian 7 /dev/sda3 for Fedora 20 /dev/sda4 for swap The sequence of my installations are as follows:   1. Install Debian 7.   2. Install Fedora 20. I just checked if this works, and it worked out OK so I continue installing Fedora 20 (step 3). But, when I boot, the bootloader cannot find "Fedora 20". It just displayed Debian and openSuSe as choices.


title: Python bindings for libtorrent-rasterbar are not working on debian

text: I'm running Debian 6.0.6 I've downloaded latest version of libtorrent-rasterbar from here: http://code.google.com/p/libtorrent/downloads/detail?name=libtorrent- rasterbar-0.16.6.tar.gz&can=2 and installed it:               ./configure --enable-python-binding     make     make install     cd bindings/python     python setup.py build     python setup.py install      now I want to test whether the library works:               >>> import libtorrent     Traceback (most recent call last):       File "<stdin>", line 1, in <module>     ImportError: libtorrent-rasterbar.so.7: cannot open shared object file: No such file or directory      The packaged version of libtorrent from the distributive's repository had some funny behaviour (complaining on boost dependences), so I've decided to upgrade. The same situation is on both of my debian boxes, yet ubuntu box is fine.


title: Are there awk versions that provide syntax for computing aggregations?

text: From time to time I find myself writing awk scripts that compute some simple statistics. For example computing a histogram, the average of a value, the standard deviation or even the variance ... Doing that again and again with helper arrays/variables and for-loops in the `END` clause etc. feels a little bit tedious and error-prone. In Dtrace there is a quite awesome syntax for such tasks which they call aggregations. It is similar to the concept/API of Accumulators in the Boost C++ library. Thus my question: are there awk variants which provide similar concepts/syntax that allow for convenient and iterative computation of such statistics? An imaginative example of such syntax:               $ someawk '{ @time[$1] = avg($2) }' measurements.log     prog1    150     prog2    200     ....      (where the 1st column contains the program name, the 2nd the runtime of one measurement, `measurements.log` contains multiple measurements for each program and the aggregate function `avg` computes the average)


title: How to use comma as tmux's prefix

text: Under screen, I used: `bindkey , command` to use the comma as the prefix instead of `Ctrl``a`. If I do `set -g prefix` in tmux, it complains saying: `unkown key` At first, I believed that tmux did not support single keys as prefix, However, I managed to use `\` as a prefix successfully! How can I do so for the `,`? [Edit] Apparently this works under tmux 1.6, haven't tried it though. Thx jasonwryan for the hint :)


title: Linux crashing my DD-WRT router

text: I'll start off that I'm new to Linux. A couple months ago I tried installing Ubuntu 11.10 on a laptop (HP). The install went great, however when setting up my wireless network, it caused my router (Buffalo) to crash. I could not login to the routers http interface even on a wired PC. I removed power from the router and shutdown the laptop. Powered the router back up. Everything worked on the network again. I powered the laptop again and the router crashed again. The router had been working fine for months and has worked great since trying. It has the following firmware: DD-WRT v24SP2-EU-US (08/19/10) std. I tried to install Mint 12 last night with the exact same issue. I turned off wireless on the laptop and plugged it into the router. I was able to update so Mint tells me I have all updates applied. I Googled a bit and found people stating to move your wireless router to bg only. I tried that with a little luck. I was able to browse the internet for ~10 minutes on wireless before the router crashed. Again replugging the router fixed the problem and without powering up the laptop the router has been solid today.


title: How does linux work with symbolic links?

text: I mean what's going on when some process wants to read a symlink? What's going on when something changes a symlink during a read or even write process? For example: I have 2 huge, similar 100G files `/mnt/1` and `/mnt/2`. `/mnt/1` is available via the symlink `/home/user/file`. Some program `A` starts reading `/home/user/file`. And after a while something changes the link from `/mnt/1` to `/mnt/2`, but `A` is still reading the file. Does the program cache the absolute path? Will it fail and error, because the symlink was changed or will it work fine, like nothing happened? Will it differ in case `/home/user/file` is linked to a block device (for example 2 replicated iscsi disks)?


title: XDG user directories

text: After installing Linux Mint Debian edition my .config/user-dirs.dirs looks like this:               # This file is written by xdg-user-dirs-update     # If you want to change or add directories, just edit the line you're     # interested in. All local changes will be retained on the next run     # Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped     # homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an     # absolute path. No other format is supported.     #      XDG_DESKTOP_DIR="$HOME/Desktop"     XDG_DOWNLOAD_DIR="$HOME/Downloads"     XDG_TEMPLATES_DIR="$HOME/Templates"     XDG_PUBLICSHARE_DIR="$HOME/Public"     XDG_DOCUMENTS_DIR="$HOME/Documents"     XDG_MUSIC_DIR="$HOME/Music"     XDG_PICTURES_DIR="$HOME/Pictures"     XDG_VIDEOS_DIR="$HOME/Videos"      The idea is what applications should be able to locate a suitable directory for different kind of contents while still making it possible to have the directory names chosen by the user (who might for example want it localized). For instance Gnome and XFCE use `$(xdg-user-dir DESKTOP)` for the Desktop files if it is defined. While I think these are fairly obvious:   * DESKTOP   * DOWNLOAD   * DOCUMENTS   * MUSIC   * PICTURES   * VIDEOS I would like an example of what these should contain or which programs use them:   * TEMPLATES   * PUBLICSHARE


title: Configure applications to ask for a user:pass behind a proxy

text: Here's the deal: I'm trying to set up a SQL server with Debian Linux, I managed to install Debian - but I can't get `apt-get` to work, since I'm behind a proxy. I already managed to setup Iceweasel to work with the proxy, but that's it. Also, I would like it to work like it did under Windows 7: every time a user tries to access the web, it should ask for a `user:pass` to authenticate the proxy. I tried:               export HTTP_PROXY='http://f472:9874@cache.webad.com:80'      and then I tried               vi /etc/apt/apt.conf      and added the line               acquire::http::proxy "http://f472:9874@cache.webad.com:80";      It didn't work in both cases Any suggestions? EDIT: It did work on the second case after I added the semicolon in the end, but still, my corporate user name and password are plaintext in the config file.


title: Continue shell commands once connected to SSH

text: Not sure if the question I'm asking is correct but basically I wanted to automate this process                 scp ~/.ssh/id_rsa.pub username@example.com:~/       ssh username@example.com       mkdir .ssh       cat id_rsa.pub >> .ssh/authorized_keys       rm id_rsa.pub       chmod go-w ~       chmod 700 ~/.ssh       chmod 600 ~/.ssh/authorized_keys      So I thought I could create a shell script and put it in my .bash_profile like this:function               setup_ssh () {       scp ~/.ssh/id_rsa.pub $1:~/       ssh $1       #the following is happens when connected to the server using ssh       mkdir .ssh       cat id_rsa.pub >> .ssh/authorized_keys       rm id_rsa.pub       chmod go-w ~       chmod 700 ~/.ssh       chmod 600 ~/.ssh/authorized_keys     }      But of course this doesn't work because it doesn't continue the commands once connected to the server. Is there any way to continue the commands once it's connected to the server via ssh?


title: How to fix this error? make: *** [obj/local/armeabi/libgstaudioflinger.so] Error 1

text: I am trying to install this following framework from my Linux Fedora box to Android using there SDK/NDK. But after following all instruction its getting still failed to get build. Any idea how to fix it? 1) Egg               $ cd /var/tmp     $ git clone git://git.collabora.co.uk/git/user/reynaldo/gstreamer_ndk_bundle     $ cd gstreamer_ndk_bundle     $ git submodule update --init      2) Dropped               $ cd /var/tmp     $ wget http://dl.google.com/android/ndk/android-ndk-r7-linux-x86.tar.bz2     $ tar xvfj android-ndk-r7-linux-x86.tar.bz2     $ wget http://dl.google.com/android/android-sdk_r15-linux.tgz     $ tar xvfz android-sdk_r15-linux.tgz;     $ export PATH=$PATH:/var/tmp/android-ndk-r7     $ export PATH=$PATH:/var/tmp/android-sdk-linux/tools          #############################     # Try 1: failed      #############################     $ ./setup.sh     Updated project.properties     Updated local.properties     Updated file ./build.xml     Updated file ./proguard.cfg     android_headers     faad     glib     gnonlin     gst-android     gst-editing-services     gst-openmax     gst-plugins-bad     gst-plugins-base     gst-plugins-good     gst-plugins-ugly     gstreamer     jni     libid3tag     libmad     ogg     res     src     x264     /var/tmp/android-ndk-r7/prebuilt/linux-x86/bin/awk: /var/tmp/android-ndk-r7/prebuilt/linux-x86/bin/awk: cannot execute binary file     Android NDK: Host 'awk' tool is outdated. Please define HOST_AWK to point to Gawk or Nawk !         /var/tmp/android-ndk-r7/build/core/init.mk:258: *** Android NDK: Aborting.    .  Stop.     # use this to fix this error     $ mv /var/tmp/android-ndk-r7/prebuilt/linux-x69/bin/awk awk_          #############################     # Try 2: failed      #############################     $ ./setup.sh          > Android.mk     /bin/sh: line 1: androgenizer: command not found     make[1]: *** [Android.mk] Error 127     make[1]: Leaving directory `/home/sun/Downloads/gstreamer_ndk_bundle/faad/libfaad'     make: *** [libfaad-configure] Error 2          # use following to fix this above error     $ git clone git://git.collabora.co.uk/git/user/derek/androgenizer.git     $ make     $ export PATH=$PATH:/var/tmp/gstreamer_ndk_bundle/androgenizer          #############################     # Try 3: failed      #############################     $ ./setup.sh     /var/tmp/android-ndk-r7/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/ld: cannot find -lmedia     collect2: ld returned 1 exit status     make: *** [obj/local/armeabi/libgstaudioflinger.so] Error 1     # How to fix this error?      3) Born               @TODO     $ ./install_bundle.sh


title: In vim, how to map "command-right" and "command-left" to beginning of line and end of line on mac?

text: I'm trying to get it to be like default text editing in Mac. I tried `map! <D-Left> 0` and `map! <D-Right> $` in ~/.vimrc, but of course it didn't work. How can i do this?


title: Strange behaviour in recursive copy

text: Could someone explain why this happens? Most specifically: Why is one 1's content copied to f? And why is f copied to g?               $ tree       .          0 directories, 0 files          $ mkdir 1     $ mkdir 2     $ touch 1/a     $ touch 1/b     $ mkdir 1/c     $ touch 1/c/x     $ tree     .     ├── 1     │   ├── a     │   ├── b     │   └── c     │       └── x     └── 2          3 directories, 3 files          $ cp -r 1/* 2/*     zsh: no matches found: 2/*          $ cp -r 1/* 2/*     $ mkdir 2/f     $ mkdir 2/g     $ cp -r 1/* 2/*     $ tree     .     ├── 1     │   ├── a     │   ├── b     │   └── c     │       └── x     └── 2         ├── f         └── g             ├── a             ├── b             ├── c             │   └── x             └── f          7 directories, 6 files


title: Wildmenu "closes" when opening a single item directory

text: TLDR; I want to open `wildmenu` with `<Tab>` and keep it open until I open a file. * * * Suppose that I have the following directory structure:               ./file1     ./file2     ./dir1/file3     ./dir1/dir2/file4     ./dir1/dir2/file5     ./dir1/dir3/dir4/file6      I normally use `wildmenu` and the arrow keys to navigate through the directories. If I have `file1` open and want to open `file5` I can navigate through the directories like this:               :tabe dir1/ <Tab>     :tabe dir1/dir2 dir3 file3 <Down>     :tabe dir1/dir2/file4 file5 <Right>     :tabe dir1/dir2/file5 file4 <Enter>      But when I try to do the same to open `file6` the `wildmenu` will close on `dir4` because this is the only file inside `dir3`, I want to keep the `wildmenu` open even if there is only one choice for a given directory so that I can keep navigating with just the arrow keys (without doing `<Tab>` in every directory that has only one file inside) Edit: my .vimrc


title: Move /usr to SSD

text: I have an SSD and regular HDD drive in my laptop. The SSD drive is not used at all; it is not even being mounted. I am using Arch Linux. I'd like to start using the SSD, and from what I have read I believe mounting `/usr` there would be a good idea. My question is: with an installed system, how do I go about setting up the `/usr` partition on the SSD and moving the current files to this new location?


title: Compiling and running Snapper for Ubuntu

text: I am trying to get snapper working in my Mint 14. (The version from launchpad is old and not compatible with Ubuntu 12.10. The OpenSuSe's build project failed to build it, too). So I try my luck with manual compile. Following the Snapper Development page, I've downloaded repo and installed the dependencies. After `make` finally I've got this error:               (...)     make[2]: Entering directory `/home/adam/tmp/snapper/server'       CXXLD  snapperd     snapperd.cc:125: error: undefined reference to 'boost::thread::interrupt()'     /usr/include/boost/thread/pthread/shared_mutex.hpp:129: error: undefined reference to 'boost::this_thread::disable_interruption::disable_interruption()'     /usr/include/boost/thread/pthread/shared_mutex.hpp:137: error: undefined reference to 'boost::this_thread::disable_interruption::~disable_interruption()'      (...) I've noticed another quesion that suggests adding `-lboost_thread-mt` to linker invocation. Simple enough... and compilation finished successfully. But after that and `sudo make install` whatever way I try invoke the snapper I get error `Failure (org.freedesktop.DBus.Error.NoReply)`. And I'm stuck here. Can anyone help me?


title: aptitude search output

text: Can someone please explain this situation to me? I do an aptitude search and I get the following output:               i package  ...     p package:i386 ...      When I start up synaptic I see package but not package:i386 Also can someone clarify what the p and I stand for?


title: Can not mount drive after installing windows vista

text: I have searched for weeks now and have not found an answer to my question. Hopefully you guys can give me a push in the right direction :) Ok, here is what happened:   * I have linux mint on a 1.5 TB hard drive (with all of my media on it), this is the 'every day' computer I use   * My brother is running linux and also wanted to run vista on his computer.   * I had a spare 500 GB hard drive I was going to use to put vista on and then just have two drives run inside his computer.   * I am a college student and had the drive with me at school so I put the drive in my computer, removed the linux mint 1.5 TB hdd and went along with the vista install on the 500 GB hdd. (I did this so all I had to do was pop it in his computer when I came home).   * Install went without a hitch (other than its windows) and I removed the 500 GB hdd and set it aside for my next trip home.   * I then reconnected the 1.5 TB hdd and the issues started to pop up (here they are in the order I've been getting them):   * When I start the computer like normal I get a message saying something about an Ubuntu GRUB version. And then it has a GRUB prompt.   * ^^Because of this I found that I probably needed to reinstall GRUB. So I booted up a live mint disk. I know I need to know where my / partition is but I wanted to double check. So I go to click on the volume on the desktop and it disappears. This is where I've been stuck for a few weeks now. Any and all help is appreciated! From lgeorget's request: I get to the part where I just mounted it, but my drive will not open for me to get files from it. Am I doing something wrong in the process?


title: Calling a script on each line of a file

text: I have a bash script that takes 3 arguments:               $ do_something foo bar baz      and a file with several lines, each with different 3 args. I want to execute the script as a cronjob, and each time it's called it should call `do_something` on a line in that file, passing it the three arguments on that line. Next time it's called it should run the next line, so it will take `n` calls to `do_something` for it to process `n` lines. If it processed the last line of the file, it should start over at the beginning next time. My solution is to remove the processed line from the head of the file each time and append it to tail, but it seems me too cumbersome having all these disk writes just to remember a position. I could have another file around with a pointer to last line, but three files for a simple task is not that smart. Is there a better solution?


title: Windows 7 to Debian Linux: install without CD/DVD or USB drive or net during install

text: Installed : windows 7 home premium. Now want debian linux. Tried a couple of things (see question below). Got installer menu using win32-loader.exe of debian from the goodbye-ms site. But I have a fibre optic internet that needs a login so when the installer came up could set keyboard, timezone, detect network automatically ... but stuck when it wants to get packages. Using bit torrent i have the 3 debian DVD iso files debian-7.0.0-amd64-DVD-1.iso ... at /d/ (in my windows c:) renamed them to d1.iso, d2.iso ... I also have them extracted at /d/d2/ (in my windows c:) /win32-loader/ is the folder made by win32-loader.exe It has base URL to http://cdn.debian.net/debian/dists/stable/ is there a way to change this to /d/d2 where i extracted everything (i can download more files and put them there if needed) Or can i edit the grub setting so it loads from local? This was my trial 2 edited C:\win32-loader\grub.cfg Tried loopback but guess did not do it right as i just get a grub prompt.               loopback loop /d/d2     linux (loop) /boot/vmlinuz     initrd /boot/initrd.gz      Note: I know i can get ubunto installer as suggested and upvoted on Windows 7 to Linux: install without CD/DVD or USB drive but i would like to get debian and dual boot to windows or seperately to debian. How do I find out if its grub or grub 2? I also tried to put grub interdependently using winGrub but need better instructions for that for windows 7 as it did not work (edited windows using bcdedit but when i try to boot using that get an error), results of that too are on first question


title: Extremely long time for an ext4 fsck

text: The problem that I am having is the extremely long time that `fsck` is taking. I have thoroughly made searches on Google, but I could not find anything that would resolve the problem. The command that I am running is `sudo fsck.ext4 -vc /dev/sdb1`. I have a 200GB SATA hard drive which has some bad sectors. It is SMART- compatible, however, SMART somehow is not capable of remapping the sectors. The command that I am running is going to check for bad sectors and add them to the bad block list. However, here is the output so far: `e2fsck 1.42 (29-Nov-2011)   Checking for bad blocks (read-only test): 1.95% done, 11:53:24 elapsed. (1657/0/0 errors)` At this rate it will probably take around 1 month. Now don't tell me "Your hard drive is too old and it's gonna fail soon blah blah blah". I just want to add the bad blocks to the badblocks list. The hard drive is not developing any new bad sectors. My machine has an i3 quad-core with 8GB of RAM. My CPU usage is under 10%, and about 1.5GB of the RAM is used. Nothing is paged. The disk which I am checking has a newly created ext4 filesystem with nothing on it. I just don't understand why it will take 1 month to fsck a disk and list bad blocks. Something is definitely wrong here. Any advice?


title: Ninja privilege escalation problem

text: I have a problem with ninja. I think I have configured it correctly. However, when I type in `su test` to login as test and then run `sudo -i` the log shows that test is in the ninja group when in reality it is not. Also, it does not show up as an unauthorized process. What might I be doing wrong to not trigger an unauthorized process alert to the log? The ninja page is here. The guide I used is here. The log I got is: `[Sun Jun 9 08:08:41 2013] NEW ROOT PROCESS: sudo[6332] ppid=6244 uid=0 gid=1001 [Sun Jun 9 08:08:41 2013] - ppid uid=1001(test) gid=1001 ppid=6232 [Sun Jun 9 08:08:41 2013] + test is in magic group, all OK!` Test is not in the "magic" group.


title: Bonding configuration on a blade server with Oracle 6.3

text: I'm trying to configure a mode 6 bonding on a blade server.   * Blade Enclosure: HP c7000   * Blade Server: ProLiant BL460c G1 Redundancy part of the bond is working, I can pull out any one of the cables and the connection doesn't break.But for some strange reason the load balancing is not.The blade center has 2 network modules installed. Each network cable is connected to a different network module.I have another server (not blade) connected to the same switch and the bond is working great there, so it's not a switch issue. Trying to figure it out for two days now, any help will be appreciated.               cat /proc/net/bonding/bond0     Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)          Bonding Mode: adaptive load balancing     Primary Slave: None     Currently Active Slave: eth0     MII Status: up     MII Polling Interval (ms): 100     Up Delay (ms): 0     Down Delay (ms): 0          Slave Interface: eth0     MII Status: up     Speed: 1000 Mbps     Duplex: full     Link Failure Count: 0     Permanent HW addr: 00:21:5a:ce:39:b4     Slave queue ID: 0          Slave Interface: eth1     MII Status: up     Speed: 1000 Mbps     Duplex: full     Link Failure Count: 0     Permanent HW addr: 00:21:5a:ce:39:b2     Slave queue ID: 0


title: What does this key code qualifier mean?

text: I know that in general this means that I have a "bad disk". But I'm after a more specific reason for why I am getting these messages from the kernel:               sd 15:0:0:0: [sda] Attached SCSI disk     sd 15:0:0:0: [sda] Unhandled sense code     sd 15:0:0:0: [sda]  Result: hostbyte=0x10 driverbyte=0x08     sd 15:0:0:0: [sda]  Sense Key : 0x3 [current]      sd 15:0:0:0: [sda]  ASC=0x11 ASCQ=0xc     sd 15:0:0:0: [sda] CDB: cdb[0]=0x28: 28 00 00 00 00 00 00 00 20 00     end_request: critical target error, dev sda, sector 0      I've had a bit of a search and I see that 0x3 sense key means "Medium error" and ASC=0x11 means "Read error". But it is still a mystery as to what the ASCQ=0xc means. The device is a bus powered USB drive which reports its model as "TOSHIBA MQ01ABB200"


title: Join, filling in missing key values

text: I have two files having a primary key value as a first field, and a corresponding value(s) as the remaining fields, and some primary key values are missing in one of them but are present in another, and vice versa:               $ cat jointest1.txt jointest2.txt       a 1       b 2       d 4       e 5              a 10       b 11       c 12       d 13        I'd expect an output that merges those files according to a primary key, either substituting the missing values or not, like:               $ joinmerge  jointest1.txt jointest2.txt        a 1 10       b 2 11       c - 12       d 4 13       e 5 -      Ability to replace missing values with dashes or something is optional. I tried `join`, but it says my files are not properly sorted:               $ join jointest1.txt jointest2.txt        a 1 10       b 2 11       join: file 2 is not in sorted order       d 4 13        What command should I use instead?


title: Starting Udev hangs at boot

text: We have One SuperMicro server and on that we installed RHEL 5.6 64 bit but after installation it hangs at STARTING UDEV . Any ideas what is stopping it to start and proceed. ![Boot](http://i.stack.imgur.com/jVBu9.jpg)


title: Linux Mint CPU cores balancing and high temprature

text: I'm using Linux Mint. My laptop has a Corei5 CPU. When I check the system monitor, it shows that the CPU 1 usage is between 90 to 100% and CPU 2,3,4 are less than 5%. why it doesn't balance processes onto all cores? Because of high CPU 1 usage, the fan always works and the temperature is high... in Windows I had not this problem.


title: Is the Solaris libc based on the GNU libc?

text: On Solaris： ### basename.c               #include <stdio.h>     #include <libgen.h>          int main(int argc, char* argv[])     {         int len = strlen(argv[0]);         char *bsname = basename(argv[0]);         printf("%s\n", bsname);         printf("%d\n", len);         return 0;     }                    cc basename.c     ldd a.out      ### output：               libc.so.1 => /lib/libc.so.1     libm.so.1     ......      On Linux： ### basename.c               #include <stdio.h>     #include <libgen.h>          int main(int argc, char* argv[])     {         int len = strlen(argv[0]);         char *bsname = basename(argv[0]);         printf("%s\n", bsname);         printf("%d\n", len);         return 0;     }                    gcc basename.c     ldd a.out      ### output：               libc.so.6 => /lib/libc.so.6      ......      Is Solaris libc is based on GNU libc? Is `libc.so.1` on Solaris the same as `libc.so.6` on Linux?


title: Why does a default Linux installation run more processes than a default OpenBSD installation?

text: If I `ps -aux` on Ubuntu (or any GNU/Linux distribution) without GUI I see ~100 processes running. If I `ps -aux` on OpenBSD without GUI, then I get ~10 processes. What is the explanation/reason for this? Are the *BSD systems much "clearer" (code) **or** do they just put everything in the kernel?


title: determine user-modified files

text: I plan to reinstall my operating system since I messed up some stuff. Access to files and folders is painfully slow sometimes, even if they contain just a few files. But of course, I don't want to do _everything_ again. I remember adding a few aliases for `ssh` to make my daily work more convenient, I changed some syntax-highlighting files for `gedit` and probably a lot more than I currently remember. Is there a way to easily see which **files** were **modified by a specific user**? Alternatively, is there a way to find files, not found in a fresh installation? Backing up the stuff in the home directory is easy, but I don't want to search through every single directory just to remember "Oh, I put something there as well".


title: SED command and filenames with space

text: I was hacked, for my php files was infected. **Example:** http://www.nwww.ma.mk/oscommerce/configweb/apexfash-wp-blog.txt **Bad Code:**               <?php $zend_framework="\x63\162\x65\141\x74\145\x5f\146\x75\156\x63\164\x69\157\x6e"; @error_reporting(0); $zend_framework("", "\x7d\73\x40\145\x76\141\x6c\50\x40\142\x61\163\x65\66\x34\137\x64\145\x63\157\x64\145\x28\42\x4a\107\x56\[encoded data, 15773 characters]\x4e\103\x6e\60\x3d\42\x29\51\x3b\57\x2f"); ?>      **My Bash Code:**               find /home/USER_NAME/domains/*/public_html/* -name '*.php' | xargs sed -i 's#<?php $zend_framework=.* ?>##g'      When I scan filenames with space ive got error: no such file or directory find. In example, filenames: "index progress.php", "index info.php" and "index block.php". **Output:**               sed: cannot open index: No such file or directory     sed: cannot open progress.php: No such file or directory     sed: cannot open index: No such file or directory     sed: cannot open info.php: No such file or directory     sed: cannot open index: No such file or directory     sed: cannot open block.php: No such file or directory      Can anyone help with this problem?


title: Can anyone explain the output of mount?

text: I'm getting the following output when the `mount` command is executed.               [root@]# mount     /dev/sda2 on / type ext4 (rw)     proc on /proc type proc (rw)     sysfs on /sys type sysfs (rw)     devpts on /dev/pts type devpts (rw,gid=5,mode=620)     tmpfs on /dev/shm type tmpfs (rw)     /dev/sda1 on /boot type ext4 (rw)     /dev/sda3 on /home type ext4 (rw)     none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)     sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)     gvfs-fuse-daemon on /root/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev)      I'm not able to understand the output of this command. Can anyone give the explanation for this output?


title: Why are there empty lines in the output of my command?: find ~/x/y/ | shuf > ~/Desktop/z.txt

text: As it turns out the reason for this problem was one filename with several newlines. (No idea how that happened.)               find ~/x/y/ | shuf > ~/Desktop/z.txt      This command works pretty much as expected except some empty lines appear in the "z.txt" file. This is inconvenient because the next step is to pick the uppermost file and open it, an empty line would obviously be useless. I'm curious why this happens and if there is some "standard" solution to the problem (some option?), or, alternatively, some robust and simple solution (an extra command to delete empty lines?).


title: Adding a line in vim adds it at the line after the cursor, I would like to insert

text: I have this keybinding in `.vimrc`:               map + :put=''<cr>     map - dd      I find it really useful for fast layout and source file cleaning with `+` and `-`. But using `:put=""<cr>` adds a line after the current cursor line, whereas `dd` removes a line at the current cursor. I'd rather have my `+` keybinding insert a line rather than add it after. What command should I try ?


title: better use of find - rvm.sh

text: I am trying to find rvm.sh as I am receiving the infamous rvm is not a function error. The file in most linuxes is supposed to be at               /etc/profile.d/rvm.sh      However on opensuse it is not there so I am attempting to use find. Here is how I am using it               [sayth ~]$  sudo find / -name 'rvm.sh' 2>/dev/null     root's password:      Now the issue is that half an hour has now passed and I am still awaiting a return result. Is there anyway to do this better?


title: Sort lines by unicode value

text: I'm trying to sort a text file linewise by their Unicode values. As far as I can tell, this means numerals first, then letters, then CJK-Ideographs. However, `sort` (with `LC_ALL=C`) fails horribly at this task. Here is an excerpt from my list:               [#ゆうかりんちゃんねる]     [チ→ム♂ツナギ]     [ぞめ]     ...     [サディスティックブラウニー]     [ほねとかわとがはなれるおと]     [10th Avenue Cafe]     [2nd Flush]     ...     [Alstroemeria Records & Cradle]     [ALTERNATIVE]     [アルトノイラント - Altneuland]     [Amateras Records]     [セブンスヘブンAmmy's]     [anagram]     [Analyze]     ...     [Z.S.G TRAXXX]     [α music]     [Яiselied]     [一人華飯スペシャル]     [七瀬屋]      It seems like `sort` ignores (at least sometimes) the characters it can't read, because `Altneuland` would indeed be between `Alternative` and `Amateras Records`. Someone suggested using `msort`, but it failed as well (with options `-u c`, `-u d`, and `-u n`, respectively). First, why is it acting so unexpected? Second, how can I fix this? Add:// I'm using Raspbian on a Raspberry Pi (B)


title: Search and replace strings that are not substrings of other strings

text: I have a list of replacements like so:               search_and -> replace     big_boy -> bb     little_boy -> lb     good_dog -> gd     ...      I need to make replacements for the above, but at the same time avoid matching strings that are longer like these:               big_boys     good_little_boy      I tried this:               sed -i -r "s/$(\W){search}(\W)/$\1{replacement}\2/g"      But the above does not work when the string ("good_dog" in this case) occurs at the end of a line like so:               Mary had a 'little_boy', good_little_boy, $big_boy, big_boys and good_dog          Mary had a 'lb', good_little_boy, $bb, big_boys and good_dog      And I doubt the above would work when the string occurs at the start of the line too. Is there a good way to do the search and replacement?


title: PCI header in my laptop looks different from free-electrons' PCI header

text: I'm trying to develope a pci driver but I can not compile it because my pci header is quite different from books and references. My distribution is 3.15.7-1-ARCH. http://lxr.free-electrons.com/source/include/linux/pci.h When the reference's pci.h looks complete, I can not understand why my laptop's header is just below:               /*      *  pci.h      *      *  PCI defines and function prototypes      *  Copyright 1994, Drew Eckhardt      *  Copyright 1997--1999 Martin Mares <mj@ucw.cz>      *      *  For more information, please consult the following manuals (look at      *  http://www.pcisig.com/ for how to get them):      *      *  PCI BIOS Specification      *  PCI Local Bus Specification      *  PCI to PCI Bridge Specification      *  PCI System Design Guide      */          #ifndef LINUX_PCI_H     #define LINUX_PCI_H          #include <linux/pci_regs.h> /* The pci register defines */          /*      * The PCI interface treats multi-function devices as independent      * devices.  The slot/function address of each device is encoded      * in a single byte as follows:      *      *  7:3 = slot      *  2:0 = function      */     #define PCI_DEVFN(slot, func)   ((((slot) & 0x1f) << 3) | ((func) & 0x07))     #define PCI_SLOT(devfn)     (((devfn) >> 3) & 0x1f)     #define PCI_FUNC(devfn)     ((devfn) & 0x07)          /* Ioctls for /proc/bus/pci/X/Y nodes. */     #define PCIIOC_BASE     ('P' << 24 | 'C' << 16 | 'I' << 8)     #define PCIIOC_CONTROLLER   (PCIIOC_BASE | 0x00)    /* Get controller for PCI device. */     #define PCIIOC_MMAP_IS_IO   (PCIIOC_BASE | 0x01)    /* Set mmap state to I/O space. */     #define PCIIOC_MMAP_IS_MEM  (PCIIOC_BASE | 0x02)    /* Set mmap state to MEM space. */     #define PCIIOC_WRITE_COMBINE    (PCIIOC_BASE | 0x03)    /* Enable/disable write-combining. */          #endif /* LINUX_PCI_H */


title: tmux.conf embedding a shell script?

text: In my `tmux.conf`, I need to start a session with the name of the current user in capitals (this is actually a simplification but it will do as an example). Imagine a fictitious line like this one, which is illegal:               new-session -n BananaWindow -s "$(echo "${USER}" | tr '[:lower:]' '[:upper:]')" 'bash -l'      How can I achieve what is intended above?


title: /sys/class/drm directory structure

text: Who is responsible for creating the "/sys/class/drm" directory structure, more specifically the "/sys/class/drm/card0-LVDS-1" directory? I am using kernel-2.6.38 and an nVidia card.


title: ls: Do not show directories that match same pattern in wildcard searches, only files

text: Supposing I have something like the following, a typical business PC situation:               drwxr-xr-x 1 whatever whoever       3 Oct  3 16:40 invoices2009     drwxr-xr-x 1 whatever whoever       4 Oct  3 16:40 invoices2010     drwxr-xr-x 1 whatever whoever       2 Oct  3 16:40 invoices2011     -rwxr-xr-x 1 whatever whoever  440575 Oct  3 16:40 tax2010_1     -rwxr-xr-x 1 whatever whoever  461762 Oct  3 16:40 tax2010_2     -rwxr-xr-x 1 whatever whoever  609123 Oct  3 16:40 tax2010_3      Now let's be lazy and just type:               $ ls -l *2010*      Supposing that there _is_ something in the invoices2010 directory, it won't work as expected. Since the _directory name_ contains the _2010_ year as well, `ls` will also list the files in _invoices2010_ , although I only want to list those in the current directory. Even funnier: imagine the tax2010* files weren't there at all and there were not those three directories as in the example, but 50 of them. Yes I've tried it out: `ls` will not even _indicate_ which files are in which directory, but simply list them top-down, just as if all files resided in the current directory (unless you explicitly specify the `-R` option, certainly I do know that) Plus, I know that I can do this with `find`, too, but is there also any way to accomplish this task with a plain `ls` one-liner (which, obviously, has a far less complicated syntax)?


title: Copying records into another file based on condition

text: I have a file that has multiple records. I have to copy those records that have a code '06' at a specific position, lets say, at position 19 and 20, into a another file. Records don't have any spaces in between. How can I achieve this using a shell script?


title: WMA conversion for playitslowly

text: I need to transcribe some audio files. The original format is .WMA. I've tried using both:               ffmpeg -i some.WMA some.wav      and               pacpl -to wav some.WMA some.wav       as well as exporting with Audacity to mp3. I've updated to the newest ffmpeg. The problem (despite the error message) doesn't seem to be the conversion. Namely,               file some.wav       shows               some.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, stereo 44100 Hz      and I still get the same resulting error message when trying to play some.wav (.mp3) with playitslowly:               ** (app.py:31502): WARNING **: cannot set NULL uri     ** Message: don't know how to handle audio/x-wma, wmaversion=(int)2, bitrate=(int)128016, depth=(int)16, rate=(int)44100, channels=(int)2, block_align=(int)5945, codec_data=(buffer)009000000f0039170000      (How) can I remedy this?


title: Am I in the right direction for a linux os?

text: I compiled the linux kernel by downloading it from kernel.org, put it on my desktop, and opened up terminal. I changed to the linux-3.2.13 folder, typed mr proper.   Then I use "make menuconfig" to configure my .config file. After I am done with that and I save it I type "make" and terminal starts to compile the files. After 3 hours of compiling I was wondering if I did something wrong. My questions are:   1. Did I do something wrong?   2. If not what should I do next?   3. What will the output be (ex. .bin, .elf)?   4. My ultimate goal is to make an OS that I can put on a cd, put on another computer and run ( **not** an Ubuntu OS with a different kernel). Any help would be greatly appreciated! **ALSO** I am using ubuntu in a virtual box on a macbook pro


title: less --quit-if-one-screen without --no-init

text: I'm on a terminal that supports the alternate screen which is used by less, vim, etc. to restore the previous display after exiting. That's a nice feature, but it really breaks the `--quit-if-one-screen` switch of `less` since in that case less switches to the alternate screen, displays its data, figures out there is only one screen, and exits, taking the contents of the alternate screen with it. The commonly suggested workaround is using the `--no-init` switch to avoid using the alternate screen altogether. However, this is somewhat ugly because I _do_ want to use it in case less actually acts as a pager. Therefore I'm looking for a solution to use the alternate screen only if less doesn't terminate automatically. I'll mostly use this as Git's pager, so a wrapper shell script that only runs less in case there is enough output would be fine, too. At least if there's no way to do it without one.


title: Problem with command promp cycling when using colors and trying to put git branches on the command prompt

text: tl;dr: I want my command prompt to be customizable with any color I want and also display the current git branch that I am on. I am aware that there are at least six different post asking an extremely similar question. I have read the ones I have found and I still have my command prompt cycling and having problem even with their suggestion when I insert colors. There are a few details that make my question different and worthwhile I hope. Currently this is what my PS1 variable looks like:               PS1='\[\e[0;31m\u \W $(__git_ps1 "(%s)")\$ \e[m\]'      As the other posts suggested, I inserted the:               \[...\]      I am aware that:               ctrl + L       clears the screen but that does not really address the problem that is, that the command prompt should not be acting weird. One specific problem that it has is that, after I type something and then delete it, the command prompt disappears all together. When I try to look at my command history it also overwrites my command prompt with the history. I believe commands are executed correctly but I am not sure why it behaves weirdly. Also, the __git_ps1 is a function in a shell script for git that I downloaded at: https://raw.github.com/git/git/master/contrib/completion/git-prompt.sh I am not sure if that function is the problem or if its the different type of quotes. I have tried different quotes. I have also tried storing the value of what __git_ps1 returns and then putting it in the string. I think I tried it correctly, but if anyone has something that works, I would be very grateful! Also, I am using bash and a MAC with Mavericks. Just in case this is helpful.


title: How to install packages to a custom location in centos6

text: I have a shared location, let me call it `/tp` I want to install all my libraries and packages in this location just like the default install. Reason to do this is: I want all the users in the network connected to this server to link their programs to this particular location to pick up libraries for the program. Could someone help me do this. The closest I came to was using (for example) `yum install boost --installroot=/tp/`. This did not work as the yum started looking for mirror list in this location. I want the installation to be done in the location `/tp/` Your help will be much appreciated. This is a set up I am doing for a college to promote Linux use in their labs.


title: What is the "eval" command in bash?

text: What can a man do with the "eval" command, why is it usefull? It's some kind of built-in function in bash? There is no "man" page for it..


title: How to convert hex chars to normal chars?

text: I tried, but I'm stuck at "escaping" the "sed's":               sed -i 's/\\x0/NUL/g' $1     sed -i 's/\\x1/SOH/g' $1     sed -i 's/\\x2/STX/g' $1     sed -i 's/\\x3/ETX/g' $1     sed -i 's/\\x4/EOT/g' $1     sed -i 's/\\x5/ENQ/g' $1     sed -i 's/\\x6/ACK/g' $1     sed -i 's/\\x7/BEL/g' $1     sed -i 's/\\x8/BS/g' $1     sed -i 's/\\x9/HT/g' $1     sed -i 's/\\x0A/LF/g' $1     sed -i 's/\\x0B/VT/g' $1     sed -i 's/\\x0C/FF/g' $1     sed -i 's/\\x0D/CR/g' $1     sed -i 's/\\x0E/SO/g' $1     sed -i 's/\\x0F/SI/g' $1     sed -i 's/\\x10/DLE/g' $1     sed -i 's/\\x11/DC1/g' $1     sed -i 's/\\x12/DC2/g' $1     sed -i 's/\\x13/DC3/g' $1     sed -i 's/\\x14/DC4/g' $1     sed -i 's/\\x15/NAK/g' $1     sed -i 's/\\x16/SYN/g' $1     sed -i 's/\\x17/ETB/g' $1     sed -i 's/\\x18/CAN/g' $1     sed -i 's/\\x19/EM/g' $1     sed -i 's/\\x1A/SUB/g' $1     sed -i 's/\\x1B/ESC/g' $1     sed -i 's/\\x1C/FS/g' $1     sed -i 's/\\x1D/GS/g' $1     sed -i 's/\\x1E/RS/g' $1     sed -i 's/\\x1F/US/g' $1     sed -i 's/\\x20//g' $1     sed -i 's/\\x21/!/g' $1     sed -i 's/\\x22/"/g' $1     sed -i 's/\\x23/#/g' $1     sed -i 's/\\x24/$/g' $1     sed -i 's/\\x25/%/g' $1     sed -i 's/\\x26/&/g' $1     sed -i 's/\\x27'/g' $1     sed -i 's/\\x28/(/g' $1     sed -i 's/\\x29/)/g' $1     sed -i 's/\\x2A/*/g' $1     sed -i 's/\\x2B/0/g' $1     sed -i 's/\\x2C/,/g' $1     sed -i 's/\\x2D/0/g' $1     sed -i 's/\\x2E/0/g' $1     sed -i 's/\\x2F///g' $1     sed -i 's/\\x30/0/g' $1     sed -i 's/\\x31/1/g' $1     sed -i 's/\\x32/2/g' $1     sed -i 's/\\x33/3/g' $1     sed -i 's/\\x34/4/g' $1     sed -i 's/\\x35/5/g' $1     sed -i 's/\\x36/6/g' $1     sed -i 's/\\x37/7/g' $1     sed -i 's/\\x38/8/g' $1     sed -i 's/\\x39/9/g' $1     sed -i 's/\\x3A/:/g' $1     sed -i 's/\\x3B/;/g' $1     sed -i 's/\\x3C/</g' $1     sed -i 's/\\x3D/=/g' $1     sed -i 's/\\x3E/>/g' $1     sed -i 's/\\x3F/?/g' $1     sed -i 's/\\x40/@/g' $1     sed -i 's/\\x41/A/g' $1     sed -i 's/\\x42/B/g' $1     sed -i 's/\\x43/C/g' $1     sed -i 's/\\x44/D/g' $1     sed -i 's/\\x45/E/g' $1     sed -i 's/\\x46/F/g' $1     sed -i 's/\\x47/G/g' $1     sed -i 's/\\x48/H/g' $1     sed -i 's/\\x49/I/g' $1     sed -i 's/\\x4A/J/g' $1     sed -i 's/\\x4B/K/g' $1     sed -i 's/\\x4C/L/g' $1     sed -i 's/\\x4D/M/g' $1     sed -i 's/\\x4E/N/g' $1     sed -i 's/\\x4F/O/g' $1     sed -i 's/\\x50/P/g' $1     sed -i 's/\\x51/Q/g' $1     sed -i 's/\\x52/R/g' $1     sed -i 's/\\x53/S/g' $1     sed -i 's/\\x54/T/g' $1     sed -i 's/\\x55/U/g' $1     sed -i 's/\\x56/V/g' $1     sed -i 's/\\x57/W/g' $1     sed -i 's/\\x58/X/g' $1     sed -i 's/\\x59/Y/g' $1     sed -i 's/\\x5A/Z/g' $1     sed -i 's/\\x5B/[/g' $1     sed -i 's/\\x5C/\/g' $1     sed -i 's/\\x5D/]/g' $1     sed -i 's/\\x5E/^/g' $1     sed -i 's/\\x5F/_/g' $1     sed -i 's/\\x60/`/g' $1     sed -i 's/\\x61/a/g' $1     sed -i 's/\\x62/b/g' $1     sed -i 's/\\x63/c/g' $1     sed -i 's/\\x64/d/g' $1     sed -i 's/\\x65/e/g' $1     sed -i 's/\\x66/f/g' $1     sed -i 's/\\x67/g/g' $1     sed -i 's/\\x68/h/g' $1     sed -i 's/\\x69/i/g' $1     sed -i 's/\\x6A/j/g' $1     sed -i 's/\\x6B/k/g' $1     sed -i 's/\\x6C/l/g' $1     sed -i 's/\\x6D/m/g' $1     sed -i 's/\\x6E/n/g' $1     sed -i 's/\\x6F/o/g' $1     sed -i 's/\\x70/p/g' $1     sed -i 's/\\x71/q/g' $1     sed -i 's/\\x72/r/g' $1     sed -i 's/\\x73/s/g' $1     sed -i 's/\\x74/t/g' $1     sed -i 's/\\x75/u/g' $1     sed -i 's/\\x76/v/g' $1     sed -i 's/\\x77/w/g' $1     sed -i 's/\\x78/x/g' $1     sed -i 's/\\x79/y/g' $1     sed -i 's/\\x7A/z/g' $1     sed -i 's/\\x7B/{/g' $1     sed -i 's/\\x7C/|/g' $1     sed -i 's/\\x7D/}/g' $1     sed -i 's/\\x7E/~/g' $1     sed -i 's/\\x7F//g' $1     sed -i 's/\\x80/€/g' $1     sed -i 's/\\x81//g' $1     sed -i 's/\\x82/‚/g' $1     sed -i 's/\\x83/ƒ/g' $1     sed -i 's/\\x84/„/g' $1     sed -i 's/\\x85/…/g' $1     sed -i 's/\\x86/†/g' $1     sed -i 's/\\x87/‡/g' $1     sed -i 's/\\x88/ˆ/g' $1     sed -i 's/\\x89/‰/g' $1     sed -i 's/\\x8A/Š/g' $1     sed -i 's/\\x8B/‹/g' $1     sed -i 's/\\x8C/Œ/g' $1     sed -i 's/\\x8D//g' $1     sed -i 's/\\x8E/Ž/g' $1     sed -i 's/\\x8F//g' $1     sed -i 's/\\x90//g' $1     sed -i 's/\\x91/‘/g' $1     sed -i 's/\\x92/’/g' $1     sed -i 's/\\x93/“/g' $1     sed -i 's/\\x94/”/g' $1     sed -i 's/\\x95/•/g' $1     sed -i 's/\\x96/–/g' $1     sed -i 's/\\x97/—/g' $1     sed -i 's/\\x98/˜/g' $1     sed -i 's/\\x99/™/g' $1     sed -i 's/\\x9A/š/g' $1     sed -i 's/\\x9B/›/g' $1     sed -i 's/\\x9C/œ/g' $1     sed -i 's/\\x9D//g' $1     sed -i 's/\\x9E/ž/g' $1     sed -i 's/\\x9F/Ÿ/g' $1     sed -i 's/\\xA0//g' $1     sed -i 's/\\xA1/¡/g' $1     sed -i 's/\\xA2/¢/g' $1     sed -i 's/\\xA3/£/g' $1     sed -i 's/\\xA4/¤/g' $1     sed -i 's/\\xA5/¥/g' $1     sed -i 's/\\xA6/¦/g' $1     sed -i 's/\\xA7/§/g' $1     sed -i 's/\\xA8/¨/g' $1     sed -i 's/\\xA9/©/g' $1     sed -i 's/\\xAA/ª/g' $1     sed -i 's/\\xAB/«/g' $1     sed -i 's/\\xAC/¬/g' $1     sed -i 's/\\xAD//g' $1     sed -i 's/\\xAE/®/g' $1     sed -i 's/\\xAF/¯/g' $1     sed -i 's/\\xB0/°/g' $1     sed -i 's/\\xB1/±/g' $1     sed -i 's/\\xB2/²/g' $1     sed -i 's/\\xB3/³/g' $1     sed -i 's/\\xB4/´/g' $1     sed -i 's/\\xB5/µ/g' $1     sed -i 's/\\xB6/¶/g' $1     sed -i 's/\\xB7/·/g' $1     sed -i 's/\\xB8/¸/g' $1     sed -i 's/\\xB9/¹/g' $1     sed -i 's/\\xBA/º/g' $1     sed -i 's/\\xBB/»/g' $1     sed -i 's/\\xBC/¼/g' $1     sed -i 's/\\xBD/½/g' $1     sed -i 's/\\xBE/¾/g' $1     sed -i 's/\\xBF/¿/g' $1     sed -i 's/\\xC0/À/g' $1     sed -i 's/\\xC1/A/g' $1     sed -i 's/\\xC2/Â/g' $1     sed -i 's/\\xC3/Ã/g' $1     sed -i 's/\\xC4/Ä/g' $1     sed -i 's/\\xC5/Å/g' $1     sed -i 's/\\xC6/Æ/g' $1     sed -i 's/\\xC7/Ç/g' $1     sed -i 's/\\xC8/È/g' $1     sed -i 's/\\xC9/E/g' $1     sed -i 's/\\xCA/Ê/g' $1     sed -i 's/\\xCB/Ë/g' $1     sed -i 's/\\xCC/Ì/g' $1     sed -i 's/\\xCD/I/g' $1     sed -i 's/\\xCE/Î/g' $1     sed -i 's/\\xCF/Ï/g' $1     sed -i 's/\\xD0/Ð/g' $1     sed -i 's/\\xD1/Ñ/g' $1     sed -i 's/\\xD2/Ò/g' $1     sed -i 's/\\xD3/O/g' $1     sed -i 's/\\xD4/Ô/g' $1     sed -i 's/\\xD5/Õ/g' $1     sed -i 's/\\xD6/O/g' $1     sed -i 's/\\xD7/×/g' $1     sed -i 's/\\xD8/Ø/g' $1     sed -i 's/\\xD9/Ù/g' $1     sed -i 's/\\xDA/U/g' $1     sed -i 's/\\xDB/Û/g' $1     sed -i 's/\\xDC/U/g' $1     sed -i 's/\\xDD/Ý/g' $1     sed -i 's/\\xDE/Þ/g' $1     sed -i 's/\\xDF/ß/g' $1     sed -i 's/\\xE0/à/g' $1     sed -i 's/\\xE1/a/g' $1     sed -i 's/\\xE2/â/g' $1     sed -i 's/\\xE3/ã/g' $1     sed -i 's/\\xE4/ä/g' $1     sed -i 's/\\xE5/å/g' $1     sed -i 's/\\xE6/æ/g' $1     sed -i 's/\\xE7/ç/g' $1     sed -i 's/\\xE8/è/g' $1     sed -i 's/\\xE9/e/g' $1     sed -i 's/\\xEA/ê/g' $1     sed -i 's/\\xEB/ë/g' $1     sed -i 's/\\xEC/ì/g' $1     sed -i 's/\\xED/i/g' $1     sed -i 's/\\xEE/î/g' $1     sed -i 's/\\xEF/ï/g' $1     sed -i 's/\\xF0/ð/g' $1     sed -i 's/\\xF1/ñ/g' $1     sed -i 's/\\xF2/ò/g' $1     sed -i 's/\\xF3/o/g' $1     sed -i 's/\\xF4/ô/g' $1     sed -i 's/\\xF5/õ/g' $1     sed -i 's/\\xF6/o/g' $1     sed -i 's/\\xF7/÷/g' $1     sed -i 's/\\xF8/ø/g' $1     sed -i 's/\\xF9/ù/g' $1     sed -i 's/\\xFA/u/g' $1     sed -i 's/\\xFB/û/g' $1     sed -i 's/\\xFC/u/g' $1     sed -i 's/\\xFD/ý/g' $1     sed -i 's/\\xFE/þ/g' $1     sed -i 's/\\xFF/\ÿ/g' $1      How can I create a hex-code TO normal char converter? So that if I run:               sh thementionedscript.sh hexstrings.txt      \-->> all the HEX chars in hexstrings.txt should be converted to normal chars, like: before:               \x68\x69      after:               hi


title: get Lexmark Z515 running on Linux

text: Following this tutorial I was able to intall this driver here in Crunchbang Linux 11. As expected, it didn't work. Lexmark itself offers a driver for OS X and that was it. I've tried something similar on a Windows Installation (Test Version of "Server 2008), which lead to a complete freeze of the system. **Question** : What would be a good approach to get a Lexmark Z515 Printer, connected to the machine via USB, running on Linux?


title: How to re-enable hibernate in Kubuntu 11.10?

text: After making some changes to my swap space, namely deleting and recreating swap space, my Kubuntu 11.10 has lost hibernate functionality. Although the button has returned, hibernating only appears to be working superficially until you try to resume the system - but instead of resuming you find it is restarting. `swapon -s`:                   Filename                                Type            Size    Used    Priority         /dev/sda5                               partition       10237948        0       -1      Partitions: ![enter image description here](http://i.stack.imgur.com/Igw2g.png) /etc/fstab:               # /etc/fstab: static file system information.     #     # Use 'blkid -o value -s UUID' to print the universally unique identifier     # for a device; this may be used with UUID= as a more robust way to name     # devices that works even if disks are added and removed. See fstab(5).     #     # <file system> <mount point>   <type>  <options>       <dump>  <pass>     proc            /proc           proc    nodev,noexec,nosuid 0       0     # / was on /dev/sda3 during installation     UUID=0b109499-4feb-4ec1-b368-c7f945194e44 /               ext4    errors=remount-ro 0       1     # swap was on /dev/sda5 during installation     #/dev/sda5 none            swap    sw              0       0     /dev/sda5 none            swap    sw              0       0     /dev/fd0        /media/floppy0  auto    rw,user,noauto,exec,utf8 0       0


title: Is it possible to save in a log everything the system outputs when I turn it on?

text: I am using a BeagleBone Black without any screen. It works fine, but sometimes when I turn it on it hangs and have to reset. I do not know why this is happening and since I cannot see whatever it is doing when it is starting, I would like to save everything that it is actually doing to a log file so when this happens I can reset and read it, so I understand what is failing. Any ideas on how to do that?


title: How to find the command line for tinymce

text: I have installed the packages `tinymce` and `tinymce2`. It's an HTML Editor.               sudo apt-get install tinymce tinymce2      but when I launch the command `tinymce` the system tells me there's no such command. Same for `tinymce2`. I have noticed that they don't seem to be in `/usr/bin/` I have tried `man tinymce` and `man tinymce2` and the system says there's no man entry for them. What can I do to find the command line to launch the application ?


title: how to grep complex hierarcy?

text: I have a file as:-               start apple     1 a     2 b     3 c     start orange     4 a     5 b     start mango     1 a     start a/b/c     5 z     end     4 b     end     6 c     end     start banana     3 c     end     4 d     5 e     end      I want the output as :-               1 apple/a     2 apple/b     3 apple/c     4 apple/orange/a     5 apple/orange/b     1 apple/orange/mango/a     5 apple/orange/mango/a/b/c/z     4 apple/orange/mango/b     6 apple/orange/c     3 apple/banana/c     4 apple/d     5 apple/e      I just want to grep the hierarchy of the numbers with fastest possible method


title: Cannot apt-get - Package install issue

text: I was halfway through updating my machine when it crashed and I had to reboot. It was updating new packages while it crashed. When I try to use `apt-get` it always fails because of a `mysql` package.               mysql-server-5.5 : Depends: mysql-server-core-5.5 (= 5.5.32-0ubuntu0.12.04.1) but 5.5.34-0ubuntu0.12.04.1 is to be installed      Typging `sudo apt-get -f install` returns the following error: `dpkg: dependency problems prevent configuration of mysql-server-5.5: mysql- server-5.5 depends on mysql-server-core-5.5 (= 5.5.32-0ubuntu0.12.04.1); however: Version of mysql-server-core-5.5 on system is 5.5.34-0ubuntu0.12.04.1. dpkg: error processing mysql-server-5.5 (--configure): dependency problems - leaving unconfigured No apport report written because the error message indicates it's a follow-up error from a previous failure.   dpkg: dependency problems prevent configuration of mysql-server: mysql-server depends on mysql-server-5.5; however: Package mysql-server-5.5 is not configured yet. dpkg: error processing mysql-server (--configure): dependency problems - leaving unconfigured No apport report written because the error message indicates it's a follow-up error from a previous failure. Errors were encountered while processing: mysql-server-5.5 mysql-server E: Sub-process /usr/bin/dpkg returned an error code (1)` Does anyone know how to fix this issue? Thanks


title: Dependencies between shared libraries in the same Debian packages

text: Suppose I want to create a package with multiple shared libraries - call it `libfoo`, which contains `liba.so.1` and `libb.so.1`. Now, say `liba.so.1` uses a symbol from `libb.so.1`. If I compile like this, then everything is OK:               cc   -shared -fPIC -Wl,-soname,libb.so.1 -o libb.so.1 libb.c     cc   -shared -fPIC -Wl,-soname,liba.so.1 -o liba.so.1 liba.c libb.so.1 However, that takes some extra work (I have to manually figure out the dependencies and code them into my makefile, and scons doesn't seem to do this automatically). Compiling the easy way creates an interesting problem:               cc   -shared -fPIC -Wl,-soname,libb.so.1 -o libb.so.1 libb.c     cc   -shared -fPIC -Wl,-soname,liba.so.1 -o liba.so.1 liba.c Now `liba.so.1` doesn't have `libb.so.1` in its `DT_NEEDED` header (visible using `objdump -p`), and when building a debian package I get the following message (and this step takes MUCH longer):               dh_shlibdeps        dpkg-shlibdeps: warning: symbol b used by debian/libfoo1/usr/lib/liba.so.1 found in none of the libraries. This happens because symbol `b` is defined in `libb.so.1`, but `dpkg- shlibdeps` has no way of knowing that. I should note that there doesn't seem to be a real problem here - the actual binary has both `liba` and `libb` as `DT_NEEDED`, and they are both loaded at run-time... have been for years. This problem only arose when trying to create a proper, cleanly-building debian package. How should I solve this? ( _should_ I solve this?) The libraries really should (TM) be in the same debian package. (For bonus points, solve for circular dependencies, i.e. `libb` also uses a symbol from `liba`).


title: What does a mirrorlog do in LVM mirroring?

text: http://www.tcpdump.com/kb/os/linux/lvm-mirroring/intro.html states that when mirroring a Logical Volume in LVM we need a "A volume for the log "... ehh, what exactly is a mirror log? Is it always recommended when mirroring an LV?


title: What filesystems can be shrunk online in 2011?

text: I'm asking because, for example, https://en.wikipedia.org/wiki/Comparison_of_file_systems#Features states that EXT3 can be shrunk online. But when I click on the reference: "Offline growing/shrinking as well as online growing" So what is the truth? Can someone post a small list of filesystems that currently be shrunk online?


title: chmod -R 644 ~/Documents

text: I recently noticed that all of the files in my `~/Documents` were somehow incorrectly given executable status. This proved annoying as trying to opening any file gave me a message box saying it was executable. I tried doing a recursive `chmod` like:               chmod -R 644 ~/Documents      Unfortunately, this made the whole Documents folder inaccessible. What went wrong?


title: Best way to back up a system in its entirety?

text: I considering doing a complete re-build of my home desktop computer. The only thing that will actually be the same, will be the case. I have a 1 TB external hard drive I want to back up my 200 GB of stuff to. I want to basically be able to "clone" this entire system onto a bigger hard drive of a compltelely different system, with faster CPU, better motherboard, and alot more memory (more than 4 Gigs). The issues are that I am running the 32 bit version of Elementary OS Jupiter, but to have more than 4 gigs of memory, I know you need 64 bit. So I don't think a direct clone would really work. Is there any way to backup all my apps, files, settings, and even my themes and backgrounds from this 32 bit system. And restore them to a new install of a 64 bit system? Also eOS Jupiter is based on Ubuntu 10.10. I really really don't like how Unity and Gnome 3 are looking right now. Theme wise and system wise. So sticking with eOS Jupiter for now would be very perferable.


title: The caps lock and scroll lock lights are flashing and everything is frozen

text: I was using a small Linux distro that was running X11 with JWM as its window manager. I was browsing a directory when all of a sudden the mouse froze and the keyboard became unresponsive. The caps lock and scroll lock lights are flashing. What does this mean... and is there anything I can do about it?


title: Crontab job not emailing on failure

text: I have a cron job on Debian:               1 * * * * /home/paradroid/bin/myscript.sh >/dev/null      There is an installed and configured MTA, and I have received emails when the script has a syntax error, so I have always thought that I would be informed when anything goes wrong. The script downloads a file using `curl` through a proxy. Recently the proxy has failed so `curl` could not download. It is the last command in the script, which has been exiting with the error code 7. I thought I would be getting emails when this happens, but I have not. How come I get email alerts from something like syntax errors in the script, but I have not been getting them when the script fails to do its job and exits with an error code? Is something wrong, or do I have to get the script to email me directly when there has been an error with `curl`?


title: Set Gnome terminal's default charset to utf8

text: Currently, I opened my gnome terminal and the default charset is gb2312. How can set the default charset to utf8 in Gnome terminal? I checked the preference setting but seemed not to find it. Thanks for any help!


title: Clang/LLVM Install Within Slackware?

text: I would like to install the Clang/LLVM compiler suite within Slackware since I use it as my default C conpiler for my C programming assignments. I am currently building it within a build directory inside `/usr/local/src` (`/usr/local/src/build`) and wish to install it after compiling. I am following the build instructions on the Clang website: http://clang.llvm.org/get_started.html ./configure and make are doing what I expect but there are no instructions for `make install` on the clang website at the end. Should I run `make install` and if yes within the build directory or elsewhere? The actual source code is in `/usr/local/src/llvm`. Should I have created the build directory in `/usr/local/bin` instead? Slackware newbie here. I mostly installed prepackaged software in other distros before (Debian/Ubuntu and Fedora).


title: How to compress a TMPFS folder?

text: I'm looking for a way to compress a tmpfs folder on the fly. I would like to use it for a local cache folder with a lot of data. I know there is a way to use Redis with eg LZF compression, but I prefer to use tmpfs.


title: CH3MNAS Fun Plug and NZBget. Cannot launch NzbGet 0.7, word unexpected

text: I have un-tarred the nzbget0.70 debug version and have put it in the `/ffp/bin` dir. and I have a config file in the `/ffp/etc/` dir but when I try to run it, I get the following:               root@NAS:/mnt/HD_a2/ffp/bin# nzbget     -sh: nzbget: not found     root@NAS:/mnt/HD_a2/ffp/bin# sh nzbget     nzbget: line 1: syntax error: word unexpected (expecting ")")      I used this how-to: http://www.aroundmyroom.com/2009/01/27/the-how-to-that- replaces-all/ I used this tar: **nzbget-0.7.0-bin-dns323-arm-debug.tar.gz** from http://sourceforge.net/projects/nzbget/files/ what did I do wrong? ps. I logged in as root


title: Unable to access linux/skbuff.h

text: I am writing a kernel module where I need to access `sk_buff` variables. But when I write               #include <linux/skbuff.h>      Netbeans says it can't locate that header file.


title: Installing HP DeskJet 3520 in CUPS

text: I am trying to install this printer into CUPS under Debian 6. The printer is automatically detected correctly and then I have a list of drivers to choose from. There is no driver for the 3520 - so I have tried the DeskJet 3500 hpcups and 3500 hpijs drivers. I have also tried installing the hplip drivers from here: http://hplipopensource.com/hplip-web/downloads.html But that seemed to give me no more options when choosing a driver in cups. The printer adds fine and printing a test page appears to work fine, but there is no output from the printer! What am I missing?


title: Graphics dim, but mouse cursor not dim

text: When I resume from suspend-to-ram often the graphics on my internal screen is dim (around 30-50% intensity). Initially I thought it might be the backlight, but the mouse cursor is not dimmed - only everything else. I also tried:               xbacklight -set 100     xbacklight -set 50      There is no change in the intensity of neither in the graphics nor the cursor. A switch to another virtual terminal (CTRL-ALT-F2) and back (CTRL-ALT-F7) also did not change anything. I attached an external screen and took a screen shot spanning both screens. The screen shot shows everything at full intensity. `xpdyinfo` sees the two spanning screens as a single screen - thus does not treat the internal screen different. Logging out and logging in again solves the issue, so it is clearly a software issue. The re-login seems to restart Xorg, but I would like to not have to re- login just to get the graphics on my screen un-dimmed.               Hardware: HP EliteBook 8540w     Software Ubuntu 11.10.     Window manager: xfce      How can I un-dim the graphics?


title: sqlite3 bash grep username

text: #!/bin/bash     username=$(sqlite3 db.sl3 "select user from main";)     yad --list --column="#" "$username" --height 200      I want to display the usernames of my db in a list and then select one of theme.   The problem with the code above is that the username "a b c" are treated as an unique username.   How can i split them into more username?


title: Trouble creating a directory

text: What would cause this please?               $ mkdir 20140830     $ mkdir: cannot create directory '20140830': Invalid argument      I can create any other directory following this format. `mkdir 20140831` works just fine. I'm at a loss here.


title: Can I unzip and merge sorted text files in a single operation?

text: I have tens of thousands of gzipped text files, each of which has already been sorted internally. I've written a script to unzip them (creating a copy) and then using `sort -m` to merge them. It all works very well, but in trying to improve the performance I noted that the unzipping operation is about 16-20% of the total run time. Basically, the merge operation has to scan through the entire bulk of the text files repeatedly, merging 16 files into 1 at a time. Typically, this leads to about 4-5 full scans through the data I have. The unzipping essentially adds one additional scan through it all. Saving 1 out of 5-6 scans through 50-100 GB of data is a substantial saving. Thus I started wondering if I could feed the output of `gunzip` straight into `sort` (or some other tool) and basically combine the unzipping round with the first round of merging. The output would not be gzipped. Does anyone know if this can be done? Ideally with the standard tools, but I'm also open to a third party tools if it fits the bill.


title: Is there a way to have regular expression in ~/.ssh/config

text: I have two set of server. Test on production. All server have internal ip. currently I am using alias to login:               Host pro-10     Hostname 192.168.1.10     ProxyCommand ssh production-server nc %h %p      For every server I need to repeat this rule. I am looking for a regualr expression way for doing this ?               Host pro-*     Hostname 192.168.1.$1     ProxyCommand ssh production-server nc %h %p      Is there a way of doing this ?


title: Can I use GAIM (Pidgin) to telnet (for MOOs, MUSHes, MUDs, etc) like TF?

text: GAIM supports many protocols, but I couldn't find a way to create a 'telnet' account, so that I can finally stop using TinyFugue to play MUDs/etc. How do I create a telnet "account" with GAIM? Do one of the other protocols secretly support telnet? Can I create a local jabber-to-telnet proxy or something?


title: Linux distro for a developer

text: I am mainly using Linux for programming. I basically started with Archlinux and Manjaro and I kinda like it. What I really like is the package management. It has a huge collection of new software and the updates are coming out really fast. For example when GCC 4.8 was released I instantly had it 2 days after the release which was pretty neat. Even small libraries such as "OpenAssetImporter" are in the repos. It is so convenient because if you have a huge collection of libraries that are coming out frequently, all you have to do is a system update. What bugs me is that my system breaks really often, and I don't want to spend so much time to fix stuff. Basically all I want is up to date libraries such as gcc etc. I don't really care if I have up to date Gnome etc. Any recommendations that you can give me?


title: Should I use useradd or adduser?

text: I am trying to add a new user to the system. I am confused though which command to run: `useradd` or `adduser`?


title: Novice Ubuntu 12.04 user needs help!

text: I'm new to Unix/Linux and someone suggested I try Ubuntu. I like it but I can't figure a couple of things out and don't really have time to google up ways to solve the problem. Answers from a quick search were so confusing. Can someone provide me with a straightforward set of instructions with easy places to click and download packages for the following problems: 1) I manually placed an icon on the Ubuntu desktop. I want to remove it but can't figure out how! When I delete it, it's completely unaccessible on the original left side tool bar. 2) Where/How do I install Java for Ubuntu 12.04? 3) Where/How to I install a de-coder that will let me play a regular movie DVD? 4) How do I go back to installation options and allocate more computer space for Ubuntu and less for Windows?


title: Fedora 17 : Cannot open font file True

text: Each time I login to Fedora 17, no GUI, just a console, I notice this error:               Cannot open font file True      I have followed some tutorial on web to fix this problem, but still cannot. Here some steps that I have done:   1. Edit `/etc/default/grub` `vi /etc/default/grub`. After that, change `SYSFONT=True` to `SYSFONT=atarcyrheb-sun16`   2. Edit `/etc/sysconfig/i18n`. Same, change `SYSFONT=True` to `SYSFONT=atarcyrheb-sun16`   3. Rebuild Grub2 with the command `grub2-mkconfig -o /boot/grub2/grub.cfg` In my boot folder, I don't have a grub2 directory. I must create it first with `mkdir /boot/grub2` But no matter how I try, I still meet this frustrating error. When I boot to recovering mode, I see a failed operation : `failed to mount /media/sda8`. Does it matter to my error?


title: laptop enery management for improving battery lifetime Linux

text: I have bought a Lenovo Ideapad that cames with Windows preinstalled. I installed Ubuntu 14.04 to dual boot. There is a tool for Windows called Lenovo Energy Manager that allows to control the charge of your battery, I mean, I can configure it so that when my computer is connected to AC and the charge is 60%, the computer takes all the energy from the AC and not from the battery. Doing this the battery lifetime is longer. Do you know some software similar for Ubuntu?


title: What is an effective method for installing up-to-date software on an out-dated production machine?

text: Apologies if this has been asked already, but I'm such a beginner, I'm not even able phrase a search query for this. **Background** My company uses a small out-dated cluster (CentOS 5.4) to do number crunching (finite element calculations to be more specific). They are using a commercial package and have no idea of Linux. They don't want to change anything on the machines as long as they run, which I accept as a time-effective policy. I do _not_ have administrative rights. I can have them install smaller packages, but not change e.g. the python version from 2.4 to 2.6+, so I decided to compile the current version (`./configure --prefix=/home/mysuser/root2`) and ran into a few problems with the dependencies (wrong version of e.g. readline, zlib, curses, bz2 ... or packages not found). I also need to update gcc which complaines about missing `GMP`, `MPFR` and `MPC`. The reason for doing this is I'd like to compile other test software to do run on these machines. What can I do to effectively install the packages I need in order to compile the software I need to work with? I'm elsewhere using _archlinux_ and would find it quite handy to be able to do something along the lines               pacman --root /home/myuser/root2 -S <package>      But I have no idea if this is possible or clever. Other related SE questions: gentoo-prefix and pkgsrc seem to be not so easy (I may be wrong, though).