title: Perform floating point arithmetic in shell script variable definitions

text: I understand `bash` and some other interpreters only perform arithmetic for integers. In the following `for` loop, how can I accomplish this? I've read that `bc` can be used but am not sure how to use `bc` in this situation.               total=0     for number in `cat /path/to/file`; do             total=$(($total+$number))     done     average=$(($total/10))     echo Average is $average      file:               1.143362     1.193994     1.210489     1.210540     1.227611     1.243496     1.260872     1.276752     1.294121     1.427371


title: Can sed remove 'double' newline characters?

text: I have a document with a lot of empty lines. How can I remove them when there are 2 or more together. I tried `sed "s/\n\n//"` file but it didn't work. No error.


title: Run Xdotool on multiple users at once

text: When running Xdotool on user `one` (cron):                * * * * * export DISPLAY=:0 && xdotool mousemove 10 10      and I switch to user `two` for several hours, and back to user `one`, I find out Xdotool not running while I'm not viewing their user's window. How to make Xdotool running no matter what user's window I'm viewing?


title: Copying files from command line to clipboard

text: In a GUI file manager it is possible to select a few files, press Ctrl-C (which supposedly copies come info about the files to clipboard), then navigate to another folder and press Ctrl-V, which will then copy the files into that directory. As an experiment, after copying files in the file manager, it is possible to switch to a text editor - pressing Ctrl-V there pastes a list of absolute filenames. The reverse process (copying a list of files from a text editor and pasting them to a file manager) does not work, which is supposedly due to different target atoms The goal of the exercise is to be able to copy some files from command line, for example               find ${PWD} -name "*.txt" | xclip <magic parameters>      then switch to a file manager and copy them all to a directory using File->Paste. So, the question is: What parameters of `xclip` (or other program) do I need to specify so file manager recognizes the selection as a list of files and enables its Paste menu item? Alternatively, is there a low-level tool which would allow to inspect the contents of X selection and see what data it currently contains?


title: X11/Xlib.h: No such file or directory

text: I am trying to install tcl and tk on my linux server.I don't have the root password,So I am installing them in my home directory.I am using below method for installing it manually.               cd ~/tcl8.5.11/unix     ./configure --prefix=/home/cnel711 --exec-prefix=/home/cnel711     make     make install          cd ~/tk8.5.11/unix     ./configure --prefix=/home/cnel711 --exec-prefix=/home/cnel711 --with-tcl=/home/cnel711/tcl8.5.11/unix     make     make install      I was able to install tcl without any problem ,but I am facing problem while installing tk. `configure` for `tk` worked fine ,I am facing problem while using `make`.I am getting this error.               X11/Xlib.h: No such file or directory      I found out this file was missing on the server.So,I downloaded `libX11-devel` from here.Again,I installed it in my home directory.Then I exported the path to the header files and when I use `which` command to find Xlib.h,it locates ths file.               >which Xlib.h     ~/include/X11/Xlib.h      Now, when I try to install `tk` again `configure` works fine as usual but I get the same error again while using `make` `X11/Xlib.h: No such file or directory`. Please help me out,what possibly is going wrong here ?


title: What is the difference between a job and a process?

text: What is the difference between a "job" and a "process"?


title: How to install Fedora from an ISO on a USB?

text: I have a Fedora 14 x86_64 iso image and I want to install it using a USB stick. How do I get this stick to boot up, and use the image to start the installation? I'm running Debian.


title: How to mount external hard disk every time the server is restarted?

text: I have a server which the date will be backup to a external windows server hard disk which is mounted. But problem is every time the server is restarted I will need to mount the disk manually. How do I setup such as it will be mounted on server startup?


title: How to know list of applications installed in my server?

text: I got one LINUX server in which Oracle LINUX 5 is installed. I have installed MySQL 5.1.73-community version. Now, I have to configure the variables. When I checked available memory through `cat /proc/meminfo` command, I got below output:               MemTotal:      1927692 kB     MemFree:        446620 kB     Buffers:        619140 kB     Cached:         214340 kB     SwapCached:          0 kB     Active:         649660 kB     Inactive:       725232 kB      Now, it seems that system has only 2GB memory (RAM) in which only 0.4 GB is free. Can I know what are other applications have been installed in this machine?


title: Forward Autocorrect to a script

text: > **Possible Duplicate:**   >  How do I get bash completion for command aliases? I wrote a series of scripts to make package management a little more intuitive for me. However, I can no longer tab complete for package names. Is there a way I can forward the results of a tab completion to a script? Sample- package-install:               #!/bin/bash          apt-get install $*


title: Prevent hacking the grub.conf using a 'live rescue' from a live linux iso

text: It happened that I had set the grub password in grub.conf. But, using a live linux iso, I was able to delete the password from the grub.conf. Please read the steps for the same mentioned in this link: http://gofedora.com/how-to- recover-crack-root-password-grub-locked/ Instead of editing menu.lst, I edited the grub.conf. Rest all steps same My question is: Is there a way to prevent such a hack. When I tried rescuing, the system showed a message that if it is not able to rescue (i.e. if it fails mounting the HDD under the directory: /mnt/sysimage), do I want to continue/skip/abort. So, I feel that there must be a concrete way of preventing such hacks by doing something with the mounts/boot etc, which shall prevent mounting into /mnt/sysimage. Any help would be valuable Edit: PS: Please re-consider this environment for a virtualised environment where the actual VM in VSphere is a linux VM, and I need to disable/delete the CD/DVD-Rom and network boot from BIOS. After doing all that stuff, I want to re-package the VM into .ovf and check whether the new ovf has the BIOS restrictions or not.


title: How to rotate video?

text: I have many videos taken from Nokia N73 that are getting played on my laptop (after transferring from phone to laptop) horizontally. How to make them play vertically. I have read this link. but the issue is this link talks of mp4 file & mine is avi. Regarding my mp4 video file I ran:               ffmpeg -i infile.mp4 -vf "transpose=1" -an -vcodec mpeg4 outfile.mp4      It worked for mp4 but I lost my sound from the video. Also after getting rotated, the area on screen on which the video is running has shrinked (one can call it frame size or so). Now it has become more narrow vertically. Is this how it will be?


title: MAME saving but not restoring games

text: **Background** I discovered Ms. PacMan some time ago, but you don't see many of that game in arcades. Then I did find out about `mame` (version 0.145), available on my Linux (Ubuntu) machine and about running Ms. PacMan and that works. **Problem** When I save a game (so I don't have to start from the beginning every time (so to improve more difficult levels) and then restore the game, the game in MAME resets and I have to start from the beginning. I have read here about games being updated to support save state and also somewhere that saving was removed from MAME .100. I also tried to compile an older MAME version 0.99 (which should support saving), but it has no Linux support. And AdvanceMAME (1.2) does not compile because of configuration file problems that don't seem easy to solve. **Question** Should I try harder to get an old MAME compiled, or is this saving of Ms. PacMan not going to work on Linux anyway?


title: Number of files not containing given string

text: I read the question about how to find out the number of files that contain a certain string. This is possible with `grep -l "string" * | wc -l`. Is it possible to invert this, finding the number of files **not** containing the target string? I tried adding the `-v` option, but this doesn't seem to output the right result.


title: Unable to mount CDROM on Solaris 10

text: I have problem with using CDROM on Solaris 10. When I mount any ISO using VMware, ISO is not being visible under Solaris.   1. When I go to CDROM there is nothing inside:              --- 134 # cd /cdrom     --- 135 # ls -lart     total 9     drwxr-xr-x   2 root     root           2 Jan  3 10:36 test     drwxr-xr-x   3 root     nobody         3 Jan  3 10:36 .     drwxr-xr-x  29 root     root          32 Jan  3 15:03 ..        2. I can try to mount CDROM manually, for example using the following command:              --- 136 # mount -F hsfs -o ro /dev/dsk/c0t0d0 /cdrom/test          mount: No such device          mount: cannot mount /dev/dsk/c0t0d0      This is because I can't find information abount the physical name of my CDROM - in the following format: c1t1d0, c1t2d0, c2t1d0 etc.   3. IOSTAT command gives me results:              --- 137 # iostat -E     sd0       Soft Errors: 0 Hard Errors: 0 Transport Errors: 0     Vendor: VMware   Product: Virtual disk     Revision: 1.0  Serial No:     Size: 26.84GB <26843545088 bytes>     Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0     Illegal Request: 3 Predictive Failure Analysis: 0     sd2       Soft Errors: 0 Hard Errors: 0 Transport Errors: 0     Vendor: VMware   Product: Virtual disk     Revision: 1.0  Serial No:     Size: 21.47GB <21474835968 bytes>     Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0     Illegal Request: 3 Predictive Failure Analysis: 0     sd4       Soft Errors: 0 Hard Errors: 0 Transport Errors: 0     Vendor: VMware   Product: Virtual disk     Revision: 1.0  Serial No:     Size: 107.37GB <107374181888 bytes>     Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0     Illegal Request: 3 Predictive Failure Analysis: 0     sd5       Soft Errors: 0 Hard Errors: 0 Transport Errors: 0     Vendor: NECVMWar Product: VMware IDE CDR00 Revision: 1.00 Serial No:     Size: 0.00GB <0 bytes>     Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0     Illegal Request: 2 Predictive Failure Analysis: 0     sd6       Soft Errors: 0 Hard Errors: 0 Transport Errors: 0     Vendor: NECVMWar Product: VMware IDE CDR01 Revision: 1.00 Serial No:     Size: 0.00GB <0 bytes>     Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0     Illegal Request: 2 Predictive Failure Analysis: 0          --- 138 # iostat -En          c1t0d0           Soft Errors: 0 Hard Errors: 0 Transport Errors: 0     Vendor: VMware   Product: Virtual disk     Revision: 1.0  Serial No:     Size: 26.84GB <26843545088 bytes>     Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0     Illegal Request: 3 Predictive Failure Analysis: 0     c1t2d0           Soft Errors: 0 Hard Errors: 0 Transport Errors: 0     Vendor: VMware   Product: Virtual disk     Revision: 1.0  Serial No:     Size: 21.47GB <21474835968 bytes>     Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0     Illegal Request: 3 Predictive Failure Analysis: 0     c1t1d0           Soft Errors: 0 Hard Errors: 0 Transport Errors: 0     Vendor: VMware   Product: Virtual disk     Revision: 1.0  Serial No:     Size: 107.37GB <107374181888 bytes>     Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0     Illegal Request: 3 Predictive Failure Analysis: 0     sd5              Soft Errors: 0 Hard Errors: 0 Transport Errors: 0     Vendor: NECVMWar Product: VMware IDE CDR00 Revision: 1.00 Serial No:     Size: 0.00GB <0 bytes>     Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0     Illegal Request: 2 Predictive Failure Analysis: 0     sd6              Soft Errors: 0 Hard Errors: 0 Transport Errors: 0     Vendor: NECVMWar Product: VMware IDE CDR01 Revision: 1.00 Serial No:     Size: 0.00GB <0 bytes>     Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0     Illegal Request: 2 Predictive Failure Analysis: 0        4. When trying to use script which was found on Stackoverflow I have resutls:              --- root@solaio03 : /cdrom     --- 139 # iostat -x|tail -n +3|awk '{print $1}'>/tmp/f0.txt.$$     iostat -nx|tail -n +3|awk '{print "/dev/dsk/"$11}'>/tmp/f1.txt.$$     paste -d= /tmp/f[01].txt.$$     rm /tmp/f[01].txt.$$     --- root@solaio03 : /cdrom     --- 140 # iostat -nx|tail -n +3|awk '{print "/dev/dsk/"$11}'>/tmp/f1.txt.$$          --- root@solaio03 : /cdrom     --- 141 # paste -d= /tmp/f[01].txt.$$     sd0=/dev/dsk/c1t0d0     sd2=/dev/dsk/c1t2d0     sd4=/dev/dsk/c1t1d0     sd5=/dev/dsk/sd5     sd6=/dev/dsk/sd6     nfs1=/dev/dsk/solaio03.sys.net:vold(pid747)        5. And now my final question: Is there anybody which can give me any advice what should I do?


