title: Shell script doesn't paint last line of stdout to screen without user input

text: I have a shell script that's happily doing all my backup process and writing progress to stderr and stdout, with one exception — the last line doesn't get written to my terminal (if I call the script manually) until I hit `Enter`. Now this isn't a big deal, but it's really irritating me that it's not doing it, so I'd like to understand why it's behaving that way. What gets written to the output (after I hit `Enter`) reads:               [blackero@XXXXXXXXXXXXXXXX ~]$ fullbackup.sh     Tue Feb 28 17:57:41 GMT 2012     Tue Feb 28 17:57:41 GMT 2012     Starting SITE_NAME backup     maintenance_mode was set to 1.                                                    [success]     /home/blackero/bin/fullbackup.sh: line 36: hash: lzma: not found     maintenance_mode was set to 0.                                                    [success]          Backup for SITE_NAME created               [blackero@XXXXXXXXXXXXXXXX ~]$      The relevant parts of the script read as follows (with `↪` indicating I've wordwrapped the code for legibility):               #!/bin/bash     date     date 2>&1          # [A bunch of content has been deleted from here]          # Compress with lzma if available, otherwise use gzip     if hash lzma; then       lzma -c ${backup_dest}/${dbname} >${backup_dest}/${dbname}.lzma       ↪  && rm ${backup_dest}/${dbname}     else       gzip -c ${backup_dest}/${dbname} >${backup_dest}/${dbname}.gz       ↪  && rm ${backup_dest}/${dbname}     fi          # Disable maintenance mode.     drush -r ${drupal_root} vset --always-set maintenance_mode 0          # Remove old backups >30 days     find ${backup_dest} -mtime +30 -exec rm {} \; >> /dev/null 2>&1          echo "Backup for ${sitename} created"     echo     echo 2>&1      So, you can see the `if hash lzma; then` line that's causing the `hash: lzma: not found` line to stderr (it'd be nice if I could suppress this message, so it doesn't write that warning, but I can live with it). You can see that `drush` is writing the `maintenance_mode was set to 0.` line to stdout. But the line `Backup for SITE_NAME created` only appears once I hit `Enter`. Is that because the previous command is redirecting stdout to `/dev/null`? Do I need to undo that redirect somehow? (I thought stream redirection only affected the single command atomically.) (Caveats: Fwiw, when this script is run from cron, with stdout and stderr redirected to append to logfiles, everything gets written to the logfiles quite happily, with no terminal input required. The script is originally from Drupal's Administration Guide: `fullsitebackup_drush`; I've edited it a fair amount, but the `lzma` or `gzip` code is from there.)


title: Accidental `nano SomeFile | uniq` renders the shell unresponsive

text: In my attempt to get unique entries (read lines) out of a simple text file, I accidentally executed `nano SomeTextFile | uniq`. This "instruction" renders the shell (bash) completely (?) unresponsive/non- usable -- tested within from Yakuake and Konsole. I had to retrieve the _process id_ (PID) (by executing `ps aux | grep nano`) and manually `sudo kill -9` the PID in question. Anyhow, couldn't (or shouldn't?) the above return some error message? Why doesn't `Ctrl`+`C` kill this pipeline? Is there an easier or cleaner way to stop it than `kill -9`?


title: I am using `&`: why isn't the process running in the background?

text: I know that I can append `&` to a command to run the process in the background. I'm SSH'ing into an Ubuntu 12.04 box and running a python program with `$python program.py &` -- but when I go to close the terminal window I get a message saying that closing the terminal will kill the running process. Why is this? I am using the ampersand to run the process in the background. How can I get it to run regardless of if I am SSH'ed in?


title: nscd uses 100% cpu

text: I'm working on a linux box and the output of `top` reveals that the command `nscd` (user `nscd`) is using 100% of CPU. I'm uploading a flat file to MySQL from this box, and it is taking a long time (albeit it is a very large file)... I am curious whether `nscd` could be slowing it down by hogging all the CPU. That said, I'm puzzled as to why anything could be working with a process taking 100% of CPU... because, after all, I am running bash scripts, perl scripts, and bash commands fine notwithstanding. Is this a known problem with `nscd`? Is it actually hogging 100% of `CPU` as top reports?


title: How to detect and remove a Linux trojan?

text: I recently (re)stumbled upon this:   * Linux Trojan Goes Unnoticed For Almost A Year (Unreal IRCd) Yes, I know that adding some random PPA/software from an untrusted source is asking for trouble (or worse). I never do that, but many do (many Linux blogs and tabloids promote adding PPAs for fancy apps, without warning that it may break your system or worse still, compromise your security.) **How can a trojan horse or a rogue application/script be detected and removed?**


title: How does partprobe work?

text: I was looking for a way to refresh the scsi bus (or any other bus, for that matter) that would allow my kernel ( 2.6.18-194-el5 on CentOS 5.5) to know about the partitions on a drive, and I couldn't find a way. partprobe did it instantly. How? Since it's important, here's what I was doing: I wanted to get some practice in partition-specific things like resizing, backing up the MBR and restoring it, and so on. I had created a 20GB partition on /dev/sdb, backed up the MBR: > dd if=/dev/sdb of=sdb.mbr bs=512 count=1 then I went into fdisk, deleted the partition, wrote it, and exited. > ls /dev/sdb* showed that there was no partition, and > fdisk -l /dev/sdb' matched, so I figured I was good. I then reversed the dd: > dd if=sdb.mbr of=/dev/sdb bs=512 count=1 Of course, I didn't do anything at that point, so > ls /dev/sdb* didn't list any partitions, but > fdisk -l showed the partition, presumably because it reads the first 512 bytes on the disk and doesn't rely on the kernel. I knew that I'd have to refresh the bus, so I went into into /sys/class/scsi_host/host1, and did > echo "- - -" > scan and doing > ls /dev/sdb didn't show anything new, so then I went to /sys/bus/scsi/devices and for each of the listed devices, I did > echo 1 > rescan and that didn't work. I then did more research on the problem, and came across 'partprobe', which comes with parted. I ran it, and it worked instantly. If I don't get a likely answer here, I'm probably going to just go get the source and look it up, but I figure there are wizards here beyond me, so I thought I'd appeal to you all.


title: Cannot change global keyboard shortcuts in Linux Mint XFCE

text: I am using Linux Mint 14 XFCE. I am trying to remove the default XFCE window manager shortcuts for workspace switching (Ctrl-F1, Ctrl-F2, etc.), as described in this question. The answers there don't have any effect for me. If I go into Settings->Window Manger->Keyboard, nothing I do has any effect. If I click on a setting and hit "Clear", the setting stays there unchanged. If I double-click on a setting and choose a new shortcut key, the original settings stays there unchanged. If I go into Settings Editor (as described in the other answer to that question) and attempt to reset the settings there, nothing has any effect still. What is going on? How can I get XFCE to let me change the keyboard shortcut settings?


title: How to set up control for case fans in Debian Wheezy?

text: We'll for some days now I've been trying to get the fancontrol for my Debian Wheezy up and running. Actually (after some problems with pwmconfig not accepting my chipset, which is a AMD 770 one) now at least CPU and GFC-card fans are being controlled by fancontrol. But, this being already a very nice success, I was wondering how to control (specifically, lower) the speed (and the volume therefore) of my case fans? I've to admit I have absolutely no clue where to begin? (I only know that it should be possible somehow, because Ubuntu 12.04 did it.. but I am currently all in favor of Debian, so it would be quite nice to have this ability there as well.) So, I would really appreciate any kind of help with this issue. Here's some basic information about my system:               CPU: AMD Athlon64 5050e     GFX: MSI NX7800GT (nV 7800GT Chipset)     MB: Biostar TA770 A2+ (Chipset AMD 770)      Please let me know, if you need any further information.


title: How to integrate a multiline awk script in a shell script

text: I am a beginner in shell scripting and my question is a continuation of How to parse a file to extract 3 digits numbers kept in a "group number" I am trying to integrate in a single shell script a series of commands that   1. parse a european standard to extract a test sequence   2. convert the text encodings to utf8   3. process the result with the the awk routine that was provided to me on the post above.   4. save the content in a destination file I have tentatively written the script below. I am able to achieve only `step 1` and `step 4`, but neither `step 2` nor `step 3`. I wonder if intermediate (temporary) file(s) should be created. I have tried to store the output of intermediate steps into variables, but without success. Any help also would be helpul regarding possible mistakes and the best way to do this.               #!/bin/bash     # creating the Latex code for a test procedure          awkcommand= "/usr/bin/awk      '         $1 == "Group" {printf("\\section{%s %d}\n", $1, $2); next}         {           title = sep = ""           for (i=1; i<=NF; i++)              if ($i ~ /^[0-9][0-9][0-9]$/) {               printf("\\subsection{%s} \n\\TestDetails{%d}\n", title, $i)               break             }             else {               title = title sep $i               sep = FS             }         }     '      "          sourcefolder="/Users/yves/Desktop/Test-folder-parsing/"     sourcefile="NFEN3545-001.pdf"     destfile="Latex-code.tex"     destfolder=$sourcefolder     destinationfilepath=${destfolder}${destfile}     extractioncmd="/usr/local/bin/pdftotext -layout -f 54 -l 54"     modifier=" -"     #textencodingcmd="/usr/bin/iconv -f L1 -t UTF-8" # Needed but not used          ${extractioncmd}  ${sourcefolder}${sourcefile} ${modifier}  >  $destinationfilepath     exit 0


title: How does 'screen' impact environment variables?

text: I noticed a difference in 'env' before and after a 'screen' call, is there any additional clarity on what gets called (for setting environment variables)? I couldn't see any clear explanation from a quick search on 'man screen' Some googled queries on the topic: http://alan.lamielle.net/2009/03/09/environment-variables-and-gnu-screen http://superuser.com/questions/105954/updating-screen-session-environment- variables-to-reflect-new-graphical-login I guess a more specific sub-question would be, what is not instantiated in a screen session vs. that of a normal log-in?


title: Merging multiple lines selectively?

text: I have a large file in which a header line is followed by a string of characters at multiple times. eg: `file1`               VHBFBJBDSBVVFJBSV     SVJBVHJBVJ     SVKJBVJBNVKVJV      `file2`               dfhgdgffdghgg     SVKJBVJBNVKVJV      I want to keep the header file same, but merge all characters from line 2 onwards into a single line. can anyone suggest something?


title: In OSX ssh-keygen creates a key but then the session won't connect

text: I made a key, but it logs me back out as i try to setup passphraseless logins to localhost:               $ rsa-keygen -t rsa     $ cat id_rsa.pub > authorized_keys     $ ssh localhost          The authenticity of host 'localhost (::1)' can't be established.     RSA key fingerprint is bb:a6:5e:46:c9:b5:e9:46:bd:43:c1:6e:cd:3b:e5:ea.     Are you sure you want to continue connecting (yes/no)? yes     Warning: Permanently added 'localhost' (RSA) to the list of known hosts.     Connection closed by ::1      The same thing happens when I try to login with using the hostname as well. What am I missing?


