title: openSuSE power management from command line

text: I'm using openSuSE 13.1 as a text-only server on an old netbook. A couple days ago, I was able to set it so that it didn't suspend or power down when the lid closed. I had to reinstall the OS today, and now for the life of me I can't get that setting to work again. The best lead I've found is to change `HandleLidSwitch=suspend` to `HandleLidSwitch=ignore` in /etc/systemd/logind.conf. I've done that, but it didn't fix it. (Yes, restarted systemd-logind and rebooted machine). Some of the other forums give clear directions on how to do this with a graphical desktop, but there doesn't seem to be much help on how to do it from the command line. Does anyone know the best method to do power management from the command line on openSuSE 13?


title: Playing or converting .dv4 files in Linux

text: I need to find a way to playback a number of .dv4 files on Ubuntu 12.04 and Fedora 20, possibly after having converted them to a more conventional format. So far I have managed to convert the files with               mencoder -fps 25 ./input.dv4 -ovc copy -oac copy -o ./output.avi      which does a decent job, as does going the `mplayer` way:               mplayer -fps input.dv4      The problem I'm facing is that the output video in both cases has no timestamp characteristic of most CCTV videos, having which is crucial for my purposes. The question, then, is how to get that timestamp in the output file. EDIT: I'm not, by the way, completely certain that I'm using the term "timestamp" correctly: what I mean is the date-and-time line, depicted in the running video, of the recorded event(s). I'm including a link to a sample file. https://dl.dropboxusercontent.com/u/37327335/input.dv4


title: Set list of applications allowed for execution by unprivileged user

text: I am working on a project of security enforced Linux-based system (kernel 2.6.32 + Gnome 2 + Centos package base mostly). We need to implement the restriction of execution of unallowed executables. Source compiling, package building, scripting and `chmod +x` command will be prohibited in this system. Briefly speaking we need to **restrict any execution by default** for a unprivileged (non root) user excepting the very short list of user-space application (X.org, office, browser etc). I guess that it's not enough to use discretionary access control in this case, rather it should be a kind of a mandatory access control superstructure. What is a preferable way to work it out? I heard something about SELinux and ACL rules but I'm not shure.Thank you.


title: CentOS Apache virtual hosts sites-available type structure

text: I just set up LAMP on a new CentOS server. Previously when I installed LAMP on Ubuntu, I always needed to create a virtual host definition for each website I create in my `/var/www` directory. But on CentOS, I realised once I put my website into my `/var/www` directory, it's immediately visible on my browser. I included this directive: `Include conf/vhosts/*.conf` in my `httpd.conf` file in order to define virtual hosts for specific sites. Inside my vhost directory, I have defined my `*.conf` files. Can anyone tell me what needs to be edited, possibly in `httpd.conf`, to stop sites that don't have an individual `/vhosts/*.conf` file from displaying when visited? Below is my default virtual host definition information which I amend for each new site:               <VirtualHost var/www/aSite:80>         ServerAdmin webmaster@dummy-host.example.com         DocumentRoot var/www/aSite         ServerName myServer         ErrorLog var/www/aSite/logs/error_log         CustomLog var/www/aSite/logs/access_log common     </VirtualHost>


title: How do you extract a single folder from a large tar.gz archive?

text: I am using this command on a **5GB** archive               tar -zxvf archive.tar.gz /folder/in/archive      is this the correct way to do this? It seems to be taking forever with no command line output...


title: Increase nice value for many processes

text: Say I have launched a couple of non-timecritical applications such as a text editor a web browser etc and one more time critical (audio)application. Is there a utility that simulates the opposite of nice by increasing nice value for all my other process or do I need to write a script for that.


title: Host unreachable and I do not get why

text: I can not open a specific website. This is a website hosted by our company, and I know it is up. However, these are my symptoms:               VARIABLES:     host.com - the website I can not open     x.x.x.x - the IP of host.com     192.168.0.121 - the IP of my local machine     192.168.0.1 - the gateway IP that gives access to internet        * If I go to the browser and open `http://host.com`, then it gives me an error (Unable to Connect in Firefox; Page not Available in Chrome)   * If I run `ping host.com`, it returns: > >     PING host.com (x.x.x.x) 56(84) bytes of data. >     From 192.168.0.121 icmp_seq=1 Destination Host Unreachable >     From 192.168.0.121 icmp_seq=2 Destination Host Unreachable >     From 192.168.0.121 icmp_seq=3 Destination Host Unreachable >   Please note that `192.168.0.121` is the IP of my own machine.   * A traceroute will also fail miserably: > >     $ traceroute host.com >     traceroute to host.com (x.x.x.x), 30 hops max, 52 byte packets   >     1  192.168.0.121 (192.168.0.121)  3008.068 ms !H  3007.312 ms !H > 3009.967 ms !H >   And I have already checked the following:   * The website is available just fine from any other computer in our network   * If I try to ping or traceroute the IP directly, the results are the same   * This IP or website is not listed in my `/etc/hosts`   * There is no firewall rule interfering. I even flushed all rules and tried again; same results.  What can it be? EDIT: Connectivity to this particular IP just came back. I can now connect to this website again. But this has happened before: I can connect, and then I cannot connect. It comes and goes, whereas for other computers in the network and for all other people in the public, this site is online all the time. EDIT 2: The problem is back. We just had an internet failure and have reset the router, and on all computers internet works just fine. On my computer, internet itself is also fine. It's just this particular domain name. I expect this to mysteriously work again in half an hour or so, but in the meantime I try to debug this issue. Here come some data as requested:               $ netstat -rn     Kernel IP routing table     Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface     0.0.0.0         192.168.0.1     0.0.0.0         UG        0 0          0 eth0     192.168.0.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0               $ nslookup host.com     Server:     8.8.8.8     Address:    8.8.8.8#53          Non-authoritative answer:     Name:   host.com     Address: x.x.x.x (this is the right IP)          $ ip route get x.x.x.x     x.x.x.x dev eth0  src 192.168.0.121         cache  ipid 0xc740 rtt 1.71s rttvar 1.025s cwnd 10          $ ip route get 192.168.0.121     local 192.168.0.121 dev lo  src 192.168.0.121         cache <local>  ipid 0xf209


title: Find all postgresql and mysql databases on a system

text: Is there a way to find all postgresql and mysql databases on my system? (Perhaps using the find command).


title: Combining Awk with Curl

text: How would I set my `curl` statement so that it puts the value of each `$3` in for the username, and the value of each `$4` for the wallclock information? ### Some further information I am trying to take the username and wallclock information and `curl` it into a system admin app on a website. Here is what I have so far               ~/qacct.monthly | awk '{print $3}''{print $4}'      Yields this output: (where `$3` = owner and `$4` = wallclock)                   OWNER     WALLCLOCK     ===================================================================          adeluca     1610     athardin     1     axelsone     18707336     bfinley     1875     bihe     9918667     brogers     108710282     ckbui     10     ctokheim     2445     dliang     6470745     gaolong     3395364     htrn     1     jchen12     13475380     jdereus     1086617     jiangp     24343174     jinkwang     30733663     johnsonhj     58967432     joneskl     32085365     jongkwki     47160388     jwpark     101601184     keefeh     2     ktan     13484388     litd     2031229     lteng     3882281     luhon     32500508     lvantol     66959     lwen     1272867     mama     4635850     mariettaj     44247412     msscully     64419431     nkumr     6     piersonr     454978875     rhylock     187877     rjconnel     57     root     65     sbonett     2388132     shishen     114025934     tbair     1363490     tnath     9196673     wanj     53041427     wassinkt     376268     wdeng     949336     wpmcdowe     5360475     zeiene     159442263     zhaok     3609429      Here is my `curl` statement:               curl -d 'cluster=<CLUSTER>&username=<USER>&wallclock=<WALLCLOCK>' \         'https://www-dev.****.****.edu/****SysAdmin/****sysadmin/clusterusage/rest/update.html';


title: ubuntu like lightdm in arch linux

text: I have just installed archlinux on a virtual machine and I managed to install lightdm by following the instructions given in https://wiki.archlinux.org/index.php/LightDM https://wiki.archlinux.org/index.php/Display_Manager but lightdm looks like this ![default lightdm looks](http://i.stack.imgur.com/4DplU.png) But I want it to look like the default one in ubuntu ![Ubuntu default lightdm](http://i.stack.imgur.com/RMxst.jpg) How can that be done ? Ps: I am running xfce4 as the desktop Environment


title: How to set up an Internet Connection in Linux Mint?

text: My machine has wired Internet connection with Windows 7 OS. In connection properties I see               service name : ispone     obtain IP address automatically     obtain DNS server address automatically      How do I step above connection in Linux Mint (16 Cinnamon, installed on USB (16 GB)) What I have tried               dhclient         /etc/dhcp3/dhclient.cof      sudo gedit /etc/network/interfaces         auto eth0         iface eth0 inet dhcp     sudo ifconfig eth0 down     sudo ifconfig eth0 up      but nothing works.