title: Getting information from sysfs

text: I'm creating a script for polling information about network interfaces. For this I get some data from `/sysfs`. Everything went fine until I wanted to clarify all possible states of an interface (Which are they btw? I'm aware for now only about `up`, `down` and `unknown`). I went through `/usr/src/linux/Documentation/sysfs-rules.txt` and found this: > Accessing /sys/class/net/eth0/device is a bug in the application Is there a reason for this? Could someone explain me if I'm doing something wrong by getting information from `/sysfs`? I don't iterate through all interfaces in `/sysfs` but get all network interfaces with `getifaddrs(3)`. Perhaps there is another method to get iface status? Thanks.


title: updating BIOS without MS Windows (or a floppy drive)

text: I'm running Kubuntu 12.04. I need to update my motherboard BIOS. The Arch Linux Wiki says, "By far the easiest way to make a bootable FreeDOS USB Stick is using unetbootin." So I did that. Using UNetbootin I succeeded in installing FreeDOS 1.0 (fdboot.img) on the USB stick. Now, however, I am having a hard time figuring out though how to add files so that I can access them from FreeDos. The Arch Linux wiki says, "Finally, you may copy everything you want to flash there (BIOS, firmwares, etc)." I did that and then I rebooted into FreeDos. The files were no where to be found. I had a "A:>" prompt with only FreeDos system files. No other drives were available and the files I had copied to the root of the USB stick could not be found. BTW, my BIOS image is 4.0 MB in size.


When I want to run ffmpeg I get the following error: `ffmpeg: error while loading shared libraries: libtheoraenc.so.1: cannot open shared object file: No such file or directory` This is output of `ls \usr\lib -l | grep libtheora`:                    -rw-r--r--  1 root   root    419238 Jan  5  2010 libtheora.a     -rw-r--r--  1 root   root       935 Jan  5  2010 libtheora.la     lrwxrwxrwx  1 root   root        19 Jan  5  2010 libtheora.so -> libtheora.so.0.3.10     -rw-r--r--  1 root   root    145636 Jan  5  2010 libtheoradec.a     -rw-r--r--  1 root   root       948 Jan  5  2010 libtheoradec.la     lrwxrwxrwx  1 root   root        21 Jan  5  2010 libtheoradec.so -> libtheoradec.so.1.1.4     -rw-r--r--  1 root   root    334696 Jan  5  2010 libtheoraenc.a     -rw-r--r--  1 root   root       954 Jan  5  2010 libtheoraenc.la     lrwxrwxrwx  1 root   root        21 Jan  5  2010 libtheoraenc.so -> libtheoraenc.so.1.1.2           What should I do to solve the problem? Edit: in line: `libtheoraenc.so -> libtheoraenc.so.1.1.2` I can't find libtheoraenc.so.1.1.2 in /usr/lib(packages libtheora and libtheora-dev are installed) output of `locate libtheoraenc.so.1.1.2` is: /usr/lib/libtheoraenc.so.1 /usr/lib/libtheoraenc.so.1.1.2 But I can't find this files in /usr/lib!


title: What is the tool that allows me to specify arbitrary directories using **

text: I once saw a colleague uses a tool which allows to use ** to represent any directories. For example: if a file called `myfile.java` sits deep inside:               src/main/com/mycompany/product/store/myfile.java      A command in the parent of `src` directory:               ls **/myfile.java      can list the file. Can anyone tell me what tool it is? What package I need to use on `Ubuntu` to achieve this?


title: Mount Android phone file system on Linux manually

text: How can I bind my Android file system to my Linux machine, and modify it? When I plug in my Android device, it seems to use one USB interface but I couldn't find whre the mount point is. I checked `/mnt` but there is nothing.


title: Enabling Numeric Keypad

text: I have trouble with the numeric keypad (`NumLock` keys) being unusable while typing. While I don't think it's GUI specific, this happens both in Gnome and KDE. Sometimes it works in TTY, other times it fails. If I press the `NumLock` key nothing happens, and the response is the same. I cannot use any of the keys except `Ins`, which repeats text after `Backspace` is used. EDIT: xev output, on `NumLock` press/release               KeyPress event, serial 33, synthetic NO, window 0x2800001,         root 0x101, subw 0x0, time 389867, (311,217), root:(319,313),         state 0x0, keycode 77 (keysym 0xff7f, Num_Lock), same_screen YES,         XLookupString gives 0 bytes:          XmbLookupString gives 0 bytes:          XFilterEvent returns: False          KeyRelease event, serial 33, synthetic NO, window 0x2800001,         root 0x101, subw 0x0, time 389867, (311,217), root:(319,313),         state 0x10, keycode 77 (keysym 0xff7f, Num_Lock), same_screen YES,         XLookupString gives 0 bytes:          XFilterEvent returns: False


title: Restrict applications to access certain hardware (webcam, microphone...)

text: If I tell applications like VLC or Audacity to record from my webcam or microphone, they just wake the hardware if sleeping and do their work without my interference. Although this is a good thing, I've always wondered, due to privacy concerns: is there a way to restrict applications access to a hardware device? Many times I need to run non-free software, and **most of them from companies I know I shouldn't trust**. While writing this, I came up with the idea of using something like SELinux or AppArmor to restrict access to `/dev/something`. Is this possible? Could there be a better or easier way? Also, is there any more hardware besides the webcam and microphone that I should be concerned about (in terms of privacy)?


title: VST plugin integration into ALSA?

text: I have "headless" (e.g. no graphical front-end) VST plugin that I would like to embed into my ALSA setup to continuously filter my sound. I remember that there used to be a `LADSPA` plugin which itself embedded/used VST plugins, but I can't seem to find it anymore. Is there a way to use a VST plugin directly with ALSA? `jackd` is not much of an option here as it hangs too often on the target (Raspberry) when in real- time mode.


title: What effects does restarting sshd have on existing ssh sessions?

text: I've made some changes to the sshd_config. As I understand it, now I need to restart the sshd service. What happens to existing ssh sessions for the users? Any pointers to documentation I need to read?


title: How to specify attachment encoding in mutt command line?

text: I'm trying to send an email with attachment from a perl script. First, I create the attachment (an xml file):               open(XMLFILE, ">:utf8", $xmlfile);     print XMLFILE "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";     print XMLFILE "<data>\n";     #print XMLFILE "...\n";     print XMLFILE "</data>\n";     close (XMLFILE);      I also tried `open(XMLFILE, ">", $xmlfile);` with `binmode XMLFILE, ":utf8";`. Then I send the email like this:               open(MUTT, "|/usr/bin/mutt -s \"TestSubject\" -a $xmlfile \"test\@example.com\"");     binmode MUTT, ":utf8";     print MUTT ("TestBody");     close (MUTT);      Nevertheless, both the text part and the attachment have `Content-Type: text/plain; charset=iso-8859-1`. I also tried `open(MUTT, "|/usr/bin/mutt -e \"set file_charset=utf-8\" -a $xmlfile ...`, but this gave me an `Error in command line: file_charset: unknown variable`. What am I doing wrong?


title: Can we Bring Up eth1 after removing e1000e modules?

text: I am trying to setup TCP in RTnet. I am not sure whether its possible. I read that RTnet is not supporting TCP. Is that so? So now I am trying to setup rteth0 as server and eth1 as client. To setup rteth0, I removed e1000e modules and I am actually able set up both rteth0 and rteth1. But I need to setup only rteth0 and want eth1 as a non-real time port. How can I do that?


title: get the Xth argument in each line

text: I would like to get the second argument in a line of output. For example:               ps aux      gives me an output that contains the cpu-usage %CPU in the third column. How can I filter the output so I have only that column? I tried               ps aux | cut -f 3      but that's not working see also: Filtering the Xth element in a row?


title: No response from remote host for Nagios check_snmp_mem.pl plugin

text: Trying to setup memory usage monitoring for Nagios using the `check_snmp_mem.pl` from Nagios SNMP plugin. I could not even get it working from the command line, I mean I go to `/usr/lib/nagios/plugins` and run the script, it gets a "No response from remote host" error.               [root@nagios plugins]# ./check_snmp_mem.pl -H rhel01 -C public -N -w 90,20 -c 99,30     Argument "v6.0.1" isn't numeric in numeric lt (<) at ./check_snmp_mem.pl line 319.     ERROR: Description table : No response from remote host "rhel01".      Any SNMP configurations required on the monitored server?


title: How to match a literal '*' with sed?

text: I have this line in my file called test.php               'dbs_password' => 'a8b*cyP0',      and want to replace into:               'dbs_password' => 'password-here',      So I use this `sed` command with syntax:               $ sed -e "s:'dbs_password' => 'a8b*cyP0',:'dbs_password' => 'password-here':" -i test.php      However it doesn't change/get replaced. I would appreciate it if anyone could share some knowledge on the proper way to use `sed` for this such kind of code?


title: Home key acting strange in bash (tty and X) on long input strings