title: Why does xargs cause apt-get to abort?

text: I'm trying to remove a list of packages from a file. I'm using the following command:               cat packages | xargs sudo apt-get remove      `packages` is my file containing a list of packages I want to remove. Everything appears to work, but `apt-get` aborts instead of letting me choose yes or no. I know I can get around this with the `-y` option, but I would like to know why this is happening and how can I keep the interactive choice.


title: Microsoft LifeCam VX-800 stopped working on Linux Mint

text: My Microsoft Lifecam VX-800 stopped working without any plausible reason. `lsusb` identifies the camera with the name "Z-Star Microelectronics Corp. Venus USB2.0 Camera". Another unusual thing is that the camera's green light is always turned on (this didn't happen when it was still working). I didn't install any new software, update anything, or change any OS configurations. What could have broken things?


title: Centos CMake Does Not Install Using gcc 4.7.2

text: A similar problem has been reported here with no solution:https://www.centos.org/modules/newbb/print.php?form=1&topic_id=42696&forum=56&order=ASC&start=0 I've added and upgraded gcc to centos               cd /etc/yum.repos.d     wget http://people.centos.org/tru/devtools-1.1/devtools-1.1.repo      yum --enablerepo=testing-1.1-devtools-6 install devtoolset-1.1-gcc devtoolset-1.1-gcc-c++     scl enable devtoolset-1.1 bash      The result is this for my gcc               [root@hhvm-build-centos cmake-2.8.11.1]# gcc -v     Using built-in specs.     COLLECT_GCC=gcc     COLLECT_LTO_WRAPPER=/opt/centos/devtoolset-1.1/root/usr/libexec/gcc/x86_64-redhat-linux/4.7.2/lto-wrapper     Target: x86_64-redhat-linux     Configured with: ../configure --prefix=/opt/centos/devtoolset-1.1/root/usr --mandir=/opt/centos/devtoolset-1.1/root/usr/share/man --infodir=/opt/centos/devtoolset-1.1/root/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --disable-build-with-cxx --disable-build-poststage1-with-cxx --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --enable-languages=c,c++,fortran,lto --enable-plugin --with-linker-hash-style=gnu --enable-initfini-array --disable-libgcj --with-ppl --with-cloog --with-mpc=/home/centos/rpm/BUILD/gcc-4.7.2-20121015/obj-x86_64-redhat-linux/mpc-install --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux     Thread model: posix     gcc version 4.7.2 20121015 (Red Hat 4.7.2-5) (GCC)       And I tried to then install cmake through http://www.cmake.org/cmake/resources/software.html#latest But I keep running into this error:               Linking CXX executable ../bin/ccmake     /opt/centos/devtoolset-1.1/root/usr/libexec/gcc/x86_64-redhat-linux/4.7.2/ld: CMakeFiles/ccmake.dir/CursesDialog/cmCursesMainForm.cxx.o: undefined reference to symbol 'keypad'     /opt/centos/devtoolset-1.1/root/usr/libexec/gcc/x86_64-redhat-linux/4.7.2/ld: note: 'keypad' is defined in DSO /lib64/libtinfo.so.5 so try adding it to the linker command line     /lib64/libtinfo.so.5: could not read symbols: Invalid operation     collect2: error: ld returned 1 exit status     gmake[2]: *** [bin/ccmake] Error 1     gmake[1]: *** [Source/CMakeFiles/ccmake.dir/all] Error 2     gmake: *** [all] Error 2      The problem seems to come from the new gcc installed because it works with the default install. Is there a solution to this problem?


title: compiling ldc2 on a centOS 5 system with no root access

text: I git-cloned the latest version of ldc2, but I don't know how to compile it on my centOS 5 machine:               git clone --recursive git://github.com/ldc-developers/ldc     cd ldc     git submodule update --init      `cmake` doesn't seem to do much. Neither does `cmake Unix Makefiles` Any ideas? There is no INSTALL file and the README file doesn't mention any installation instructions.


title: Cannot delete broken symbolic link

text: I have a symbolic link formerly pointing to a Dropbox directory. I don't know what I did wrong, but apparently now it points to itself.               hyper@mypi:/home/hyper/test$ ls -l     total 1024     lrwxrwxrwx 1 hyper hyper 7 Feb 15  2013 Dropbox -> Dropbox      When I try to remove the link I get:               hyper@mypi:/home/hyper/test$ rm Dropbox     rm: cannot remove ‘Dropbox’: Not a directory      What else can I try to get rid of this link? Part of the Output of strace rm Dropbox:               close(3)                                = 0     ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0     newfstatat(AT_FDCWD, "Dropbox", {st_mode=S_IFLNK|0777, st_size=7, ...}, AT_SYMLINK_NOFOLLOW) = 0     geteuid()                               = 1000     newfstatat(AT_FDCWD, "Dropbox", {st_mode=S_IFLNK|0777, st_size=7, ...}, AT_SYMLINK_NOFOLLOW) = 0     unlinkat(AT_FDCWD, "Dropbox", 0)        = -1 ENOTDIR (Not a directory)     open("/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 3     fstat(3, {st_mode=S_IFREG|0644, st_size=2570, ...}) = 0     mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f7ce00fc000     read(3, "# Locale name alias data base.\n#"..., 4096) = 2570     read(3, "", 4096)                       = 0     close(3)                                = 0     munmap(0x7f7ce00fc000, 4096)            = 0     open("/usr/share/locale/en_US/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)     open("/usr/share/locale/en/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)     open("/usr/share/locale-langpack/en_US/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)     open("/usr/share/locale-langpack/en/LC_MESSAGES/coreutils.mo", O_RDONLY) = 3     fstat(3, {st_mode=S_IFREG|0644, st_size=619, ...}) = 0     mmap(NULL, 619, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f7ce00fc000     close(3)                                = 0     open("/usr/lib/charset.alias", O_RDONLY|O_NOFOLLOW) = -1 ENOENT (No such file or directory)     write(2, "rm: ", 4rm: )                     = 4     write(2, "cannot remove \342\200\230Dropbox\342\200\231", 27cannot remove ‘Dropbox’) = 27     open("/usr/share/locale/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)     open("/usr/share/locale/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)     open("/usr/share/locale-langpack/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)     open("/usr/share/locale-langpack/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)     write(2, ": Not a directory", 17: Not a directory)       = 17     write(2, "\n", 1     )                       = 1     lseek(0, 0, SEEK_CUR)                   = -1 ESPIPE (Illegal seek)     close(0)                                = 0     close(1)                                = 0     close(2)                                = 0     exit_group(1)                           = ?     +++ exited with 1 +++


title: Using tcpdump to extract NFS RPC contents

text: Fairly simple question... I'm running tcpdump and trying to analyze the contents of the TCP packets between server/client. I see the "GETATTR" RPC being received, which is great! However, I want to know the file for which the RPC is being made. I'm assuming this is in the packet content. When I print the tcpdump as ASCII.               From server:     tcpdump -vvv -s 200 port 2049      14:45:38.408949 IP (tos 0x0, ttl 64, id 58408, offset 0, flags [DF], proto TCP (6), length 296)     myserver.nfs > myclient.2469839164: reply ok 240 getattr NON 3 ids 0/3 sz 0      Here and other sites show that it is possible to map to filenames. Maybe it's platform dependent? I just want to make sure there isn't an obvious option to tcpdump that I am missing. I'm running RH5 - Kernel 2.6.32-279.el6.x86_64


title: A question about wlan0 / eth0 and wireshark

text: I'm using wireshark to listen to packets on my own personal home network. I have my Desktop with Debian and Windows 7 running and my laptop is running the same setup; Debian and Windows 7. I installed wireshark on both. When on my laptop, I can listen to packets on wlan0. When I browse the web, the packets are captured and all is good. When on my desktop, I can listen to packets on eth0. When I browse the web and etc, the packets are captured and all is good. However, when on my laptop (wlan0) and want to listen to packets coming in/out on eth0 - which my desktop computer is on, I obviously get no results. ### To the Question: If I want to use my laptop and monitor the packets coming in and out from my desktop or just simply on both wlan0 and eth0, how could I do this? This is what it all looks like. As you can see, there is no IP address at eth0. (This is from my laptop, where wlan0 has an IP address). ![enter image description here](http://i.stack.imgur.com/KYeA3.png) and here is another perspective ![enter image description here](http://i.stack.imgur.com/AJ51b.png) I know it's a small image but if you look closely, under eth0 there is no ip address.. but just below that, wlan0, has a bunch of information there and an ip address.


title: Does -q definitely turn off wget output logging?

text: I currently have a shell script running on a linux server which is using wget in oder to download a remote web page. This in turn is executed by a cron job which is scheduled to run at certain times. Can someone please confirm that adding in the `-q` option will not only stop all output being returned to the console, but will also stop all attempts by wget to write to the logs or to try and create a log file?


title: Does this threat still exist: Linux keylogger without root privileges

text: http://superuser.com/questions/301646/linux-keylogger-without-root-or-sudo-is- it-real Or it's long gone as most of the new distros implement SELinux by default


title: Emacs subshell (M-x shell) not autocompleting shell aliases

text: I have aliases defined on my `.zshrc` file that I commonly use when I am on a `gnome-terminal`. However, when I am on `M-x shell` on Emacs, the autocompletion does not find them (even though they still work). Is this a limitation of the Emacs subshell? Are there any known workarounds to this problem?


title: How to compile and install iperf on a MIPS based router?

text: I have a DIR-825 router based on Atheros AR7161 (MIPS) running DD-WRT v24-sp2 std. How can I compile and install iperf on it? Can I compile it directly on the target device, or do I have to cross compile it and then transfer the binary to the target device? Is this possible, and where do I begin? What kind of tools do I need? What's involved in doing something like this? _Side note: I have limited knowledge of Linux, so please provide as thorough answer as possible, and not just some external links. If you do post a link, make sure it links to some article or a blog post that thoroughly explains the process._


title: How do I use ctags functionality in vim with cscope installed?

text: When I install `cscope` by adding the line `Bundle 'chazy/cscope_maps` to my `.vimrc` file, my tags menu (`g+[`) is replaced with a cscope list, which seems to contain a list of files where the tag is _called_ , not where it is _declared_. I would like to be able to use cscope using `CTRL\\+s` to get a list of locations where the tag is referenced, and then use `g+[` to get locations where the object is declared. Can I do this? I'm not fussed whether I'm using `cscope` or `ctags` to get the token declarations.


title: What does it mean to redirect /dev/console through a non-existent file?