title: gawk join two TSV by columns (a'la sql join)

text: How to join, to tsv files, examples: a.tsv               c   7   r   z     d   6   s   w     f   1   f   f     b   8   p   y     a   9   q   x      b.tsv               a   q   a     c   r   ccc     b   p   bb     0   0   0     d   s   dddd      Here I'd like to "join" them by columns, `where a$1,a$3==b$1,b$2` and display rest (a$2,a$4,b$3) :               6   w   dddd     9   x   a     8   y   bb     7   z   ccc      Question is: how would you do this in gawk ? **Order of rows does not metter** (in output. In input, order of rows is not defined and can be different in a.tsv and b.tsv - like rows in relational db, they have no order). _Uniqueness note_ : Originally, I assumed "uniqueness of `key={a$1,a$3}`. As glenn jackman noticed - it can not be assumed from original problem statement, as it allows not unique rows according to any key - thanks glenn.


title: sudo not preserving PS1

text: The configuration below is in my `/etc/sudoers`:               Defaults    !visiblepw     Defaults    always_set_home     Defaults    env_reset     Defaults    env_keep =  "COLORS EDITOR DISPLAY HOSTNAME HISTSIZE INPUTRC KDEDIR LS_COLORS"     Defaults    env_keep += "MAIL PS1 PS2 QTDIR USERNAME LANG LC_ADDRESS LC_CTYPE"     Defaults    env_keep += "LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES"     Defaults    env_keep += "LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE"     Defaults    env_keep += "LC_TIME LC_ALL LANGUAGE LINGUAS _XKB_CHARSET XAUTHORITY"     Defaults    secure_path = /sbin:/bin:/usr/sbin:/usr/bin      When I `sudo su` my `PS1` terminal changes to the system default; ignoring my `.bashrc` `PS1` setting. How can I fix this so that the environment variables are not lost when `sudo su`ing? Weird; it's exporting `EDITOR` but it's not exporting `PS1` for some reason; it's like it's being forcefully overridden; how can I stop this? When I run `sudo -V` the variables to keep `PS1` is listed; it's not listed in the variables to remove.


title: Network Interfaces Don't Exist After Loading Modules

text: I installed SourceMage Linux on my laptop and the ethernet and wireless interfaces don't exist after loading the required modules (`tg3` and `ath9k`). On other distros (Xubuntu, aptosid) the networking worked. `lspci`:               02:00.0 Ethernet controller: Broadcom Corporation Device 1692 (rev 01)     08:00.0 Network controller: Atheros Communications Inc. Device 002e (rev 01)


title: How to specify a daemon shutdown command with upstart?

text: In an upstart configuration how do I define what command should be used to shutdown a server. Lets say I have daemon that has two seperate processes.   * startup.sh - to start the server    * shutdown.sh - to shut down the server Suppose I have an upstart file that looks like this.               description "Some Example Service"     author "Me"          start on runlevel [2345]     stop on runlevel [016]     respawn          exec satrtup.sh       How do I tell upstart that it should called shutdown.sh when shutting down the server? How does upstart normally expect to shut down a daemon?


title: setting up yum in stripped down linux

text: I have a box that contains minimal binaries needed to run Scientific Linux. What I want to do is to install additional programs. I could get rpm installed and tried to install yum but resolving those dependencies is a pain. Is there any easy way to do this?. What I want is to have all these basic utilities installed without much effort.At least if I could get yum to work without manually resolving each dependencies that would be great. I don't have physical access to the box.


title: Not able to run vnstat unless as root in debian 7

text: So, I need to run this command:               vnstat -tr 2      But as a user I just created, not as root, as root it works fine, but as a regular user I get this:               Error: Unable to get interface "eth0" statistics.     Error: Interface "eth0" not available, exiting.      On Debian 6 there wasn't this restriction, how do I remove it? Sounds like a permissions problem.


title: Difference between virtual interfaces with ifconfig and iproute2

text: I am wondering what is the difference between:               # ifconfig eth0:0 1.1.1.1/24      and just               # ip addr add 1.1.1.1/24 dev eth0      Btw I cannot do               # ip addr add 1.1.1.1/24 dev eth0:0     RTNETLINK answers: File exists      In `ip addr show` it appears differently :               eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000      link/ether 8c:ae:4c:fe:1f:75 brd ff:ff:ff:ff:ff:ff     inet 1.1.1.1/24 brd 1.1.1.255 scope global eth0:0 ---> with ifconfig     inet 2.2.2.2/24 scope global eth0 ----> with ip      When should I prefer the first way and when should I prefer the second way? It seems more cool to


title: How to format USB drive in Linux Mint 14 with GUI?

text: I'm new to Linux Mint and I've just installed Linux Mint 14. Now I need to format my USB drive, but I'm not getting any option to do that. Please suggest me anyone, how can I do that with a GUI?


title: Proper file system for an External Hard Drive to work well on Linux

text: I have a External Hard Drive (EHD) I want to use to backup the data on my Linux laptop. I want to know how I should format my EHD for it to work correctly with Linux. Thanks.


title: How can I run a specific command for each find result?

text: How would one run a specific command for each file that was found by using the `find` command? For the purpose of the question lets say that I would simply like to delete each file found by `find`. I am unix/linux noob so be gentle with me.


title: tinyproxy with user authentification

text: Does anybody have a solution that'll make tinyproxy work with user authentification like `pam_auth` at the squid proxy? I don't want to create a SSH-Tunnel and allow only localhost.


title: Can I fix bad blocks on my hard disk with a single command?

text: I'm working on fixing the errors in my Hard Disk, It's possible to do that manually but it might take hours. After typing this command `sudo badblocks -b 512 /dev/sda`, I got hundreds of results and I want to avoid fixing them manually. More details about my error can be found here So is there any tool I can use to fix the errors? Or maybe you could help me write a shell script?


title: Creating temp file vs process substituion vs variable expansion?

text: If I am doing something like   1. creating temporary file              some process generating output > temp_file     cat  temp_file        2. process substitution:              cat <(some process generating output)        3. another way :              cat <<<(some process generating output)      I have some doubts regarding these:   1. Is there any limit on data output size of process substitution`<()` `>()` or variable expansion `<<<()`   2. Which among these is the fastest or is there a way to do it faster? My ulimit command output is :               bash-3.00$ ulimit -a     core file size        (blocks, -c) unlimited     data seg size         (kbytes, -d) unlimited     file size             (blocks, -f) unlimited     open files                    (-n) 256     pipe size          (512 bytes, -p) 10     stack size            (kbytes, -s) 8480     cpu time             (seconds, -t) unlimited     max user processes            (-u) 8053     virtual memory        (kbytes, -v) unlimited


title: bash_history: comment out dangerous commands: `#`

text: To prevent logging "dangerous" commands in bash history, I have added following line to my `.bashrc` file:               HISTIGNORE='rm *:mv *:cp *:cat*>*:pv*>*'      this works well, but it has a side effect: I cannot see the complete history of commands executed on a machine. Let's say I have several machines for experiments, and I want to be able to see all commands executed. I would use the bash internal `history` to display executed commands, and perhaps grep for today's date:               history | grep Sep-28      What I would like do have is to log "dangerous" commands as well, but put a `#` at the beginning of the line, so that if I happen to execute the command from history by mistake, no damage would be done. I have no idea if this is possible. Any comment would be greatly appreciated. ## Update and clarification: The main reason why this is a problem for me is that I am usually connected to my machine from several terminals, and any command executed on one terminal is immediately read into history of other terminals. This is achieved by               PROMPT_COMMAND="history -a; history -c; history -r"      Lets imagine I have two terminals open. In one I have some `cat /dev/foo > file.out` process running. In the second, I check the progress with `ls -lAhF`. I keep repeating `ls` by pressing `Up` and `ENTER` (that is, last command from history). As soon as the first command finishes, the last command from history is no longer `ls`, but `cat /dev/foo > file.out`. If I am not careful, I will start cat again and overwrite file.out. What I would like to achieve is that the cat command would be preceded with a `#`, so that it would not be executed. I would however still see it in history and can reuse it (if it is a long command) by un-commenting it.


title: How to do calculation on eval variables in shell script

text: I want to do mathematical operations on eval variables in shell script, but it is not working.               query=first     eval avgOverall$query[1]=28.5          avgOverall=$(("`eval echo '${avgOverall'$query'[1]}'`+1")) | bc      But I am getting below error               bash: "28.5+1": syntax error: operand expected (error token is ""28.5+1"")      What am I doing wrong?


title: grep caret appears to have no effect

text: I was under the impression that a caret symbol means "beginning of the line" with Extended POSIX regular expressions. However, when I use it with grep it behaves unexpectedly.               #grep --version     GNU grep 2.5.4     ...      I am using GNU grep 2.5.4 on Ubuntu 10.04 Lucid Lynx. I echo out a line ' hello', then pipe it to a grep that searches for "zero-or- more white-space characters followed by the letter h":               #echo ' hello' | grep -E '[:space:]*h'      hello      grep finds it ok. If I add a caret to indicate that I only want the pattern to match "zero-or- more white-space characters followed by the letter h" "at the beginning of the string":               #echo ' hello' | grep -E '^[:space:]*h'     #      No matches are found. I would expect the string to have matched because it begins with `white-space` followed by `h`. Why does this caret symbol prevent a match?


title: Will GNOME and GTK libs bloat up my KDE?

text: I want to use Shutter. I installed it previously under Kubuntu and it needed a lot of libs. What bothered me most was that Kubuntu wanted me to restart, that is rare for OS's nowadays and in general means that something was added to startup procedures. So will these libs bloat my KDE up and get loaded even if I don't start Shutter? To be clear, as long as it's only disk space that not what I mean by bloat. Please take this more as a general question about installing GNOME apps on KDE and not so much about Shutter and the libs it needs. Maybe you can help me understand the technical background a bit better.


title: How to grant non-root user access to device files

text: I have device file that appears in `/dev` when a specific board is plugged in. The read and write operations to it work just fine, but in order to open the device file the program needs to be executed with root priveledges. Is there any way I can all a non-root user to open this one specific device file without having to use sudo?


title: Normal looking text file, detected by file as ASCII Pascal program text

text: I have a "normal" looking text file (contains english sentences) which is getting detected by `file` command as `ASCII Pascal program text`. How does Pascal program text differentiate itself from normal ASCII English text? I did `head -10 file > tmp` `file tmp` still shows `Pascal`. `tmp` when opened in VI and `:set list`               HELEN'S BABIES$     $     With some account of their ways, innocent, crafty, angelic, impish,$     witching and impulsive; also a partial record of their actions during$     ten days of their existence$     $     By JOHN HABBERTON$     $     $     $      Output of `head file | od -c`               0000000   H   E   L   E   N   '   S       B   A   B   I   E   S  \n  \n     0000020   W   i   t   h       s   o   m   e       a   c   c   o   u   n     0000040   t       o   f       t   h   e   i   r       w   a   y   s   ,     0000060       i   n   n   o   c   e   n   t   ,       c   r   a   f   t     0000100   y   ,       a   n   g   e   l   i   c   ,       i   m   p   i     0000120   s   h   ,  \n   w   i   t   c   h   i   n   g       a   n   d     0000140       i   m   p   u   l   s   i   v   e   ;       a   l   s   o     0000160       a       p   a   r   t   i   a   l       r   e   c   o   r     0000200   d       o   f       t   h   e   i   r       a   c   t   i   o     0000220   n   s       d   u   r   i   n   g  \n   t   e   n       d   a     0000240   y   s       o   f       t   h   e   i   r       e   x   i   s     0000260   t   e   n   c   e  \n  \n   B   y       J   O   H   N       H     0000300   A   B   B   E   R   T   O   N  \n  \n  \n  \n     0000314      File uploaded here: http://www.fileswap.com/dl/L0eCWJTvy/ I'm on `CentOS release 6.5`, `file` version `5.04` **There is something in the 4th line. Removing from 4th line onwards detects it as only text file**


title: Rebuilt kmod package not updating via `YUM` but is via `rpm`

text: I have built a package with the following version:               kmod-dahdi-linux 10:2.9.1.1-75_shmz65.1.11.2.6.32_431.el6.i686      Which should be an upgrade of the one installed on the system:               kmod-dahdi-linux 0:2.9.0.1-72_centos6.2.6.32_431.el6.i686      when I do a `yum localupdate` I get the following:               Resolving Dependencies     --> Running transaction check     ---> Package kmod-dahdi-linux.i686 0:2.9.0.1-72_centos6.2.6.32_431.el6.i686 will be updated     ---> Package kmod-dahdi-linux.i686 10:2.9.1.1-75_shmz65.1.11.2.6.32_431.el6.i686 will be an update     --> Finished Dependency Resolution      But when it hits the transaction check, I get file conflicts like it's not updating the package, but installing it side-by-side, as seen here:               file /lib/modules/2.6.32-431.el6.i686/dahdi/dahdi.ko from install of kmod-dahdi-linux-10:2.9.1.1-75_shmz65.1.11.2.6.32_431.el6.i686.i686     conflicts with file from package kmod-dahdi-linux-2.9.0.1-72_centos6.2.6.32_431.el6.i686.i686      I've tried obsoletes for older versions, I've tried upping the Epoch (as you can see mine has an epoch of 10 now) When I do:               rpm -Uvh kmod-dahdi-linux-2.9.1.1-75_shmz65.1.11.2.6.32_431.el6.i686.i686.rpm      it upgrades properly. I've double checked the rpmversion shows as newer:               # rpmdev-vercmp 0:2.9.0.1-72_centos6.2.6.32_431.el6.i686 10:2.9.1.1-75_shmz65.1.11.2.6.32_431.el6.i686     10:2.9.1.1-75_shmz65.1.11.2.6.32_431.el6.i686 is newer      Any ideas? Additional information: I've re-tooled my RPM to have the exact same dist tag and it still fails.               # yum localupdate kmod-dahdi-linux-2.9.1.1-11_centos6.2.6.32_431.el6.i686.i686.rpm     Resolving Dependencies     --> Running transaction check     ---> Package kmod-dahdi-linux.i686 0:2.9.0.1-72_centos6.2.6.32_431.el6.i686 will be updated     ---> Package kmod-dahdi-linux.i686 0:2.9.1.1-11_centos6.2.6.32_431.el6.i686 will be an update     --> Finished Dependency Resolution          Transaction Check Error:       file /lib/modules/2.6.32-431.el6.i686/dahdi/dahdi.ko from install of kmod-dahdi-linux-2.9.1.1-11_centos6.2.6.32_431.el6.i686.i686 conflicts with file from package kmod-dahdi-linux-2.9.0.1-72_centos6.2.6.32_431.el6.i686.i686


title: Spotty wireless with Fedora

text: I have this Toshiba laptop I started poking around trying to find out why it quits out so often and is just so bad. This guy seems to have the same problem with the fact that it works perfect in Windows and it cuts out so much. It's quite annoying. Anyone know of any solutions? Edit* I found that I have to constantly "forget" the network to then re connect to it. This kind of fixes the problem but then of course it derps out again.


title: Built the kernel with NFS support but not getting /dev/nfs

text: I'm trying to build kernel 3.13.9, fetched using `apt-get source`, and built in a clean `debootstrap` chroot (both host and chroot being installations of Ubuntu Trusty). My goal is to boot a diskless machine to a console over NFS. I ran `make menuconfig` and enabled 64-bit kernel, disabled debugging, and made sure I was doing a 64-bit build. In addition, I went to file systems->network file systems, and enabled the following:   * Network File Systems   * NFS Client Support  The host has `nfs-kernel-server` installed, and an export set up for the directory that I would like to use as the root of the network-booted system. PXE boot happens OK, kernel and initrd are loaded, but after a long pause, I'm dumped to a busybox prompt, due to a root filesystem being missing. What could be the cause? (or, is more info needed?) **Edit:** I'm already passing `nfsroot`:               LABEL linux     KERNEL vmlinuz-3.13.9     APPEND root=/dev/nfs initrd=initrd.img-3.13.9 nfsroot=192.168.1.39:/nfsroot,rw ip=dhcp rw


title: Some icons are broken in the application menu

text: I am using Xfce-4.10 on Debian 7. But I found some icons are missing (and only "x"'s appear) in the application menu. Take `ipython3` as an example. Here's the `ipython3.desktop`:               # If you want ipython3 to appear in a linux app launcher ("start menu"), install this by doing:     # sudo desktop-file-install ipython3.desktop          [Desktop Entry]     Comment=Enhanced interactive Python shell     Exec=ipython3     GenericName[en_US]=IPython3     GenericName=IPython3     Icon=ipython3     Name[en_US]=ipython3     Name=ipython3     Categories=Development;Utility;     StartupNotify=false     Terminal=true     Type=Application      The theme is installed (currently `tango-icon-theme`, but other themes don't work either). The icon file is at `/usr/share/icons/hicolor/scalable/apps/ipython3.svg`. It can be displayed in an image viewer. Reinstalling `ipython3` doesn't help. I also tried to replace the `ipython3.svg` with some other normal icon files (`libreoffice-calc.svg`, for example). This doesn't help either. Any ideas to bring the icons back? Thank you.


title: Measuring CPU and Memory per user to distribute "cost" of a server

text: How should I implement approximately correct per-user monitoring on a server? I want a way to split the cost of a server between the users based on their usage. On newer machines (RHEL6) I would use `cgroups`; on older kernels process accounting and `ps` averages. Are these the best ways?


title: Burning a directory structure from a stdin pipe

text: I'm trying to do something tricky, I want to burn a directory structure onto a CD from a pipe stream. The reason is that it is coming from the network and I don't want it written on the hard drive of the cd-burning machine. I am unsure of how (or if possible) to pipe the output of tar (for example) into genisoimage or mkisofs. I noticed a stream option in genisoimage, but when I tried doing               tar -cvf - /home/myuser | genisoimage --stream-media-size 200 -o test.iso      I only got a test.iso which contained a stream.img (as specified in genisoimage(1)) which itself was the original tar-archive. This will not do, it needs to be a directory structure on the CD. I know that cdrskin (cli tool for burning) can take data from stdin and burn it. So how can I pipe data into genisoimage, have it create a directory structure of that data for the ISO and then have it pipe that data back out to cdrskin to burn? I know also that genisoimage pipes the iso data to stdout by default so my only issue appears to be getting a stream of a directory structure piped into genisoimage and having that directory structure maintained in the ISO data. The tags on this post are terrible because I couldn't find genisoimage, cdrskin, not even stdin. Edit: This is not about data security, it's about lack of disk space. I don't care if the data is buffered on the HDD but I can't write the full ISO. And of course genisoimage is just a suggestion, I'm open to any other method of creating the ISO data. For your information it's intended for blu ray discs.


title: Set a network range in the no_proxy environment variable

text: I'm in a network using a proxy. I've got machines using lots of scripts here and there accessing each other over HTTP.   * The network is 10.0.0.0/8.   * My proxy is 10.1.1.1:81, so I set it up accordingly:              export http_proxy=http://10.1.1.1:81/        * I want to exclude my own range to be accessed with the proxy. I tried any combination available.              export no_proxy='10.*'     export no_proxy='10.*.*.*'     export no_proxy='10.0.0.0/8'      None of the above work! I'm testing with `wget` and it always tries to query the proxy, whatever IP address I want to connect to.   * Since lots of scripts lie everywhere in all systems the `\--no-proxy` option is actually not an option. I want to set it system wide. Many thanks.


title: Postfix uses the interface alias instead of the primary interface

text: When sending e-mail with /usr/sbin/sendmail ( _e.g., using a script_ ), Postfix causes the mail to be sent using one of the host's interface aliases ( **eth0:0, 74.50.122.55** ) instead of using the primary interface ( **eth0, 66.232.99.54** )...               [root@www ~]# cat test.msg      To: epretorios@gmail.com     Subject: This is a bogus e-mail          This is a bogus e-mail.     [root@www ~]# sendmail -t -i < test.msg      Results in e-mail headers like this:               Return-Path: <root@www.rocket-powered.com>     Received: from www.rocket-powered.com ([74.50.122.55])             by mx.google.com with ESMTPS id c4si14411712yhe.53.2013.04.13.11.39.16             (version=TLSv1 cipher=RC4-SHA bits=128/128);             Sat, 13 Apr 2013 11:39:16 -0700 (PDT)     Received-SPF: fail (google.com: domain of root@www.rocket-powered.com does not designate 74.50.122.55 as permitted sender) client-ip=74.50.122.55;     Authentication-Results: mx.google.com;            spf=hardfail (google.com: domain of root@www.rocket-powered.com does not designate 74.50.122.55 as permitted sender) smtp.mail=root@www.rocket-powered.com     Received: by www.rocket-powered.com (Postfix, from userid 0)         id CA46D39412D; Sat, 13 Apr 2013 18:32:14 +0000 (UTC)     From: bogus@gmail.com     To: epretorios@gmail.com     Subject: This is a bogus e-mail      Why is Postfix using the interface alias ( **eth0:0, 74.50.122.55** ) _instead of using the primary interface ( **eth0, 66.232.99.54** )_? FWIW: e-mail submitted for delivery via SMTP is routinely delivered using the primary interface ( **eth0, 66.232.99.54** ). e.g.,               Return-Path: <administrative@rocket-powered.com>     Received: from www.rocket-powered.com (rocket-powered.com. [66.232.99.54])             by mx.google.com with ESMTPS id s61si9056793yhd.296.2013.04.13.17.28.36             (version=TLSv1 cipher=RC4-SHA bits=128/128);             Sat, 13 Apr 2013 17:28:36 -0700 (PDT)     Received-SPF: pass (google.com: domain of administrative@rocket-powered.com designates 66.232.99.54 as permitted sender) client-ip=66.232.99.54;     Authentication-Results: mx.google.com;            spf=pass (google.com: domain of administrative@rocket-powered.com designates 66.232.99.54 as permitted sender) smtp.mail=administrative@rocket-powered.com     Received: from www.rocket-powered.com (localhost [IPv6:::1])         by www.rocket-powered.com (Postfix) with ESMTPA id 979D23940F7         for <epretorios@gmail.com>; Sun, 14 Apr 2013 00:21:33 +0000 (UTC)     DomainKey-Signature: a=rsa-sha1;  q=dns; c=nofws;       s=default; d=rocket-powered.com;       b=Y5YVbjb5mXPJgyDkMjXdanWRCM4gdEjIdbgouOpDJ6hEAObGcaokpiidfhc29lvBezLyZL06++gL1oyd+bjrywd1I9sqlB0i5Tfjig2ufKLEizcSeyTkDWjm/jKP6TIy;       h=Date:To:From:Reply-To:Subject:Message-ID:X-Priority:X-Mailer:MIME-Version:Content-Type;     Date: Sun, 14 Apr 2013 00:21:33 +0000     To: Fred Flintstone <epretorios@gmail.com>     From: "Rocket-Powered.com" <administrative@rocket-powered.com>     Reply-To: "Rocket-Powered.com" <administrative@rocket-powered.com>     Subject: Welcome


title: What are the current differences between tuxonice and µswsusp?

text: I tried to find out what is the current comparation between TOI and µswsusp. Unfortunately I could not find any recent information about the state of hibernation in Linux and how TOI compares to µswsusp (the most recent information I found is from 2009 in talk of merge between Nigel, Machek and Wysocki). The features matrix seems to be partially out-of-date as µswsusp supports "Multithreaded I/O" since 1.0. Does anyone know some more up-to-date comparison?


title: How can I replace my keyboard and mouse udev rules with xorg.conf.d?

text: Since it is impossible to make udev rules that affect Xorg settings run on startup, I'd like to replace these with other alternatives. At the moment, I have two primary udev scripts that I've written. The first changes keyboard layout when the keyboard is plugged in or removed, as well as starting `xcape`. The second slows down the pointer when a specific mouse is plugged in, and also allow input from the mouse to wake the computer up. I'm using (K)ubuntu 13.04. The udev rules and scripts follow, as do the xmodmaps. `/etc/udev/rules.d/00-teck.rules`:               ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="0e6a", ATTR{idProduct}=="030c", RUN+="/usr/local/bin/TECK_connect"     ACTION=="remove", SUBSYSTEM=="usb", RUN+="/usr/local/bin/TECK_disconnect"      `/usr/local/bin/TECK_connect`:               #!/usr/bin/env bash          export DISPLAY=:0.0     cp -f /home/sparhawk/HDD/Computer/Xmodmaps/Xmodmap_for_TECK /home/sparhawk/.Xmodmap     sudo -u sparhawk setxkbmap -layout us -variant altgr-intl     sudo -u sparhawk xmodmap /home/sparhawk/.Xmodmap     sudo -u sparhawk pkill xcape     sudo -u sparhawk xcape -e 'Alt_L=Return' && sudo -u sparhawk notify-send "xmodmap" "TECK connected." -i /usr/share/icons/oxygen/48x48/devices/input-keyboard.png --hint=int:transient:1      `/usr/local/bin/TECK_disconnect`:               #!/usr/bin/env bash     if [[ `lsusb | egrep -c 'Apple, Inc\. Aluminum Keyboard'` == 0 ]] && [[ `lsusb | egrep -c 'Megawin Technology Co\., Ltd'` == 0 ]]; then       export DISPLAY=:0.0       cp -f /home/sparhawk/HDD/Computer/Xmodmaps/Xmodmap_for_internal_Dell_keyboard /home/sparhawk/.Xmodmap       sudo -u sparhawk setxkbmap -layout us -variant altgr-intl       sudo -u sparhawk xmodmap /home/sparhawk/.Xmodmap       sudo -u sparhawk pkill xcape     fi      `/etc/udev/rules.d/90-razerwakeup-slowdown.rules`:               ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="1532", ATTRS{idProduct}=="0016" RUN+="/bin/sh -c 'echo $env{DEVPATH} | grep -q usb./[^/]*/[^/]*/[^/]*$ && echo enabled > /sys$env{DEVPATH}/../power/wakeup; razer_slowdown'"      `/usr/local/bin/razer_slowdown`:               #!/usr/bin/env bash     # slow down the tracking speed of a razer mouse.     # to check, $ xinput --list-props "Razer Razer DeathAdder"| grep 'Constant Deceleration'     # which was originally 1          scriptproper () {             sleep 0.5 # perhaps not necessary, but putting it in background is.             export DISPLAY=:0.0             sudo -u sparhawk xinput --set-prop "Razer Razer DeathAdder" "Device Accel Constant Deceleration" 3     }          scriptproper &      `~/HDD/Computer/Xmodmaps/Xmodmap_for_TECK`:               ! map right blank key to "menu" for KDE.     keycode 97 = Menu Menu     ! Swap left ctrl and shift     keycode 50 = Control_L Control_L     keycode 37 = Shift_L Shift_L     ! Replace right ctrl with shift     keycode 105 = Shift_R Shift_R     ! Replace right shift, '     keycode 62 = apostrophe quotedbl     keycode 48 = slash question     ! Enter to alt     keycode 36 = Alt_L Meta_L     ! AltGr to Compose     !keycode 108 = Multi_key     ! AltGr+key     keycode 20 = minus underscore minus underscore endash emdash     keycode 60 = period greater period greater ellipsis     ! Left blank key to AltGr     keycode 101 = ISO_Level3_Shift Multi_key ISO_Level3_Shift     ! key to the left of `     keycode 94 = Return NoSymbol Return     ! Fn+F5 and Fn+F6 control brightness     keycode 148 = XF86MonBrightnessDown NoSymbol XF86MonBrightnessDown     keycode 179 = XF86MonBrightnessUp NoSymbol XF86MonBrightnessUp          clear Shift     clear Lock     clear Control     clear Mod1     clear Mod2     clear Mod3     clear Mod4     clear Mod5     add    Shift   = Shift_L Shift_R     add    Lock    = Caps_Lock     add    Control = Control_L Control_R     add    Mod1    = Alt_L     add    Mod2    = Num_Lock     add    Mod4    = Super_L Super_R     add    Mod5    = Mode_switch ISO_Level3_Shift ISO_Level3_Shift ISO_Level3_Shift      `~/HDD/Computer/Xmodmaps/Xmodmap_for_internal_Dell_keyboard`:               ! map right alt to ISO_Level3_Shift (e.g. for compose)     keycode 108 =   ISO_Level3_Shift Multi_key     ! Swap left ctrl and caps lock     keycode 66 =    Control_L     keycode 37 =    Caps_Lock          ! AltGr+key     keycode 20 = minus underscore minus underscore endash emdash     keycode 60 = period greater period greater ellipsis          keycode 105 =   Control_R       Multi_key     clear Shift     clear Lock     clear Control     clear Mod1     clear Mod2     clear Mod3     clear Mod4     clear Mod5     add    Shift   = Shift_L Shift_R     add    Lock    = Caps_Lock     add    Control = Control_L Control_R     add    Mod1    = Alt_L     add    Mod2    = Num_Lock     add    Mod4    = Super_L Super_R     add    Mod5    = Mode_switch ISO_Level3_Shift ISO_Level3_Shift ISO_Level3_Shift


title: Iptable rule to ssh over the internet

text: I've a server `abc.example.com` and a remote desktop `zzz.example.com`. I'm using SSH over a custom port, say, 6789. Whenever my firewall is off, I'm able to connect to the server successfully. But, as soon as I start my firewall, in vain. Moreover, I want to allow ssh session only between `abc.example.com` and `zzz.example.com`, for security reasons. This is the rule that I have added to my iptables on the server,               iptables -A INPUT -s zzz.example.com -m state --state NEW,ESTABLISHED -p tcp --dport 6789 -j ACCEPT


title: memory consumption alert

text: My VPS has reported a memory consumption alert says reached 273% and I cannot access any of my sites. But I checked on the terminal today and it does not look like a memory problem. Am I correct in thinking memory is fine?                            total       used       free     shared    buffers     cached     Mem:          1004        110        893          0         56         20     -/+ buffers/cache:         33        970     Swap:         2047          1       2046      The VPS reports my using 2.73 GB of allotted 1024 so they are wanting me to move up a plan but clearly I'm not using anywhere near that amount. But it appears over the weekend something spiked the usage but none of my sites were active so what could it be? How can I test the problem? ### screenshot of graph     ![my usage report](http://i.stack.imgur.com/vgFl4.jpg) What are you supposed to do to get the sites all up again? I'm at a loss. update: I have looked in /var/log/messages and found this : `rsyslogd was HUPed ` but now I've found mysql has disappeared!


title: Automating tasks on a website on a headless server

text: I want to automate a task which can only be done on a website (with prior login) on my debian server. There is no public API available, so I can't use one. Is there a way to do so? I thought about a text-based browser or something similar.


title: What does this command actually cause?

text: Once while talking with my friend I was trying to joke that we might stand a better chance of completing our project if we just run loads of random programs and expect one of them to solve our problem. To demonstrate that, I wrote this "proof of concept":               while true; do          dd if=/dev/urandom of=pliczek count=1     chmod +x pliczek     ./pliczek          done      To my horror, when I ran this loop and called `ls`, I noticed a lot of files with random-looking filenames in my current directory (tested on Fedora Linux on 64-bit x86). Now I can't stop wondering - what could actually have happened?


title: Git commit from within a Makefile

text: I have a Makefile for a Latex project I'm working on. Makefiles aren't my forte, but is there a way to do something like:               make git "My comment"      And have the makefile execute:               git commit -m "My comment"     git push origin master      ?


title: Command substitution interpreting spaces within quotes as argument separators

text: I'd like an `alias` that additionally appends itself to `~/.bashrc`, _e.g._               function tailias     {         $(echo "alias $1='${*:2}'" | tee -a ~/.bashrc)     }      I'm using `tee` to split the command to `~/.bashrc` while leaving the stdout intact to be run by `$()`. This works fine for aliasing one-word commands, _e.g._               [/home/acheong87] tailias f g     [/home/acheong87] alias     alias f='g'      and I see it appended to my `~/.bashrc`. But for commands with spaces, I get               [/home/acheong87] tailias ll 'ls -al'     -bash: alias: -al: not found      It looks correct in `~/.bashrc`—               alias ll='ls -al'      —but in the alias list I get this crazy thing:               [/home/acheong87] alias     alias ll=''\''ls'      I've tried putting the quotes in different places, to no avail. I've reduced the function to just the `echo`, and like in the `~/.bashrc`, it _looks_ correct—so I can't figure out what hidden step is averting my attention.


title: Stop Git submodule foreach from opening less for each module

text: I occasionally need to grep through git submodules for which I use:               git submodule foreach 'git grep x'      However, since switching to zsh I find a less prompt is opened for each submodule, even when there are no options. What I'd much prefer is for all of the output to be printed out to the terminal. My current solution is to call:               git submodule foreach 'git grep x' > /tmp/a && cat /tmp/a      Which achieves what I want but I can't help but feel that I'm missing an option or a more elegant solution. Is there one?


title: retrieve the host interface name used by a VirtualBox interface in "bridged mode"

text: I need to retrieve the tuntap interface name used from my the VM interfaces in "bridged adapter" mode. I found that this information resides in the xml file of the VirtualBox VM under: val xml=(xmlfile \ "Machine" \ "Hardware" \ "Network" \ "Adapter" \ "BridgedInterface") Is there any way to get this info from terminal, ad example with VBoxManage? And if not, can i rely on the xml file for most up-to date informations or is this file updated only when the VM is shut down?


title: An easier way to print from a live CD than Puppy?

text: After several failed attempts to burn an Ubuntu CD to live boot from (they wouldn't boot, maybe because my CD burning software wouldn't burn slower than 4X speed?), I've managed to get a boot disc working with Puppy linux ("Slacko"). My next task is to figure out how to print. I have an HP PSC2410 printer. The documentation on puppylinux.org provides some links, and I tried following the instructions here. Unfortunately, it appears python isn't installed in Puppy by default, as I got the error:               ./hplip-install: line 2: python: command not found      when I ran the install with `sh hplip-3.13.4.run` There's quite a list of system requirements for installing the print drivers, so I wonder if I'm barking up the wrong tree by trying to use Puppy. Might I be better having another try at getting Ubuntu working, or is there an easier distribution to use that will enable me to print when booting from a live CD? The only functionality I need is print capability, a browser, and being able to read a flash drive, all offline from the web.


title: When you type "ls -a", what is the significance of "." and ".."?

text: Whenever you type `ls -a` into the command prompt, you usually get all of your folders, files, and then you see that the first two entries are `.` and `..` Just curious, but what is the significance of these two entries?


title: How to display Discordian date?

text: I am a strong believer in Discordianism. Yet most mostly I am confronted with the time measurement of pesky heathens. How do I know what date it really is?


title: Grub doesn't install - corrupted iso?

text: I wanted to install Arch Linux on my netbook. I hadn't important files on my hard drive so I've created new partition table (GPT) using GParted from Fedora LiveCD. When I'm running               grub-mkconfig -o /boot/grub/grub.cfg      I get errors and my new system will not run from GRUB. How can I fix it? Is it a corrupted iso file? I'll add it isn't a problem with hard drive - before Arch, there was Ubuntu and Fedora.


title: What is Binary package? How to build them?

text: I want to get detail about binary package and run them on linux. I am running Debian base (Ubuntu/Linux mint) Linux os.   1. How to build binary package from source? And can I directly download binary package for applications (like firefox, etc.) and games (like boswars, etc.) ?   2. I run some direct package which is in "xyz.linux.run" format What are these package? Are they independent of dependencies? or Is it pre-built binary packages?   3. How to build them which can be run on linux operating system by directly "xyz.linux.run" on linux.   4. What is diference between binary package and deb package?


title: Dual boot windows 8 and Ubuntu 13.04 & Broadcom Compatibility

text: I have windows 8 pre-installed and also want to use Ubuntu (13.04) as my secondary OS. I had problems regarding Broadcom STA wireless drivers in 12.10, but the drivers work fine on older versions. How to dual boot Ubuntu and install Broadcom drivers after it.


title: Can't install anything

text: I'm not able to install, update or do anything else with `apt-get`, `aptitude`, `dpkg` and so on. The lock-file `/var/lib/dpkg/lock` exists from boot-time on. When I delete it and run `apt-get update`, it prints out, that dpkg has been interrupted. I tried `dpkg --configure -a` as mentioned in the help text, but that runs into a problem with gconf2:               root@andre-ubuntu:/home/andre# dpkg --configure -a     Setting up libbonoboui2-0:amd64 (2.24.5-0ubuntu2) ...     Setting up libgnomeui-0:amd64 (2.24.5-2ubuntu3) ...     Processing triggers for libc-bin ...     ldconfig deferred processing now taking place     Setting up gconf2 (3.2.6-0ubuntu1) ...          (gconftool-2:16760):       GConf-WARNING **: Client failed to connect to the D-BUS daemon:      Did not receive a reply. Possible causes include: the remote application       did not send a reply, the message bus security policy blocked the reply,       the reply timeout expired, or the network connection was broken.      `dpkg` stops at this point and i can't even interrupt it with `Ctrl+C`. I have the following version of Ubuntu:               Linux andre-ubuntu 3.8.0-19-generic #30-Ubuntu      SMP Wed May 1 16:35:23 UTC 2013      x86_64 x86_64 x86_64 GNU/Linux      Do you have any ideas what to do?


title: sed pattern space and hold space

text: i was just going thorugh this and i was unable to understand.               sed -n '1h; 1!H; ${ g; s/foo\nbar/bla\nblub/ p }' file.      where cat file is :                foo      foo      bar      why there is `1!H` because to me `1h` overwrites the pattern space and `1!H` is of no use But the sed one liner seems to work fine.


title: Change sampling rate in ALSA

text: I'm a Computer Audiophile, I've used Windows (with ASIO4ALL)and OSX for Audio. Now I'm making Ubuntu 13 my HTPC/Stereo Audio. To begin with I disabled Pulse audio and using GooMusicplayer with ALSA. My DAC is capable of 24bit 96khz. I can't seem to find a configuration for ALSA to set output sampling rate. How can I configure it?


title: JAVA_HOME not set in script when run using sudo

text: I'm trying to run an install script that requires java to be installed and the JAVA_HOME environment variable to be set. I've set JAVA_HOME in `/etc/profile` and also in a file I've called java.sh in `/etc/profile.d`. I can `echo $JAVA_HOME` and get the correct response and I can even `sudo echo $JAVA_HOME` and get the correct response. In the install.sh I'm trying to run I inserted an `echo $JAVA_HOME`. When I run this script as myself I see the java directory, but when I run the script with sudo it is blank. Any ideas why this is happening? I'm running CentOS


title: Dtach and Vim over Ssh: Reattach Session

text: I connected to my server:               $ ssh me@example.com      While in the server, I open a `dtach` session with `vim`:               $ dtach -c \tmp\my-dtach-session-pipe vim      Then my ssh session dies. I attempt to go back to my session:               $ ssh me@example.com     $ dtach -a \tmp\my-dtach-session-pipe      I do not get vim, but instead just a blinking cursor. I cannot do anything from there, not even `ctrl+c`, I can only detach the `dtach` with `ctrl+\`. How can I get my dtach session back properly? Or am I missing the idea of how dtach is supposed to behave? N.B. I am well aware of the `tmux` and `screen` utilities.


title: testing services/open ports with telnet?

text: I often see that folks test ports this way:               //shell     telnet ip-address 80     telnet ip-address 25      AFAIK telnet was the old way of getting onto some remote box - right? or so I thought... Why exactly can you connect via telnet to smtp port for example?


title: Prevent init daemon echoing on TTY

text: Below is an `init` script which starts/stops a daemon. The daemon is unfortunately printing the parsed packet data (from `/home/nuthan/program/server`), a socket server written in perl, listening to a socket for tcp packets from a client. As soon as I start the service, the parsed data (print statements from `/home/nuthan/program/server`) is echoed on my TTY. And, if I try to kill the terminal, the daemon quits. How do I overcome this? **daemon and logging packet data command**                daemon -18 perl /home/nuthan/program/server -d -v -r -f -O=/var/log/vts.log --daemon      * * *               #!/bin/bash     #     # vts      Start/Stop Vts.     #     # description: VTS daemon for vehicle Tracking.     # Source function library     . /etc/init.d/functions          # Get network config     . /etc/sysconfig/network          RETVAL=0          start() {     echo -n $"Starting vts: "     # Start me up!     daemon -18 perl /home/nuthan/program/server -d -v -r -f -O=/var/log/vts.log --daemon     RETVAL=$?     echo     [ $RETVAL -eq 0 ] && touch /var/lock/subsys/vts         touch /var/lock/subsys/vts     return $RETVAL          }          stop() {     echo -n $"Stopping vts: "     killproc vts     RETVAL=$?     echo     [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/vtsdaemon     return $RETVAL     }          restart() {       stop     start     }          reload() {     stop     start     }          case "$1" in       start)       start     ;;       stop)       stop     ;;       status)     status vts     ;;       restart)       restart     ;;       condrestart)       [ -f /var/lock/subsys/vts ] && restart || :     ;;       reload)     reload     ;;       *)     echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}"     exit 1     esac          exit 0


title: Creating multiple devices from one device?

text: Specifically taking a USB device, which normally allows only one process to open it for reading, and clone/duplicate/replicate it so that multiple processes can open and read the input. Something along these lines:               # Duplicate two streams from microphone     arecord -D [mic] | tee /dev/[#1] > /dev/[#2] &          # Set up process 1     apply-live-effects -filter lo-pass < /dev/[#1] > output1.raw &          # Set up process 2     apply-live-effects -filter hi-pass < /dev/[#2] > output2.raw &      With `/dev/[#1]` and `/dev/[#2]` being the devices to open for reading. I thought I might be able to use the `/dev/loop#` devices. I tried playing around with these but no luck.


title: source address chosen in case of multiple IPv4 addresses

text: I have following four IPv4 addresses configured to `eth0` interface:               # ip addr show dev eth0     2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc pfifo_fast state UP qlen 1000         link/ether 00:16:41:54:01:93 brd ff:ff:ff:ff:ff:ff         inet 10.10.10.1/24 scope global eth0         inet 192.168.2.2/30 scope global eth0         inet 10.10.10.128/24 scope global secondary eth0         inet 10.10.10.127/24 scope global secondary eth0     #       Now if I send traffic to any(10.10.10.1, 192.168.2.2, 10.10.10.128 or 10.10.10.127) of those addresses from IP address 10.10.11.1, then despite the fact that I have specified the source IP to be 10.10.10.127:               # ip route show match 10.10.11.1     default via 192.168.2.1 dev eth0  src 10.10.10.127      #       ..my machine sends out packets with the same source IP which was used as a destination IP, e.g. if I execute `ping 10.10.10.128 source 10.10.11.1` in a remote machine, then my machine sends out replies with source address 10.10.10.128:               16:11:02.478607 00:19:e2:9e:ec:00 > 00:16:41:54:01:93, ethertype IPv4 (0x0800), length 114: 10.10.11.1 > 10.10.10.128: ICMP echo request, id 34, seq 4, length 80     16:11:02.478616 00:16:41:54:01:93 > 00:19:e2:9e:ec:00, ethertype IPv4 (0x0800), length 114: 10.10.10.128 > 10.10.11.1: ICMP echo reply, id 34, seq 4, length 80      In which situation `src` address specified in routing table has affect?


title: how can I replace a record in my DB (mySql) by new record?

text: I have created a shell script to connect to a DB and INSERT IPs and MACs from dhcpd.log file:               #/!bin/bash     dhcpLogFile="/var/log/dhcpd.log"     NumberOfLines=$(awk '/DHCPACK/ { print $8} ' $dhcpLogFile | awk '!x[$0]++'|awk 'BEGIN{i=0}{i++;}END{print i}')     j=1     while [ $NumberOfLines -gt 0 ]     do     ip=$(awk '/DHCPACK/ { print $8} ' $dhcpLogFile | awk '!x[$0]++' |cut -f$j -d$'\n')     mac=$(awk '/DHCPACK/ { print $10} ' $dhcpLogFile | awk '!x[$0]++' |cut -f$j -d$'\n')        let "j +=1"     let "NumberOfLines -=1"     mysql -u root --password='pw' MatchingDB <<- _END_      INSERT INTO IP_MACTable (IP_Address, MAC) VALUES ('$ip','$mac');     _END_     done      my question is how to modify the insert query above to let it replace an existing record when the ip attribute is duplicated and to insert a new record normally when the ip attribute isn't duplicated ? I have tried something like this but it keeps return an error (syntax error):               INSERT INTO IP_MACTable (IP_Address, MAC) VALUES ('$ip','$mac')      ON DUPLICATE KEY UPDATE MAC = VALUES('$mac')      the error according to my server is `near '$mac')` Error code is #1064


title: Running a Transparent Proxy for LAN and Webserver for WAN

text: I am running a LAMP stack on an Arch Linux server in my home, and my router firewall port 80 is open to the world. Recently, I've decided to set up a dansguardian transparent proxy to do some web filtering for my children. Everything is working well inside my LAN. However, while checking the dansguardian logs, I noticed that my home had become a proxy for chinese IP addresses. Apparently, my iptables setup is allowing requests coming in on port 80 to be sent to my LAN dansguardian setup! I have now closed down port 80, but I would like to continue running my home website. Can someone please advise me on the correct iptables setup to transparently proxy LAN http requests through dansguardian but not proxy INCOMING requests on port 80? Here is the output of iptables-save:               # Generated by iptables-save v1.4.18 on Tue May 20 18:51:46 2014     *filter     :INPUT ACCEPT [99752358:83925475634]     :FORWARD ACCEPT [1137723:181159087]     :OUTPUT ACCEPT [57478321:118350587619]     COMMIT     # Completed on Tue May 20 18:51:46 2014     # Generated by iptables-save v1.4.18 on Tue May 20 18:51:46 2014     *nat     :PREROUTING ACCEPT [3362634:253695591]     :INPUT ACCEPT [3450241:258605740]     :OUTPUT ACCEPT [3451732:250709703]     :POSTROUTING ACCEPT [3492061:253533144]     -A PREROUTING -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 9809     -A POSTROUTING -o eth0 -j MASQUERADE     COMMIT     # Completed on Tue May 20 18:51:46 2014      * * * ## Update: Possible Solution Found This looks like it is working: From: https://help.ubuntu.com/community/DansGuardian               sudo iptables -t nat -A OUTPUT -p tcp --dport 80 -m owner --uid-owner proxy -j ACCEPT     sudo iptables -t nat -A OUTPUT -p tcp --dport 3128 -m owner --uid-owner proxy -j ACCEPT     sudo iptables -t nat -A OUTPUT -p tcp --dport 80 -j REDIRECT --to-ports 8080     sudo iptables -t nat -A OUTPUT -p tcp --dport 3128 -j REDIRECT --to-ports 8080      If anyone knows of a good tutorial of iptables for dummies, I'd really appreciate it!


title: Installing SASM Integrated Development Invironment for assemby, dependency problems

text: How do I resolve these dependency issues? I want to install a IDE for assembly in my Fedora 20, but it's not working. Here is the package I'm trying to install: package site Here is the output from yum:               home_Dman95                                                                    3/3     Resolving Dependencies     --> Running transaction check     ---> Package SASM.x86_64 0:2.3.1-2.3 will be installed     --> Processing Dependency: libxcb-icccm4 for package: SASM-2.3.1-2.3.x86_64     --> Processing Dependency: libxcb-render0 for package: SASM-2.3.1-2.3.x86_64     --> Processing Dependency: gcc-32bit for package: SASM-2.3.1-2.3.x86_64     --> Processing Dependency: libxcb-sync0 for package: SASM-2.3.1-2.3.x86_64     --> Processing Dependency: libxcb1 for package: SASM-2.3.1-2.3.x86_64     --> Processing Dependency: libqt4 for package: SASM-2.3.1-2.3.x86_64     --> Finished Dependency Resolution     Error: Package: SASM-2.3.1-2.3.x86_64 (home_Dman95)                Requires: libxcb-icccm4     Error: Package: SASM-2.3.1-2.3.x86_64 (home_Dman95)                Requires: libxcb-render0     Error: Package: SASM-2.3.1-2.3.x86_64 (home_Dman95)                Requires: libxcb-sync0     Error: Package: SASM-2.3.1-2.3.x86_64 (home_Dman95)                Requires: libxcb1     Error: Package: SASM-2.3.1-2.3.x86_64 (home_Dman95)                Requires: libqt4     Error: Package: SASM-2.3.1-2.3.x86_64 (home_Dman95)                Requires: gcc-32bit      You could try using --skip-broken to work around the problem      You could try running: rpm -Va --nofiles --nodigest      EDIT: I installed gcc*.i686 but still the "gcc-32bit" dependency is not resolved. Any idea's?


title: How to remove duplicate lines with awk whilst keeping empty lines?

text: Below `awk` command removes all duplicate lines as explained here:               awk '!seen[$0]++'      If the text contains empty lines, all but one empty line will be deleted. How can I keep all empty lines whilst deleting all non-empty duplicate lines, using only `awk`? Please, also include a brief explanation.


title: Send duplicate packets over two Internet connections

text: I need to duplicate an RTP stream over two different (non-reliable) Internet connections. On the receiver side, I will probably run a custom program that will use a buffer and rebuild the stream before using it. But I have some trouble in splitting the traffic over the two connections. I did some research and found that maybe `tc` (part of `iproute2`) could be what I need. Can anyone help me?


title: Logging in using voice commands with GDM

text: Is there a program capable of doing such thing? Something that would wait for me to either supply a username and a password, or select my username and a voice command that does the same thing.


title: How to install man command for chef

text: I want to see manual for `chef` with command `man knife-cookbook`. But it looks like manuals are not installed by default install `gem install chef`. I found the man page of `knife cookbook`. http://manned.org/knife- cookbook/061616e2 How can I install these manual pages to my local environments? Normally documents are automatically installed along with software itself. I never installed manual separately. I'm using `OS X 10.9.2`.


title: Configure the OOM to avoid having the system grind to a halt

text: I have an SSD and therefore no swap. However, when I open a lot of tabs in the browser, the system tends to grind to a halt. If I'm lucky, I can close one or two tabs before the system is completely unresponsive. Is it possible to use the OOM in this case to kill a few browser processes (chromium) to avoid the unresponsiveness? There is still a bit of memory available, but apparently there's still a resource conflict.


title: Restart a process when I get stderr from another process

text: I have this constantly running process which POSTs some data collected locally to an endpoint. Now there is some issue in the raspberryPi wifi module and it drops connection frequently. After restarting networking, it starts working again. So this is what I have right now based on the face that everytime internet disconnects, proc1 starts throwing stderr:               while true; do        ./proc1 2>&1 >/dev/null | sudo /etc/init.d/networking restart     done &      But this code restarts networking multiple times, not sure why. What I actually want is something like this:               while true:         if proc1 has stderr:            sudo /etc/init.d/networking restart;            sleep 10;      So my question are:   1. How can I convert that pseudocode to bash?   2. This is a hack to get around the actual problem of networking drops, how can I debug what’s wrong?


title: Easiest way to chown the contents of a directory?

text: I often use               ls -ld .     # remember current user and group     chown -R user.group .     chown remembered_user.remembered_group .      Isn't there an easier way to recursively chown all files and directories in a directory but not the directory itself? It should include hidden files and work no matter how many files there are.


title: How to convert, resize and center image with ImageMagick

text: I'm unable to center a converted *.png file with ImageMagick's gravity option. Gravity seems to have no effect in the following command. On the contrary it erases everything and the output becomes white page.               convert puma1.png -compress jpeg \                       -resize 1755x2475 \                       -units PixelsPerInch \                       -density 150x150 \                       -page A3 \                       -gravity center puma1.pdf      ImageMagick version is 6.8.6-9 2014-03-06 Q16.


title: Script or tool for maintenance (archive/remove old files, clean temporal files, etc…) on Unix/Linux

text: Everybody have the same problem: How to deal with old files, logs, temporal files to archive them (compress, store in alternate locations), delete unneeded, etc. them Specially if you have to deal with a lot of home-brew and third-party software and tools, that basically fill the disk do not care about their logs/temp files. Now I am using my own shell scripts using find, logrotate, tar, etc... But everything is too adhoc for my taste, and not efficient at all. I would love some kind of generic tool, based on patterns and rules/actions that will allow define actions on the files based on their name, age, etc. I wanna write it, but I am sure that somewhere wrote something: Do you know any?


title: Error creating ext4 file system

text: Recently I purchased a Cubietruck Cubieboard 3, and I'm trying to copy Lubuntu server from the builtin NAND memory to a hard disk. I can create a partition successfully, but when I go to format the partition with ext4, using `mkfs.ext4 /dev/sda1`, I get a bunch of errors, which all look the same:               Writing inode tables: done     Creating Journal (32768 blocks): done     Writing superblocks and filesystem accounting information:     [  815.XXXXXX] ata1.00: exception Emask 0x0 SAct 0x1 SErr 0x0 action 0x0     [  815.XXXXXX] ata1.00: irq_stat 0x40000000     [  815.XXXXXX] ata1.00: failed command: READ FPDMA QUEUED     [  815.XXXXXX] ata1.00: cmd 60/08:00:00:08:1c/00:00:00:00/40 tag 0 ncq 4096 in     [  815.XXXXXX]          res 41/40:00:02:08:1c/00:00:00:00/60 Emask 0x409 (media error) <F>     [  815.XXXXXX] ata1.00: status: { DRDY ERR }     [  815.XXXXXX] ata1.00: error: { UNC }     [...] above 7 lines repeated 5x, each with a 6 second time difference     [  845.XXXXXX] end_request: I/O error, dev sda, sector 1837058      I don't think it is the drive, because it is new, and I can also format it on Elementary (Ubuntu). If I format it from Elementary, I can then not mount it on my Cubieboard.


title: Find all files that have been last modified on a specific day - like Monday?

text: So I want to use `find` to return a list of all .html files in a given directory that have been last modified on a Monday. How can I do this?


title: Could it cause any problem if I not reboot after a kernel upgrade?

text: I know there are solution for not rebooting after kernel update: https://en.wikipedia.org/wiki/Ksplice But If Ksplice isn't installed, and the user doesn't reboots it's notebook after even several kernel updates (so notebook running for even months). Could there be a problem about it? (not counting that an update probably came because there was a bugfix or security fix)


title: What's the main difference between bash and zsh?

text: Someone told me that some commands in zsh shell may differ from the bash shell commands. So what's the main difference between zsh and bash shells?


title: Bash Ping to return 'alive' IP addresses

text: (Disclaimer- I know this can be done more easily with `nmap`, but its supposed to be practice for bash shell scripting).               $ scriptname 192.168.42 18 23           Checking: 192.168.42.18 19 20 21 22 23           Live hosts:       192.168.42.21       192.168.42.22           There were:       5 alive hosts       1 not alive hosts       found through the use of 'ping'.       Above is what I want the output to look like. 'Checking: ...' will list whatever IP is being checked. All of the Live ones will be listed under "Live Hosts" and then running totals for alive and not-alive. Here is what I have so far               for i in `seq ${2} ${3}`         do         ping -c 1 -t 1 ${1}.${i} > /dev/null 2>&1;         if [ $? -eq 0 ]; then             echo "Live hosts: \n ${1}.${i}"; LIVECOUNT=$( ???? )         fi     done      The `LIVECOUNT=$( ???? )` because I don't know what to put in it. I'm not sure how to keep a running total for living/non living ones. The 'Live Hosts' and 'There were' sections don't need to appear until the checking is complete.


title: virtmanager- Unable to locate libvirtd daemon

text: I tried starting Virt-manager but get this error               Unable to connect to libvirt.          internal error: Unable to locate libvirtd daemon in /usr/sbin (to override, set $LIBVIRTD_PATH to the name of the libvirtd binary)     Hi, I tried to start virtmanagerr (installed via mint software center)     but get this?              Libvirt URI is: qemu:///system              Traceback (most recent call last):           File "/usr/share/virt-manager/virtManager/connection.py", line 1027, in _open_thread             self.vmm = self._try_open()           File "/usr/share/virt-manager/virtManager/connection.py", line 1009, in _try_open             flags)           File "/usr/lib/python2.7/dist-packages/libvirt.py", line 102, in openAuth             if ret is None:raise libvirtError('virConnectOpenAuth() failed')         libvirtError: internal error: Unable to locate libvirtd daemon in /usr/sbin (to override, set $LIBVIRTD_PATH to the name of the libvirtd binary)


title: Display manager unrecognised service, trying to disable "x server" to install nvidia driver, debian wheezy

text: First time install of Debian wheezy. My nvidia 580gtx GPU is crashing GNOME and the computer. To get it to boot I had to use `nouveau.modeset=0` in GRUB. Now that I'm in, I want to install the newest NVidia driver so I can boot normally, but when I try and install it, it tells me to disable "x server". I've tried:               $ sudo service xdm stop     $ sudo service lightdm stop     $ sudo service gdm stop      but they all fail. What am I doing wrong?


title: Compare two files for matching lines and store positive results

text: I have two files. ### File 1:               A0001  C001     B0003  C896     A0024  C234     .     B1542  C231     .     upto 28412 such lines      ### File 2:               A0001     A0024     B1542     .     .     and 12000 such lines.      I want to compare File 2 against File 1 and store the matching lines from File 1. I tried Perl and Bash but none seems to be working. The latest thing I tried was something like this:               for (@q) # after storing contents of second file in an array     {             $line =`cat File1 | grep $_`; #directly calling File 1 from bash             print $line;     }      but it fails.


title: Compare first column in different files

text: I want to compare one file with other files in the same directory. `file1.txt` contains:               move 34#123#         get 11#278         put 33#29#567#23      `file1.txt` should compare with files `1.txt` and `2.txt`. `1.txt` contains:               move 11         put 34         run 13      `2.txt` contains:               get 14         move 66      I need the results to be like this:               move 2         get 1         put 1      How can I accomplish this?


title: Environment variable does not seem to work in sudo

text: I use apt behind a firewall, so I specify a proxy in the `http_proxy` environment variable. What I have done is added the following line to both `.profile` and `.bashrc` (for good measure) of the root user:               export http_proxy=http://proxyserver:8080      When I do the following, it prints the value of the proxy correctly:               sudo echo $http_proxy      However, when I call `sudo apt-get update`, it does not seem to see the `http_proxy` variable as the root user. Only when I su to root, `apt-get` works as expected, through the proxy, so it obviously sees the variable. So my question is, as above, why does `sudo apt-get` not see the variable? **UPDATE** I have just learned that when I call `sudo echo`, it echoes the value of the variable set in the current user's profile. But even so, why does `sudo apt-get` not use that variable value?


title: Change working directory

text: I'm trying to compress a directory at               /home/cyrus/sql      And I wanted to change the working directory when zipping the folder:               / $ zip -b /home/cyrus sql.zip /home/cyrus/sql      But when I check the zip file:               / $ unzip -l sql.zip          Archive:  sql.zip       Length      Date    Time    Name     ---------  ---------- -----   ----             0  2013-05-30 10:59   home/cyrus/sql/       1776642  2013-05-23 10:22   home/cyrus/sql/wordpress.sql     ---------                     -------       1776642                     2 files      The root folder should have been `sql`. What have I done wrong?


title: Crash analysis and 4 levels of page table

text: I am having xen 3.4.2 running with 15 vm (pv+hvm) on a host with 256 Gb RAM and 96 core CPU. But recently my host crashed on debug log its showing               translating ffff83183fcb0000 with CR3 100ae42000 and 4 levels of page table.      after so many similar lines its showing               cannot translate address 0 < ffff830000000000 without cr3      From my understanding of xen pv is that, hypervisor gives pv direct access to physical RAM but hypervisor cross checks all the call to physical memory rather than using shadow pages. So it has less overhead in virtual memory to physical conversion,as its aware about actual mapping. But in case of HVM hypervisor needs to translate guests memory to physical ram. So can anyone explain me from above translation that its for hvm ram translation hypervisor is doing or will it happen in pv also? and on crash.log its showing               (XEN) grant_table.c:1408:d0 dest domain 452 dying     (XEN) p2m_pod_cache_get: Breaking up superpage.     (XEN) mm.c:741:d421 Non-privileged (421) attempt to map I/O space 00000000     (XEN) mm.c:741:d421 Non-privileged (421) attempt to map I/O space 000000f0     (XEN) mm.c:741:d352 Non-privileged (352) attempt to map I/O space 00000000     (XEN) mm.c:741:d352 Non-privileged (352) attempt to map I/O space 000000f0     (XEN) mm.c:741:d249 Non-privileged (249) attempt to map I/O space 00000000     (XEN) mm.c:741:d249 Non-privileged (249) attempt to map I/O space 000000f0     (XEN) grant_table.c:1408:d0 dest domain 450 dying      This is the second crash in a month. I have seen many system programming related questions here thats why i posted it here.


title: Control + L not clearing screen

text: When I try to clear my terminal screen on OSX:               computer@ ~ () $ ^L      And when I hit `Enter` after that it just shows:               -bash:        : command not found      Any ideas on how this happens? My `.bash_profile`, `.profile`, and `.bashrc` are empty.


title: Connecting to Verizon Mifi (wirelss hotspot) breaks everything

text: This question is obviously network related, but I thought it would be more appropriately placed in this forum because it's really not so much a connectivity issue. I recently got my hands on one of those Verizon Wireless Hotspot Mifi devices: ![enter image description here](http://i.stack.imgur.com/ySwYr.png) I observed that everything on my install works great until I actually connect to the device. Once connection is established my computer is rendered virtually useless. Specifically, I cannot run any programs (chromium, terminal, anything). Interestingly, if I boot up and start an instance of chromium and a terminal then those specific instances will continue to (partially) work until I close them, but no new instances can be created. I say partially because I did notice that pages began to load incompletely after a while and eventually the open instance ceased to work as well. Upon reboot everything works just as it should - unless of course I connect to that wireless hotspot again. Any ideas?


title: How to enable "Predictable Network Interface Names"?

text: I decided to check out what name my ethernet device will end up with, but contrary to other distros, Debian doesn't seem to have activated this change (or is holding it back?),               * Keep the old persistent network interface naming scheme for now and make       the new one opt-in via net.ifnames=1 on the kernel command line.      The problem is that I have to edit the grub kernel lines, and that seems like overkill for something that can be disabled by modifying a file. Is there another way?


title: dot command in Vim, last change?

text: The dot command in Vim repeats the "last change", but I am not exactly sure what constitutes the "last change". For example, if I type the sequence: > A;{ESC}j. Then a semi-colon is appended to the current line, but I have to type "j" again. In other words, the dot macro only does "A;{ESC}", so apparently the ESC is defining the end of the "last change". Why doesn't it include the "j" as well?


title: How do I re-map the changing pane keys in tmux?

text: I want `Prefix` + `Up`,`Down`,`Left`,`Right` to be mapped to `Prefix` + `Ctrl``h`, `Ctrl``j`, `Ctrl``k`,`Ctrl``l`. I tried:               bind-key C-h Left     bind-key C-j Down     bind-key C-k Up     bind-key C-l Right      But it didn't really work: it said "Unknown Command: Right". How do I specify this correctly? I went to `man tmux` to see the command under KEY BINDINGS and it did say Up, Down, Left, Right were the correct command for it. I am confused why the official tmux manual would say those commands when they don't actually exist like that, or what am I doing wrong?


title: regexp which matches all tokens independent of order

text: I have a quick (and hopefully simple) question about regexps. I'm trying to think of a regexp which matches all of a set of tokens irrespective of order. So for example I have a file with the names of the US states thus               Abbreviation:State name:Capital:Became a state     AL:Alabama:Montgomery:December 14, 1819     AK:Alaska:Juneau:January 3, 1959     AZ:Arizona:Phoenix:February 14, 1912     ...     WI:Wisconsin:Madison:May 29, 1848     WY:Wyoming:Cheyenne:July 10, 1890      Say I wanted to find all states which had the letters "A", "R" and "N" in their names (case insensitive). I could do a               $ cut -d: -f2 states.txt | tail -n +2 | grep -i a | grep -i r | grep -i n      which sure enough produces               Arizona     Arkansas     California     Maryland     Nebraska     New Hampshire     North Carolina     North Dakota     Rhode Island     South Carolina     Virginia     West Virginia      Is there any way of matching all three letters if they occur in any order using a single regexp?


title: What is the symbol *.* called?

text: What's the name for the               *.*      symbol and what is its significance?


title: Changing systemd HandleLidSwitch setting during run-time?

text: The setting `HandleLidSwitch` is defined in `/etc/systemd/logind.conf` as follows: `HandleLidSwitch=<hibernate,ignore,...> ` The setting is applied successfully on boot. However, I would like to change the setting during run-time depending on the AC state: If my laptop is charging, use `HandleLidSwitch=ignore`. If my laptop is on battery, use `HandleLidSwitch=suspend`. Is this somehow possible to realise with current systemd?


title: How can I create my own spelling file for vim?

text: At the moment I'm writing a document where need to use a lot of acronyms, technical language, and non German words. Now I was thinking if I could create a spelling file (`tech_speak`) which checks for this technical language so I can use the following vim command               :set spelllang=de,tech_speak spell      How could this be done?


title: Messages from syslogd, what do they mean and what do I do?

text: Recently, these messages started popping up straight into my prompt when I'm connected to the OpenSUSE system in question via PuTTY:               Message from syslogd@host at Aug  5 11:04:03 ...      kernel:[ 6177.851012] EIP: [<75c0234e>] 0x75c0234e SS:ESP 0068:f324dde1          Message from syslogd@host at Aug  5 11:15:01 ...      kernel:[ 6836.654020] Process sh (pid: 6245, ti=f2bee000 task=f32fd2b0 task.ti=f2bee000)          Message from syslogd@host at Aug  5 11:15:01 ...      kernel:[ 6836.654020] Stack:          Message from syslogd@host at Aug  5 11:15:01 ...      kernel:[ 6836.654020] Call Trace:          Message from syslogd@host at Aug  5 11:15:01 ...      kernel:[ 6836.654020] Inexact backtrace:          Message from syslogd@host at Aug  5 11:15:01 ...      kernel:[ 6836.654020]          Message from syslogd@host at Aug  5 11:15:01 ...      kernel:[ 6836.654020] Code:  Bad EIP value.          Message from syslogd@host at Aug  5 11:15:01 ...      kernel:[ 6836.654020] EIP: [<75c0234e>] 0x75c0234e SS:ESP 0068:f2befead      I know some very basic stuff about Linux but this catches me off guard. What does this mean? How do I troubleshoot? **edit** Turns out the system is actually unreachable now, while it does reply to ping I cannot connect via SSH to it. Is there anything I can do physically on the machine?


title: How to change cursor shape, color, and blinkrate of Linux Console?

text: I know I can change some fundamental settings of the Linux console, things like fonts, for instance, with `dpkg-reconfigure console-setup`. But I'd like to change things like blinkrate, color, and shape (I want my cursor to be a block, at all times). I've seen people accomplishing this. I just never had a chance to ask those people how to do that. _I don't mean terminal emulator windows, I mean the Linux text console, you reach with` Ctrl`+`Alt`+`F-key`_ I'm using Linux Mint at the moment, which is a Debian derivate. I'd like to know how to do that in Fedora as well, though. * * * _**Edit:** I might be on to something_ I learned from this website, how to do the changes I need. But I'm not finished yet. I've settled on using `echo -e "\e[?16;0;200c"` for now, but I've got a problem: when running applications like `vim` or `irssi`, or attaching a screen session, the cursor reverts back to being a blinking gray underscore. And of course, it only works on this one `tty` all other text consoles are unaffected. So how can I make those changes permanent? How can I populate them to other consoles?


title: Update jails FreeBSD in silent mode

text: What if I want to add all process to the cron? Is there silent way to upgrade jail? After these steps:               # make buildworld            # make installworld DESTDIR=/jails/somejail      It comes time to:               # mergemaster -Ui -D /jails/somejail      How to automate this process as asking so many questions during this operation (mean mergemaster) ? I want all my config files to stay untouched.


title: Determining the path of an executable

text: When looking for the path to an executable or checking what would happen would you enter a command name in a Unix shell, there's a plethora of different utilities (`which`, `type`, `command`, `whence`, `where`, `whereis`, `whatis`, `hash`...). We often hear that `which` should be avoided. Why? What should we use instead?


title: `command` vs `type` - Locate program file in user's PATH

text: I need locate program file in user's PATH. I found few solution, the best are `command` and `type`. Which is better, faster, UNIX-like way and why?               command -v <application>     type -p <application>


title: 'which' reports one thing, actual command is another

text: I am running Ubuntu 12.04, which came with Cmake v 2.8.7. I had need for a more current CMake, so I downloaded the source for 12.8.12.1, built, and installed it per directions. The last step, `make install` I ran `sudo`ed.               ./bootstrap     make     sudo make install      Now I want to run it, but I find that the old version is still invoked when I execute `cmake` from the command line:               jdibling@hurricane:/$ cd /; cmake --version; which cmake     cmake version 2.8.7     /usr/local/bin/cmake     jdibling@hurricane:/$       Odd, I think. So I `su` and try it from there:               root@hurricane:~# cd /; cmake --version; which cmake     cmake version 2.8.12.1     /usr/local/bin/cmake     root@hurricane:/#       Why does `which` report the same directory, but `cmake --version` reports different versions? How can I find where the new `cmake` was actually installed? As suggested, I ran `type`:               jdibling@hurricane:/tmp/cmake-2.8.12.1$ type cmake     cmake is hashed (/usr/bin/cmake)     jdibling@hurricane:/tmp/cmake-2.8.12.1$ sudo su -     root@hurricane:~# type cmake     cmake is /usr/local/bin/cmake     root@hurricane:~#


title: Is there an alternative to the `which` command?

text: If the `which` command is not available, is there another 'standard' method to find out where a command's executable can be found? If there is no other 'standard' method available, the actual system I face currently is a bare Android emulator with an `ash` Almquist shell, if that means anything.


title: Linux make 1 big from 3 smaller pictures

text: I need to automate a task where I have smaller jpg/png images what I would like to merge into 1 big picture by placing them in a square area. Obviously to do this I would need to open gimp every time. Create a new big image, like 1920x1200 and open the 4 smaller images, select them and copy paste them into the new one and save it. The solution I looking for don't have to be the pretties, it's enough if it "just works" tm. Thanks


title: How do I get rid of the small nub in the bottom right corner of my terminal?

text: I'm setting up XMonad within Linux Mint, and I've been able to remove the menubar and the scrollbar from my terminal windows, but I can't get rid of the small resizing nub in the bottom right corner. Here's a screenshot: ![terminal with offending nub](http://i.stack.imgur.com/KAJQE.png) I think it's feature of Linux Mint (maybe?), but it serves no purpose because of the nature of XMonad, so I'd love to get rid of it. It's gnome-terminal, by the way. I assume that's important. Edit: Ok, it's a feature of gnome-terminal, because xterm and rxvt don't have it. So I guess my question is: How can I remove the nub from gnome-terminal? One answer is just "use a different emulator", but I'm hoping there's a way to get rid of it.


title: How to change colors of all running urxvt instances?

text: I'm used to black background and light green text when working on my urxvt terminals. But sometimes, when I take my laptop outside, it becomes hard to read and I'd like to change the colors of all my urxvt instances to black on white, without having to shut them down and reopen again. Is it possible, and if yes, how?


title: How to hide someone else's directories from a user?

text: I have several folders:               /home/user1/ -u user1 -G user1     /home/user2/ -u user2 -G user2     /home/user3/ -u user3 -G user3      I created three users user1, user2, user3. Each user has own group. Any user can see other account folder for a while but cannot open it. After user2 logged in using ssh he shouldn't see any folders downto its folder `/home/user2/`. He should see only folders in `/home/user2/`. How to set these permissions?


title: Create a fake shell in Linux?

text: I am not talking about shell programming or making a whole new shell like Bourne or Korn Shell.... I just want a user accessing ftp through port 21 to be directed to this shell which can support some of the basic commands a shell uses! I Googled the very same...but didn't find any satisfactory results.


title: Strange issue with xml_split in Linux

text: I am using the code `xml_split` from https://metacpan.org/pod/distribution/XML-Twig/tools/xml_split/xml_split to split a huge XML file. I am facing a strange issue with this. First, I tried the `xml_split` for splitting a `12 MB` XML file to smaller pieces of `2 MB` each. I used the following command:               ./xml_split -s 2Mb small_file.xml      It worked perfectly and created around 6 small XML files. Next, I tried with a 100 MB file.               ./xml_split -s 2Mb big_file.xml      It completed without any error, but it created a single file which was of the same size as the source file. Again, I tried with my biggest file, of around `15 GB`.               ./xml_split -s 2Mb biggest_file.xml      It went on to create a single file, and I killed the process when the file size exceeded `500 MB`. I am not sure what to make of this behavior since the same code in the same environment is working for the small file, but not for any of the bigger ones. Also, I can't find any similar issue reported at the Metacpan website. I was wondering whether there could be some system limit on my machine which could be causing this. I am on `Ubuntu 12.04.4 LTS`. Thanks, TM **_Edit:_** Instead of using the source file from the link I provided, I installed using `sudo apt-get install xml-twig-tools`, but the issue remains. I also got a colleague to do this on his system and the `xml_split` on the `15 GB` file is working on his desktop (Ubuntu)


title: Tracing system call on Ubuntu 12.04

text: The main task I have to carry out, is to trace the system call of processes in ubuntu 12.04 LTS. Problem is, I am unable to trace them continuously, i.e. as soon as they are added to the system, they should get traced. Is there any kind of signal or interrupt which can inform the user about a newly added process in the system?


title: How do I send text to a USB device?

text: I'm trying to get the "Torobot" USB servo controller to work with Angstrom on a Beagle Board XM. The servo controller registers as a USB device. The device just takes simple text commands, but there is no TTY associated with it. So I'm not sure how to send commands to it. Can I just send data like this (assuming that 002/005 is the device):               $ cat file.txt >> /dev/bus/usb/002/005      Or do I need to associate it with the generic USB device? If so, how do I do that?


title: Problems with accessing files on a Sansa Clip mp3 player

text: I have problems with accessing my mp3 player (Sansa Clip) on my Linux Mint. When I plug in the player, it does mount, but seems to be empty - well ... there are built in directories and config files, here goes tree output:               .     ├── AUDIBLE     ├── AUDIOBOOKS     ├── DID.bin     ├── MTABLE.SYS     ├── MUSIC     ├── PODCASTS     ├── RECORD     │   ├── FM     │   └── VOICE     ├── RES_INFO.SYS     ├── SYS_CONF.SYS     └── version.sdk          7 directories, 5 files      I have no idea whats going on, I've changed the USB mode to MSC, but it didn't helped. P.S. When I tried to open it with banshee - it displayed on the bottom bar that there are no audio files, no video files, 2.3GB of "other files" and 5GB of free space.


title: Find and copy directories containing file type

text: I have a directory "Movies" containing subdirectories "Movie Name". Each subdirectory "Movie Name" contains a movie file and related image/nfo files etc. I'm trying to copy all directories containing movie file of type ".avi" to an external usb device. So if `Directory/subdirectory A` contains `movie.avi`, `poster.jpg` and `movie.nfo`, then I want to copy that directory and its contents to the external drive. I've tried this:               find . -name "*.avi" -printf "%h\n" -exec cp {} /share/USBDisk1/Movies/ \;      But it only copies the file, not the directory and file contents.


title: vim latex: disable quickfix

text: How can I disable latex's quickfix feature when editing tex files (having vimlatex installed). But I want to keep it for any other language… Pretty sure this is just a small flag, didn't find it 'though.


title: Bad blocks only with extension cord?

text: My external hard drive was acting strangely, so I ran badblocks, and it seemed that nearly every block was bad from the first minute I ran it. If I did `badblocks -v > file`, the file was over 100MB after only seconds of running it. Then, for the hell of it, I ran badlocks on the same drive without using the 10 foot USB3 extension cable I've been using, and it's at 5% with no errors. Also, if I interrupt badblocks with the cord, it will show up as a different drive name (/dev/sdb, run badblocks and quit, and the drive is now /dev/sdc), and I haven't been able to reproduce this without the cord. Is it possible for badblocks to be wrong and complain about a perfect drive?