text: When I hit `Home` if my current input is short enough (say, <36 characters), it works fine. However, when I've typed a longer command and then want to go back to the beginning, it seems like it does its job, but the command isn't **displayed** right anymore. It looks as if I'm not in the beginning but about 10 characters off. Although if I type "blindly", it works fine, but it looks like a total mess, as if the whole input is shifted to the right, but not redrawn. So I type over it, but "in fact" not, because the place I'm "erasing" is "actually" 10 characters to the right. Accordingly, if I try to erase the command, the first 10 characters are still displayed, but if I hit `Enter` it just displays another prompt as if the previous input was empty. I know it's not the best explanation ever, but the point is that bash recognizes it and tries to do the right thing, but often fails. I reproduce this both in tty and in a terminal in an X session. When I hit `Ctrl`+`V` and then `Home` I see different sequences (`^[OH` in X, `^[[1~` in tty), but both seem to be in my `/etc/inputrc`:               # do not bell on tab-completion     #set bell-style none          set meta-flag on     set input-meta on     set convert-meta off     set output-meta on          $if mode=emacs          # for linux console and RH/Debian xterm     "\e[1~": beginning-of-line     "\e[4~": end-of-line     "\e[5~": beginning-of-history     "\e[6~": end-of-history     "\e[7~": beginning-of-line     "\e[3~": delete-char     "\e[2~": quoted-insert     "\e[5C": forward-word     "\e[5D": backward-word     "\e\e[C": forward-word     "\e\e[D": backward-word     "\e[1;5C": forward-word     "\e[1;5D": backward-word          # for rxvt     "\e[8~": end-of-line          # for non RH/Debian xterm, can't hurt for RH/DEbian xterm     "\eOH": beginning-of-line     "\eOF": end-of-line          # for freebsd console     "\e[H": beginning-of-line     "\e[F": end-of-line     $endif      `echo $TERM` shows `linux` in tty and `xterm` in X session. It's > GNU bash, version 4.2.24(2)-release (i686-pc-linux-gnu) Anyone have clues about this?


title: Cannot execute command at GNU screen startup

text: I want to do something similar to what's written here without using zsh (I use bash), but if I try to start screen with               screen 'cd /home/cataldo/Programs'      I get the following error:               Cannot exec 'cd home/cataldo/Programs': No such file or directory      Without qoutes after exec it does not work either. Double quotes make no difference. Using bash -c "cd .." does not work. It might be some permission problem or screen executes commands as a special user at startup? Thank you very much for your help!               screen --version     Screen version 4.00.03jw4 (FAU) 2-May-06          cat /etc/debian_version      6.0.3


title: What is the `editor` command in bash?

text: I was looking for a command that would hopefully open the current user's favourite text editor, because I am writing out some instructions with commands in a blog. I was expecting a command like `edit`, and I found `editor`. For me, it started vim in the terminal, which is close to what I wanted; I use vim-gtk. I started searching for a way to make editor use vim- gtk and found this question that explains an `$EDITOR` environment variable, but I am not sure if that is even related to the `editor` command. I tried `man editor`, but that just pulled up the vim manpage. How can I make `editor` use a text editor of my choice, or should I be using a different command?


title: Linux mint 15, synaptic can't download all repository indexes

text: I'm using Linux Mint 15, and started getting these errors from synaptic update manager. I did not change anything in the system, one day it just started to throw these errors. My network works OK, all websites load without any problems. How can I track the cause of the issue? ![Synapctic error](http://i.stack.imgur.com/GtfjQ.png)


title: How does SMART work for scsi device?

text: After going through the man pages of `smartctl`, `smartd` and `smartd.conf`, I am no clearer on how S.M.A.R.T. is supposed to work on a scsi device. I have a default configuration file that says:               DEVICESCAN -H -m root -M exec /usr/libexec/smartmontools/smartdnotify -n standby,10,q      The above does not work for my case as DEVICESCAN is not able to detect my scsi disk on RAID 1 configuration. I ran the following command and it says that the next internal SMART test will run in 47 minutes time:               # smartctl -d scsi -A /dev/sg1     === START OF READ SMART DATA SECTION ===     Current Drive Temperature:     34 C     Drive Trip Temperature:        68 C     ....     Vendor (Seagate/Hitachi) factory information       number of hours powered up = 11183.48       number of minutes until next internal SMART test = 47      From the man page of smartd, I understand that the default interval between disk checks is 30 minutes. Now, my question is, how does the 47 minutes come about? Also, from the man page of smartd.conf, there are actually very few options that are valid, namely the `-l self-test` (even -H is for ATA only). Do I have to explicitly schedule a self-test (short or long) prior to the disk check? For the above question, my point is, if I just have the following in my config:               DEFAULT -d scsi -l selftest -m root -M exec /usr/libexec/smartmontools/smartdnotify     /dev/sg1     /dev/sg2      would it be of any use at all? **Extra Info:** I am using Dell PERC H200 RAID controller on two Seagate ST3300657SS disks.


title: pg_dump version mismatch on Debian

text: I'm running PostgreSQL on Debian Unstable/Sid. I've got the current versions (9.1) of `postgresql`, `postgresql-client`, `postgresql-client-common` (143) installed. The problem I'm having is trying to run `pg_dump`. I'm getting this error:               pg_dump: server version: 9.1.9; pg_dump version: 9.0.6     pg_dump: aborting because of server version mismatch      I can't seem to figure out how to get a newer version of `pg_dump`. It seems to be coming from the `postgresql-client-common` package, and I've trying running `apt-get --reinstall` on it, but that didn't get me a newer version of pg_dump. How do I work around this? Or where can I find a package with a newer version of `pg_dump`?


title: Is there a way to lock terminal's title?

text: Sometimes there're lots of different sessions opened in own terminal's tabs and it's rather desirable to have theirs initial titles (named by session name) locked since local title tweaks make those sessions indistinguishable. It's obvious that controlling all the bits and pieces of remote software running is too wide task to be accomplished in reality, so the most suitable way would be setting a knob prohibiting any further changes to a title. I doubt there's such a knob, but who knows?


title: Why doesn't `head -c 2 /dev/hwrng` work?

text: I have an Atmel 97SC3201 in my computer and set the following in the kernel:   * CONFIG_HW_RANDOM_TPM   * CONFIG_TCG_TPM   * CONFIG_TCG_ATMEL `/dev` has `tpm0` and `hwrng`, but running this command returns the following:               head -c 2 /dev/hwrng      output:               head: error reading ‘/dev/hwrng’: Input/output error      In `dmesg` these messages appear:               tpm_atmel tpm_atmel: A TPM error (2048) occurred attempting get random      additional tries yield these messages:               tpm_atmel tpm_atmel: A TPM error (6) occurred attempting get random      Any ideas why this fails or better, how to get it working?


title: urxvt not loading xft font from ~/.Xdefaults

text: Some basic details:               archlinux 3.9.3-1     xmonad 0.11     urxvt 9.18      I can get urxvt to load my desired font manually using:               urxvt -fn "xft:Ubuntu Mono"      However, I'm unable to get this font to load through ~/.Xdefaults - Here's what I have at the moment:               Xft*dpi: 96     Xft*antialias: true     Xft*rgba: rgb     Xft*hinting: true     Xft*hintstyle: hintslight          URxvt*transparent: true     URxvt*shading: 40     URxvt*saveLines: 12000     URxvt*foreground: White     URxvt*background: Black     URxvt*scrollBar: false     Urxvt*font: xft:Ubuntu Mono     Urxvt*boldFont: xft:Ubuntu Mono      All other urxvt settings load fine, except the font. I've tried many different combinations like: `xft:Ubuntu Mono:pixelsize=14:style=regular` etc, but nothing seems to work. I've tried `xrdb -merge ~/.Xdefaults`, `xrdb -load ~/.Xdefaults`, and restarting X entirely. I've also tried these settings in ~/.Xresources, however urxvt seems to ignore those settings entirely. What am I missing?


title: How does irqbalance determine which package to use?

text: `irqbalance --debug` shows the following:               Package 0: Core 0, 2, 4, 6, 8, 10, 12, 14     Package 1: Core 1, 3, 5, 7, 9, 11, 13      When I run network applications, it seems like IRQs are being handled by package 1, however the `smp_affinity` for the NIC is in package 0.   1. Does `irqbalance` override `smp_affinity` configuration?   2. How does `irqbalance` decide which package to use for handling IRQs?


title: How to boot into FreeBSD installed in the second partition of an external drive

text: I have installed FreeBSD 9.1 on the second partition of an external hard disk and I'm not able to get my computer to boot from it. FreeBSD was installed using the FreeBSD memstick image dd'd onto a USB flash drive. The first partition is an ntfs partition which has my backup. When I found the need to have a FreeBSD installation, I "shrank" the first partition (in windows) to get free space to install FreeBSD and then installed FreeBSD. It never asked to install a boot manager. When I first tried to boot, it failed without any error message (maybe there was no boot manager installed). So I booted from my flash drive, and ran the command `boot0cfg -B /dev/ad1)` (ad1 refers to the external hard disk). Now on booting, it displays a menu like:               F1 Win     F2 FreeBSD     F5 First disk      and on pressing F1 or F2 I get the error message: "BOOTMGR is missing". What could the problem be? Please help me boot into my FreeBSD installation.


title: cp SOMEFILE .. copies to a different directory after cd'ing via a symbolic link

text: Consider the following setup:               ~/Desktop/Public/subdir     ~/Desktop/subdir --> ~/Desktop/Public/subdir (symbolic link)      Now I do:               cd ~/Desktop/subdir      Which leads me into the linked directory. If I now issue the command:               cd ..      I will be moved back into the `Desktop` directory. This means the cd command is context sensitive - it remembers that I entered `subdir` via the symbolic link. However, issuing the command               cp testfile ..      will copy `testfile` into `Desktop/Public`. I prefer the behavior of `cd` over the (often unpredictable) behavior of `cp`. In any case, I wonder what is the reason for this difference in behavior? Just a legacy thing or is there a good reason?


title: Using passwordless ssh on CentOS 6

text: I have a fresh install of CentOS 6 that I am trying to connect to using ssh without a password. But each time I try to login, I am asked for the password. Here are the commands in order:               ssh-keygen     ssh-copy-id -i ./id_rsa.pub user@192.168.1.20     ssh user@192.168.1.20     restorecon -r .ssh


title: Machine keeps backups of files that I have already deleted

text: I recently found out that my machine keeps backups of files that I have already deleted. For example, a file called `a.svg` that I have deleted in the past, still exists in the directory it was deleted from but with a new filename called `a.svg~`. Again, another deleted file called `README.txt` still exists with a filename `README.txt~` and so on. Moreover, you can not see directly these kind of files but only when you check "show hidden and backup files" in Nautilus or when you `ls` in a terminal. How can I disable those backup files and have my files deleted for good?


title: Updating CentOS by YUM command without removing previous version

text: I wanna update my system by yum command, after executing `yum update` it wants to update kernel to **2.6.32-431.5.1.el6** version also it wants to remove my oldest kernel version (2.6.32-279.el6). **Question:** How to prevent YUM to not remove my previous kernel versions?


title: Create a computer lab using Linux