text: I have been trying to follow the "NAND firmware update" tutorial and I am perplexed by these last lines: > now, in second stage, all processes are gone, only /dev/console in old root > is still open and connected to our stdin/stdout/stderr. This blocks un- > mounting our old root. To close it, start third stage script to redirect > console to new rootfs /dev/console (use exec to replace current process): > > exec /bin/sh /bin/update-firmware3 /dev/console 2>&1 but /bin/update-firmware3 isn't mentioned previously. What is the `exec /bin/sh /bin/update-firmware3 </dev/console >/dev/console 2>&1` code trying to accomplish? and what is '/bin/update-firmware3'?


title: How to recover a corrupted "tar.gz" file

text: I suddenly needed to recover an old `tar.gz` file, but as soon as I execute so:               tar -zxvf filename.tar.gz      I get this:               gzip: stdin: invalid compressed data--format violated       tar: Child returned status 1       tar: Error is not recoverable: exiting now


title: How to fix Russian letters in a Wine application when adjusting LANG does not help?

text: An application with a Russian UI shows question marks instead the most of its text (some elements are rendered ok though). The system locale is English (en_US, en_IE), I've tried Ubuntu ant XUbuntu 12.04 with Wine 1.5. I've tried launching the application with               LANG=ru_RU.utf8 wine myapp.exe      but it doesn't help. I have also checked that `ttf-mscorefonts-installer` is installed. If I use Windows, setting Russian codepage for non-unicode apps in the Control Panel solves the problem. Any ideas?


title: Awk : Range of PIDs

text: I am learning `awk` from this tutorial. It's quite basic. I have a list of processes in a file which I got by doing `ps aux > processes` Now according to the tutorial, doing `awk '$2 ~ 14022, $2 ~ 14040'` should give a range of processes with PID ranging from 14022 to 14040. I tried the same with PID range 1746 - 1760. But it outputs the processes which have PID above 1760. Output               $ awk '$2 ~ 1746, $2 ~ 1760 {print $1, $2, $11}' processes      root 1746 sudo     root 1750 wvdial     root 1751 /usr/sbin/pppd     dharmit 1772 /opt/google/chrome/chrome     dharmit 1788 /opt/google/chrome/chrome     dharmit 1790 /opt/google/chrome/chrome     root 1791 /sbin/udevd     dharmit 1827 /opt/google/chrome/chrome     dharmit 1830 /opt/google/chrome/chrome     dharmit 1846 /opt/google/chrome/chrome     dharmit 1850 gnome-terminal     dharmit 1856 gnome-pty-helper     dharmit 1857 bash     root 1902 [kworker/0:4]     dharmit 1940 /opt/google/chrome/chrome     root 1952 [kworker/1:0]     root 2104 /usr/sbin/anacron     root 2181 /usr/libexec/packagekitd     dharmit 2183 ps      Why does it happen so? What am I missing here?


title: Any reason for encrypted /?

text: I am a big fan of linux and like trying out new distros now and then. I usually have my home folders and roots in a lvm atop an encrypted partition, but this tends to become cumbersome with every initramfs creation process being more alien than the last one. I value privacy, but most of my valuable information or personal is stored in the home folders. Moreover, I partitioned using GPT, so multiple partitions are not that hard to setup even outside a lvm. So the question is: Is root crypting and lvm-ing of "/" worth it, especially with all the early userspace hassle I have to deal with?


title: help needed to decipher this Acer Aspire 4830TG ACPI code for Nvidia Optimus

text: I am trying to make sense of the following NVOP Method from the ACPI tables for an Acer Aspire 4830TG with an Nvidia Optimus hybrid graphics system. The NVOP method on top defines a bunch of instructions that can be used later on in the _DSM method. Which method should I call with the acpi_call module or the byo-switcheroo module to switch on/off the card on demand? See the code below:               Method (NVOP, 4, Serialized)     {         Name (_T_0, Zero)         Store ("------- NV OPTIMUS DSM --------", Debug)         If (LNotEqual (Arg1, 0x0100))         {             Return (0x80000001)         }              While (One)         {             Store (ToInteger (Arg2), _T_0)             If (LEqual (_T_0, Zero))             {                 Store (Buffer (0x04)                     {                         0x61, 0x00, 0x01, 0x0C                     }, Local0)                 Return (Local0)             }             Else             {                 If (LEqual (_T_0, 0x05))                 {                     Name (TMP5, Buffer (0x04)                     {                         0x00, 0x00, 0x00, 0x00                     })                     CreateField (TMP5, Zero, 0x04, DAVF)                     CreateField (TMP5, 0x04, One, LIDF)                     CreateField (TMP5, 0x08, 0x06, TOGN)                     CreateField (Arg3, 0x1F, One, NCSM)                     CreateField (Arg3, 0x19, 0x05, NCSN)                     CreateField (Arg3, 0x18, One, DIMK)                     CreateField (Arg3, 0x0C, 0x0C, ACTD)                     CreateField (Arg3, Zero, 0x0C, ATTD)                     If (ToInteger (NCSM))                     {                         Store (ToInteger (NCSN), TOGN)                     }                     Else                     {                         If (ToInteger (DIMK))                         {                             GETD (ToInteger (ATTD), ToInteger (ACTD))                             Store (\_SB.PCI0.PEG0.PEGP.NTOI, TOGN)                             Store (One, DAVF)                         }                     }                          Return (TMP5)                 }                 Else                 {                     If (LEqual (_T_0, 0x06))                     {                         Name (TMP6, Package (0x0F)                         {                             Ones,                              0x2C,                              Ones,                              0x2C,                              Ones,                              0x2C,                              Ones,                              Ones,                              0x2C,                              Ones,                              Ones,                              0x2C,                              Ones,                              Ones,                              0x2C                         })                         Store (\_SB.PCI0.GFX0.IDI2, Index (TMP6, Zero))                         Store (\_SB.PCI0.GFX0.IDI1, Index (TMP6, 0x02))                         Store (\_SB.PCI0.GFX0.IDI4, Index (TMP6, 0x04))                         Store (\_SB.PCI0.GFX0.IDI2, Index (TMP6, 0x06))                         Store (\_SB.PCI0.GFX0.IDI1, Index (TMP6, 0x07))                         Store (\_SB.PCI0.GFX0.IDI2, Index (TMP6, 0x09))                         Store (\_SB.PCI0.GFX0.IDI4, Index (TMP6, 0x0A))                         Store (\_SB.PCI0.GFX0.IDI1, Index (TMP6, 0x0C))                         Store (\_SB.PCI0.GFX0.IDI4, Index (TMP6, 0x0D))                         Return (TMP6)                     }                     Else                     {                         If (LEqual (_T_0, 0x10))                         {                             Return (\_SB.PCI0.PEG0.PEGP.GOBT (Arg3))                         }                         Else                         {                             If (LEqual (_T_0, 0x1A))                             {                                 CreateField (Arg3, 0x18, 0x02, OPCE)                                 CreateField (Arg3, Zero, One, FLCH)                                 If (ToInteger (FLCH))                                 {                                     Store (ToInteger (OPCE), OMPR)                                 }                                      Name (RBUF, Buffer (0x04)                                 {                                     0x00, 0x00, 0x00, 0x00                                 })                                 CreateField (RBUF, Zero, One, OPEN)                                 CreateField (RBUF, 0x03, 0x02, CGCS)                                 CreateField (RBUF, 0x06, One, SHPC)                                 CreateField (RBUF, 0x18, 0x03, DGPC)                                 CreateField (RBUF, 0x1B, 0x02, HDAC)                                 Store (One, OPEN)                                 Store (One, SHPC)                                 Store (0x02, HDAC)                                 Store (One, DGPC)                                 If (\_SB.PCI0.PEG0.PEGP.GSTA ())                                 {                                     Store (0x03, CGCS)                                 }                                 Else                                 {                                     Store (Zero, CGCS)                                 }                                      Return (RBUF)                             }                             Else                             {                                 If (LEqual (_T_0, 0x1B))                                 {                                     Store (Arg3, Local0)                                     CreateField (Local0, Zero, One, OPFL)                                     CreateField (Local0, One, One, OPVL)                                     If (ToInteger (OPVL))                                     {                                         Store (Zero, OPTF)                                         If (ToInteger (OPFL))                                         {                                             Store (One, OPTF)                                         }                                     }                                          Store (OPTF, Local0)                                     Return (Local0)                                 }                                 Else                                 {                                     Return (0x80000002)                                 }                             }                         }                     }                 }             }                  Break         }     }          Method (GOBT, 1, NotSerialized)     {         Name (OPVK, Buffer (0xE2)         {             /* 0000 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0008 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0010 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0018 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0020 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0028 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0030 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0038 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0040 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0048 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0050 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0058 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0060 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0068 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0070 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0078 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0080 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0088 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0090 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0098 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 00A0 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 00A8 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 00B0 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 00B8 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 00C0 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 00C8 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 00D0 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 00D8 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 00E0 */    0x00, 0x00         })         CreateWordField (Arg0, 0x02, USRG)         If (LEqual (USRG, 0x564B))         {             Return (OPVK)         }              Return (Zero)     }          Method (_INI, 0, NotSerialized)     {         Store (Zero, \_SB.PCI0.PEG0.PEGP._ADR)     }          Method (GSTA, 0, Serialized)     {         If (LEqual (\_SB.PCI0.PEG0.PEGP.PI17, One))         {             Return (One)         }         Else         {             Return (Zero)         }     }          Method (_ON, 0, Serialized)     {         \_SB.PCI0.PEG0.PEGP.PWRE ()         Store (Zero, LNKD)         While (LLess (LNKS, 0x07))         {             Sleep (One)         }              Store (Zero, CMDR)         Store (VGAB, VGAR)         Store (0x06, CMDR)     }          Method (_OFF, 0, Serialized)     {         Store (VGAR, VGAB)         Store (One, LNKD)         While (LNotEqual (LNKS, Zero))         {             Sleep (One)         }              \_SB.PCI0.PEG0.PEGP.PWRD ()     }          Method (_PS0, 0, NotSerialized)     {         If (DGOS)         {             GLSC ()             \_SB.PCI0.PEG0.PEGP._ON ()             GLSR ()             Store (Zero, DGOS)             Store (Zero, MLTF)             Store (Zero, \_SB.PCI0.LPCB.EC0.DSPM)         }     }          Method (_PS3, 0, NotSerialized)     {         If (LEqual (\_SB.PCI0.PEG0.PEGP.OMPR, 0x03))         {             GLSC ()             \_SB.PCI0.PEG0.PEGP._OFF ()             GLSR ()             Store (One, DGOS)             Store (0x02, \_SB.PCI0.PEG0.PEGP.OMPR)             Store (One, \_SB.PCI0.LPCB.EC0.DSPM)         }     }          Method (_STA, 0, Serialized)     {         Return (0x0F)     }          Method (_ROM, 2, NotSerialized)     {         Store (Arg0, Local0)         Store (Arg1, Local1)         If (LGreater (Local1, 0x1000))         {             Store (0x1000, Local1)         }              If (LGreater (Local0, 0x00010000))         {             Return (Buffer (Local1)             {                 0x00             })         }              If (LGreater (Local0, RVBS))         {             Return (Buffer (Local1)             {                 0x00             })         }              Multiply (Local1, 0x08, Local3)         Name (ROM1, Buffer (0x8000)         {             0x00         })         Name (ROM2, Buffer (Local1)         {             0x00         })         If (LLess (Local0, 0x8000))         {             Store (RBF1, ROM1)         }         Else         {             Subtract (Local0, 0x8000, Local0)             Store (RBF2, ROM1)         }              Multiply (Local0, 0x08, Local2)         CreateField (ROM1, Local2, Local3, TMPB)         Store (TMPB, ROM2)         Return (ROM2)     }          Method (MXMX, 1, Serialized)     {         If (LEqual (Arg0, One))         {             P8XH (One, 0x99, P8XH (Zero, One, Return (One), Return (Zero)))         }     }          Name (MXM3, Buffer (0x45)     {         /* 0000 */    0x4D, 0x58, 0x4D, 0x5F, 0x03, 0x00, 0x3D, 0x00,          /* 0008 */    0x30, 0x10, 0xB8, 0xFF, 0xF9, 0x3E, 0x00, 0x00,          /* 0010 */    0x00, 0x01, 0x8A, 0xFF, 0xF9, 0x3E, 0x00, 0x00,          /* 0018 */    0x60, 0x79, 0xD0, 0xFE, 0xF9, 0x3E, 0x00, 0x00,          /* 0020 */    0x20, 0x2B, 0xE2, 0xFE, 0xF9, 0x3E, 0x00, 0x00,          /* 0028 */    0x60, 0x6C, 0xEA, 0xFE, 0xF9, 0x3E, 0x00, 0x00,          /* 0030 */    0x01, 0x90, 0x01, 0x00, 0x03, 0x00, 0x90, 0x01,          /* 0038 */    0x13, 0x00, 0x90, 0x01, 0xE5, 0x0D, 0x01, 0x01,          /* 0040 */    0x01, 0x00, 0x00, 0x00, 0x96     })     Method (_DSM, 4, Serialized)     {         Name (_T_0, Zero)         If (LEqual (Arg0, Buffer (0x10)                 {                     /* 0000 */    0xF8, 0xD8, 0x86, 0xA4, 0xDA, 0x0B, 0x1B, 0x47,                      /* 0008 */    0xA7, 0x2B, 0x60, 0x42, 0xA6, 0xB5, 0xBE, 0xE0                 }))         {             Return (\_SB.PCI0.PEG0.PEGP.NVOP (Arg0, Arg1, Arg2, Arg3))         }              If (LEqual (Arg0, Buffer (0x10)                 {                     /* 0000 */    0x00, 0xA4, 0x04, 0x40, 0x7D, 0x91, 0xF2, 0x4C,                      /* 0008 */    0xB8, 0x9C, 0x79, 0xB6, 0x2F, 0xD5, 0x56, 0x65                 }))         {             While (One)             {                 Store (ToInteger (Arg2), _T_0)                 If (LEqual (_T_0, Zero))                 {                     Return (Buffer (0x04)                     {                         0x01, 0x00, 0x01, 0x01                     })                 }                 Else                 {                     If (LEqual (_T_0, 0x18))                     {                         Return (Buffer (0x04)                         {                             0x00, 0x03, 0x00, 0x00                         })                     }                     Else                     {                         If (LEqual (_T_0, 0x10))                         {                             If (LEqual (Arg1, 0x0300))                             {                                 Return (MXM3)                             }                         }                     }                 }                      Break             }                  Return (0x80000002)         }              Return (0x80000001)     }      The original ACPI tables are available here:   http://bugs.launchpad.net/lpbugreporter/+bug/752542/+attachment/2235754/+files/Aspire%204830TG.tar.gz http://github.com/mkottman/acpi_call   http://github.com/awilliam/asus-switcheroo