text: I would like to know, how I can create my own Linux lab, like the universities Linux labs. I mean OK, I can install for example Fedora to all my 4 PCs, but how I can login from different computers, and be able to have access to my files from any out of the 4 PCs? In addition how can I login at all 4 using the same password? I know that it should be a server behind all that containing my files, or login info, but how all these are connected? And how I can ensure security on that lab (eg, not be able for a user to install a malware, and how I cannot for example see or copy files of other users)?


title: What does "cd &" mean?

text: I know how to change directory from terminal by typing               cd <directory>      but here's the scenario. I was using terminal to go on my git repository's folder.   * glennRepositories      * glenn-remdroid-repository Given the folder structure above, I want to switch in `glenn-remdroid- repository` because it is my repository by doing.               cd glennRepositories      Before switching in glenn-remdroid-repository, I mistakenly typed the commmand               cd &       instead of `cd *`. I used `cd *` because the folder name is long for me, sorry for being lazy. When I execute the `cd &` , the terminal replies               [1] 7519      When I execute `cd *` this is now happened               [1]+  Done                    cd  (wd: ~/glennRepositories)     (wd now: ~/glennRepositories/glenn-remdroid-repository)      Does anyone what `cd &` means and its output? Google doesn't know my question :)


title: soundblast live on linx mint: fatal: module snd-emu10k1 not found

text: I'm trying to get my soundblast live 5.1 emu10k1 (rev 7) working. It is listed in my xconf settings but the onboard sound processor is the standard (i have tried to make de soundblaster standard, but then I had no sound). I ran `alsamixer` from a terminal and there's my soundblaster live 5.1 shown as the first device, but I cannot get any sound out of it... ### screenshot from alsamixer     ![ss #1](http://i.stack.imgur.com/WgyAx.png) _original URL:https://db.tt/ukN6Qd2T_ I found a tutorial from Ubuntu which tells step by step what to do. When I'm at the point of doing a `modprobe`, this is the output in terminal:               FATAL: Module snd_EMU10K1 not found.      What can I do to make my soundblaster live working?


title: inotifywait different action on file or dir

text: I'm trying to make a `inotifywait` script take different actions for files vs folders if it sees a close_write flag being raised in the watched directory, but cannot seem to get the checks working. In other scripts I use these kinds of checks all the time and they just_work, but there seems to be something about `inotifywait` I'm not grasping yet. This is the script in its current form:                   #!/bin/bash              dir1=/sambashares              while true; do          inotifywait -r -e close_write "$dir1" | while read f; do           #debug           echo $f           #Is it a directory?           if [[ -d "${f}" ]]; then            #debug            echo "New directory called ${f} detected"            chown -R jake:jake $f            chmod -R 775 $f            cp -R $f /media/lacie/Film           fi           #Is it a file?           if [[ -f "${f}" ]]; then            #debug           echo "New file called ${f} detected"           chown jake:jake $f           chmod 775 $f           cp $f /media/lacie/Film           fi               done         done      If I run this in a terminal to see what is happening all I get is the confirmation a close_write was detected, followed by a "setting up watches" without any other messages or any of the other code being triggered, not even the debug echo directly below:                while read f; do      :-( I'm running this on Ubuntu server 12.04 LTS 64 bit.               $ bash --version     GNU bash, version 4.2.25(1)-release (x86_64-pc-linux-gnu)          $ dpkg -l | grep inotify     ii  inotify-tools                    3.13-3     ii  libinotifytools0                 3.13-3     ii  python-pyinotify                 0.9.2-1          $ python --version     Python 2.7.3


title: Running Viber as another user while using "mine" X Server's microphine and speakers

text: I run _Fedora_ with _GNOME_ and recently installed _Viber_ for linux. It's very good and all is working just fine. As _Viber_ is not _open-source_ software, I decided to run it as another user **to make sure that it doesn't have access to my files without my concent** , by creating a _user:group_ `viber:viber`. If I try to open from inside _Viber_ files that belong to me or any other user, it can't read them. **Goal achieved but partly.** Now, I stumbled against another problem, which is _Viber_ works only with **messages** and when I try to make a call, it says, that it **can't find neither microphone nor speakers?** It feels that I know why (I run X Server (GNOME) as _myself_ and _Viber_ as _viber:viber (user:group)_ ). **How to make _Viber_ run as `viber:viber` and at the same time, to let it use microphone and speakers, while running GNOME session as `myusername:myusername`?** SELinux solutions are also welcome but with concrete examples! _chroot_ is not the solution, as it will lead, as I understand, to the same problem as described above. ### EDIT 1: The _exec_ for running it is: `su - viber -c /opt/viber/Viber`


title: How do I generate an SNMP community string for MRTG?

text: I have trying to set up MRTG on my server, following this guide: https://help.ubuntu.com/community/MRTG I followed it as far as,   `cfgmaker <snmp_community_string>@<ip_address_of_device_to_be_monitored> > /etc/mrtg.cfg`   at this point I have no idea what my snmp community string is, I've looked around to try to find out, some places said this is issued from my ISP, so I asked the datacenter that hosts my server, they said I need to generate my own string, so I google'd that, but still nothing. I also tried public@my_ip, but then I receive this error:                   cfgmaker public@<my_ip_address>     --base: Get Device Info on public@<my_ip_address>:     SNMP Error:     no response received     SNMPv1_Session (remote host: "<my_ip_address>" [<my_ip_address>].161)                       community: "public"                      request ID: 1795983726                     PDU bufsize: 8000 bytes                         timeout: 2s                         retries: 5                         backoff: 1)      at /usr/share/perl5/SNMP_util.pm line 629     SNMPWALK Problem for 1.3.6.1.2.1.1 on public@<my_ip_address>::::::v4only      at /usr/bin/cfgmaker line 960     WARNING: Skipping public@<my_ip_address>: as no info could be retrieved          Use of uninitialized value $comment_sysdescr in substitution (s///) at /usr/bin/cfgmaker line 384.     Use of uninitialized value $sysname in concatenation (.) or string at /usr/bin/cfgmaker line 417.     Use of uninitialized value $comment_sysdescr in concatenation (.) or string at /usr/bin/cfgmaker line 417.     Use of uninitialized value $syscontact in concatenation (.) or string at /usr/bin/cfgmaker line 417.     Use of uninitialized value $syslocation in concatenation (.) or string at /usr/bin/cfgmaker line 417.      Could anyone please tell me how I generate my snmp community string for use with MRTG? I am using Ubuntu Server 13.04 with kernel 3.2.0-51-generic.


title: Removing user entry from /etc/passwd

text: I am trying to create a `sed` statement to remove `ftp` and other users which we don't need on our Redhat 5/6 servers. I am trying to create a `sed` pattern so I can find for example `ftp` and it removes the whole line. The following is what I have but it's not working:               sed '/ftp/d'  /etc/passwd


title: Cannot install libevent on CentOS 6.5

text: I'm on CentOS 6.5. Specifically, I'm running this AMI: Adobe Media Server 5 Extended. I followed these steps:               $ sudo yum groupinstall "Development Tools"     $ sudo yum install glib2-devel fuse-devel libevent-devel \         libxml2-devel openssl-devel          $ wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz          $ tar -xzf libevent-2.0.21-stable.tar.gz     $ cd libevent-2.0.21-stable          $ ./configure && make     $ sudo make install          $ sudo echo "/usr/local/lib/" > /etc/ld.so.conf.d/riofs.conf     $ sudo ldconfig     $ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig      Then do `libevent` and I get `command not found`. What am I doing wrong?


title: How do I "fix" Flash?

text: I'm brand new to linux and, coming from Windows, I sometimes find it quite daunting. I managed to install openSUSE and after much trial and error I discovered how to install some software, and my video driver with YaST. My problem is that when I try to play Flash games in Firefox or Chrome they flicker sporadically and Flash videos play like a slide-show. Occasionally my system hangs for approximately 5-10 minutes in full screen mode. I have no idea what's wrong. Is it Flash or the nVidia driver? I've searched the web for possible solutions and the closest I came was this forum post. At the end of the thread, the poster writes: > I revert to [nVidia] 280.13 and now it is working well, I will wait to new > fixes. Unfortunately, I don't know how to install an older version of the driver (or if it will fix my problem if I do). Please bare in mind that I've only been using openSUSE for about a week. **CPU Information**               Processor (CPU):    Intel(R) Celeron(R)     CPU 2.40GHz Speed:  2,399.96 MHz      **Memory Information**               Total memory (RAM): 969.9     MiB Free memory:    85.4 MiB (+ 321.4 MiB Caches)     Free swap:          637.2 MiB      **OS Information**               OS:                 Linux 3.1.0-1.2-default i686     System:             openSUSE 12.1 (i586)     KDE:                4.7.2 (4.7.2) "release 5"      **Display Info**               Vendor:             nVidia Corporation     Model:              GeForce 6200 (0x0221)     2D driver:          nvidia     3D driver:          NVIDIA 290.10      ## Update This problem occurs primarily with Facebook games and certain video websites. Youtube, Dailymotion, and Hulu perform well, but less known sites such as wimp.com or funnyordie.com perform poorly. I don't expect high definition video to perform very well since I only have 1GB of RAM, but most of these sites stream low quality video. I should add that I didn't experience any problems under Ubunutu 11.10 so I'm wondering if this is related to openSUSE or possibly KDE.


title: Lock file from being edited or deleted

text: I have CentOS and cPanel installed. I want to lock certain files (e.g. `.ftpquota`) from being deleted through FTP. I tried to change the ownership to `root:root` or `root:lock` but it didn't work; neither did changing the mode to 0. How can I lock the `.ftpquota` file?


title: What is LightDM and GDM

text: What is LightDM and GDM? In Linux operating system I heard both but I don't know about them and what is called? Where they are used? Are they related to display?


title: configuration for my wireless connection

text: I had connection issues so I changed some wireless configuration.   I think I solved the problem, but I still have minor issues.   First thing I had my Internet connection freeze badly,   Then after doing those configuration things changed,               modprobe rtl8187 &&     iwconfig wlan0 rate 5.5M auto fixed &&     iwconfig wlan0 rts auto &&     iwconfig wlan0 frag auto      It's now more stable and faster,   but my wireless connection still freeze(I only notice that while gaming) like   1-3 seconds every while(range from minutes to hours).   And I'm sure it's not my Internet, so I think it's my configuration.. Note:   Device: Alfa 036H   Driver: RTL8187L Did someone experience this before?   What are the right configuration for my device/driver?   and what does rts, frag and rate means?   I might be able to fix it myself, if I can understand them.


title: Awesome symbols and characters in a bash prompt

text: I just ran across a screenshot of someone's terminal: ![enter image description here](http://i.stack.imgur.com/BX5xV.png) Is there a list of all of the characters which can be used in a Bash prompt, or can someone get me the character for the star and the right arrow?


title: What does this hard disk error message mean: “Current Pending Sector Count …”?