title: Printing evaluated prompt placeholders to screen

text: Is there a way to print interpreted PS1 variable placeholders to console? Something like               $ echo `%u`      for printing a username or               $ echo `%h`      for printing a host. I do know about environment variables I just want to know if there is a way to get same information through `PS1` variable.


title: How to check if a filesystem is mounted with a script

text: I am new at scripting ... I can do very basic stuff, but now I need a hand. I have a local filesystem that only will be mounted when I need to do a backup. I'm starting with this.               #!/bin/bash     export MOUNT=/myfilesystem          if grep -qs $MOUNT /proc/mounts; then       echo "It's mounted."     else       echo "It's not mounted."; then       mount $MOUNT;     fi      As I said, I'm very basic at scripting. I heard that you can check the status of the `mount` command by looking at the return codes.               RETURN CODES            mount has the following return codes (the bits can be ORed):            0      success            1      incorrect invocation or permissions            2      system error (out of memory, cannot fork, no more loop devices)            4      internal mount bug            8      user interrupt            16     problems writing or locking /etc/mtab            32     mount failure            64     some mount succeeded      I don't know how to check that. Any guidance?


title: Software for very simple editing of advanced .psd files

text: I need a Linux application for very simple editing of advanced `.psd` files in Linux. Turning on and off layers would be enough. Unfortunately, GIMP has way too many problems with it. It is unable to display image with few more advanced layers correctly. It renders little different picture. Is there any other solutions other than Photoshop in Wine? P.S.   I'm fine with GIMP interface and I don't know Photoshop. However it looks I have to work with `.psd` files.


title: Sending commands to dbx from Vim

text: Using this information, I've been able to debug code using `dbx` and display the code from within Vim. What would be really cool is if I could send commands (step, next, print, stop in ... etc) to `dbx` from within Vim. I am relatively new to Unix so do not know of any way to do this. Does anyone know how to send commands to `dbx` in this way? For example, sending commands to `dbx` from a separate process, or running `dbx` as a server?


title: USB Keyboard does not work with Grub

text: I am setting up Arcade Puppy http://scottjarvis.com/page105.htm on an old Dell GX50 PC. Instead of using a PS2 style keyboard which I don't have I opted for a low profile generic USB keyboard. The problem is that once installed to the hard disk the GRUB boot menu does not recognize the USB Keyboard so I cannot choose the boot option to start Linux, also there isn't the normal default timeout setup. The USB keyboard works the BIOS settings fine and worked okay when booting off the live CD to install Linux. Has anyone got any suggestions or will I be forced to find a PS2 keyboard?


title: Update yum offline

text: I've been looking around for a way to update an offline fedora box but haven't found anything. I only have a Windows computer connected to the Internet. I noticed that my yum config is pointed to http://download.fedoraproject.org/pub/fedora/linux/updates/14/i386. Is there a way I can download a list of packages and then those packages manually but still use yum? I've seen ways to do this with a second linux box that has Internet access, but I don't have that.


title: Which Red Hat Enterprise Linux packages for CentOS?

text: I want to use a Red Hat Enterprise Linux RPM software package on CentOS 5.6, but I don't know which version of RHEL works with CentOS 5.6. RHEL 4 = CentOS 4? RHEL 5 = CentOS 5? ...


title: ntfs external HD works read-only on Arch

text: I only have read-only access to my external hard-drive which is using NTFS filesystem. How do I fix this problem to get full access to my hard drive?


title: Piping tcpdump traffic via SSH - but no root ssh access

text: **The situation** I would like to use Wireshark to analyze traffic on one of our servers, but I don't want to install Wireshark on the server itself. I understand that I can pipe tcpdump traffic via SSH to my local machine (Ubuntu) which has Wireshark installed. **The problem** I cannot login to the server with a root account because that is disabled. I have sudo rights, but when logged in to the server the command `sudo tcpdump` does not work. The command below (with or without sudo) won't work:               $ ssh john@server-abc.com "sudo tcpdump -s 0 -U -n -w - -i eth0 not port 22" > /tmp/remote      **The question** Is there a way to get this working? If so - how?


title: Directory "diff"?

text: I have two directories which are different versions of the same software package. I'd like to list all the files/directories that have changed between the two then copy those differences to a new directory. I've been trying different scripts with `md5sum` and `diff -Nurq` but haven't been able to get the result I'm looking for. Any recommendations?


title: Detecting pattern at the end of a line with grep

text: If I do:               $ ls -R     .:     4Shared/  Cloud/          ./4Shared:     UFAIZLV2R7.part3.rar          ./Cloud:     UFAIZLV2R7.part2.rar.part     UFAIZLV2R7.part1.rar.part     UFAIZLV2R7.part4.rar.part      If I want to list the `.rar` files only, and I use **grep** , it will show me too the `.rar.part` files, what is not my wish.   I am solving this using `find` or `ls **/*.rar` as told in this thread and they work fine, but I would like to learn if it is possible to do it via `grep`. I have tried (thinking about `EOL`):               ls -R | grep ".rar\n"      with no results.   I think that the problem lies in discover if the greping is found **at the end of the line** , but I am not sure. Any help out here, please?


title: Limit on the number of btrfs snapshots?

text: I am considering using btrfs on my data drive so that I can use snapper, or something like snapper, to take time based snapshots. I believe this will let me browse old versions of my data. This would be in addition to my current off site backup since a drive failure would wipe out the data and the snapshots. Is there a limit to the number of snapshots I can take and store? From my understanding snapshots do not take up much space (meta data and the blocks that have changed, plus maybe some overhead), so space doesn't seem to be a constraint. If I have a million snapshots (e.g., a snapshot every minute for two years) would that cause havoc, assuming I have enough disk space for the data, the changed data, and the meta data? If there is a practical limit on the number of snapshots, does it depend on the number of files and/or size of files?


title: How does dispatcher work?

text: This is a general Operating Systems theory question but since I am learning OS theory through UNIX-like systems I wanted to ask it here. Today, after my OS lecture , I asked to our instructor that: 'Dispatcher is a thread , which is inside Process Manager process. Since PM is also a process, while a process called A is in the running state, how does PM take over the processor from it? Dispatcher is supposed to take processor away from processes and allocate it to another process. But while Process Manager is not running, how is that supposed to happen?' He said: 'Process Manager is "always" in the running state in CPU0'. I said: 'If there is only one CPU with one core, how does PM always in running state?" He said it is. Any one can light me out of that dilemma?


title: Equivalent of "truss -T" and "truss -U" on Linux?