text: I grabbed this information from Disk Utillity on Linux Mint:               Current Pending Sector Count:          Normalized: 200     Worst:      200     Threshold:  0     Value:      22 sectors      What does it mean? Is it possible to fix that error?


title: Why does "file foo.css" and "file bar.css" have different outputs?

text: For example, executing `file styles.css` outputs:               styles.css: asssembler source text      whereas `file bar.css` outputs:               bar.css: ASCII text      Even better, is there a way to convert my file `styles.css` to ASCII text?


title: How to sort date: YYYY.MM.DD. HH:MM?

text: INPUT:               b|2013.06.03. 18:47|     a|2013.06.03. 13:15|     c|2013.06.03. 13:53|      needed OUTPUT:               a|2013.06.03. 13:15|     c|2013.06.03. 13:53|     b|2013.06.03. 18:47|      How can I sort the dates correctly in ascendant order? The delimiter is the `|`. P.S.               sort -t "|" -n -k 2      is not enough, because it doesn't put the HH:MM in good order, only the YYYY.MM.DD.


title: Arch Linux: Unable to connect to internet post-installation reboot

text: So I somehow managed to install Arch Linux successfully. At the time of installation, I followed the official guide as well as this guide. During the installation, I had successfully connected to wireless by the mentioned method in the guide and was able to install packages. I issued following commands to stay connected to internet after reboot:               # systemctl enable dhcpcd.service     # systemctl start dhcpcd.service      Now when I do the first reboot, I am unable to connect to internet. I tried all the ways mentioned in both the guides. This is the screenshot of my terminal. As you can see, the command `ip link show wlp4s0` indicated that the interface is UP. But still I am not connected to the internet i.e. Ping to Google fails. I am unable to install any new packages because of this. (No pacman) What is going wrong in my steps? How should I proceed?


title: What is the expected performance of obnam? Or: why is it so slow?

text: I've been playing around with obnam these last few days, and although it looks very promising and seems to offer basically everything I ever wanted in a backup tool, I am pretty disappointed in its performance. In fact, it's so slow, I'm suspecting that obnam is not even at fault here, but something in my environment is causing it. So I'm mainly wondering, if anyone else is using obnam or knows its internals well enough to maybe identify the problem. From what I could tell so far, obnam seems to fork an individual gpg process for each file that is backed up. Judging from htop, strace, and iostat, the speed of an initial backup is mostly bounded by the constant forking, while the CPU and the drives (no networking is involved) are mostly idling below 20% utilization. My backup amounts to about 500.000 files with 170 GiB of data in total. So for each backup run, gpg is forked 500.000 times. I'm actually not even surprised that this takes almost an entire day for the initial run and over three hours for another run with most files unchanged. But is this really the performance obnam users should expect? For comparison: an incremental run of rsnapshot (same data, same machine, same drives) takes about four minutes. Granted, there is no encryption involved, but this shouldn't be _that_ significant. So, to ask plainly: Is everyone else's machine not able to run gpg (encrypting a small chunk of data) more than 50 times per second either, ultimately making obnam an almost unusably slow tool? Or is it just me? (FWIW, my machine is a Core i5-2500 with 8G of RAM and SSD drives, running Gentoo. Backup is done onto an HDD, but I couldn't observe any difference to backing up to the SSD, since it's not I/O-bound.)


title: How to apply Eclipse plugins installed system-wide by package manager without hurting of the user configuration files?

text: To make the plugins installed system-wide available, I need to re-launch eclipse after deleting the configuration files at ~/.eclipse and I will lost my settings.


title: Split DNS (bind9), match-clients any doesn't work?

text: I've been fighting with this for the last few days. A few of my entries have external and internal IP's. My internal network is 10.0.0.0/8. When I `nslookup pc1.clase.net` internally it responds with a 10.0.0.0 address but if I `nslookup pc1.clase.net` externally it still gives me a 10.0.0.0 address. I'm on Debian Wheezy. ### named.conf               include "/etc/bind/named.conf.options";     view "internal" {       match-clients { 10.0.0.0/8;};       zone "clase.net"{         type master;         file "/etc/bind/internals/db.forward.net";         allow-transfer { 10.0.0.11/8; }       };     };     include "/etc/bind/named.conf.default-zones";          zone "10.in-addr.arpa" {       type master;       file "/etc/bind/internals/db.reverse.net";       allow-transfer { 10.0.0.11/8;       };     };     };          view "external" {       match-clients { any; };       zone "clase.net" {         type master;         file "/etc/bind/externals/db.forward.net";         allow-transfer { 10.0.0.11/18;         };       };     };      ### internal/db.foward.net               $TTL    604800     @       IN      SOA     ns.clase.net. root.clase.net. (                          2 ; Serial                              604800 ; Refresh                               86400 ; Retry                             2419200 ; Expire                              604800); Negative Cache TTL     ;     @   IN  NS  ns.clase.net.     ns  IN  A   10.0.0.10     pc1 IN  A   10.0.0.12      ### external/db.forward.net               $TTL    604800     @       IN      SOA     ns.clase.net. root.clase.net. (                          2 ; Serial                              604800 ; Refresh                               86400 ; Retry                             2419200 ; Expire                              604800); Negative Cache TTL     ;     @   IN  NS  ns         IN  A   150.210.0.1     ns  IN  A   150.210.0.1     pc1 IN  A   150.210.0.22


title: Authenticating with x11vnc: what's the difference between -auth and -rfbauth?

text: I'm on xubuntu 11.10 trying to setup x11vnc server. I followed instructions here and I can connect to VNC server - but it never asks me for password! Is there a difference between these 2 options:               -auth file     and     -rfbauth passwd-file      Or why wouldn't my VNC client (remmina) ask for password. any clues? **UPDATE:** OK. - I've added **-rfbauth** option and now authentication works with that single password. I can connect and prompted for password:               x11vnc -xkb -noxrecord -noxfixes -noxdamage -display :0 \     -auth /var/run/lightdm/root/:0 -forever -bg -o /var/log/x11vnc.log \     -rfbauth /etc/.x11vnc.pass      I can connect but NOT! prompted for password:               x11vnc -xkb -noxrecord -noxfixes -noxdamage -display :0 \     -auth /var/run/lightdm/root/:0 -forever -bg -o /var/log/x11vnc.log      I don't get - what is the reason for -auth option then if not for authentication?


title: tmux session_name count

text: Let's say that I created four new `tmux` sessions (1, 2, 3, and 4). Now, I kill every window in session 2. `tmux list-session` only show that 1, 3, and 4 are active. If I create a new `tmux` session, it is named 5. _How can I make realise`tmux` that "session 2" (or just the number 2) can be recycled?_ Of course, I can rename session 5 to session 2 but that's an extra command and I am lazy. Note that I am talking here about _sessions_ and not _windows_ numbering. I know about `renumber-windows`.


title: org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed] while running spoon.sh in ubuntu

text: When I am running `spoon.sh` file in Ubuntu I am getting the following error:               [santosh@sbx data-integration]$ ./spoon.sh     /home/decathlon/Pentaho-5.0.1/data-integration     org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed]         at org.eclipse.swt.SWT.error(Unknown Source)         at org.eclipse.swt.widgets.Display.createDisplay(Unknown Source)         at org.eclipse.swt.widgets.Display.create(Unknown Source)         at org.eclipse.swt.graphics.Device.<init>(Unknown Source)         at org.eclipse.swt.widgets.Display.<init>(Unknown Source)         at org.eclipse.swt.widgets.Display.<init>(Unknown Source)         at org.pentaho.di.ui.spoon.Spoon.main(Spoon.java:582)         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)         at java.lang.reflect.Method.invoke(Method.java:606)         at org.pentaho.commons.launcher.Launcher.main(Launcher.java:134)      Could anyone please help me in resolving the same?


title: Bash: What is the use of type (Bash builtins)?

text: I came across a command in Bash script in which I found:               find /var/log/abcd -type f      The above command was in context of cleaning the log files. I know what `find` does. After having seen `-type f`, I looked manual page for it. I got to see it in man page of **BASH_BUILTINS(1)** The description of -f flag under `type` command is :-               The -f option suppresses shell function lookup, as with the command builtin.      Following are my questions:   1. What is the use of `type` ?   2. What is the significance of `-f` flag?   3. What is the use of using `type` with `find` command?  **[EDIT]:-** After having read all the comments and answers till now, I would like to mention the cause for my misinterpretation of `-type option in command find` Vs `type command` . This all happened because I was assuming and till date have seen only the short options(Tests in case of the `find` command) with a **single minus sign '-'** , example, `ls -l`. Most of the times I have seen long options with **double minus sign '--'** , example, `ls --version`.


title: Insert variable and keep the variable

text: I'm on VMWare which, no matter what anyone says, responds to most unix commands. Some things are unique though, for example the fact that almost no files are persistent through reboot. Due to this I'm getting a problem with a scripted backup which is using a variable to name log files: If I manually insert               backup-$(date +%Y-%m-%d).log      into `cron`, log files will of course be named after the date they were started. However, if I insert this into `local.sh` to re-enter `cron` job at reboot;               /bin/echo "0 0 * * 1-5 ...backup-$(date +%Y-%m-%d).log      it will of course end up like this:               backup-2014-07-01.log      So the question is how do I write this to `cron`, so that it ends up as a varible instead of a date?


title: What is the correct way to abort an operation from the sudo password prompt?

text: Sometimes it amazes me the "little" things I _don't_ know about Unix. For years now I have occasionally noted that I don't actually know how to deal with the sudo password prompt cleanly. Every once in a while I sudo something only to realize that I don't actually want to run the command at all. This happens rarely enough I always forget to ask but just often enough that I remember I still haven't learned the right way to abort. Once sudo starts asking for a password it doesn't want to give up. You can't `Ctrl`+`C` it. If you give it the right password it will run the command that I've decided I want to abort. The only solution I have found is to give it wrong passwords until it gives up asking and falls back to an su prompt which actually listens to a `Ctrl`+`C`. This feels dirty to me. It's sad enough that I changed my mind about a command; not to be able to cancel it cleanly is just embarrassing. What is the proper way to tell sudo to abort the attempt while at the password prompt?


title: Does software installed in one distribution of linux run in another distribution of linux?

text: Suppose, I create seperate partition for "/usr" directory. This is the directory which contains all user programs. If I switch from one OS to other(for eg. From Ubuntu to Arch Linux or vice versa), can Arch linux run that program? Will blender that I installed on Ubuntu work on Arch Linux?


title: SLiM autologin to wrong wm

text: I configured my system to do an autologin using awesome wm. However, after an upgrade of my Debian Sid (which wasn't without difficulty because of a bug in the package of my graphic driver, I had to reinstall some packages such as SLiM before figuring out a solution.), SLiM is now using Gnome Classic as default WM. My configuration is the following, feel free to ask me more information, I'll provide anything I can. Relevant parts of `/var/log/slim.log`:               login_cmd           exec /bin/bash -login /etc/X11/Xsession %session     sessions            awesome,startxfce4,openbox,ion3,icewm,wmaker,blackbox     default_user        max     auto_login          yes


title: How to properly upgrade glibc?

text: The firmware of my NAS comes with a rather old version of `glibc`, namely 2.5. In order to cope with some precompiled binaries (despite being linked "statically", they _still_ dynamically link to glibc...) linked to `glibc` 2.15. From some simple testing in a `chroot` environment I learned simply adding the newer `libc-2.15.so` and updating the symlink `libc.so.6` will yield an unusable system; probably due to `libc-2.15.so` being linked to `ld- linux.so.3` in turn, which would of course also require the 2.15 version instead of the 2.5 one. But before I descend into too much trial and error, > what is the correct procedure to manually upgrade glibc?


title: Function, return value using pwd in KSH

text: I tried to write a small `ksh` script:               fDestExists (){         cd /tmp         read vANSWER?" >> Do you want to create a repository in pwd ? Type YES or NO"             echo "    |----> $(fGetDatum) You typed: " $vANSWER                      if [ "$vANSWER" = "YES" ]; then                     read vANSWER2?" >> Type your repository's name."                     mkdir -p $vANSWER2                     cd $vANSWER2                     echo "    |----> Logs will be coped in pwd."                     elif [ "$vANSWER" = "NO" ]; then                 echo "    |----> Logs will be coped in pwd."                     else                  echo "    |----> You typed a wrong answer; exiting."                         exit 1             fi           pwd #return     }      Several questions here.   1. How can I use pwd's value in my echo?    2. To return value, I read it was feasible using echo [yourValue] at last line. Then where you call the function, I guess I can use : $?. So how can I do the same behaviour with pwd?


title: diff two directories for changes and format output to use for script

text: I currently try to monitor two directories and subdirectories for changes in files. The directories contain the same set of files, some of them are changed. So I thought I might use the `diff` command to create a list of changed files with the line numbers and changes. I need this list to further process it by another script. Since you can use the `diff -r` option to recursively check for changes, I tried to format the output to suit my needs. I can't use the default multiline output, but want to have the following: `file_1`:               my first line     my second line     my third line      `file_2`:               my first line     my changed second line     my third line      My desired output would either look like:               file_2:2:my changed second line      or (if that is easier):               file_1:2:my second line     file_2:2:my changed second line      I managed to produce the output without the filename with the following parameters:               diff -qbBwr --unchanged-line-format="" --old-line-format=":%d:%L" --new-line-format=":%dn:%L"  file_1 file_2      which results in               :2:my second line     :2:my changed second line      But there are two problems:   * The lfmt option does not work with the recursive option `-r`   * I do not get the filename So finally the question is: Does anybody know how to `diff` two directories in a way that I get the desired output from above?


title: Nvidia Proprietary Driver Causing Multiple Problems

text: I have recently downloaded and installed `NVIDIA-Linux-x86_64-319.17.run` for my Nvidia Quadro NVS 130M Graphics Card. Installation went fine after disabling the X server and running the install from a tty. After rebooting;   * The Slim Login manager took considerably longer to process my initial username entry (8-10 seconds vs <1s)   * Any attempts to access another tty results in a system hang, from which I have to restart.   * Attempting to launch Firefox results in a system hang before displaying anything. I have done some searching around but have found nothing that has fixed my problem. I am running `archbang linux x64`, so followed the instructions detailed on their site. I am attempting `pacman -Syu` but do not think this will make much of a difference... I changed from using the nouveau drivers. I have looked through my Xorg.0.log file but didn't see anything that was glaringly obvious. If you need any more details than those provided below, please comment.


title: What are the methods to protect home folder files from other applications runing as the same user?

text: I would like to enforce the security access of some files in my Home folder. My concern is about processes running with the same privileges as me having access to those files. I've been wondering about this for sometime, because the role based security in Linux is great but weak for things running in the same role. Specially when it comes to an user account that is very active, every file laying inside the home folder is vulnerable to the user actions. For example installing a malicious Firefox plug-in, the other parts of the OS wont be touched but all the files inside the home folder can be exposed and installing a Firefox plug- in is something any user could do with out any special privilege.


title: Can I Change Caps Lock to Hyper/Additional Modifier?

text: In Arch Linux, I have Caps Lock function as an alternate Ctrl: In the console through a personal keymap, and in X through a "kbd" option in `xorg.conf`. I've already researched a little about changing Caps Lock to a Hyper modifier, and it sounded like this wasn't feasible in the console, but is there any way I can do this for X? Here's what I currently use for X:               Option "XkbOptions" "ctrl:nocaps"      Is there an `XkbOptions` option or something similar to make Caps Lock act like an additional modifier? My goal in this is to be able to create more custom keymappings in Emacs with the new modifier.


title: How can I mount a remote sshfs directory of an publicly inaccessible server on my inaccessible client machine?

text: This is an extension of the question by @Andrei > How to mount remote SSHFS via intermediate machine? Tunneling? I'm in the same situation that I want to mount a remote directory, however the difference is that both machines `A` and `B` are not publicly exposed on the internet. `A` is my local work station. **So I can neither ssh from`A -> B`, nor `B -> A`.** What I regularly do, is establish a reverse connection from `B -> C`, where `C` is a rented virtual server (VPS). A script doing this connection (and reconnecting in case of lost connection) is started via the `@reboot` key of `cron`.               user@pcB $ ssh -R 2048:localhost:22 -p<port> user@serverC      Then, to go from `A -> B` I take the intermediate route `A -> C -> B`.               user@pcA $ ssh serverC     user@serverC $ ssh -p 2048 user@localhost     user@pcB $ # okay, logged in.      I'm looking for a way to mount the directory `pcB:/home/user` on `pcA`. How do I connect to a pc through another pc using ssh is similar, but the solutions provided don't work in this scenario: the connection map in my case is `A -> C <\- B` not `A -> C -> B`.


title: Installing debian 7 besides windows 8

text: I ask this question in superuser but no one can answer my question, I hope any one can help me: I bought a VAIO laptop which Windows 8 preinstalled on it in UEFI mode. Now I want to install Debian 7 besides Windows 8 but when I entered to the Partition Setup of debian setup menu, there is a partition which named EFI partition system. My question is do I have to create another partition for debian to boot in UEFI? or EFI partition system which belongs Windows8 is enough? And if I have to create another EFI boot partition for Debian 7, What name should I choose for it? And do I have to delete EFI partition system?


title: How to start multiple login managers on different ttys?

text: How i can configure (best if its a "slim" or "gdm") login manger to start on different ttys? I want a 1 login manger on tty6, another on tty7 and next one on tty8 accessible independently. Is it possible? :)


title: uname shows duplicate architecture

text: Why does uname show x86_64 three times? This is Ubuntu 12.04.4.               $ uname -a     Linux seedbox 3.2.0-59-generic #90-Ubuntu SMP Tue Jan 7 22:43:51 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux


title: Error installing arch Linux due to virtual box-guest-modules (despite not installing on virtual machine)

text: I'm installing Arch Linux, following the instructions at the Beginners' Guide, and got up to running `pacstrap -i /mnt base base-devel`. It finishes with the following error:               resolving dependencies...     looking for inter-conflicts...     error: failed to prepare transaction (could not satisfy dependencies)     :: virtualbox-guest-modules: requires linux<3.15     ==> ERROR: Failed to install packages to new root      What is really weird is that I'm not installing Arch in a virtual machine, I'm setting it up to dual boot on my laptop.


title: Testing the Success of a Congestion Algorithm

text: How do you test whether a particular congestion algorithm is working for you? I ask because it's not as if I can easily re-create a representative workload for most algorithms. I'm current looking at two things, but I'm open to more suggestions:   * The "segments retransmitted" from the output of `netstat -s` My current thinking is that congestion could result in dropped packets some percentage of the time so while there may not be a 1:1 relationship between a packet being dropped and the server being notified of a congestion event, there may be a loose correlation to be drawn if switching to one algorithm resulted in fewer dropped packets. Does this figure show segments that were retransmitted due to congestion or is it limited to lossy links? If so (and I'm thinking it might be the case) that might muddy the waters even more to the point of this not being a good metric to use.   * Is there a metric available to measuring the average age for TCP connections? My thinking here is that TCP connections that finish earlier (absent a spike in errors and dropped packets) might indicate that data is being pushed through with less delay.


title: sed, getting an error: sed -e expression #1, char 28: unterminated `s' command

text: When I do:               sed 's/@driver.quit/#@driver.quit' set_QA_district_name_spec.rb       I get the error shown in the title. How can I get around this error, what is wrong?


title: CHROOT: Unable to copy files to jailed users directory from local machine using WINSCP

text: I've setup a chroot environment for one of my users called **client** on my system. I'm using WINSCP to connect to my server from my machine using public key authentication. Everything works fine, I can login, see the home directory (jail directory) and cannot navigate upwards. The issue I am having at the moment is that I cannot copy files to the server from my local machine. When I do that I am getting **Permission denied : Cannot create remote file /home/client/test.txt** My server is a Red Hat server and this is my sshd configuration:                   Match User client         ChrootDirectory %h         PubkeyAuthentication yes         AllowTCPForwarding no         X11Forwarding no         ForceCommand internal-sftp      I've looked online for this and I've found some notes regarding making copies of the `bin` and `lib` folder on the client's home directory, but those solutions didn't help. All I need at the moment is for the user to be able to copy files from their local machine to my server under their chroot folder. ### EDIT #1 Here is a quick description of what I have done: I have a chrooted user (username: clientd) which I've jailed inside their home directory. This chroot directory is `/home/client/` which is owned by root. Now I need this client user to be able access the tomcat web application folder which is residing under `/mnt/datadrive/tomcat/webapps`. What I've done is:   1. chroot the user with a public key of their own to the home directory.   2. Create a folder under `/home/client` called `tomcat_ROOT` and given the ownership to `clientdev`. Now when I run the command:               $ mount --bind /mnt/datadrive/tomcat/webapps /home/client/tomcat_ROOT      The folder disappears from the directory listing inside `/home/client` if I login with client. My root user can see it but not the desired user. Here are some permission listings: Output of `ls -l /home/client/tomcat_ROOT`:               drwxr-xr-x.  6 root   root    4096 Apr 11 15:07 .        drwxrwxr-x. 12 root   root    4096 Apr 11 15:07 ..      drwxr-xr-x.  3 root   root    4096 Apr  9 22:10 webapp1      drwxr-xr-x.  4 root   root    4096 Mar 18 18:43 webapp2      drwxr-xr-x.  3 root   root    4096 Apr  9 22:11 webapp3      drwxrwxr-x. 10 root   root    4096 Apr 11 15:20 ROOT      Output of `ls -l /home/client/`:               drwx------. 4 clientdev clientdev 4096 Apr 10 21:36 .      drwxr-xr-x. 7 root      root      4096 Apr 10 22:07 ..      -rw-------. 1 client client  664 Apr 10 21:43 .bash_history      -rw-r--r--. 1 client client   18 Apr 23  2012 .bash_logout      -rw-r--r--. 1 client client  176 Apr 23  2012 .bash_profile      -rw-r--r--. 1 client client  124 Apr 23  2012 .bashrc      drwx------. 2 client client 4096 Apr 10 19:20 .ssh     drwxr-xr-x. 2 client client 4096 Apr 10 21:34 tomcat_ROOT