text: Is there an equivalent of what the `-T` and `-U` option of the `truss` Solaris utility does on Linux. Those are to specify a system call (`-T`) or library function (`-U`) which when called by the traced application would cause it to stop. Or, said otherwise, I'd want any process started by a traced application to be stopped (as if killed by SIGSTOP) as soon as it makes a given system call or a given shared library function call. `strace` and `ltrace` on Linux provide with much of the featureset of Solaris `truss`, but they don't seem to be doing that. For instance:               truss -f -T open cmd      Would be like `strace -f cmd` except that if the process executing `cmd` or any of its descendants does any `open` system call, it would be stopped immediately (and I can resume it later on at my convenience) In some cases, I could use `gdb`'s `catch syscall`, but I was looking for a solution that can conveniently follow forks and continue doing it for all the forked processes and keep on doing it even after `execve`s. I seem to recall some utility giving the same functionality, even one (or options to that same utility) to single-step applications between some occurrences of some syscall remotely like that, but my memory is failing me, I can't even be sure that was on Linux.


title: Executing commands with ssh and shell script using variables on a remote machine

text: I'd like to execute a command and script located on a remote machine with a script on a local machine. I know it's possible to execute these kind of commands with `ssh`, so I made:               #!/bin/bash     ssh username@target 'cd locationOf/theScript/; ./myScript.sh'      It works perfectly. I'd like this script to be more generic, using variables. Now, it is:               #!/bin/bash     LOCATION=locationOf/theScript/     EXEC=myScript.sh     ssh username@target 'cd ${LOCATION}; ./${EXEC}'      And I get this error: `bash: ./: is a directory` I guess the remote machine doesn't know these variables. So is there a way to _export_ them to the target ?


title: Could ">" be included in a bash Variable?

text: **Current approach** :               sudo awk 'BEGIN{printf "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<hello>\n\t<world>\n";} {print "\t\t",$0}END{printf "\t </world>\n</hello>\n"}' hello > hello2      **Preferred approach does not work** : `hello > hello2` would like to be defined as a variable to avoid code duplication               $CURRENT_TO_OUT=hello > hello2          echo "CP1" $CURRENT_TO_OUT          sudo awk 'BEGIN{printf "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<hello>\n\t<world>\n";} {print "\t\t",$0}END{printf "\t </world>\n</hello>\n"}' $CURRENT_TO_OUT      **Output $CURRENT_TO_OUT:** `CP1 hello`


title: High memory (user space) and highmem (kernel space)

text: Each process has 2 memory area: User space (high memory) and kernel space (low memmory). In the kernel space, are the first 896 MB used for mapping kernel code (not fully 1 GB)? This means, when a user -space application performs a system call or anything related to the kernel, the kernel will refer to kernel space for the system call to execute, is it? The reserved 128MB in kernel space (for high memory (user space) access), is it all the references of user-space memory area? So, a kernel process can access any user space by refer to this area, is this true? That's why this area is called highmem in kernel space, isn't it?


title: Official tools to save/restore gnome settings

text: Is there an official tool that can save and restore gnome-specific settings ? I know several applications uses ~/.config, I don't care about them, just settings for gnome, e.g panel applets, keyboard shortcuts, and other application uses gconf. P.S: it's best for both gnome2/3


title: Ubuntu One in Fedora

text: I have an Ubuntu One account and want to be able to sync it to a folder in Fedora. Is this possible and what is the best way to do it?


title: su - user doesn't work for users without a password

text: I've created a user on CentOS with `useradd -M username`. Now, I want to become that user just like `su - username`. It asks me for a password for that user but I didn't set a password for that user. As a workaround, I have to become root then `su - username` works obviously. First, I thought it asks for a root password but it is not the case. Any ideas?


title: Best way to view scripted session logs

text: I have aliases set up for SSH and minicom to call simple wrapper scripts which just ensure that I get a log of the session. The logs are stored in a specified directory, and named with a tag and a time-stamp so that I can find them again later. For SSH the wrapper uses "script" to perform the session recording. For minicom the wrapper enabled the built-in session logging feature. This works well for capturing simple output. However terminal control codes, can cause havoc with the legibility of the logs. In particular if I enter into vi, run "top", start "screen" use less to page up and down or even when "editing" the command line control characters end up in the captured log. "top" and "screen" contend for being the worst culprits in making these captured logs hard to read. I've discovered that "more" is much better than "less" at viewing log files. More actually replays most of the control codes with a degree of success, resulting in something on screen which represents what was on screen originally. Additionally "strings" (piped to more or less) or even more piped to less (less is more), can help to restore some sense to the log. grep can find a command ... if it was entered correctly and not been edited. I'm looking for suggestions for viewing the logs, how to get rid of embedded control characters, and re-construct the terminal output as it was at the time it was captured as far as possible. GUI or CLI tools are both acceptable though I have a slight preference to using CLI tools. I've been dabbling with the idea of writing a pre-processor script which will cut out "top". I also unfortunately quite often use screen to multiplex the sessions and save long running commands from being interrupted by a lost connection, so maybe I can find a way to recognize and strip out screen specific codes too.


title: Add new network interface to the kvm (Slackware is installed)

text: Installed slackware11 on KVM, which is controlled by virt-manager. I need one more network interface, so I added another one using the same model as was installed by default, and restarted the machine. But the `ifconfig` command just shows the `lo` and `eth0`. Should I do any job on Linux after adding interfaces to KVM?


title: How can I extract the hash value of a LUKS device?