title: vim shortcut to open a file under cursor in an already opened window

text: In vim you can open a file under the cursor by using the `gf` command. One can also easily open that file in a new split window by hitting `<c-w> f`. This is a really nice and time saving feature. However, I can't figure out, how to open the file in an already opened split window (without creating a new one).


title: Make a tmux pane 80 (or so) columns wide

text: I'm trying to follow the 80 column rule when writing my code, my current tmux setup is split 50/50 horizontally. I like to have vim in the left-hand pane, and in the right-hand pane I have a 75/25 split where I run other things. On my side monitor 50% is 76 columns wide, but on my laptop's display it's 123 column wide. I'd like to maximize real-estate for other commands, Is there a way to set this to exactly 80 columns (or so) when I launch my workspace? I'm currently setting up my workspace with:               bind C-w source-file ~/dotfiles/scripts/tmux_work_layout      that file contains:               selectp -t 0              # Select pane 0     splitw -h -p 50           # Split pane 0 vertically by 50%     selectp -t 1              # Select pane 1     splitw -v -p 25           # Split pane 1 horizontally by 25%     selectp -t 0              # Select pane 0


title: Is there a way to run a privileged command upon successful SSH login (not necessarily with shell or PTY)?

text: I'd like to run a privileged command upon successful SSH logins at the server's end. However, this has to be in the server configuration (`sshd_config` or anything else that cannot be manipulated or circumvented by the user) as I need this to be mandatory. That is, however restricted the system account used is, it needs to be able to manipulate a piece of data that requires superuser privileges (namely use `ipset add` conditionally - which I can script). Oh and I'd like to be able to access the contents of `SSH_CLIENT`, please - despite privileged execution. The command also must be unaffected by `ChrootDirectory`. I am aware of `/etc/ssh/sshrc`, but that appears to be "client-side", i.e. it's being run by the user who is logging into the machine. Does such a facility exist in OpenSSH? I am using version 6.6. * * * Also, the man page (`ssh(1)`) isn't all too clear about `sshrc`: > `/etc/ssh/sshrc` Commands in this file are executed by `ssh` when the user > logs in, just before the user's shell (or command) is started. See the > `sshd(8)` manual page for more information. So does this mean it also runs whenever external commands (via `ForceCommand`) or subsystems like `internal-sftp` get invoked, despite restricting settings like PTY allocation or forcing a `chroot`? If so, I could resort to a restrictive `/etc/sudoers` entry if there is no other way at all. **NB:** I am _not_ using `inetd` for obvious reasons (see `sshd(8)`) as described here.


title: Why does SLES 11 corrupts given characters?

text: If I open a notepad and copy this from it:               aña,       to a file opened with vi on the machine, I get this:               aÃ±a      **My question:** Why? What could the problem be? Logfiles on the server has the same problems. How can I verify if UTF-8 support is ""installed well"" on the SLES?


title: Is there an auto refreshing graphical text file reader?

text: So, is there a graphical text reader or editor that automatically refreshes its text if the file is completely changed outside of it? I found that `gedit` detects file changes but refresh is not automatic, requiring interaction. Also, `evince` could do it but does not work with plain text files.


title: Where does make defconfig get its configuration in OpenWrt?

text: I am compiling an image for wifi devices using _OpenWrt_. Following the instruction I copy a simple `.config` file to TOP-DIR.               CONFIG_TARGET_ar71xx=y     CONFIG_TARGET_ar71xx_generic=y     CONFIG_TARGET_ar71xx_generic_XXX_OpenWrt_Router=y      Then run the command `make menuconfig`. The outcome of this command is               .config file now having default configuration.       However, I don't know where all the new configuration comes from. If I just change `CONFIG_TARGET_ar71xx_generic_XXX_Router=y` to `CONFIG_TARGET_ar71xx_generic_YYY_Router=y` then the outcome of `make defconfig` must be a lot different.


I used to be able to connect via ssh with the user I have created but now I keep getting: "Write Failed: Broken Pipe" and I can only connect as root In the ssh auth.log I get the following:               Accepted password for username from 100.10.10.10 port 49999 ssh2     pam_unix(sshd:session): session opened for user username by (uid=0)     fatal: bad ownership or modes for chroot directory component "/"     pam_unix(sshd:session): session closed for user username     reverse mapping checking getaddrinfo for ip.com [ip] failed - POSSIBLE BREAK-IN ATTEMPT!      In sshd_conf I have:               Subsystem sftp internal-sftp      and               Match User username             ChrootDirectory /home/username             X11Forwarding no             AllowTcpForwarding no             ForceCommand internal-sftp      /home directory permissions:               drwxr-xr-x 3 root root 4096 date username      /home/username permissions:               drwxrwsr-x 3 username www-data 4096 date public      /home/username/public permissions:               drwxr-xr-x 5 root root 4096 date example.com      /home/username/public/example.com permissions:               drwxr-xr-x 2 root root 4096 date backup     drwxr-xr-x 2 root root 4096 date log     drwxr-xr-x 14 www-data www-data 4096 date public      I also did all of these from another post but it still doesn't work:               chown root /home/username     chmod go-w /home/username     chown username:www-data /home/username/public     chmod ug+rwX /home/username/public      I am new to Linux so I don't really know what might have gone wrong.. Does anyone have any idea?   **UPDATE**   All the files that I have listed are on my VPS server which is running (Debian 7.4) I am connecting via OSX Terminal like so: "ssh root@ip"      Below is the output of ssh -v user@host               OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011     debug1: Reading configuration data /etc/ssh_config     debug1: /etc/ssh_config line 20: Applying options for *     debug1: Connecting to 80.80.80.80 [80.80.80.80] port 22.     debug1: Connection established.     debug1: identity file /Users/razvan/.ssh/id_rsa type 1     debug1: identity file /Users/razvan/.ssh/id_rsa-cert type -1     debug1: identity file /Users/razvan/.ssh/id_dsa type -1     debug1: identity file /Users/razvan/.ssh/id_dsa-cert type -1     debug1: Enabling compatibility mode for protocol 2.0     debug1: Local version string SSH-2.0-OpenSSH_6.2     debug1: Remote protocol version 2.0, remote software version OpenSSH_6.0p1 Debian-4+deb7u1     debug1: match: OpenSSH_6.0p1 Debian-4+deb7u1 pat OpenSSH*     debug1: SSH2_MSG_KEXINIT sent     debug1: SSH2_MSG_KEXINIT received     debug1: kex: server->client aes128-ctr hmac-md5 none     debug1: kex: client->server aes128-ctr hmac-md5 none     debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent     debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP     debug1: SSH2_MSG_KEX_DH_GEX_INIT sent     debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY     debug1: Server host key: RSA dc:dc:dc:etc     debug1: Host '80.80.80.80' is known and matches the RSA host key.     debug1: Found key in /Users/razvan/.ssh/known_hosts:7     debug1: ssh_rsa_verify: signature correct     debug1: SSH2_MSG_NEWKEYS sent     debug1: expecting SSH2_MSG_NEWKEYS     debug1: SSH2_MSG_NEWKEYS received     debug1: Roaming not allowed by server     debug1: SSH2_MSG_SERVICE_REQUEST sent     debug1: SSH2_MSG_SERVICE_ACCEPT received     debug1: Authentications that can continue: publickey,password     debug1: Next authentication method: publickey     debug1: Offering RSA public key: /Users/razvan/.ssh/id_rsa     debug1: Authentications that can continue: publickey,password     debug1: Trying private key: /Users/razvan/.ssh/id_dsa     debug1: Next authentication method: password     username@host's password:      debug1: Authentication succeeded (password).     Authenticated to 80.80.80.80 ([80.80.80.80]:22).     debug1: channel 0: new [client-session]     debug1: Requesting no-more-sessions@openssh.com     debug1: Entering interactive session.     Write failed: Broken pipe


title: I can't use or find the google debian unstable/sid repository

text: I'm trying to use the debian unstable/sid branch of the google repositories (deb http://dl.google.com/linux/deb/ unstable non-free main), but I get errors: > Err "http://dl.google.com" unstable/non-free i386 Packages   >  404 Not Found [IP: 209.85.146.93 80]   >  Err "http://dl.google.com" unstable/main i386 Packages   >  404 Not Found [IP: 209.85.146.93 80]   >  W: Failed to fetch "http://dl.google.com/linux/deb/dists/unstable/non-free > binary-i386/Packages.gz 404 Not Found [IP: 209.85.146.93 80]   >  W: Failed to fetch > "http://dl.google.com/linux/deb/dists/unstable/main/binary-i386/Packages.gz > 404 Not Found [IP: 209.85.146.93 80] I get the same errors for deb "http://dl.google.com/linux/deb/ sid non-free main". I can't browse the repository at "http://dl.google.com", I just get a 404. Is it ok to use the stable repository instead even though I'm using debian unstable?


title: What causes a ssh interruption?

text: What exactly causes a ssh connection to interrupt? When you idle for a while, it disconnects. How do I keep the connection alive (without `autossh` or reconnect)?


title: Where is the current wallpaper stored?

text: Does anyone know where the current wallpaper is stored in xfce4? I am using SLiM and I want to symlink the SLiM background to whatever my current wallpaper is so I don't have to manually change it every time.


title: Can GNU Parallel execute more parallel processes?

text: Can I for example execute: `parallel -j 200 < list0` Where "list" has: `nice -n -20 parallel -j 100 < list2 nice -n -20 parallel -j 100 < list1` Would this be feasible/possible?


title: Installing windows from Linux mint

text: I have an iso of windows xp and I am currently running Linux mint 8 Helena (we don't gave a proper connection to download the latest) . Since my DVD drive isn't working I need to make a boot able USB pen drive to install windows. Please suggest a method not involving too much textual commands . it has 'wine' but common windows utilities do not work. Maybe irrelevant but the processor is core 2duo t6400 3gb ram Intel GMA 4500 MHD..


title: Failed to download the JMeter CA certificate for HTTPS recording

text: I am unable to run HTTPS recording in Jmeter. I have used "jmeter_proxy_step_by_step.pdf" for the setup. The Jmeter version is 2.11 and Java jdk7. But I am unable to generate the certificate. The following error is displayed when running "HTTP(S) Test Script Recorder"- ![Warning message](http://i.stack.imgur.com/6w0Uh.png) > Could not create script recording proxy - see log for details:'keytool > -genkeypair -alias :root_ca:dname "CN-_DO NOT INSTALL unless this is your > certificate (Jmeter root CA, OU=Username: shreesha, C-US' -keyalg RSA > -keystore proxyserver.jks -storepass (redacted) -keypas (redacted) -validity > 7 -ext bc:c' failed, code: 1 Illegal option: -ext Try keytool -help


title: Why my tabs are not expanding in TIMEFORMAT?

text: I need to measure the running time of an application, so I'm messing with TIMEFORMAT in order to print short format with the maximum precision available. From the Bash Refence Manual: > TIMEFORMAT > > The value of this parameter is used as a format string specifying how the > timing information for pipelines prefixed with the time reserved word should > be displayed. The ‘%’ character introduces an escape sequence that is > expanded to a time value or other information. The escape sequences and > their meanings are as follows; the braces denote optional portions. > > %% A literal ‘%’. > > %[p][l]R The elapsed time in seconds. > > %[p][l]U The number of CPU seconds spent in user mode. > > %[p][l]S The number of CPU seconds spent in system mode. > > %P The CPU percentage, computed as (%U + %S) / %R. > > The optional p is a digit specifying the precision, the number of fractional > digits after a decimal point. A value of 0 causes no decimal point or > fraction to be output. At most three places after the decimal point may be > specified; values of p greater than 3 are changed to 3. If p is not > specified, the value 3 is used. > > The optional l specifies a longer format, including minutes, of the form > MMmSS.FFs. The value of p determines whether or not the fraction is > included. > > If this variable is not set, Bash acts as if it had the value > > $'\nreal\t%3lR\nuser\t%3lU\nsys\t%3lS' > > If the value is null, no timing information is displayed. A trailing newline > is added when the format string is displayed. But, whenever I set TIMEFORMAT the tabs and new lines are not expanding:               rafael@lip ~/time-tests $ time ls          real    0m0.099s     user    0m0.000s     sys 0m0.002s     rafael@lip ~/time-tests $ TIMEFORMAT='\nreal\t%3lR\nuser\t%3lU\nsys\t%3lS'     rafael@lip ~/time-tests $ time ls     \nreal\t0m0.002s\nuser\t0m0.000s\nsys\t0m0.002s      Why? and how to solve it?


title: fstab does not mount cifs at startup

text: I'm using Cent OS 6.5. I have a cifs share which needs to be automatically mounted at the system reboot/startup. Following is the line from my `/etc/fstab` file :               //192.168.1.2/files/ /users/ cifs _netdev,credentials=/root/secret.txt,uid=apache,gid=apache 0 0      When I run `mount -a` command the cifs mounts into the system, but does not automatically mount when I reboot or startup the machine. Any reasons for this? EDIT: When I `cat /var/log/messages | grep -i cifs` I get the following logs               Apr 21 17:01:13 cloud kernel: CIFS VFS: cifs_mount failed w/return code = -113     Apr 21 17:03:32 cloud kernel: CIFS VFS: Error connecting to socket. Aborting operation     Apr 21 17:03:32 cloud kernel: CIFS VFS: cifs_mount failed w/return code = -113     Apr 21 17:03:32 cloud kernel: CIFS VFS: Error connecting to socket. Aborting operation


title: xbindkeys and messed up outputs

text: I am trying to set some key bindings for the use inside my wm. so I did `xbindkeys -mk` and start testing with keys. The result was somehow not what I expected. Left wind key ===> `m:0x50 + c:115 Mod2+Mod4 + Super_L` x ===> `Mod2+x` ctrl+left-win+x ===> `m:0x54 + c:53 Control+Mod2+Mod4 + x` First was should I put in the _xbindkeyrc_ and second Why I get such outputs?


title: Nvidia Geforce 7150m display issues on Ubuntu 13.10

text: I have just completed a fresh installation of Ubuntu 13.10 on my desktop and the installation was successful. My video card is an on-board Nvidia Geforce 7150m/630i and I was able to include the latest PPA from Nvidia into the apt repository and did an apt-get install nvidia-current. This too went successful and is now showing that the latest driver of Nvidia is active. The problem is that the screen has a very slight flicker, distortion and is oversized on the display by a few pixels. Using the Nouveau driver gives a crystal clear display and the size is also correct, but there seems to be a few bugs in the display rendering and I suppose it does not use GL so the speed is very slow. Can you give me any assistance on finding the problem? Similar questions have been asked in this forum but nobody seems to struggle with the distortion and/or oversized screen display.


title: How to change kernel boot options in GRUB 2

text: In old GRUB, if I wanted to change boot options, I would use a line starting with the word `kernel` in " **/boot/grub/menu.lst** ":               kernel /vmlinuz root=/dev/sda1 ro MY BOOT OPTIONS      Now since I'm using GRUB 2, I looked under " **/etc/grub.d/10_Linux** " for something similar, but I'm not even sure that's the right place to do this. If it is, please guide me. If it's not, guide me anyways.


title: Black screen when kernel boots with vga= parameter

text: Recently recompiled kernel refuses to do output on the screen if `vga` parameter was in the list. Without it kernel boots properly as usual, however, before that it changed resolution and RC log appeared at the top on the cleaned screen, now it’s something resembling 80×25 and RC log runs right after the tail of kernel messages. This tells me I’ve disabled some kind of important thing in VESA, but I can’t figure out what exactly, because all seem ok               $ zgrep -iE '^[^#].*(vga|vesa|fb)' /proc/config.gz     CONFIG_X86_SYSFB=y     CONFIG_VGA_ARB=y     CONFIG_VGA_ARB_MAX_GPUS=16     CONFIG_FB=y     CONFIG_FB_BOOT_VESA_SUPPORT=y     CONFIG_FB_CFB_FILLRECT=y     CONFIG_FB_CFB_COPYAREA=y     CONFIG_FB_CFB_IMAGEBLIT=y     CONFIG_FB_VESA=y     CONFIG_VGA_CONSOLE=y     CONFIG_VGACON_SOFT_SCROLLBACK=y     CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=1024      It is the same 3.12 kernel that I was running before, I just added KVM support and TUN/TAP interfaces AFAIR. No kernel mode setting, because proprietary driver from nvidia.


title: How to make *sh lines shorter

text: I recently encountered a line of `zsh` code               ls_colors_parsed=${${(@s.:.)LS_COLORS}/(#m)\**=[0-9;]#/${${MATCH/(#m)[0-9;]##/$MATCH=$MATCH=04;$MATCH}/\*/'=(#b)($PREFIX:t)(?)*'}}      Not only does this burn my eyballs, it's far, far over the 80 char limit. Unfortunately, I don't see any clear way to shorten it. I have many lines like this (made of ridiculously complicated substitutions that can't be cut into pieces). What is the canonical way of handling lines like these if I want them to be <80 chars long.


title: How can I *completely* wipe an MP3's metadata?

text: I'm using "beets" to organize my mp3s. One album I bought from Amazon as mp3s is incorrectly marked as NOT a compilation when indeed it IS a compilation. I organize my files differently based on whether or not an album is a compilation. No matter what I attempt to do to these mp3s, the changes I apply to the ID3 tags do not stick. For example:               mp3info -d ../amazon_album/*  # This WIPES the tags     mp3info ../amazon_album/01-01 - Track 1.mp3      ../amazon_album/01-01 - Track 1.mp3 does not have an ID3 1.x tag.      But then when I open the file in any media player, ALL of the information is still there! So then I tried:               mp3info -a "LOL" ../amazon_album/*     mp3info  ../amazon_album/01-01 - Track 1.mp3     File: ../amazon_album/01-01 - Track 1.mp3     Title:                                  Track:      Artist:  LOL     Album:                                  Year:       Comment:                                Genre:  [255]      Yet, in any media player, it still retains all of the original information. Because of this, I'm not able to change the album to a "Compilation" which means I can't organize it in Beets the way I want. I've confirmed that it's not a file permissions issue. Am I doing something wrong? Is there another way to accomplish this in Linux? Or is there a way I can "trick" beets into treating it as a compilation (so that it uses my compilation path)?


title: Capacities on Load-balancer & Web Servers? Bandwidth + Performance

text: I'm on **DigitalOcean** and I have a very simple scenario for my website.   * Now having `3000` concurrent hits every minutes. (For example)   * Currently it is directly on 1 only single Apache Server.   * **The website CAN NOT be Cached**. (for some sensitive reason) Then I am thinking for simply advanced setup, like:   * 1x Software Load Balancer (e.g, Nginx)   * 3x Apache as Web Servers .. at behind LB. Then suddenly my simple (but BIG) questions are:   * `Load Balancer` or `Web Servers`. Which ones should have better CAPACITIES, in terms of `BANDWIDTH` and `PERFOMANCE`. Lets say LB redirects `1000` connections to each Web Servers. Does it mean:   1. The LB still need to consume 3000 Traffic Bandwidth IN+OUT?   2. Each WebServer still need to consume 1000 Traffic Bandwidth IN+OUT?   3. LB should have big PROCESSING performance? Or, the WebServers? * * * ## To be more dummy .. Something like ..   * Do I need to buy $80 / month for LB Droplet (and, leave $20 Droplets for WebServers)?   * (or) Do I need to buy $40 / month 3x WebServer Droplets (and, leave $10 Droplet for LB)?


title: List of servers to check for SSH availability

text: I have a list of IP address that I need to SSH to and log if I could get to them. I would use a Ping script, but DNS might have already reassigned the address. I do not care about the ones I can't get to. If the SSH works I need to log that IP address, I shouldn't have to worry about passwords or keys because I don't want to log in to the box's. I just want to see if I can SSH to them. So far i have:               touch logfile_$(date "+%Y%m%d%T")     IP_FILE="path/to/ip_address.txt"     LOGFILE="path/to/logfile_$(date "+%Y%m%d%T")"               if [[ ! -f ${IP_FILE} ]]; then        echo "Cannot find IP address!"        exit 1     fi          for IP_ADDRESS in `cat $IP_FILE` ; do              ssh $IP_ADDRESS >> $LOGFILE 2>&1      I am still new to scripting and any help would be great. I have looked at "How to check if I can log in to server via ssh?" posted by LanceBaynes but its not really what I need. I can't install anything on this boxes. Or I would have downloaded a nice scanner. Like Netcat or Nmap both of which are great options.