text: For LUKS devices I know that hashes are stored somehow in the partition header (I don't really know what this means). But I don't know how to print the hash value in this case. For example in a standard unix system the user password hashes are stored in `/etc/shadow`. If I want to see a hash of a password I can just open this file and see it. So, how can I extract the hash value of a LUKS device?


title: Spamassassin blacklist_to testing

text: I have some rules in my local.cfg file with some addresses defined as `blacklist_to`. However, I keep getting spam for these addresses -- or rather any email whatsoever. How can I test spamassassin to see why it keeps accepting said emails?


title: Can't share an ssh connection with rsync

text: In my `.ssh/config` file I have the following:               Host xxx     User yyy     HostName zzzz     ControlMaster auto     ControlPath ~/.ssh/%r@%h:%p       This works great for multiplexing my ssh connections (i.e. login once, and share the connection with multiple sessions). I would like to multiplex (share) my ssh connection with **rsync** , so that I can do things like               rsync -arv -e ssh xxx:/source target      and not have to login through **rsync** (I have two-factor authentication system with XXX and it would be great if I can just skip that when I use rsync). **Update:** I learn that by default rsync would try to re-use the connection first. So I am not sure why it isn't working. Here is the verbose output of my attempt:               > rsync -arv -e 'ssh -v' XXX:~/file ~/temp/.     OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008     debug1: Reading configuration data /home/YYYY/.ssh/config     debug1: Applying options for XXX     debug1: Reading configuration data /etc/ssh/ssh_config     debug1: Applying options for *     debug1: auto-mux: Trying existing master     Control socket connect(/home/YYY/.ssh/XXX@ZZZZ:22): Connection refused


title: How can I track virtual Disk device to physical slot?

text: I'm kind of new working with Unix (Ubuntu). I managed to install Ubuntu on RAID1 and mounted 3 RAID 0 drives. I have a 9271-8i storage controller:               RAID1 (sda) - Unix installed     RAID0 (sdb)     RAID0 (sdc)     RAID0 (sdd)      I'm trying to track virtual drives (sdb, sdc, sdd) to the actual physical slot. If I see sdb is bad, I need to know which drive it is exactly on the server (I only have chance to do with the Device Id/Slot Id). How to get the physical drive/Slot ID? Any guidance on this would be appreciated.


title: Switch off syslog on laptop?

text: Is there any point in keeping logs on my laptop? This is not a server to debug problems via syslog. I occassionally want to look at dmesg | tail but that does not mean I need anything on disk. Wastes space and also the SSD has a limited number of write cycles.


title: copy (to X clipboard) shortcut in .tmux.conf

text: In order to copy text to X clipboard in tmux, what I currently do is:   * go selection mode with `prefix``[`   * start selection with `space` (using `mode-keys vi` btw)   * select the text and press `enter`   * copy tmux buffer to X clipboard using `prefix``ctrl+c` (I have a mapping as `bind C-c run "tmux show-buffer | xclip -selection clipboard -i"` I'm trying to eliminate some of these steps by making a mapping for selection mode. I have tried:               bind-key -t vi-copy C-c run "tmux show-buffer | xclip -selection clipboard -i"      which gives me and error:               .. usage: bind-key [-cnr] [-t key-table] key command [arguments]      (I couldn't copy the error lol) how can I fix this? **EDIT:** I have realized I can select and copy to tmux buffer (first 3 steps) using mouse just like a regular selection (although highlighting doesn't last, it still selects the text) and then use the following bind to copy to x clipboard:               bind-key -n C-c run "tmux show-buffer | xclip -selection clipboard -i"      (I used this method to copy this text and it was easy ;) note that `-n` denotes "no prefix" therefore no escaping is needed. if you don't get confused by the vanishing highlight this is analogous to regular (common user interface) copying. this is the best I have come up with so far.. **EDIT2:** turned out `ctrl+c` overlaps with process interrupt thing so I changed to `ctrl+alt+c` for now. (didn't quite like it) **EDIT3:** tmux 1.8 or so added support to add keybindings in copy mode so now my first original intention is possible using something like:               bind-key -tvi-copy y copy-pipe "xclip -selection clipboard -i"     bind-key -tvi-copy enter copy-pipe "xclip -selection clipboard -i"      These two bindings make it possible to copy text to clipboard when I used `enter` or `y` to finish copying. I still keep this line in case I do the copying with mouse and decide to get the tmux buffer content to clipboard later on:               bind-key y run "tmux show-buffer | xclip -selection clipboard -i"


title: GSM modem does not create /dev/ttyUSB file

text: I installed Kannel in a server, and I want to use a GSM 3G USB modem to send/receive SMS messages, as described in section _SMS Centers > GSM Modem_ of the Kannel User Guide. I have already installed, configured and tested Kannel on my notebook successfully. When I plug the modem into my notebook, a device named `/dev/ttyUSB0` appears. It acts as a serial port to send commands to the modem. I have to put this device in the Kannel configuration file. After some testing, I decided to install Kannel in the production server. The server runs **Linux-VServer** , and my task is to install Kannel on the _host_ and PlaySMS in one of the _guests_ , which runs Apache. The problem is that I can't find any device analogous to the `ttyUSB0` that is created in my machine (and AFAIK, in all normal Linux boxes). Here are some diagnostic commands. The modems used are not the same model, but I have already tested Sierra 308 on my notebook and it works, too. ## My notebook - Arch Linux uname -a:               Linux twoflower 3.4.9-1-ARCH #1 SMP PREEMPT Wed Aug 15 18:11:01 UTC 2012 i686 GNU/Linux      dmesg when I plug the modem in (Huawei 156B):               [35328.849886] usb 1-2: new high-speed USB device number 12 using ehci_hcd     [35329.007281] scsi9 : usb-storage 1-2:1.2     [35329.010054] scsi10 : usb-storage 1-2:1.3     [35329.301153] usbcore: registered new interface driver usbserial     [35329.302155] usbcore: registered new interface driver usbserial_generic     [35329.303064] USB Serial support registered for generic     [35329.303221] usbserial: USB Serial Driver core     [35329.368043] usbcore: registered new interface driver option     [35329.368960] USB Serial support registered for GSM modem (1-port)     [35329.369332] option 1-2:1.0: GSM modem (1-port) converter detected     [35329.377484] usb 1-2: GSM modem (1-port) converter now attached to ttyUSB0     [35329.377567] option 1-2:1.1: GSM modem (1-port) converter detected     [35329.378930] usb 1-2: GSM modem (1-port) converter now attached to ttyUSB1     [35330.013635] scsi 9:0:0:0: CD-ROM            HUAWEI   Mass Storage     2.31     PQ: 0 ANSI: 2     [35330.019275] scsi 10:0:0:0: Direct-Access     HUAWEI   MMC Storage      2.31     PQ: 0 ANSI: 2     [35330.028997] sd 10:0:0:0: [sdb] Attached SCSI removable disk     [35330.214473] sr0: scsi-1 drive     [35330.214484] cdrom: Uniform CD-ROM driver Revision: 3.20     [35330.216603] sr 9:0:0:0: Attached scsi CD-ROM sr0      ## Server - Debian Lenny uname -a:               Linux macunaima 2.6.26-1-vserver-amd64 #1 SMP Fri Mar 13 20:19:13 UTC 2009 x86_64 GNU/Linux      dmesg when I plug the modem in (Sierra 308):                 [    3.246112] usb 8-4: new high speed USB device using ehci_hcd and address 2       [    3.381966] usb 8-4: config 1 has an invalid interface number: 9 but       max is 5       [    3.382076] usb 8-4: config 1 has an invalid interface number: 7 but       max is 5       [    3.382184] usb 8-4: config 1 has no interface number 2       [    3.382285] usb 8-4: config 1 has no interface number 5       [    3.384576] usb 8-4: configuration #1 chosen from 1 choice       [    3.389070] usb 8-4: New USB device found, idVendor=0f3d,       idProduct=68a3       [    3.389070] usb 8-4: New USB device strings: Mfr=3, Product=2,       SerialNumber=4       [    3.389070] usb 8-4: Product: USB 308       [    3.389070] usb 8-4: Manufacturer: Sierra Wireless, Incorporated       [    3.389070] usb 8-4: SerialNumber: 353354045586405      lsusb:               Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 008 Device 002: ID 0f3d:68a3 Airprime, Incorporated     Bus 008 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub      ## Previous questions The only previous question with a similar problem that I found here was How do I access a USB serial port without an entry in /dev?. In his case, `dmesg` said that `ttyUSB0` was created, which does not occur in my case. Anyway, I have tried the solution posted there, using `mknod` to create devices manually:               for i in 0 1 2 3 4 5 6 7 8 9; do         sudo mknod /dev/ttyUSB$i c 188 $i     done      I created all these devices because `lsusb` says that the device is plugged in `Bus 008 Device 002`. It did not work. I tested it with `picocom`, and this it says (to all these devices, not only `ttyUSB0`):               $ picocom -     FATAL: cannot open /dev/ttyUSB0: No such device or address      While in my notebook, picocom works fine:               $ picocom -b 9600 /dev/ttyUSB0     Terminal ready     AT                      # my input     OK


title: Log file visualizer in a Terminal (UNIX) (terminal logging replay)

text: I need to log in to various servers via ssh, and its a useful thing to log the terminal (even things in smitty menus/AIX and with correct/exact date/time). I already have a solution for this:               0)     # with root:     apt-get install bsdutils          # with the given user:     mkdir ~/logs          1)     # append this to you're "~/.bashrc" - this must be the last line!!     STARTTIME=`date +%F-%Hh-%Mm-%Ss-%N`; script -q -t 2> /home/USERNAMEHERE/logs/$STARTTIME-timing.txt -c 'bash --rcfile /home/USERNAMEHERE/.bashrc-cp' -f /home/USERNAMEHERE/logs/$STARTTIME-log.txt; exit 0          2)     # make sure the 1) is the last line of bashrc, then [this is needed to avoid "fork bomb"..]:     sed -e '$d' /home/USERNAMEHERE/.bashrc > /home/USERNAMEHERE/.bashrc-cp      **And this works GREAT!** Now, the question is: how to replay these terminal loggings? This is the default way to do this:               REPLAY:     # rename the filenames to you're needs! - you can only play 1 file at one time..     scriptreplay "/home/USERNAMEHERE/logs/$STARTTIME-timing.txt" "/home/USERNAMEHERE/logs/$STARTTIME-log.txt"      Ok. It works. But it's not enough..: you can only start playing the recording. But what if you need the recording only from given time, or you need to know when exactly was a command excuted (you can see this in the terminal logfiles+timing files that "script" generates). Or better: you need terminal logging for educational purposes (so you need to stop the replay of the recording to write something down from it, etc.). For these replay problems, I still haven't found and good programs. So I though I should write my own program about this (but I have only bash scripting experience). I thought the best would be for this task is using ncurses (the replay solution needs to be used on several different OSes, like: OpenBSD, Ubuntu, Redhat). - the terminal logging could be an "auditing tool" to trace what the users done via SSH. So I'm thinking about this (this is a terminal window, ex.: gnome-terminal): http://i.imgur.com/cyeqf.png **Q** : What does unix.stackexchange think? Could this replay solution done with **ncurses** (or are there better->more portable/easy for a non programmer?)? Can you provide some hints/URL's how to do this? (can ncurses do this?) p.s.: a sample for the terminal logging files (I opened a terminal, typed "echo hi", then closed the terminal):               [USER@HOST ~/logs] cat -vte 2012-09-14-12h-46m-27s-509330863-log.txt      Script started on Fri 14 Sep 2012 12:46:27 PM CEST$     ^[[0;32m[USER@HOST ~]^[[m echo hi^M$     hi^M$     ^[[0;32m[USER@HOST ~]^[[m [USER@HOST ~/logs]      [USER@HOST ~/logs]      [USER@HOST ~/logs] cat -vte 2012-09-14-12h-46m-27s-509330863-timing.txt      0.512822 29$     0.179438 1$     0.925494 1$     0.254477 1$     0.065499 1$     0.075037 1$     0.139497 1$     0.136499 1$     0.039944 35$     [USER@HOST ~/logs]       UPDATE: I set a bounty on this question. :) (or are there any better logging solutions that can be replayed well? - ty!)


title: How to fix this eth0 and eth1, where traffic going out via eth0 is failing?

text: I have two public IPs. One's connected to eth0 and one to eth1, from 2 separate routers as complete DMZ towards the LAN IP. I added this following:               ip rule add from 10.0.0.108/32 table 1 # outbound     ip rule add to 10.0.0.108/32 table 1   # inbound     ip route add default via 10.0.0.1 dev eth0 table 1     ip rule add from 10.0.0.100/32 table 2 # outbound     ip rule add to 10.0.0.100/32 table 2   # inbound     ip route add default via 10.0.0.1 dev eth1 table 2      Since adding this above, I've been having problems sending traffic correctly for inbound and outbound. For example:               $ ping -I eth0 8.8.8.8     PING 8.8.8.8 (8.8.8.8) from 10.0.0.108 eth0: 56(84) bytes of data.     From 10.0.0.108 icmp_seq=2 Destination Host Unreachable     From 10.0.0.108 icmp_seq=3 Destination Host Unreachable     From 10.0.0.108 icmp_seq=4 Destination Host Unreachable          $ ping -I eth1 8.8.8.8     PING 8.8.8.8 (8.8.8.8) from 10.0.0.28 eth1: 56(84) bytes of data.     64 bytes from 8.8.8.8: icmp_seq=1 ttl=48 time=14.6 ms     64 bytes from 8.8.8.8: icmp_seq=2 ttl=48 time=14.6 ms     ^C     --- 8.8.8.8 ping statistics ---     2 packets transmitted, 2 received, 0% packet loss, time 1233ms     rtt min/avg/max/mdev = 14.611/14.639/14.667/0.028 ms      How do I use `ip rule add from/to` method to fix the eth0 (from/to), but without breaking the eth1 (eth1 is working perfect).


title: Multiple Sessions and 1 is slow

text: Setup is a Centos 6 x64 server and a Windows 7 client running putty. Multiple sessions are opened to this same server from the same client. Periodically, one of these sessions slows to a crawl and the other remains quite quick. If a new session is established, it sets up quite quickly and works well. Have checked server NICs, iostats and top and see no apparent issues. The problem appears to show up most often when large files are being listed on the screen or a large cut and paste operation is in progress. ie 'cat messages' The server has a "twin" setup at the same time with exact same hw/sw config and sessions to that server never exhibit the same issue. I was able to ssh into another server and then ssh over to the affected server while I had a putty session open that was experiencing a problem. I did a tcpdump from there and there is virtually nothing being sent to the putty client. The only traffic I see is when it is updating. Today the issue showed up during a yum install. This is what my putty session looks like:               Installing : ncurses-devel-5.7-3.20090208.el6.x86_64 [#####     Installing : ncurses-devel-5.7-3.20090208.el6.x86_64 [#######     Installing : ncurses-devel-5.7-3.20090208.el6.x86_64 [########     Installing : ncurses-devel-5.7-3.20090208.el6.x86_64 [##########     Installing : ncurses-devel-5.7-3.20090208.el6.x86_64 [############      This is what was captured in about a 10 minute period when this slows down. TCPdump showed no errors at all and very little traffic to the putty client. I just left it run and 30 minutes later, yum is done installing and the session has returned to normal. The issue in this case just showed up during a yum install, yesterday is was catting the maillog and the day before editing a file in vi. I am suspecting that this might be a hw issue on the box itself but I can't seem to put my finger on anything specific.


title: How can I change the terminal tmux info (lower right) called status-right to username or host?

text: I have 7 dashes (`\-------`) on the lower right.   Can I replace them with something like my name or my host name? This is not about the PS1 prompt. I already have time name host dir there.   I use tmux.   I am on Ubuntu13 but I'd like it to work in iterm2 on OSX if possible. In `.tmux.conf` I have it as               set -g status-right "-------"      How can I make it be user or host? I tried \u but that didn't work. Example: ![enter image description here](http://i.stack.imgur.com/E6oxq.png)**< --- here**


title: {exec} cause Conky to stop

text: I wanted to add mpd informations to my conky and therefore I created a script which role is to get the cover from ID3 tags This script is called using the {exec 'path'} command My probleme is that since I added this feature, my conky refuses to stand on his own : If I launch it from a terminal using               conky -c `path.conkyrc` &      it will stop when closing the terminal. I tried using the -d option as well I also tried to launch it at startup with a sh script run at startup : It works well at first but if I open a terminal, conky will close with the terminal i openned ... strange removing the call to {exec 'path'} solves everything so it is clearly the problem origin For the record, the script i am using is               #!/bin/sh     MPD_MUSIC_PATH="/media/Media/Music"     TMP_COVER_PATH="/tmp/mpd-track-cover"     exiftool -b -Picture "$MPD_MUSIC_PATH/$(mpc --format "%file%" current)" > "$TMP_COVER_PATH" &


title: Running my own dynamic DNS record hosting

text: I intend to run a debian server at home, it will host various websites, SSH server and email. I have a dynamic IP address and I am unwilling to pay the extra for a static IP. I was thinking I could probably get around the DNS issue if I ran my own name server and used something like no-ip to set auto-updated nameserver addresses for my registered domains, eg: On the registrar:               john-hunt.com (and my other domains) nameservers = johnns1.noip.com & johnns2.noip.com          johnns1.noip.com, johnns2.noip.com -> my dynamic IP      Which will make sure that the nameservers for my domains are always pointing to my machine at home. I will run BIND or something similar on the home machine to actually serve up the DNS records. The real problem I have is that I don't quite know how I'd configure BIND (or tinydns or whatever) to accept and apply updates when my IP address changes.. I can think of a way to bodge it (poll & ping johnns1.noip.com to get my IP address, then grep on the zonefiles and reload every 5 minutes..) but that doesn't feel very solid. Does anyone have any experience in this area? I had a look at no-ip's enhanced services but they want $25 for hosting records for every domain (and I have quite a few).


title: Cannot Boot New Linux From USB

text: Recently, I got a new laptop, the MSI gx60. I grabbed a usb and loaded the Linux Mint 16 Cinnamon image onto it, tested it on my old laptop and desktop, where it worked. However, when I try it on my laptop it fails in the strangest way: I put in the usb and turned on the laptop. Entered into the boot menu and selected my USB from the menu. I was then sent to a grub screen(I do NOT have grub installed on my laptop) with the following options: -Launch Linux Mint -Launch Linux Mint in compatibility mode When I run one of these options, the screen goes black, still on, just displaying black and stays like this forever, until I force a shut down. Now would be a good time to mention that the boot is set to UEFI. So the next thing I do, is go into BIOS and change the boot to Legacy Mode. Now, when I boot into the same USB device, instead of the grub menu, I get sent into the Linux Mint Menu, just as it should be. However, when I select an option, such as Launching Linux Mint, Instead of taking me the the desktop, as it did on the other computer I tested the USB on, I get a grey screen with a blinking cursor in the top left, followed by a black screen with the top left quarter white, and soon after this the computer goes to the very start of the boot sequence as if it had just turned on. When I attempted a different USB with a different Linux Image(Kali this time, I get very similar results).


title: Use start-stop-daemon for a PHP server

text: I'm working on a socket server written in PHP. This part of the work is done but now I need to run it as a daemon. For this I've tried to use `start-stop-daemon` but it doesn't work. My server is running Debian. To simplify, my question is why does the following command not run my daemon or how can I debug it?               start-stop-daemon --start --quiet --background --make-pidfile --pidfile /var/run/server-ticket.pid --exec /usr/local/zend/bin/php /var/www/server/consultpilot/ServerTicket.php >> /var/log/server-ticket.log 2>> /var/log/server-ticket.log </dev/null      The following is the full script, based on Till Klampaeckel's tutorial:               #! /bin/sh          ### BEGIN INIT INFO     # Provides: ServerTicket     # Required-Start: $all     # Required-Stop: $all     # Default-Start: 2 3 4 5     # Default-Stop: 0 1 6     # Short-Description: starts ServerTicket     # Description: starts ServerTicket using start-stop-daemon     ### END INIT INFO          # Load the VERBOSE setting and other rcS variables     . /lib/init/vars.sh          PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin     DAEMON=/usr/local/zend/bin/php     DAEMON_OPTS="/var/www/server/consultpilot/ServerTicket.php"     NAME=server-ticket     DESC="Daemon for the Server Ticket from DiffMed"     PIDFILE="/var/run/${NAME}.pid"     LOGFILE="/var/log/${NAME}.log"     QUIET="--quiet"     START_OPTS="--start ${QUIET} --background --make-pidfile --pidfile ${PIDFILE} --exec ${DAEMON} ${DAEMON_OPTS}"     STOP_OPTS="--stop --pidfile ${PIDFILE}"              test -x $DAEMON || exit 0          set -e          case "$1" in         start)             echo -n "Starting $DESC: "             start-stop-daemon $START_OPTS >> "${LOGFILE}" 2>> "${LOGFILE}" </dev/null             echo "$NAME."                    ;;         stop)             echo -n "Stopping $DESC: "             start-stop-daemon $STOP_OPTS             echo "$NAME."             rm -f $PIDFILE             ;;         restart|force-reload)             echo -n "Restarting $DESC: "             start-stop-daemon $STOP_OPTS             sleep 1             start-stop-daemon $START_OPTS             echo "$NAME."             ;;     *)         N=/etc/init.d/$NAME         echo "Usage: $N {start|stop|restart|force-reload}" >&2         exit 1         ;;     esac          exit 0      For information, when I start the process, there is no return. But when I finish it, it tells me that no process corresponds:               root:/var/run$ service server-ticket start     Starting Daemon for the Server Ticket from DiffMed: result : 0     server-ticket.     root:/var/run$ service server-ticket stop     Stopping Daemon for the Server Ticket from DiffMed: start-stop-daemon: warning: failed to kill 5772: No such process     1 pids were not killed     No process in pidfile '/var/run/server-ticket.pid' found running; none killed.


title: How to install mumbojumbo games on mint?

text: I heard there are some mumbojumbo games on ubuntu's software center. How can I install theme on linux mint?


title: udev set kdbrate settings on linux with console users issue

text: I have a kbdrate setting as a udev rule for usb devices(keyboards and scanners that re repluggd in). kdbrate needs to be set by someone with /dev/port access which is the console user. The udev rule works, and udev rule creates a lock file which the users .profile script reads then executes a kbdrate setting if the lock file exists. The thing is when its run from .profile it will tell me the user doesnt have /dev/port access. I cannot get the script to run in a mode that would work. The goal of this is to set the rate again after a device which sets rate is plugged in. If you force a kdbrate to be set in the rule it just gets overwritten (console users .profile script)               pi@raspberrypi /home/nrfwy60 $ cat checkrate     #!/bin/bash     while true     do         if [ -e "/tmp/setrate.lock" ]         then                 sleep 5                 sudo /sbin/kbdrate -d 1250 >> /tmp/setrate.lock                 rm -rf /tmp/setrate.lock         fi         sleep 1     done      udev script which gets run at the usb sub system.               root@raspberrypi:/home/nrfwy60# cat /root/scripts/setrate     #!/bin/bash     echo "file" > /tmp/setrate.lock     chown nrfwy60:nrfwy60 /tmp/setrate.lock      udev rule (which has been set to specific vendors or adds and did not make a difference) i settled with this               root@raspberrypi:/home/nrfwy60# cat /etc/udev/rules.d/80-usb-input.rules     SUBSYSTEM=="usb", RUN+="/root/scripts/setrate > /root/greg.error"  OWNER=="root"


title: Removing specific files recursively using rm or something simple?

text: I have a root folder with a text file in it called pairs.txt. Within that root folder are other folders with text files called pairs.txt in them. Is there a simple way to remove them using `rm`? I know that there I could use `find . -name 'pairs.txt' -exec rm {} \;` but I would like to know of other ways, perhaps using `*` or some other wildcard? I tried using `rm -rf pairs.txt` but it seems to only remove the `pairs.txt` in the current directory.


title: How to kill a script which starts new processes?

text: The following is a Python application which spans a few threads, then spawns a new process of itself and exits:               $ cat restart.py     import os     import random     import signal     import sys      import threading     import time               class Name(object):         def __init__(self, name):             self.name = name               class CallThreads(threading.Thread):         def __init__(self, target, *args):             self.target = target             self.args = args             threading.Thread.__init__(self)              def run (self):             self.target(*self.args)               def main(args):         print("Hello, world!")         letter = random.choice(['A', 'B', 'C', 'D', 'E', 'F'])         count = 0          while count<3:             count += 1             name = Name(letter+str(count))             t = CallThreads(provider_query, name)             t.daemon = True             t.start()             time.sleep(3)             print("------------")              print("Time to die!")         t = CallThreads(restart)         t.daemon = True         t.start()         time.sleep(0.1)         sys.exit(0)               def provider_query(name):         while name.name!='':             print(name.name)             time.sleep(1)               def restart():         os.system('python restart.py')               def signal_handler(signal, frame):         sys.exit()               if __name__ == '__main__':         signal.signal(signal.SIGINT, signal_handler)         main(sys.argv)      When I hit `^C` I do get a bash prompt, but the output still comes and I still see the script in the process table:               $ ps aux | grep restart.py     1000      5751  0.0  0.0   4396   616 pts/3    S    08:41   0:00 sh -c python restart.py     1000      5752  0.3  0.1 253184  5724 pts/3    Sl   08:41   0:00 python restart.py     1000      5786  0.0  0.0   9388   936 pts/4    S+   08:41   0:00 grep --color=auto restart.py      I've tried killing it with `kill 5751 && kill 5752`, but that doesn't help even if I'm fast enough to do so before the PID changes (on a new process when the script restarts). I've tried `pkill restart.py` but that does not help either. I'm wary of using `pkill python` as there are other Python processes running that I don't want to kill. Even closing the Konsole window in which the script is running does not help! **How can I kill the script?**


title: How can I create my own imagemagick binary releases?

text: I'm looking for a way to build ImageMagick binary distributions for deploying my app. I only need it for Kinux 64-bit (Ubuntu/Debian) and OSX. Actually building it is fine, but I have no idea how to include delegate libraries:   * png   * jpeg   * gif   * tiff   * webp Something similar is done with ffmpeg: http://ffmpeg.org/download.html#LinuxBuilds Are there instructions or guidelines as to how to do this?


title: Simple console text editor suited to python

text: I am looking for a light weight shell editor for Linux that a young child (eg 7-8 year old) can write python scripts in. The motivation is to find something that is helpful for a beginning programmer without the frustrations of a steep learning curve. It needs to accomplish the following:   1. Simple interface like joe, pico etc.    2. No complicated modes to think about like vim and emacs.    3. Can be configured to turn tabs into whitespace for python.   4. Ideally it should have some syntax colouring features.   5. Must have a way to configure a hotkey to run the current script. To clarify what I mean by the last point, my .vimrc file has these lines which allow me to press to execute the current script.               autocmd BufRead *.py set makeprg=python\ -c\ \"import\ py_compile,sys;\ sys.stderr=sys.stdout;\ py_compile.compile(r'%')\"     autocmd BufRead *.py set efm=%C\ %.%#,%A\ \ File\ \"%f\"\\,\ line\ %l%.%#,%Z%[%^\ ]%\\@=%m     autocmd BufRead *.py nmap <F5> :!python %<CR>


title: apache, tomcat context path

text: I have Tomcat and Apache installed in CentOS 5. They're integrated with a help of mod_jk.so. They both display the same in http://www.tource.com/cms/admin and http://www.tource.com:8080/cms/admin But I'd like to make the context **cms** displayed only when I access with address below. **http://cms.tource.com/** How could the context "www.tource.com/cms" turn into "cms.tource.com" ?


title: How to get only filename using sed

text: How can I get only the filename using sed? I've this               out_file=$(echo $in_file|sed "s/\(.*\.\).*/\1mp4/g")      But I get the path too `/root/video.mp4`, and I want only `video.mp4`.


title: how to get data of ntfs to linux?

text: I have dual boot of Windows 2003 server and Cent-OS 6.X on my PC. I have files in windows environment, can I get those files using any utility to my Linux environment with out using any external drives?


title: LVM Mirrored Logical Volume Performance

text: I read that when mirroring a logical volume a log of some sort is used to keep the files in sync. You can either set it so this log is in a separate physical volume or in memory. I also read that if the log is in memory, the system has to resync the volumes. Is there a performance hit for using the log in memory? For example, does it take much longer to boot the machine? Is the data at risk while the resync is happening? I'm working with Ubuntu 10.04 in this case. I believe it's lvm2. The clearest documentation I've found is the CentOS document here. I was also looking at this description.


title: Is SCADA an RTOS?

text: Is SCADA one of the RTOS out there (it's used for real-time control and data acquisition)?


title: What causes various signals to be sent?

text: I sometimes get a little confused by all of the signals that an application can receive. As I understand it, an application has a default handler for each of these signals, but it can provide its own handler by calling `sigaction()`. So here is my question: what causes each of the signals to be sent? I realize that you can manually send signals to running applications via the `-s` parameter to `kill`, but what are the _natural_ circumstances under which these signals are sent? For example, when does `SIGINT` get sent? Also, are there any restrictions on which signals can be handled? Can even `SIGSEGV` signals be processed and control returned to the application?


title: Activate/deactivate WiFi on Lenovo B5400 under Ubuntu 14.04

text: I have a Lenovo B5400 with Ubuntu 14.04 x64. The Ethernet port works fine. How can I enable/disable the WiFi connection? I have no hardware button for this functionality. Under Windows I can press `Fn`+`F5` and a dialog window appears, but I cannot find this functionality under Linux. `lspci | grep Network` produces: > 04:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8723BE PCIe > Wireless Network Adapter The answer from here is incomplete. Any other ideas? **EDIT #1:** The output of `rfkill list all` is:               0: tpacpi_bluetooth_sw: Bluetooth         Soft blocked: yes         Hard blocked: yes          1: hci0: Bluetooth         Soft blocked: yes         Hard blocked: no          2: phy0: Wireless LAN         Soft blocked: yes         Hard blocked: yes      PS: disclaimer: crossposting


title: Archlinux, move files to a different partition

text: During the installation I _thought_ I had generated the correct `fstab`, but now, after `cp` complains that the filesystem is full, I discover that `fstab` is **empty**. I have this configuration:               # lsblk      NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT     sda      8:0    0 232.9G  0 disk      ├─sda1   8:1    0   238M  0 part      ├─sda2   8:2    0   1.9G  0 part      ├─sda3   8:3    0  23.3G  0 part /     └─sda4   8:4    0 207.5G  0 part      But this is absolutely not what I want. I'd like to mount `/dev/sda1` as `/boot` and `/dev/sda4` as `/home/user`. `/dev/sda2` is swap. The **problem** is that I already added a ton of files in `/home/user`, all of which went in `/dev/sda3`, because that one was the only one mounted. How do I fix this? I could boot from a live cd, mount the partitions, run `genfstab`, but then? Where do my files under `/home/user` go? Is it safe? Should I move all my `home` content into a temporary directory, mount `/dev/sda4` and copy everything back?


title: How do I get my shell functions to make use of existing autocompletion in zsh?

text: I have a couple of shell functions defined in my `.zshrc` which save on typing and allow integration with screen. For example:               function s()     {          screen -t "$1" ssh "$@"     }      However, when I use these shell functions, I can't take advantage of zsh's built in command completion features. (In the case of SSH, automatically completing hostnames based on known_hosts and ssh_config). What's the preferred way to hook in to the existing completion mechanisms for commands I've created wrappers for? EDIT: Thanks to Gilles for his answer below. Using compdef appears to be the way to do this, but interestingly it doesn't seem to work uniformly. In this case, I have the following setup:               function s()     {         screen -t "$1" ssh "$@"     }          function m()     {         screen -t "man.$1" man "$1"     }          compdef $_comps[man] m     compdef $_comps[ssh] s      Completion for my wrapper function 'm' works as expected, however completion for my function 's' does not; rather than attempting to complete hostnames, it appears to fall back to default autocompletion by providing me a list of files when I hit 'tab'. Is there some oddity in the way that SSH completion is handled which means I need to do something further?


title: Capture web traffic grouped by individual TCP streams

text: As far as I know a HTTP request and response constructs one TCP connection. To debug a web application on a GUI-less server, I'd like to be able to capture these TCP streams in a single distinguishable entity (same color, file, db record, anything). `tcpdump` can only save IP packets as they arrive or leave, with no ordering or reassembling. `tcpflow` goes one step further to reassemble TCP connections in separate files, but puts send and receive streams in separate files, which makes quick debugging annoying. I'm sure I can write a script or even one- liner to merge related files, but I'm guessing a wrapper around `tcpflow` for this job could introduce complexities which wouldn't exist inside `tcpflow`. Also I'm lazy and looking for a cleaner solution. Any suggestions would be appreciated.


title: Can't ping first IP with dual NICs on different subnets with multiple gateways

text: I have two NICs assigned to a server.               eth0 - 10.199.10.0/24 w/ a GW of 10.199.10.1     eth1 - 10.199.20.0/24 w/ a GW of 10.199.20.1      From my desktop, I can ping the IP assigned to each NIC just fine (`10.199.10.100` and `10.199.20.100`). So I set up Apache to listen on ALL ips on said server. I tested this just fine from my desktop as well. Now, I went to create a new VM on the `10.199.20.0` subnet and I can access the RH test page by hitting `http://10.199.20.100` BUT I can't access it via `10.199.10.100`. This is troublesome since I have a bunch of services on this server that can only listen on one particular IP (the `10.199.10.100`). My network guy tells me the routes look fine and that it could be the routing table on the server itself.               #ip route     10.199.10.0/24 dev eth0  proto kernel  scope link src 10.199.10.100     10.199.20.0/24 dev eth1  proto kernel  scope link src 10.199.20.100     169.254.0.0/16 dev eth0  scope link  metric 1002     169.254.0.0/16 dev eth1  scope link  metric 1003     default via 10.199.10.1 dev eth0          # ip rule     0:      from all lookup local     32764:  from all to 10.199.20.100 lookup build     32765:  from 10.199.20.100 lookup build     32766:  from all lookup main     32767:  from all lookup default      _**Netowrk Layout_** These servers are Xen guests. We have four Xen servers with multiple NICs. The admin server with the two NICs have two virtual NICs assigned to them. One from `10.199.10.x` and one from the `10.199.20.x` subnet (two different NICs). The test server only has the `10.199.20.x` network assigned to it. I can ping the `10.199.30.x` network just fine.


title: SW-RAID 5 - how much CPU time and performance can it take?

text: I have Debian squeeze 6.0.4, 4x WD RE4 500Gb 7200RPM, Athlon II X4 600E and 24GB RAM DDR3. Since I work with SW raid 5, it takes much more CPU, than I think is enough. How can I get know, how much CPU performance and CPU time my Software RAID 5 takes? Do you think is there so big difference in performance between Phenom II X4 905e with L3 cache and Athlon II X4 600e without L3? Do you think it will consume more CPU time, when using more different disks instead of same type, mark and series? Is there difference between Raid 5 with 4 same disks from WD instead of RAID 5 with 4 different disks from hitachi, WD, samsung and seagate? True is, that 4 different disks could be maybe slower, than 4 same disks, but maybe more secure. (we are speaking about Software linux raid on debian squeeze) Thank you


title: KVM - Which Web Based management to use?

text: I would like to became an Expert of managing KVM on debian squeeze. I still use virt-manager. Yes, it is easy and quiet safe and quick for me. I tried a lot of web based management UI and non of them was good enough like virt-manager. You know, I'm one of those guys, who used to have VMware before, where 90% of managing is clicking. My questions : 1) Are there any CLI "interactive" utility like mc (midnight commander) or something how to control KVM ? (ON/OFF VMs, increasing memmory, reseting VMs, adding virtual hardware, adding new disks, and so on...) 2) Could you recommend me some Web based management UI for KVM on debian squeeze? Did you see VMware server 2? There is web management. I know it was slow, but it is fine, when you are somewhere without terminal. (for example on android with web browser) I tried a lots of them, but nothing i tried was working. 3) What tutorials could you recommend me to improve myself in commands to control virsh, kvm and so on? Google is full of low quality tutorials with mistakes and misunderstandings. I need something for debian. 4) Could you recommend me some tutorials how to improve performance for KVM? Google is full of a lot of tutorials, but I need some recommendations from real experts, who knows, how to improve it. 5) How to improve security of KVM? Can solve this problem some Web based UI? (for example accounting, user management ?) I know there is google, wiki, there is a long list of UI for kvm, but I need opinions, experiences from experts or users who use KVM. I hope this isn't any stupid question. Thank you all for answering my questions.


title: How to limit CPU performance for KVM VM?

text: imagine 1 Virtual machine with 2 shared cores on quad core CPU 2Ghz speed. Is it possible to limit this Virtual Machine for 500Mhz of CPU power on both cores? Or to reserve 1Ghz on 1 core for this one VM? Is it possible to limit for example to 1500Mhz for 2 VMs ? I mean to share 1500Mhz of power of 1 core for 2 VMs. For example VMware ESXI and Citrix Xenserver can do it easily by creating resource pool where you preshare for example 2x 1Ghz cores and 4GB ram and then you give there for example just only 2 or 10 VMs as you wish. Is it possible in KVM? How? If is, can it do some kind of web based interface for KVM? Thank you


title: how to check if ssh works without connecting to server

text: I just want to check whether following code will work or not. It is like a validation               su -oracle "ssh  oracle@$MY_IP -o 'BatchMode=yes' -o 'ConnectionAttempts=1'"     returnCode=$?          echo "$returnCode"      if [ $returnCode != 0 ]      then       echo "Configuration is not valid"       return 1;      else       echo "Configuration is  valid"       return 0;      fi      When I run my script, it just gives me empty prompt. I can not enter to if statement. it seems script is trying to connect MY_IP. How can I validate my statement without changing user and connecting to IP.