title: Hotplug Device Driver Priority

text: Is it possible to have more than one driver for one purpose (eg. USB) included in the Linux kernel? If so, then how does the kernel decide which one to load?


title: Stream Media Content from Linux to PS3

text: I have a Linux system (Debian testing) with some video files I would like to play on my Playstation 3 (an original, unmodified PS3). I can connect the PS3 to my home network using either WLAN at 54Mbps, or using a 100MBit LAN, which is tunneled over power sockets using a pair of Devolo powerline adapters, operating at a speed of about 4 MB/s. I know that DLNA would be the way to go, I've tried several DLNA servers for Linux (fuppes, mediatomb, minidlna, xbmc). None of those worked reliably. Either no media appears, or if, then the files randomly stop after some minutes, and it's not possible to fast forward or reverse the videos. **Now the questions:**   * I'm not sure what is the problem with DLNA. Is it that I need more bandwith, or is DLNA a bad protocol, or is the implementation of those servers buggy or incompatible with the PS3?   * Are there other methods to connect devices **remotely** to my PS3? I have heared it's possible to tunnel USB devices other Ethernet using IP, but I haven't found anything of value using Google. Currently I'm using an USB stick for media playback, but this solution feels somewhat clumsy! **UPDATE:** Important thing I forgot to mention -- if I replace the PS3 with my work Laptop (Windows XP SP3) and mount the video share over the same Devolo Ethernet connection using samba, then video playback works flawlessly. **UPDATE 2:** It's been some time since I posted this question, but I've finally managed to connect my PS3 to my computer by means of a real Ethernet cable. Guess what? The problem persists, video playback pauses every 10 or 15 seconds for one second. I'm 99.9% sure it's not a problem with the network connection.I'm using PMS right now, and the transcode buffer is always full at 400MB, with bitrates around 1 - 2 Mb/s. Any other ideas what may be the problem? **PROBLEM SOLVED:** See my answer.


title: Linux Centos 5.5 yum update command is not working

text: I have done lots of things to update.   1. `yum clean all`   2. `yum clean metadata`   3. `yum clean dbcache` then `yum update` outputs:               http://mirror.centos.org/centos/5.6/addons/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found Trying other mirror.          Error: Cannot retrieve repository metadata (repomd.xml) for repository: addons. Please verify its path and try again      I have also tried   * setting `enabled=0` in `/etc/yum.repos.d/CentOS-Media.repo`   * `yum -v update --disablerepo=contrib uname -a`   * `touch /.autorelabel`   * `yum -v update --disablerepo=contrib` but it didn't help.


title: Call 'ps' as a normal user in Linux

text: A brief introduction to my question: the command `ps` will print the information of system processes. But when I login as **root** and change the permission `x` of `ps`               chmod -x /bin/ps     chmod u+x /bin/ps     ls -l /bin/ps      -rwxr--r-- 1 root root ...... ps      Then I create a new shell script file `call_ps_via_root.sh`               #!/bin/bash     ps      and set the `x` permission               chmod +x /bin/call_ps_via_root.sh     ls -l /bin/call_ps_via_root.sh     -rwxr-xr-x 1 root root ...... call_ps_via_root.sh      After this, I login with a normal user **sammy** , and I type `ps`, it will print               Permission denied      and I type `/bin/call_ps_via_root.sh` It is still denied. How can I make it work by `call_ps_via_root.sh`?


title: Kernel 3.0.0-1 and NVIDIA driver boot problems

text: I can't boot kernel 3.0.0-1 on Asus G53S running Debian, it freezes when booting with:               NVRM loading NVIDIA Unix x86_64 kernel module 275.28      then it times out with:               udevd[350]: timeout: killing 'usb_id --export /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.0/video4linux/videob' [994]      and eventually restarts. This seems like a problem with NVIDIA proprietary driver, yet the message from dkms suggested it got configured fine when installing new kernel headers. Also why doesn't it just drop to shell if it cannot load the nvidia driver module? I'm stuck with an old 2.6.32 kernel and I was really hoping for some of the goodies coming with 3.0 (asus wmi driver especially). Both the kernel and NVIDIA driver are coming from repositories.


title: What Linux Distro contains support for Killer E2200 Ethernet chip?

text: I've been very interested in switching over to a Linux based system lately. I've decided I'm going to dual boot, but my primary machine will be the Linux system. I found that Ubuntu 12.04 didn't have any support for this Ethernet chip, and I found some solutions but none worked. And it was awfully difficult navigating through web pages on Wifi, maybe that chip doesn't work so well either on Ubuntu. Anyway, I'd like to know if there are any Linux distributions that already come with this needed support? EDIT: If it helps, I have an MSI GT70 onc-494us


title: Why does Linux print a lot of debugging messages on boot/shutdown?

text: Why does Linux print a lot of debugging messages during the boot and shutdown processes? The boot/shutdown processes usually have no error. Why not hide the debugging messages, and show them only when needed? Also, some distributions' boot/shutdown splash screens fail to completely hide debugging message. Is there any technical limitation with splash screens?


title: Why is sshd looking at a non-existent public key file?

text: In an effort to get SSH keys working I'm tailing the sshd authorization log and I see these lines:               debug1: test whether pkalg/pkblob are acceptable     debug1: temporarily_use_uid: 10144/10029 (e=0/0)     debug1: trying public key file /home/cklein/.ssh/authorized_keys     debug1: restore_uid: 0/0     debug1: temporarily_use_uid: 10144/10029 (e=0/0)     debug1: trying public key file /home/cklein/.ssh/authorized_keys2     debug1: restore_uid: 0/0     Failed publickey for cklein from 192.168.8.165 port 46583 ssh2      But if I check the `/home/cklein/.ssh/` directory it looks like this:               $ ls -al /home/cklein/.ssh/     total 16     drwx------. 2 cklein infoarch 4096 May  3 16:39 .     drwxr-x--x. 9 cklein infoarch 4096 May  3 16:39 ..     -rw-------. 1 cklein infoarch  605 May  3 16:39 authorized_keys     -rw-r--r--. 1 cklein infoarch  226 Apr  4 16:11 known_hosts      I used to have an `authorized_keys2` file in that directory, but removed it and have since restarted `sshd`. Why is it still expecting that file to exist? Also, do you have any guesses as to why the public key is getting rejected?


title: VPNC cisco + quick mode response rejected error

text: I installed a vpnc on my Linux red-hat machine version 6.3 Most of the cases vpnc work well ( connecting to gateway customers by vpnc ) But against some particular customers ( Cisco gateways ) , immediately after I activate the vpnc I get the following messages:                   vpnc: quick mode response rejected:  (ISAKMP_N_INVALID_PAYLOAD_TYPE)(1)      In this case Vpnc could not be connected Please advice what the problem here? ,                [root@TEST-LINUX-MACHINE /var/tmp]# vpnc      Enter password for user@216.134.162.39:                Connect Banner:     | Remote access to UGG company resources is restricted to AUTHORIZED USERS!     |      | Company resources may only be used for the purpose of performing work-related duties.     | The user is responsible for protecting the confidentiality and integrity of the      company resources.     | Violation may cause disciplinary action.     | By clicking on "Continue" the user agrees with the rules above.     |            RTNETLINK answers: File exists      **vpnc: quick mode response rejected:  (ISAKMP_N_INVALID_PAYLOAD_TYPE)(1)**      this means the concentrator did not like what we had to offer.           Possible reasons are:           * concentrator configured to require a firewall        this locks out even Cisco clients on any platform expect windows        which is an obvious security improvment. There is no workaround (yet).     * concentrator configured to require IP compression        this is not yet supported by vpnc.        Note: the Cisco Concentrator Documentation recommends against using        compression, expect on low-bandwith (read: ISDN) links, because it        uses much CPU-resources on the concentrator      I also try to do the follwoing                 Add the line "NAT Traversal Mode cisco-udp" in /etc/vpnc.conf      Or                  Add the line "Local Port 10000" in /etc/vpnc.conf      But they dosent help and I still get the bad messages ( chuld not be connected by the vpnc ) Please advice where is the problem ?


title: Is it secure to leave a root shell running in detached screen session?

text: I'm curious about the security of leaving a root shell running inside a detached screen session. I typically never do this. Aside from the potential of my non-root user account being compromised (password exposed, ssh key compromised, etc), are there other vectors of entry into a detached, password-protected screen session I should be worried about, or can a detached screen session be considered inert?


title: Why curl -O -C on mac fails to download

text: The following script works on Ubuntu, but not on Mac. Why? How to edit it so that it would work there too?               #!/bin/sh          v=1.1     test_file="Test10.java"     jar_file="dp4j-$v-jar-with-dependencies.jar"          curl -O "http://repo2.maven.org/maven2/com/dp4j/dp4j/$v/$jar_file"          # Start     cat > $test_file << __EOF__     class T10 {         private static void p(int i, Double d, String... s){}     }     public class Test10{         @com.dp4j.InjectReflection         public void t() {        T10.p(1,new Double(2),"hello", "reflection");         }     }     __EOF__     cat $test_file     cmd="javac -Averbose=true -cp $jar_file $test_file"     echo $cmd     $cmd      The output on the mac:               $ sudo ./TESTDRIVE       % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current                                      Dload  Upload   Total   Spent    Left  Speed     100  341k  100  341k    0     0  1516k      0 --:--:-- --:--:-- --:--:-- 3248k     class T10 {         private static void p(int i, Double d, String... s){}     }     public class Test10{         @com.dp4j.InjectReflection         public void t() {       T10.p(1,new Double(2),"hello", "reflection");         }     }     javac -Averbose=true -cp dp4j-1.1-jar-with-dependencies.jar Test10.java     error: error reading dp4j-1.1-jar-with-dependencies.jar; cannot read zip file     ...      $ md5 dp4j-1.1-jar-with-dependencies.jar MD5 (dp4j-1.1-jar-with- dependencies.jar) = eb04d0d357fd861ac414fde7d3530119


title: Apache and Tomcat integration

text: I am trying to integrate apache and tomcat. I thus want apache to forward requests to tomcat. I am using the mod_jk module for apache to achieve this. So far I am trying to get tomcat to auto-gen the configuration files for the mod_jk - I add the relevant to my server.xml               <Listener className="org.apache.jk.config.ApacheConfig" modJk="/usr/lib/apache2/modules/mod_jk.so" />      This does not however work. Please could someone that has done this recently give me some direction. I suspect that a lot of the documentation is for old versions of apache and tomcat.


title: How can I select a beginning...ending portion of a '/' delimited string (PS1 prompt in my case)

text: I am customizing my PS1 prompt, specifically the $PWD part which is delimited by `/`'s among several things I like having the current directory.   However if the directory is too long I'd like to have beginning...ending For example, instead of               otherstuff:~/apps/webs/2014/area1/groupa/current:other_stuff $       I'd like to have the first directories and the last two, i.e.               otherstuff:~/apps/webs/.../groups/current:other_stuff $       It should handle when they partially overlap, i.e.                  otherstuff:~/apps/webs/2014:other_stuff $      -> otherstuff:~/apps/webs/2014:other_stuff $       and when they are the same, i.e.                  otherstuff:~/apps/webs/:other_stuff $      -> otherstuff:~/apps/webs/:other_stuff $       I tried various substrings if $PWD using {}, () and {} but can't get the format right. Update - I used the information in guidos answer (accepted) to put together this:               parse_git_branch () {       git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'     }     PS1='\033[01;31m\]\t\033[00m\]:'     PS1=$PS1'\[\033[01;32m\]\u\033[00m\]:\033[01;34m\]'     PS1=$PS1'`pwd | sed "s#\(/[^/]\+/[^/]\+/\).*\(/[^/]\+/[^/]\+\)/\?#\1...\2#g"`'     PS1=$PS1'\033[00m\]:\033[01;33m\]$(parse_git_branch)\[\033[00m\]\n\$ '      which yields: ![enter image description here](http://i.stack.imgur.com/hvyre.png) A sad amount of the code is repeated `\033[00m\\]:`'s for the 3 white colon seperator !


title: LVM Snapshot without copy-on-write

text: I've been experimenting with LVM and how I can use it for managing data on my NFS server. With everything that I've read about snapshots, I am still unsure about how they perform in real life. Why does one need to allocate space in the snapshot if they are just a bunch of pointers to the original data? What is the point of the snapshot if modifying files on the origin also trigger modification on the snapshot via copy-on-write? I thought that the snapshot is supposed to be a "static" point in time of the original. My expectation is such:               $ ls origin-data     > file1 file2     $ snapshot origin-data to origin-data-snapshot     $ modify origin-data and add new stuff     $ ls origin-data     > file1-modified file2 file3 file4     $ ls origin-data-snapshot     > file1 file2     $ sizeof origin-data-snapshot     > 0 bytes because they're all just pointers to blocks in origin-data!      If I'm misunderstanding, please explain and also explain how snapshots could be used in the way I'm expecting (like git commits, static, non-changing, pointers to data in a point in time that don't care about changes made to the origin). Does it involve RO or RW snapshots? UPDATE: I've been experimenting with some test partitions and have a bit more understanding. While mounting both origin and it's snapshot, new files in origin obviously show up in something like `df -h` but not in the snapshot. Meanwhile, `lvdisplay` shows this percentage for "Allocated to snapshot" increasing. Using 10mb test files and 1gb test partitions, I see exactly how this percentage behaves in relation to my data, but why must this be so? Why does the new data show up on the snapshot and not origin? I would think the blocks behave like hard-links in that old data stays there because the snapshot points to it while new blocks are created next to them because origin points to the new and modified block. No?


title: How to know if an IRQ value is free to use

text: If we add a device that does not support PNP (Plug-an Play), the manufacturer will hopefully provide explicit directions on how to assign IRQ values for it. However, if we don't know what IRQ value to specify, what command line should be used to check if a IRQ value is free or not? `lsdev` displays info about devices:               $lsdev      Device            DMA   IRQ  I/O Ports     ------------------------------------------------     0000:00:02.0                   7000-703f     0000:00:1f.2                   7060-707f   7080-7087   7088-708f   7090-7093   7094-7097     0000:00:1f.3                   efa0-efbf     0000:01:00.0                     6000-607f     0000:04:00.0                     4000-40ff     0000:05:00.0                     3000-30ff     acpi                      9      ACPI                           1800-1803   1804-1805   1808-180b   1810-1815   1820-182f   1850-1850     ahci                     43      7060-707f     7080-7087     7088-708f     7090-7093     7094-7097     cascade             4             What about this cmd `lsdev`, is it enough for this task? For example, if we want to know if 1233 is free, we would run this command:               lsdev | awk '{print $3}'|grep 1233        **NOTE:** `$3` above is used because IRQ value printed in the 3rd column of `lsdev` output. Then if no output, it means that it is free for us to use?


title: Cannot run script using udev rules

text: Prescript: I have already searched for similar questions but am not able to find a useful answer. Background: I am using Fedora 64-bit. I want to execute a specific script /bin/usbattached.sh when a usb is attached. I am using Kingston Datatraveller usb stick whose Vendor Id is 0951 and Product Id is 1660 (as found from dmesg and other methods). I have found two udev rules.d directories on my machine, namely /etc/udev/rules.d and /lib/udev/rules.d Since I am not sure which directory to use, I have created my rule file in both of above mentioned directories. Below is my rule               ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="0951", ATTRS{idProduct}=="1660", RUN+="/bin/usbattached.sh"      I have removed ACTION, changed RUN+= to RUN=, written it in new file as well as pre-existing rule files, all without luck. I use               udevadm control --reload-rules       and               systemctl restart udev.service        to restart udev. When I run udevadm test on my device, it shows that it does read my rules file but the script doesn't work. Any method to debug it will be highly appreciated. The script /bin/usbattached.sh sends a notification to the top-right corner of the screen, echo's a message on the screen and appends the current date/time to ~/op file, when run manually. Unfortunately, none of the above mentioned actions are being performed when the usb is attached. EDIT: Upon adding ´sleep 10´ to my usbattached.sh script, I notice the usb is mounted roughly after 18 seconds. This time changes almost linearly with changing the value from 10 as well. Looks like the script IS being run but I am not having any notification, neither there is a new line appended to the output file


title: Regex alternation/or operator (foo|bar) in GNU or BSD Sed

text: I cannot seem to make it work. GNU sed documentation says to escape the pipe, but that doesn't work, nor does using a straight pipe without the escape. Adding parens makes no difference.               $ echo 'cat     dog     pear     banana     cat     dog' | sed 's/cat|dog/Bear/g'     cat     dog     pear     banana     cat     dog          $ echo 'cat     dog     pear     banana     cat     dog' | sed 's/cat\|dog/Bear/g'     cat     dog     pear     banana     cat     dog


title: ATI gamma correction, fglrx_xgamma not installed

text: I want to change gamma settings after installing ATI driver. But I noticed that I have no `fglrx_xgamma` tool. I installed the drivers from the ATI website. How to correct gamma without the tool, or change it in the other way?


title: Encode with ffmpeg using avi to mp4

text: What command lines to use to convert from avi to mp4, but without destroying the framesize and making the file small as the original size or a little bit bigger, and same thing with mp4 to avi? Whenever I tried converting it became like 2 gb


title: GParted is Frozen

text: I've been trying to allocate more space for Windows... And to do that, I have to resize my Linux partition partition. So I booted up from my flash drive and started up `gParted`. Everything was working great until `gParted` started to resize my Linux partition. It's been stuck at `6.33GB of 86.5GB copied` for about half an hour now. The entire OS has stopped responding and the flash drive is flashing like it does when it's active. I have Linux Mint 11 on my flash drive. I'm not too particularly worried about losing my data. I have it all backed up, but it would be nice if this could be recovered. Any suggestions?


title: ffmpeg: error while running with libx264

text: Main code: ffmpeg -i 2269801.avi -threads 0 -vcodec libx264 -b 900k -acodec libfaac -ar 44100 -ab 96k -ac 2 earthgirlsareeasy1.mp4               [libx264 @ 0x16cdde10]broken ffmpeg default settings detected     [libx264 @ 0x16cdde10]use an encoding preset (e.g. -vpre medium)     [libx264 @ 0x16cdde10]preset usage: -vpre <speed> -vpre <profile>     [libx264 @ 0x16cdde10]speed presets are listed in x264 --help     [libx264 @ 0x16cdde10]profile is optional; x264 defaults to high     Output #0, mp4, to 'earthgirlsareeasy1.mp4':         Stream #0.0: Video: libx264, yuv420p, 720x336 [PAR 1:1 DAR 15:7], q=2-31, 900 kb/s, 90k tbn, 23.98 tbc         Stream #0.1: Audio: libfaac, 44100 Hz, 2 channels, s16, 96 kb/s         Metadata:           strn            : Audio Stream     Stream mapping:       Stream #0.0 -> #0.0       Stream #0.1 -> #0.1     Error while opening encoder for output stream #0.0 - maybe incorrect parameters such as         bit_rate, rate, width or height      All lines http://pastie.org/private/0xmgwzhbu9kkplwi6a49qa Note: I am using centOS running 5.8


title: How can I save the Xterm configuration I set at runtime?

text: I configured my xterm using the `CTRL-MiddleClick` and `CTRL-RightClick`. Is there a way to export save these settings?


title: pull out a file named to ~

text: So I have downloaded a music album from aMule and it is located in the `.aMule/Incoming` directory. I tried to move it out with the following command:                mv albumName.rar ~      This left me with a file `~` in `.aMule/Incoming` which I could not rename because tilde is reserved for home directory. I know I can access it via Nautilus by showing hidden files. How can I pull it out in terminal? **Update** This is how it looks like now                  manuzhang@manuzhang-R458-R457:~/.aMule/Incoming$ ls -l        total 328        -rw-r--r-- 1 manuzhang manuzhang 297266 2012-03-19 12:07 ～        -rw-r--r-- 1 manuzhang manuzhang  34479 2011-10-11 19:51 [kat.ph]friends.season.1.with.english.subtitles.torrent


title: Dereference concatenated variable name

text: I can do this, but it requires making a string of the variable then dereferencing it. Is there any way to shorten it to a simpler statement?               #!/bin/bash          FRUITS="BANANA APPLE ORANGE"          BANANA_COLOUR="Yellow"     APPLE_COLOUR="Green or Red"     ORANGE_COLOUR="Blue"          for fruit in $( echo $FRUITS ); do         fruit_colour="${fruit}_COLOUR"         echo $fruit is ${!fruit_colour}     done      I have tried lots of things like `${!"${fruit}_COLOUR"}` or `\$${fruit}_COLOUR` and many other variants, but the only way that has worked is by using a string.


title: Slim exit as username ends in black screen

text: I recently installed Arch Linux on my notebook and it works fine. But there is still one small problem. Following to the SLiM manual I can use `exit` to exit to the shell. Unlike expected, I won't return to the shell, there is just a black screen where I cannot input anything. Also `ALT` + `F1`, `ALT` + `F2`, `ALT` + `F3` or `ALT` + `F4` makes no difference. Do I need to configure anything? Any suggestions?


title: Apple keyboard in openbox

text: I just upgraded from Fedora 15 to 16. I'm using Openbox as an alternative to Gnome 3. The problem is that I cannot find a way of using the multimedia keys properly in Openbox. Changing the keyboard layout and other (I think) Gnome-based keyboard shortcuts do not work as well, while in Gnome all they keyboard settings work perfectly. Before (in Fedora 15) I was ' _tricking_ ' Openbox by running and killing gnome's keyboard settings at startup.               timeout -sHUP 1s gnome-control-center region      This seemed to run some kind of service in the background that was letting me use all the keys in the keyboard and gnome-specific short cuts in Openbox. I know that I can set up some key bindings in Openbox ( _rc.xml_ ), the thing is that there are some keys (F13 to F18) in Apple's keyboard that are really useful when setting special. These special keys (and keyboard-layout-changing short cuts) can be seen in Gnome but cannot be seen by Openbox. Any clue on what kind of service Gnome is running that Openbox is not that it is able to 'see' all the keys in the Apple keyboard? Thanks for your time


title: What is difference between [ and [[ in BASH?

text: > **Possible Duplicate:**   >  using single or double bracket - bash When should I use a single bracket? `[` When should I use double brackets? `[[` Are both POSIX compliant?


title: [ vs [[ : which one to use in bash scripts?

text: The zsh man page, in its section on `test` (aka `[`), explicitly advises against using it at all, and urges readers to use `[[` whenever possible. The relevant section states: > The command attempts to implement POSIX and its extensions where these are > specified. Unfortunately there are intrinsic ambiguities in the syntax; in > particular there is no distinction between test operators and strings that > resemble them. The standard attempts to resolve these for small numbers of > arguments (up to four); for five or more arguments compatibility cannot be > relied on. Users are urged wherever possible to use the '`[[`' test syntax > which does not have these ambiguities. I think I've come across similar advice for bash, but as I scan over the bash man page I can't find any "official" recommendation there on which form (`[` or `[[`) to use. (Maybe I missed it?) > Is there any reason, _other than backward compatibility with "older shells"_ > , for using `[` in a bash script? Or to put it differently, does bash keep > `[` along with `[[` for reasons _other_ than backward compatibility?


title: What do square brackets mean without the "if" on the left?

text: As far as I know, square brackets are used to enclose an expression usually in if else statements. But I found square brackets being used without the "if" as follows:               [ -r /etc/profile.d/java.sh ] && . /etc/profile.d/java.sh      in the following script.               #!/bin/bash### BEGIN INIT INFO       # Provides:          jbossas7       # Required-Start:    $local_fs $remote_fs $network $syslog       # Required-Stop:     $local_fs $remote_fs $network $syslog       # Default-Start:     2 3 4 5       # Default-Stop:      0 1 6       # Short-Description: Start/Stop JBoss AS 7       ### END INIT INFO       # chkconfig: 35 92 1            ## Include some script files in order to set and export environmental variables       ## as well as add the appropriate executables to $PATH.       [ -r /etc/profile.d/java.sh ] && . /etc/profile.d/java.sh       [ -r /etc/profile.d/jboss.sh ] && . /etc/profile.d/jboss.sh            JBOSS_HOME=/sw/AS7            AS7_OPTS="$AS7_OPTS -Dorg.apache.tomcat.util.http.ServerCookie.ALLOW_HTTP_SEPARATORS_IN_V0=true"   ## See AS7-1625       AS7_OPTS="$AS7_OPTS -Djboss.bind.address.management=0.0.0.0"       AS7_OPTS="$AS7_OPTS -Djboss.bind.address=0.0.0.0"            case "$1" in           start)               echo "Starting JBoss AS 7..."               #sudo -u jboss sh ${JBOSS_HOME}/bin/standalone.sh $AS7_OPTS           ##  If running as user "jboss"               #start-stop-daemon --start --quiet --background --chuid jboss --exec ${JBOSS_HOME}/bin/standalone.sh $AS7_OPTS   ## Ubuntu               ${JBOSS_HOME}/bin/standalone.sh $AS7_OPTS &           ;;           stop)               echo "Stopping JBoss AS 7..."               #sudo -u jboss sh ${JBOSS_HOME}/bin/jboss-admin.sh --connect command=:shutdown            ##  If running as user "jboss"               #start-stop-daemon --start --quiet --background --chuid jboss --exec ${JBOSS_HOME}/bin/jboss-admin.sh -- --connect command=:shutdown     ## Ubuntu               ${JBOSS_HOME}/bin/jboss-cli.sh --connect command=:shutdown           ;;           *)               echo "Usage: /etc/init.d/jbossas7 {start|stop}"; exit 1;           ;;       esac            exit 0        What do square brackets do without the "if"? I mean, exactly, what do they mean when used in that context? This isn't a duplicate of that in which the OP used "if" which I don't have a problem with. In this question, brackets were used in a counter intuitive way. That question and this question may have the same answer but they are two different questions.


title: How to find the header file where a c function is defined?

text: Is there an easy way to find out which header file a C function declaration is in? `cd`ing into `/usr/include` and running (`grep -E 'system.*\\(' *.h -R`) works with some trial and error, but isn't there an easier way to do this?


title: Permission rights on automatic directories inside /media

text: I got a `permission denied` when I am trying to `cd` inside a directory. I could `chown` it for my user, however I'm wondering if the problem is elsewhere: The directory in question is an automatic directory added inside `/media` when I plug my usb external drive. I have read that the points inside `/media` are automatically removed, so I doubt about the usefulness of my `chown`. Is there a way to give access to the user to all the usb things I'm going to plug that will appear inside `/media` ? **Edit** : I rebooted, with the drive unplugged, logged in, then plugged the drive, and then it appears ready to be mounted in PcManFM. From what I have seen, when it's mounted, there's a point `/media/MyDrive_` owned by my user that has been created (`/media/MyDrive` without the trailing underscore is owned by root). It's when that point has been created, that the drive can no longer be accessed by another user. So now it's no longer a real problem for me, since the other user was just optionnal in my setup. But it would be nice to know how to get over it when switching between users. Should I unmount external drives any time I log out ? **Edit2** : I don't find the webpage, but I have read about a `storage` user group, can it be related to that ?


title: How to launch a set of program inside tmux or gnome-terminal within a script?

text: I wanted to launch a few commands simultaneously in tmux or gnome-terminal or xfterminal , every different tab with a single command running , and close that tab when that command finishes. Any other software is welcomed as well I wanted to issue a single script to do the job , e.g XX "cmd1" "cmd2" "cmd3"


title: Can't get directory listing of folder I have permissions to

text: I was having some permission problems and used the following command on directory Media:               chmod -R ugo+r Media      It didn't help so then I did:               chmod -R 775 Media      Now I get this error when I try to `cd`:                jeff@nacho:/DataVolume/shares$ cd Media     -bash: cd: Media: Permission denied      Even though when I do a directory listing everything looks fine:               drwxrwxr-x  8 root share 65536 Oct 15 22:38 Media     drwxrwxr-x 11 root share 65536 Oct 15 23:52 Public      Note: I can `cd` to Public with no problem. If I `su` then I can access the directory. What am I missing? Extra info:               jeff@nacho:/var/www/Admin/webapp/htdocs$ mount |grep -vE '^none'     /dev/md0 on / type ext3 (rw,noatime)     tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755,size=50M)     proc on /proc type proc (rw,noexec,nosuid,nodev)     sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)     procbususb on /proc/bus/usb type usbfs (rw)     udev on /dev type tmpfs (rw,mode=0755)     tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,size=50M)     devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)     tmpfs on /tmp type tmpfs (rw,size=50M)     /var/log on /var/log.hdd type none (rw,bind)     ramlog-tmpfs on /var/log type tmpfs (rw,size=20M)     /dev/sda4 on /DataVolume type ext4 (rw,noatime,nodelalloc)     /DataVolume/cache on /CacheVolume type none (rw,bind)     /DataVolume/shares on /shares type none (rw,bind)     /DataVolume/shares on /nfs type none (rw,bind)     rpc_pipefs on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)     nfsd on /proc/fs/nfsd type nfsd (rw)


title: Disk usage inside archives, like ncdu

text: I am a fond user of the ncdu utility to figure out how space is used within a directory. However, I have a use case where I am trying to choose which folders to backup and which folders not to backup, and the backups will be compressed (as a .tar.xz archive, but I suppose .tar.gz would yield the same result for what I have in mind). So, intuitively, I do not care that much about files that are large but will compress well (e.g., email archives), whereas I care more about files that are relatively small but will not compress at all (e.g., JPG pictures). I want to see files and folders sorted by their compressed size, not their actual uncompressed size. A natural solution would be to compress all files, and then have an `ncdu`-like tool that would operate _on the archive_ to tell me how folders take up space in the archive. Is there any such utility? I am OK with GUI programs (although I would prefer text-based ones), and I am OK with methods that would only work for a different compression algorithm as I imagine they would still yield useful results (e.g., replicate the hierarchy in a filesystem with built-in compression/deduplication).


title: Why is the theoretical RAM limit for RHEL 6 128 TB and how is this determined?

text: I'm studying for RHCSA and am confused by a statement I came across in some training material: > There is no practical maximum RAM, as theoretically, you could run 128 TB of > RAM on RHEL 6. But that's just theory. The maximum RAM supported by Red Hat > on RHEL 6 is 16 GB on 32-bit systems and 2 TB on 64-bit systems. Can someone please explain where the 128 TB theoretical limit is coming from? I'm confused on how the author knows the theoretical limit exists if RHEL 6 clearly defines other maximum limits. Is this just factoring in the theoretical limits of 64-bit architecture? Or is there some other reason here?


title: How to determine whether a linux filesystem belongs to a running system or not

text: I need to write a program that receives a block device as input, like /dev/sda1, and has to perform a set of operations depending on if the filesystem inside are currently running or not. We'll assume the input will always has a correct linux directory tree, the only I need to know is if there's a particular directory structure or file/s that can reliably determine whether the system inside is running. I mean whether the filesystem contains the root of a system that is powered on. It should work for any filesystem or linux kernel version. Thanks!


title: ssh returns message "X11 forwarding request failed on channel 1"

text: When I ssh into a remote server that's not running any type of X11 desktop environment I get the following message.               $ ssh user@server     X11 forwarding request failed          $ ssh user@server ls     X11 forwarding request failed on channel 1     file1     file2     ...      How can I get rid of these messages?


title: how to make dual monitors work as separate monitors and not duplicate? Linux mint 14

text: Need bit of help on this. I am using Linux mint 14 with xfce. I have 2 monitors. LG and Samsung. One is attached to digital input and one to VGA input cable. NVidia graphics card. The 2 monitors come up OK, and I see the Linux desktop on both of them just fine. The problem is that they are duplicate of each others. Kinda' useless. anything I do on one monitor appears exactly on the second monitor. So I like to change this so that I can have one as primary monitor, and the second one to use by dragging windows to it when I run out of space on my primary monitor. I set this very easily on windows. But hard to do on Linux. I researched this, and one is supposed to run a program called `nvidia- setting` to configure this. But when I do               sudo nvidia-setting      I get message saying                  You do not appear to be using the NVIDIA X driver.  Please edit your         X configuration file (just run `nvidia-xconfig` as root), and         restart the X server.      I have no idea what this means. I do not know how to edit configurations files. Edit them to do what? But even when I try the command above               >sudo nvidia-xconfig     sudo: nvidia-xconfig: command not found      I looked in the package manager, and searched and do not see this program. I searched also:               >aptitude search nvidia | grep -i config     i   nvidia-settings                 - Tool for configuring the NVIDIA graphics d     p   nvidia-settings:i386            - Tool for configuring the NVIDIA graphics d     p   nvidia-settings-experimental-30 - Tool of configuring the NVIDIA graphics dr     p   nvidia-settings-experimental-30 - Tool of configuring the NVIDIA graphics dr     p   nvidia-settings-experimental-31 - Tool for configuring the NVIDIA graphics d     p   nvidia-settings-experimental-31 - Tool for configuring the NVIDIA graphics d     p   nvidia-settings-updates         - Tool for configuring the NVIDIA graphics d     p   nvidia-settings-updates:i386    - Tool for configuring the NVIDIA graphics d     >      and               >apt search nvidia-xconfig     >      You can see that there is no such program out there in the Linux mint 14 xfce repository. This package is available for debian http://packages.debian.org/squeeze/nvidia-xconfig Any idea what to do now? Here are the specs:               lspci     05:00.0 VGA compatible controller: NVIDIA Corporation G98 [GeForce 8400 GS] (rev a1)      xrandr command output               >xrandr     Screen 0: minimum 320 x 200, current 1280 x 1024, maximum 8192 x 8192     DVI-I-1 connected 1280x1024+0+0 (normal left inverted right x axis y axis) 510mm x 290mm        1920x1080      59.9 +   60.0          1680x1050      59.9          1680x945       60.0          1400x1050      59.9          1600x900       60.0          1280x1024      75.0*    60.0          1440x900       75.0     59.9          1280x960       60.0          1366x768       60.0          1360x768       60.0          1280x800       74.9     59.9          1152x864       75.0          1280x768       74.9     60.0          1024x768       75.1     70.1     60.0          1024x576       60.0          832x624        74.6          800x600        72.2     75.0     60.3     56.2          848x480        60.0          640x480        72.8     75.0     60.0          720x400        70.1       VGA-1 connected 1280x1024+0+0 (normal left inverted right x axis y axis) 509mm x 286mm        1920x1080      60.0 +        1600x1200      60.0          1680x1050      60.0          1680x945       60.0          1400x1050      60.0          1600x900       60.0          1280x1024      75.0     60.0*         1440x900       75.0     59.9          1280x960       60.0          1366x768       60.0          1360x768       60.0          1280x800       74.9     59.8          1152x864       75.0          1280x768       74.9     59.9          1024x768       75.1     70.1     60.0          1024x576       60.0          832x624        74.6          800x600        72.2     75.0     60.3     56.2          848x480        60.0          640x480        72.8     75.0     66.7     60.0          720x400        70.1       >


title: How can I match this text in awk, printing line numbers for matches?

text: I have a text file thousands (roughly 148,000 lines long) that consists of a lot of sequences like this:               b 29.     b 52.     c 84.     c 83.     c 94.     c 93.     c 61.     b 38.     c 81.     c 92.     c 28.     c 37.     c 27.      ... and since the file is so large, I want to be able to search for patterns like this (non-functional one-liner): grep "b\ 34.\nc53.\nb\ 54.\na\ 45.\nd\ 44.\nd\ 63.\nd\ 64.\n" filename It seems like awk is a good choice. How can I do that, and print line numbers for matches too?


title: cinnamon doesn't start, bumblebee problem

text: I have Linux Mint 13 64 bit version with cinnamon, NVdia Geforce 320m, proprietary driver 304.54 if I'm not mistaken. I installed bumblebee following this guide:               sudo add-apt-repository ppa:bumblebee/stable     sudo apt-get update     sudo apt-get install bumblebee bumblebee-nvidia linux-headers-generic      Rebooted, and now I have 640x480 resolution, half-broken gnome 3 was loaded (there are no buttons to log out or reboot, no animations of course). When I try to run `nvidia-settings` I get:               You do not appear to be using the NVIDIA X driver.       Please edit your X configuration file (just run `nvidia-xconfig` as root),     and restart the X server.      What shall I do to fix this? I want my discrete graphics card and cinnamon back.


title: How can I create labels in VirtualBox like this video?

text: In this video, I saw a fold-able label in the VM list, how was that created? I'm running VBOX 4.2 OSE as well, but didn't spot where to configure it.               > SERVER  // can be folded       VM 1        VM 2          > Label 2       VM 1       VM 2


title: How to run a Python script in Makefile

text: I want to write a Makefile to find specific files and run a Python script on each file. The Python script accepts `sys.stdin` input.               find $(W)/$(OVE) -name "*.xml" -print | \     while read x ; do \       cat $x | /opt/exp/bin/python2.7 process_results.py > $(W)/$(OVE)/$(dirname $x)_$(basename $x).xml \     done      The output is `$(dirname $x)_$(basename $x).xml` file which is an empty _.xml file. When I run this command on command line, it works properly but in Makefile it doesn't work. Can you help me what is wrong with this command?


title: Use or convert .ttf font for console use in FreeBSD

text: I have a monospace .ttf font I really like (UbuntuBeta Mono). Is there any way I can use it (or convert first and then use, if needed) for the console in freeBSD? I know there is `usr/share/syscons/fonts`, but it looks like they might be a different format? Once I install the font, how do I tell the console to use it?


title: Ubuntu Server, set terminal font to a custom ttf font?

text: I would like to change the system (console) font of my ubuntu server to a custom (downloaded) font. Is this possible? I've tried to use:               dpkg-reconfigure console-setup      but the only allows me to choose from the default system fonts.


title: Emacs: make portion of buffer readonly

text: I sometimes edit files in `emacs` where portions of the file are documentation or something else that shouldn't be edited, and another portions are "play areas" where I'm free to edit and create new text. Question: can I make a _portion_ of an emacs buffer readonly? The simplest example would be making lines 1-100 readonly (for example). A more complex example (similar to emacs bookmarks) would be to make all text between `[readonly]` and `[/readonly]` uneditable. I googled this, but couldn't find anything useful.


title: How to pass arguments to bash shell script when executing that command with at?

text: I have a shell script that accepts an argument and uses that in the script. So to run the script I type `/path/to/script argument` The problem is when trying to setup that file to run using the `at` utility. I have tried `at -f /path/to/script argument 17:45` `at -f '/path/to/script argument' 17:45` but neither of these options work. First one receives a syntax error and the second says no such file Any suggestions?


title: Arch Linux doesn't seem to use vconsole.conf

text: I have insalled Arch Linux. During the installation, I set my vconsole.conf file to be like this:               KEYMAP=slovene     FONT=Lat2-Terminus16      But when I try to type my Slovenian letters after reboot, instead of the letter **č** I get **A''** and I also get some wierd symbols for letters like **ž** , **đ** , **š** as well as capital versions of the same. **Q1:** Why isn't my vconsole.conf applied? **Q2:** Is it possible that letters just cant be rendered?


title: Is it possible to change Inode count on an ext4 filesystem?

text: > **Possible Duplicate:**   >  How can I increase the number of inodes in an ext4 filesystem? I have a homemade NAS with Debian Wheezy 64bit. It has three disks - 2x2TB and 1.5TB, pooled together using RAID1/5 and LVM. The result is a LVM Logical Volume, about 3.16TB in size, formatted as ext4 and mounted as /home. However I just found out that roughly 50GB of this capacity is used by Inodes (exact count being 212 459 520, with 256B in size or to put it in another way - one Inode per every 16k of the partition size). While 50GB in 3.16TB is about 1.5% of the total capacity, it's still a lot of space. Since this is a storage NAS, mostly used for multimedia, I don't ever expect the /home partition to have 212 **million** files in it. So, my question is this - is it possible to lower/change the number of Inodes without actually re-creating the whole partition? While it might be possible to do it, I'd still prefer to find a way to do so instead of moving 2TB of data around and waiting for RAID to re-sync again.


title: Resize ext4 partition to create more inodes?

text: > **Possible Duplicate:**   >  How can I increase the number of inodes in an ext4 filesystem? An old headless no-X backup server I use has a small hard drive with three primary ext4 partitions: `/`, `/home` and `/swap`. The system is unable to run updates, as there are insufficient inodes available on the 1.5GB `/` partition. There is unused space available on `/home`. Would resizing the `/` partition from a live GParted environment solve this? Would more inodes be created by this process? This answer indicates that it is not possible to create more inodes after a filesystem has been created. I assume that this does not involve **resizing** the partition. This answer suggests recreating the filesystem to obtain more inodes.


title: bind key sequence to Escape, zsh

text: How would I map `jj` to `Esc` in zsh? I'm trying to recreate a key-mapping that I have setup in vim, where I have `jj` mapped to `ESC` so that whenever I double-press `j`, it sends the an `<Esc>` to vim--allowing me to enter normal mode with greater convenience. I've already tried `bindkey 'jj' ^[`, and I'm about to try `bindkey 'jj' ^[[`, but I doubt that it'll work. I also checked the list of commands provided by zsh in normal mode, but I didn't see anything that contained `normal` or `escape`. **NOTE**   The `^[` characters in my `~/.zshrc` file are actual hard coded escapes; not just the characters `^` and `[`.


title: autofs mounts not disconnecting after inactive

text: I have **autofs** installed on several linux servers that are connecting to central NFS server for the users /home directories. It works great when mounting the directories on login, but the mounts never seem to timeout. I've checked /etc/sysconfig/autofs and the default is indeed set to 300, so these should be timing out after 5 minutes. Restarting **autofs** does umount all of the directories, so I know it's capable. I've attempted using **lsof** randomly on the directories but no files appear open at any time. I've also mounted a random directory that I know is not active, but these never umount themselves. Some of these boxes have 10+ users that have logged in once, and the mounts never drop. I'm just trying to find out of there is a better method to finding out why. I don't see anything specific in any logs. Any suggestions are appreciated. Thanks! **UPDATE** I turned on debugging for **autofs** but it doesn't seem to reveal anything out of the ordinary. These logs were generated 7 minutes after the /home/user1 was initially mounted and after 6 minutes of inactivity. According to the 5 minute default, this should have been unmounted. I never saw a log come through that indicated an attempt was even made to umount.               Jan 11 12:52:00 linux automount[26505]: st_expire: state 1 path /home     Jan 11 12:52:00 linux automount[26505]: expire_proc: exp_proc = 3055176592 path /home     Jan 11 12:52:00 linux automount[26505]: expire_proc_indirect: expire /home/user1     Jan 11 12:52:00 linux automount[26505]: expire_proc_indirect: expire /home/user2     Jan 11 12:52:00 linux automount[26505]: expire_proc_indirect: expire /home/user3     Jan 11 12:52:00 linux automount[26505]: 3 remaining in /home     Jan 11 12:52:00 linux automount[26505]: expire_cleanup: got thid 3055176592 path /home stat 7     Jan 11 12:52:00 linux automount[26505]: expire_cleanup: sigchld: exp 3055176592 finished, switching from 2 to 1     Jan 11 12:52:00 linux automount[26505]: st_ready: st_ready(): state = 2 path /home      **Update 2** After talking to Red Hat support about this, the solution ended up being to just shorten the timeout value for home directories. I did that and looks well. Something apparently is traversing the mount point every 2 1/2 to 3 minutes and causing this to stay up. The solution was to add the timeout value to the /etc/auto.master file for that mapping:                /home     /etc/auto_home --timeout=120


title: sipe (plugin pidgin-gaim) unable to find libpurple headers

text: I downloaded : pidgin 2.10.6 and sipe 1.14.1 from sourceforge. I install pidgin with the following command in the folder of pidgin (2.10.6):               ./configure --prefix=/home/tony/soft/pidgin_sipe --disable-screensaver --disable-gtkspell --disable-vv --disable-meanwhile --disable-avahi --disable-nm --disable-tcl          make     make install      it works fine and i can launch pidgin with `/home/tony/soft/pidgin_sipe/bin/pidgin` then i tried to install the plugin sipe but in the folder of sipe (1.14.1) the command:               ./configure --prefix=/home/tony/soft/pidgin_sipe      returns :               checking for PURPLE... no      checking for TELEPATHY_GLIB... no     configure: error: at least one plugin must be selected          If you didn't use a --enable option then please check that you have     the headers for the packages "purple" or "telepathy-glib" installed.      I add in my environment variable `PATH` the folder `/home/tony/soft/pidgin_sipe/bin` and i export `PURPLE_LIBS="/home/tony/soft/pidgin_sipe/lib"` but the result is the same. And in the folder `/home/tony/soft/pidgin_sipe/include/libpurple` the headers are here :               account.h conversation.h debug.h .... upnp.h      Am I missing something or how can I tell to sipe where libpurple is.


title: How to remove LUKS encryption?

text: I tried removing LUKS encryption on my home directory using the following command:               cryptsetup luksRemoveKey /dev/mapper/luks-3fd5-235-26-2625-2456f-4353fgdgd      But it gives me an error saying: > Device /dev/mapper/luks-3fd5-235-26-2625-2456f-4353fgdgd is not a valid LUKS > device. Puzzled, I tried the following:               cryptsetup status luks-3fd5-235-26-2625-2456f-4353fgdgd      And it says:               /dev/mapper/luks-3fd5-235-26-2625-2456f-4353fgdgd is active and is in use.     type: LUKS1     cipher: ...      It seems the encrypted device is active, but not valid. What could be wrong here?


title: Find out what /dev/cuaU maps to?

text: I have an USB 3G modem (Huawei E353-u2) on pfSense 2.0.2 (which is based on FreeBSD 8.1-RELEASE-p13), it seems to create 2 /dev/cuaU devices:               /dev/cuaU0.0     /dev/cuaU0.3      1) Why are there 2 devices? Is one of them maybe the usb mass storage of the stick? 2) On the OS level (shell), how can I find out which of those 2 devices is the "real modem" / to what /dev/cuaUx.y is mapped? Thanks for any hint :-)


title: Set up network interface for automatic connection

text: I have an ethernet device P2P connected to the NIC in my system. When the remote device is rebooted or changes its IP address, the local network interface goes down and loses its IP address. How can I make the local interface automatically reconnect in such cases and remember its IP? I know how to set an interface up programmatically and set an IP, but I don't want to check in a loop, there should be a better way.


title: How to correctly concatenate strings in shells script?

text: I have a bash shell which I need to modify, and I have to set a variable in a script and then call another script. My variable, `EXTRA_JAVA_OPTIONS` must be               -javaagent:myagent.jar="-d 0 -i 1000 -l log2 -c log1"      So what I did is               export EXTRA_JAVA_OPTIONS="-javaagent:myagent.jar=\"-d 0 -i 1000 -l log2 -c log1 \""      Then I call my script and inside my script there is the following :               "$JAVACMD" "$EXTRA_JAVA_OPTIONS"      However, this won't produce the result I desire. Running bash -x I can see that               + /usr/java/jdk1.6.0_38/bin/java '-javaagent:myagent.jar="-d 0 -i 1000 -l log2 -c log1"'      If on the contrary I do:               "$JAVACMD" $EXTRA_JAVA_OPTIONS      I got a different version of the output, which is wrong too               + /usr/java/jdk1.6.0_38/bin/java '-javaagent:myagent.jar="-d' 0 -i 1000 -l log2 -c 'log1"'      How do I prevent `'` from appearing when printing my strings, or them to be added by the shell?


title: NetworkManager issues in Arch Linux

text: Have had WiFi working fine via wifi-menu on command line for a while, but would much prefer the gnome icon, so i switched to NetworkManager, and now nothing will connect. I enabled my dhcp daemon in the config file, but the issue seems to happen before that point... any network I try it just refuses to connect to. It sees networks, then fails to connect immediately on click.


title: Script to email all matching files in a directory

text: Trying to set up a bash script to automate sending data files. Desired end result is to check a specified directory once per week, make a list of all Excel files modified within the last 2 days, and email them to a designated recipient list. I have sendmail configured and working (using a Gmail relay). I have mutt configured and working. In general the commands I am trying to send work if send directly from CLI (mail is sent and received, with attachments) but I get repeated failures when trying to call them from the script. Everything seems to stem from the fact that the directory and file names contain spaces. I can't change this - I don't have control over the naming of the files - but it seems as if this is the sticking point in my script. Two main problems:   1. If I try to send all files in one go, mutt reports the attachment(s) cannot be attached:               Can't stat "/path\ to/file1.xls     /path\ to/file2.xls": No such file or directory The newline char is being passed as part of the $FILES variable.   1. If I try to loop through the directory to send files one at a time (my desired outcome, as some files are fairly large) the script interprets spaces as delimiters, escaped or not - so `/path/to/the\ files/file\ 1.xls` is seen as 3 values (`/path/to/the\`, `files/file\`, `1.xls`). I did have the first half of the script working (mailing all files at once) but managed to break it trying to add the loop. Of course I didn't save the earlier working version. Tried using `set ifs=$'\n'` for the loop to get the delimiters correct, but when I have that in place mutt tells me the full path to the file is not a file, or that there was no recipient designated. It's a bit maddening. Script:               #!/bin/bash     # This file should send an email to specified recipients with data files for the week attached.          # Set reply-to address for Mutt     export REPLYTO="my_email@domain.com"          # Replace with space separated email address of all recipients     EMAILS="recipient1@domain.com recipient2@domain.com"          # Get today's date for subject     # Date is in YYYY-MM-DD format     TODAY=$(date +%F)          # Set the message body     MBODY="Sending this week's data files.\n"          # Set the starting directory     # Don't bother escaping it, this is fixed in FILES variable below     DIR="/home/user/path to files"          # Get the list of files to send     FILES=$(find "$DIR" -type f -mtime -2 | sed 's/ /\\ /g' | grep ".xls")          # Check to see if we found any files or not     if [ -z "$FILES" ]; then         MBODY="No matching files added or modified within last 2 days. No files sent.\n"         echo "$MBODY" | mutt -s "Data files for $TODAY" $EMAILS     fi          # Send all files in a single email     echo $MBODY | mutt -s "Data files for $TODAY" -a "$FILES" -- $EMAILS      For sending files separately, I tried the following instead of the last 2 lines above:               # Cycle through FILES array and send each file individually     for datafile in ${FILES[*]}     do        set IFS=$'\n\t'        echo $MBODY | mutt -s \"Data files for $TODAY\" -a $datafile -- $EMAILS         unset $IFS     done      Any help? I've been stuck on this for a while now. I'm not married to using mutt, or even bash for that matter, if this is easier done in another language.


title: __modver_version_show undefined error during make

text: Platform: Ubuntu 11.10 64bit Kernel to be compiled: 3.2.1 Error after make: `ERROR: "__modver_version_show" [drivers/staging/rts5139/rts5139.ko] undefined!` To solve this I copied the .config file of a previous build kernel on the same machine to the same one. Ran make menuconfig. Saved it without any changes. Ran make. Make said that the bzImage is ready, but also gave the above error.


title: Pause at the end of `scp` transfer: from OSX or FreeBSD to Ubuntu

text: I make binary images for the releases of a freeware program for about seven platforms, with the help of VirtualBox images. The images are copied via `scp` to an Unbuntu system. I've noticed that from some operating systems, notably OS X (10.7.3) and FreeBSD 9.0, there is an annoying pause at the end of `scp` transfer before the program terminates and control of the tty returns to the shell. The transfer are successful (and I think that `scp` can be killed at the point where it is hanging; it makes no difference to the file integrity any more). From other operating systems, like Solaris 10 or Debian 5, the transfer is fast and terminates instantly when it reaches 100%. The transfers are all either between VM's on the same host, or over a wired LAN (100 mb/s) which has next to no traffic; no Wi-Fi or WAN is involved. Has anyone experienced this and drilled down to the root cause?


title: Django can not connect to MySQL database over ubuntu 10.04

text: I am newbie in Django. I got a simple Django 1.3.* project, i would like to run it over my localhost. I installed all necessary modules like: python-mysqldb, rptz etc... I have ubuntu 10.04 installed with python 2.7.2. When i tried to start project in terminal               thor@thor:/media/SAJAT - Projects/project/simple project$ python manage.py runserver      I got the following error message:               > Validating models...          Unhandled exception in thread started by <bound method Command.inner_run of <django.core.management.commands.runserver.Command object at 0x1224910>>     Traceback (most recent call last):       File "/usr/lib/python2.7/dist-packages/django/core/management/commands/runserver.py", line 88, in inner_run         self.validate(display_num_errors=True)       File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 249, in validate         num_errors = get_validation_errors(s, app)       File "/usr/lib/python2.7/dist-packages/django/core/management/validation.py", line 102, in get_validation_errors         connection.validation.validate_field(e, opts, f)       File "/usr/lib/python2.7/dist-packages/django/db/backends/mysql/validation.py", line 14, in validate_field         db_version = self.connection.get_server_version()       File "/usr/lib/python2.7/dist-packages/django/db/backends/mysql/base.py", line 338, in get_server_version         self.cursor()       File "/usr/lib/python2.7/dist-packages/django/db/backends/__init__.py", line 250, in cursor         cursor = self.make_debug_cursor(self._cursor())       File "/usr/lib/python2.7/dist-packages/django/db/backends/mysql/base.py", line 322, in _cursor         self.connection = Database.connect(**kwargs)       File "/usr/lib/python2.7/dist-packages/MySQLdb/__init__.py", line 81, in Connect         return Connection(*args, **kwargs)       File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 187, in __init__         super(Connection, self).__init__(*args, **kwargs2)     _mysql_exceptions.OperationalError: (2003, "Can't connect to MySQL server on '172.17.30.101' (110)")      I have no idea where this IP address comes from 172.17.30.101' (110) because of my mysql server has been installed on my computer(localhost) Here is my settings.py file                   DATABASES = {             'default': {                 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.                 'NAME': 'dbname',                      # Or path to database file if using sqlite3.                 'USER': 'dbuser',                      # Not used with sqlite3.                 'PASSWORD': '123456',                  # Not used with sqlite3.                 'HOST': '127.0.0.1',                      # Set to empty string for localhost. Not used with sqlite3.                 'PORT': '',                      # Set to empty string for default. Not used with sqlite3.      #'PORT': '3306', i tried with this too                      # Set to empty string for default. Not used with sqlite3.      #'PORT': '3360', i tried with this too                      # Set to empty string for default. Not used with sqlite3.             },             # 'read': {             #     'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.             #     'NAME': 'newsonia',                      # Or path to database file if using sqlite3.             #     'USER': 'dbuser',                      # Not used with sqlite3.             #     'PASSWORD': 'dbname',                  # Not used with sqlite3.             #     'HOST': '127.0.0.1',                      # Set to empty string for localhost. Not used with sqlite3.             #     'PORT': '',                      # Set to empty string for default. Not used with sqlite3.             # }         }      I have no idea how should be resolve this kind of errors.


title: Sending SIGUSR1 to parent

text: When I do a `kill -SIGUSR1 $PPID` I get `kill: (1) - Operation not permitted` . How can I overcome this?


title: Why does Bash readline sometimes try to parse the second word of a command out of context?

text: I recently migrated all my dotfiles and setting to a new laptop running Ubuntu 13.04, and have been noticing a strange behavior that I've never seen before. Essentially, it seems like my terminal is sometimes trying to parse commands from right to left rather than the normal way. Its not consistant at all, and often typing the same command twice will produce different output. Example:                ⋯  www  localwork  cd ~/Downloads     bash: /home/goldenapples/Downloads: Is a directory           ~  cd ~/Downloads      ~  Downloads  ls      So, the first command seems to have been parsed as `cd ~; Downloads`, but the second time I typed the same exact command, it worked fine. The same thing happens with aliases. Here I have `gp` aliased to `git push`:                ~  Documents  infostats-theme   master  gp     usage: git [--version] [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]                [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]                [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]                [-c name=value] [--help]                <command> [<args>]              [...]          See 'git help <command>' for more information on a specific command.     The program 'push' is currently not installed. You can install it by typing:     sudo apt-get install heimdal-clients           ~  Documents  infostats-theme   master  gp     Counting objects: 22, done.     Delta compression using up to 4 threads.     Compressing objects: 100% (14/14), done.     Writing objects: 100% (14/14), 1.69 KiB, done.     Total 14 (delta 12), reused 0 (delta 0)     To git@github.com:janrain/statboard.git        cf86529..3208e21  HEAD -> master:wq      No idea what happened there. My bash aliases were processed in the first example, and it correctly read the line as `git push`, but I don't knwo what happened after that. Looks like it tried to parse the command as `git; push;` and so it showed the git help screen, and then displayed an error that no program named `push` was installed. The werid thing is: typing the same exact command immediately afterwards worked fine. This is one of those problems I've just been putting up with because it makes no sense. The only thing I can seem to pinpoint is that the problem behavior seems to happen when I'm typing especially fast, and slowing down and retyping the command sometimes makes it work. I'm mostly using Bash inside of tmux 1.8, if that lends any help. ## Update: Adding this line to my `.tmux.conf`:               set-option -g default-command "exec /bin/bash --norc"      seems to have fixed the problem... or at least I haven't been able to cause it again since. But I still have no idea why or how, and I'd love an explanation.


title: How to make a vimrc?

text: I made a macro and stored in key 's' and stored by using like that:               :let @s='macro_name'      I want to write this macro in `q.vimrc` (for the use of my collegues). How is this possible?


title: How to make AltGr+i,j,k,l work properly as cursor keys?

text: (I already asked this question on superuser but got no answer so I'll try here now.) I would like to have the cursor keys and some others available as AltGr+c,h,t,n etc. (i,j,k,l if you have qwerty). I have made a custom keyboard layout file (see here). There I basically just took a layout file and modified the relevant lines to be like               key <AC09> { [ n, N, Right, Right ] };      I have this as `/usr/share/X11/xkb/symbols/nonpop` and I load it with `setxkbmap nonpop` in `~/.xinitrc` (I'm not using any DE, just the Awesome WM). And it works---almost.   * In Firefox, for example, everything works nicely. For example AltGr+n moves the cursor right and Shift+AltGr+n selects text. Similarly in the main text area in LyX.   * In MonoDevelop the cursor moves with AltGr+n, but Shift+AltGr+n also only moves the cursor instead of selecting. Shift+Right selects text normally.   * In NetBeans and LyX dialogs pressing (Shift+)AltGr+n does absolutely nothing. I guess these other programs read the AltGr state and decide it's a bad thing. So, is there any way to make things happen the way I want? It looks like overlays could be a solution but I didn't get them to work yet.


title: What is difference between w and W in escape mode of vim?

text: I am looking at the vim help quickref commands for moving cursor. Following lines confuse me because I find both of them working same. Could some one elaborate me difference with an example.               N  w            N words forward     N  W            N blank-separated WORDS forward      Same question is true for e and E as well.


title: Why does mcedit recommend removing hardlinks when saving a file?

text: Whenever I use `mcedit` to edit a file that is hard linked somewhere and I want to save the file, the editor asks me if I want to remove the hard links. Is that common behavior on Linux or is `mcedit` "special" in doing so? Why would regular applications (not fsck or other admin tools) care about hard links?


title: I need a step by step guide to build kernel modules in ChrUbuntu

text: I don't have experience building kernel modules. And worse, I'm trying to do it on ChrUbuntu, so it seems that I cannot follow the existing Ubuntu guides. For example, this command fails:               # apt-get install linux-headers-$(uname -r)      because the ChrUbuntu kernel is version 3.4.0 and there is no Ubuntu repo for that version (afaik). uname -a               Linux ChrUbuntu 3.4.0 #1 SMP Sun Aug 26 19:17:55 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux      Here are some references I have looked at: Kernel/Compile - Community Ubuntu Documentation How to: Compile Linux kernel modules Debian / Ubuntu Linux Install Kernel Headers Package Hello World Loadable Kernel Module | Mark Loiseau 64 bit - How do I compile a kernel module? - Ask Ubuntu Compiling Kernel Modules Setting Up Ubuntu for Building Kernel Modules - Drew Stephens


title: Which is has higher performance? Nvidia proprietary or Nouveau open source?

text: System: Manjaro 0.8.5.2 x64 Core 2 Duo P8700 @ 2.53Ghz Nvidia GT 240M


title: How to set cron job for system

text: I'm really new on Linux and have no any previous experience on it. And I opened this account to ask this question. I need to install a **cron job** I've followed the short guide **here**. Well, I think it has been installed successfully. Because, when I type `crontab -l`, I see it in the result that `Putty` display. I'm using `Putty` by the way. * * * **Problem (I'm not sure if this is problem, but seems to be):** I've asked another developer/college to login the server, using Putty, with his own credentials. Means another user. Then I asked type `crontab -l`. And the result is: > no crontab for username. So, I guess that cron job is only installed for me. **Question(s):** How can I install it system wide? What I mean is, how can I install it for everyone? If I install if for everyone, does it run as much as number of users when time comes? For example, if there are 3 users in the system, and I install cron job system wide, does it run 3 times (for every user) when time comes to run the scheduled job? Or having the cron job only for a specific username is enough to make the operation? If "no", and if I need to install it system wide, then how to do that, in what step of this guide I need do something different? * * * Little information about what cron job does. There is a database in the system/server, and the cron job is supposed to update the database from another remote database, on the first date of every month, at 8pm. I've used `.sh` to install the cron job, by the way. Thanks everyone for trying help me.


title: Faster graphics in KVM guest

text: Is there any way to improve the graphics performance of a KVM guest? I suspect that the question is too general, so I will give my setup and requirements. My ultimate goal is to use an Ubuntu guest as my primary OS. The only graphics-intensive things I do are watching videos and playing state-of- the-1990s games. Current setup: Debian host (X+Fluxbox), KVM guest with SDL graphics, (emulated) vmware graphics card (the other one has >0.5s redraw times), and a standard Ubuntu installation. I can watch videos, but games are a bit choppy. What doesn't seem to work: Non-SDL graphics (both VNC and X forwarding are very choppy), VGA passthrough (not implemented in KVM; Xen requires IOMMU, which my computer doesn't seem to support) What I am thinking about (but I have very little knowledge on the subject): Trying to eliminate X from the host. I've heard myths about something called "framebuffer", but I don't know much else.


title: How to set an alias for a specific file or directory?

text: There are several files I work with often. For instance some configuration files or log files. Let's say the Apache log file. I often want to `tail` or `grep` it. Instead of writing: `tail -50 /var/log/apache2/error_log` I prefer to write `tail -50 apachelog` So that `apachelog` functions as an alias for this filename. But if I define an alias in my `bashrc`, it needs to be a whole command; it (apparently) can not be an alias for a filename so that you can reference it later. Is there a way to achieve this? NOTE: I have a large variety of files and a large variety of different commands I want to run, so creating functions or aliasses for all of those different options will not be my preferred solution.


title: No sound from cli apps or from zsnes

text: Some programs don't have sound, in particular ZSNES and anything I run from the command line. So my question has two parts:   1. How can I diagnose this problem? (I'm thinking of a command like `lspci` that will display the idiosyncracies of my system setup... would that be `lsmod`?)   2. What do I need to install/modify to fix this?


title: How do I see what symlinks exist for a given directory?

text: I want to do some housekeeping in a directory, and I want to see if a given directory has any symlinks pointing _to_ it. I can easily enough see what directory a symlink points to, but now I want to see the relationship in reverse.


title: How to get touchpad functional, again?

text: I messed something up and can't get my touchpad functional _at all_ on GNOME 2.30 any more. I looked at Mouse Preferences on the Touchpad tab, and can't find the magic switch. The touchpad works on the Virtual Terminals, and on LXDE. Here's output from `dmesg`, after running `sudo modprobe psmouse`:               [29186.004285] Synaptics Touchpad, model: 1, fw: 6.3, id: 0x9280b1, caps: 0xa04793/0x304000/0x0     [29186.004295] serio: Synaptics pass-through port at isa0060/serio4/input0     [29186.041853] input: SynPS/2 Synaptics TouchPad as /devices/platform/i8042/serio4/input/input22     [29191.135029] input: PS/2 Generic Mouse as /devices/platform/i8042/serio4/serio9/input/input23


title: Custom kernel: fails to load firmware when module built-in

text: I'd like to have all my modules built-in, but this fails with `iwlagn`:               iwlagn 0000:03:00.0: request for firmware file 'iwlwifi-6000-4.ucode' failed.     iwlagn 0000:03:00.0: no suitable firmware found!      The microcode file exists in `/lib/firmware` and the whole thing works just fine if I compile `iwlagn` as module. I have no idea where it's looking for the file or what's wrong - any ideas?


title: forwarding DHCP packets

text: I've got this configuration:               WRouter ->(by wifi) Computer1      And I want to add another computer (`computer2`) connected by cable to `computer1`. Is it possible then to configure `computer1` to forward all packets from/to `computer2` with DHCP packets too? And if yes, how?


title: Reduce the space around in-line formulas in LibreOffice

text: When inserting a formula into LibreOffice, there is a whole lot of padding between it and other words. How can I modify the formatting of formulas to make the padding much smaller? LibreOffice 3.3.1


title: Base permissions on a fat32 usb drive

text: On linux, the base permissions for directories is 777 and for files, it is 666. Thus, with umask=022, new files are 644 and new directories are 755. But when I mount a usb drive with fat32 filesystem, the base permissions is 777 for both directories and files. I have the following line in my `fstab` file :               /dev/sdb1   /media/usbdrive  vfat   user,noauto,noatime,flush,fmask=113,dmask=002   0   0      So, new files are 664 and new directories are 775. Is it normal for a usb drive with fat32 to have 777 as the base permissions for files and directories?


title: Fluxbox menu entry that prompts for some input

text: How do I ask 'which man file would you like to open?' in one command from the commandline, which will also open `xterm` at the same time. This is needed for a fluxbox menu item. For it to be a fluxbox menu item, it must fulfil this format               [exec] (Which man page do you want to read?) {read -p 'which man file would you like to open? '; xterm -e man "$REPLY"}      where   * `[exec]` - look out its an executable command   * `(Question)` - title   * `{xterm -e man tmux}` - command with this syntax


title: Missing /dev/ram0 /dev/ram1 and /proc/kcore

text: I have been experimenting with `etckeeper` to store different snapshots of `/etc` in a git repo. I have cloned a working `/etc` in `/etc-1` of a clean VPS and I have restored metadata with `etckeeper`, the I have deleted `/etc` and I have made a symbolic link of `/etc` to `/etc-1`. I could not connect from ssh after reboot, so I logged in from the HN. Searching for broken symlinks I have found that `/etc/dev/devices/ram` and `/etc/dev/devices/ramdisk` have broken links to `/dev/ram1` and `/dev/ram0`. And `/dev/core` has a broken symlink to `/proc/kcore`. I can create the ramdisks with :               mknod -m 660 /dev/ram0 b 1 1     chown root.disk /dev/ram0      But when I reboot they disappear. What creates all those files?


title: How to add a unix/linux user in a bash script

text: Here's my test bash script. I'm not able to get it to work. I'm seeing two errors:   1. `Use of uninitialized value $answer in chop at /usr/sbin/adduser line 589.`   2. `Use of uninitialized value $answer in pattern match (m//) at /usr/sbin/adduser line 590.` Here's my script:               #!/bin/bash     sudo adduser myuser << ENDX     password     password     First Last                         Y     ENDX     exit 0      Here is the output:               me@mycomputer$ ./adduser.sh      Adding user `myuser' ...     Adding new group `myuser' (1001) ...     Adding new user `myuser' (1001) with group `myuser' ...     Creating home directory `/home/myuser' ...     Copying files from `/etc/skel' ...     Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully     Changing the user information for myuser     Enter the new value, or press ENTER for the default             Full Name []:   Room Number []:         Work Phone []:  Home Phone []:  Other []: Use of uninitialized value $answer in chop at /usr/sbin/adduser line 589.     Use of uninitialized value $answer in pattern match (m//) at /usr/sbin/adduser line 590.     Is the information correct? [Y/n] me@mycomputer$      This is on Kubuntu 12.04 LTS               $ bash --version     bash --version     GNU bash, version 4.2.25(1)-release (x86_64-pc-linux-gnu)      Here are the lines from adduser (system script - unmodified by me) with notations of the two relevant line numbers:               for (;;) {            my $chfn = &which('chfn');         &systemcall($chfn, $new_name);         # Translators: [y/N] has to be replaced by values defined in your         # locale.  You can see by running "locale yesexpr" which regular         # expression will be checked to find positive answer.         print (gtx("Is the information correct? [Y/n] "));         chop (my $answer=<STDIN>);        <-- LINE 589         last if ($answer !~ m/$noexpr/o); <-- LINE 590     }


title: How to download original ramdisk file to the computer?

text: Linux embedded, is it possible to download original ramdisk file to the computer, to get source code? Access via SFTP.               U-boot 1.2.0          Kernel command line: root=/dev/mtdblock3 mtdparts=spansion:0x20000(U-Boot)ro,0x10000(env1),0x10000(env2),0x2d0000@0xf0000(fware-FS),0x50000@0x7B0000(nvram),0x3B0000@0x40000(UBFI1),0x3B0000@0x3F0000(UBFI2)          7 cmdlinepart partitions found on MTD device spansion     partitions[0] = {.name = U-Boot, .offset = 0x00000000,.size = 0x00020000 (128K) }     partitions[1] = {.name = env1, .offset = 0x00020000,.size = 0x00010000 (64K) }     partitions[2] = {.name = env2, .offset = 0x00030000,.size = 0x00010000 (64K) }     partitions[3] = {.name = fware-FS, .offset = 0x000f0000,.size = 0x002d0000 (2880K) }     partitions[4] = {.name = nvram, .offset = 0x007b0000,.size = 0x00050000 (320K) }     partitions[5] = {.name = UBFI1, .offset = 0x00040000,.size = 0x003b0000 (3776K) }     partitions[6] = {.name = UBFI2, .offset = 0x003f0000,.size = 0x003b0000 (3776K) }     Creating 7 MTD partitions on "spansion":     0x00000000-0x00020000 : "U-Boot"     0x00020000-0x00030000 : "env1"     0x00030000-0x00040000 : "env2"     0x000f0000-0x003c0000 : "fware-FS"     0x007b0000-0x00800000 : "nvram"     0x00040000-0x003f0000 : "UBFI1"     0x003f0000-0x007a0000 : "UBFI2"


title: Auth via wget works, but cannot navigate inside webpage after it

text: I can get a cookie, ok:               wget -q --tries=5 --retry-connrefused --timeout=29 -U 'Mozilla/5.0 (Windows NT 6.1; rv:26.0) Gecko/20100101 Firefox/26.0' --no-check-certificate --keep-session-cookies --save-cookies cookies.txt --post-data 'email=foo@bar.com&password=ASDF' HTTPS://FOO.BAR -O - > /dev/null 2>&1      But when I try to surf with the cookie.. IT ONLY WORKS when I log in via a webbrowser too! (and if I log out of the website in the webbrowser it doesn't work anymore)               wget -q --tries=5 --retry-connrefused --timeout=29 -U 'Mozilla/5.0 (Windows NT 6.1; rv:26.0) Gecko/20100101 Firefox/26.0' --no-check-certificate --keep-session-cookies --load-cookies cookies.txt -p "HTTPS://FOO.BAR/somewhere" -O out.html      **My question** : Why does wget only work if I am logged in the website too? Maybe there is another auth mode that is only working in the browser?


title: How to install kvm in Debian (Lenny) over powerpc

text: I am emulating powerpc using qemu-system-ppc on top of x86, and running debian-lenny-ppc with it. I want to install kvm inside that debian. I have learned that the kvm and qemu-kvm packages are not available for the powerpc architecture. I have found two packages (kvm-source and [Edit1]qemu) and installed it, but I don't know how to proceed with it further. How do I install kvm on powerpc? Do I need to cross-compile it as well, as given on http://www.linux- kvm.org/page/PowerPC_Host_Userspace? [Edit1]:   Approach1: I downloaded qemu-kvm source code (http://sourceforge.net/projects/kvm/files/qemu-kvm/0.13.0/qemu- kvm-0.13.0.tar.gz/download) , configured               #./configure --target-list="ppc-softmmu"      #make        But I am getting this error:               CC    ppc-softmmu/virtio-pci.o     ~/qemu-kvm-0.13.0/hw/virtio-pci.c: In function 'virtio_pci_mask_notifier':     ~/qemu-kvm-0.13.0/hw/virtio-pci.c:436: error: invalid use of undefined      type 'struct kvm_irq_routing_entry'     ~/qemu-kvm-0.13.0/hw/virtio-pci.c:436: error: dereferencing pointer to      incomplete type


title: Regexp on data flow

text: I want to test if in my data flow, there is something, and do an exit code. I use gammu monitor, which provides a data flow, for example :               [root@MYSERVER ~]# gammu monitor     Press Ctrl+C to break...     Entering monitor mode...          Enabling info about incoming SMS    : No error.     Enabling info about incoming CB     : Some functions not available for your system (disabled in config or not written).     Enabling info about calls           : No error.     Enabling info about USSD            : No error.     SIM phonebook        :  42 used,  38 free     Dialled numbers      :   2 used,  28 free     Received numbers     :   0 used,  30 free     Missed numbers       :   0 used,   0 free     Phone phonebook      :  55 used, 945 free     ToDos                :   0 used, 353 free     Calendar             :  27 used, 353 free     Battery level        : 25 percent     Charge state         : battery connected, but not powered from battery     Signal strength      : -83 dBm     Network level        : 100 percent     SIM SMS status       : 0 used, 0 unread, 13 locations     Phone SMS status     : 1 used, 0 unread, 200 locations     Network state        : home network     Network              : 208 10 (SFR, France), LAC 6414, CID 0000AC99      I thought I could do something like this in my bash script :               #!/bin/bash          gammu monitor |     tail -n 1 |     if[[ "$1"=="Press*" ]]     then       echo "yes"     else       echo "no"     fi;      In order to check if, for example, battery level line, number is > to 50 (exit 0), > 25 exit 1, and < 25 exit 2. Atm, I just wanted to test if the first line begin with `Press` but ofc it doesn't work ! Objectives : Nagios uses this script as a plugin, to check if `gammu monitor` returns good values, if not, goes to `warning` or `critical` Thansk in advance


title: Qemu: No file system could mount root (unable to mount roofs)

text: In Linux, I've created the root file system (rootfs) by following commands:               dd if=/dev/zero of=ramdisk.img bs=1M count=4     mkfs.ext2 ramdisk.img     sudo mount -o loop ramdisk.img rootfs     sudo cp init rootfs      sudo mkdir rootfs/dev     sudo mknod rootfs/dev/console c 5 1     sudo mknod rootfs/dev/ram b 1 0     sudo umount rootfs      but when I run qemu by following command, it say: No file system could mount root               qemu -kernel arch/x86/boot/bzImage  -initrd ../qemu-i386/ramdisk.img  -append "root=/dev/ram init=/init"      ![enter image description here](http://i.stack.imgur.com/UlXZ7.png) What the problem with my instructions?


title: Encrypt word X to /etc/shadow encryption

text: I've changed my password to X and the shadow file has changed to:               ahmad:$1$oYINSKjP$eCkCtJV/2dXerAD57WQPj/:15425:0:99999:7:::      I see the encrypted `X` as `$1$oYINSKjP$eCkCtJV/2dXerAD57WQPj/`. How can I retrieve the encrypted `X` without changing the password? openssl or any other command to use?


title: Simple terminal emulator (themable) with mark-as-copy with 'universal' $TERM

text: I have a need for very simple terminal (no multiple tabs, no menu etc. - I use XMonad so splitting windows is not necessary as well). I tried to use xterm but unfortunately I need to be able to copy'n'paste while my middle mouse button does not work. I also tried to use st but it uses it's own termcap, which breaks many remote programs on any system it's not installed on. (Any option to make xterm copy to clipboard on mark or st use TERM=xterm is also acceptable).


title: What's this SSH error about "incorrect RSA1 identifier" and "unspecified GSS failure"?

text: How can I fix this SSH problem? ## SSH debug errors When issuing `ssh -vvv user@host` the output includes the following debug messages:               [...]     debug3: Incorrect RSA1 identifier     debug3: Could not load "/home/user/.ssh/id_rsa" as a RSA1 public key     [...]     debug1: Unspecified GSS failure.  Minor code may provide more information     Credentials cache file '/tmp/krb5cc_1000' not found     [...]      ## The symptom of the problem My SSH keyring is not automatically unlocked at system login. I'm asked for the passphrase each time. ## My temporary fix I give the command `ssh-add` I will no longer be asked for my passphrase for the rest of that session. Running on Linux Mint.


title: Recommendations for good MTA / groupware solutions?

text: I'm setting up a Debian server, and one of the things I need on it is an MTA. I don't want to use something like Exim or Postfix because I want something that ties in SMTP, POP3, and IMAP all in one (a la Microsoft Exchange). Most MTAs also seem to be hellishly difficult to configure. Try and read the Exim documentation; you could do a university degree on it (I'm not kidding). When you can get an HTTP server like Cherokee which is easy to configure and has a nice web interface, do MTAs or groupware solutions need to be that hard? I'm aware that some people think "the Unix way" is to have lots of different interacting pieces of software (like maybe an SMTP MTA, POP3 service, webmail service, and overarching manager to tie them all together), but I think this is a situation where that just makes things a lot harder to deal with and one large software suite fits in much more nicely. So, I'm looking for good open source software suites that will run on Debian that:   * Combine (at least) SMTP, POP3, and IMAP   * Are easy(ish) to configure   * Have a nice configuration web interface or GUI   * Are not defunct projects I don't mind if it's groupware and offers calendaring too, but I would only be using the e-mail functionality for now. Another nice-to-have would be built-in webmail (if we're combining a bunch of functionality, why not?) The suites I've found so far that seem to match the above criteria (and have appropriate licenses) are Citadel, Kolab, and Zimbra. I'd appreciate anyone who has experience with any of these giving me the pros and cons of them, such as how easy they are to configure and what their performance is like. I'd also appreciate any other suggestions for solutions that fulfil my criteria that I may have missed out.


title: rc.local with read will not echo key strokes

text: I'm using CentOS 6.4 and have a small problem with using `read` in `/etc/rc.local` file. It will allow keyboard entry but does not echo any of the key strokes during input. This is something that worked fine in CentOS 5.5. Anyone know what's going on here?               #!/bin/sh     #     # This script will be executed *after* all the other init scripts.     # You can put your own initialization stuff in here if you don't     # want to do the full Sys V style init stuff.     echo -n "name? "     read name     echo "Name: $name"     touch /var/lock/subsys/local      produces (`/var/log/boot.log`): `name? Name: john`


title: Suddenly lost all cronjobs

text: All of a sudden my `cron` jobs don't work any more. When I type               crontab -e      I am presented an empty file in the editor               /tmp/crontab.3fMYGi/crontab      And by empty I mean that not even this standard `cron` job info is there any more. Is there a way to recover my `cron` jobs?


title: What is a good way to get inverted colors for most text-display purposes?

text: My monitor is not the best in the world and I find reading black on white unpleasant. Where I could (gedit, terminal) I changed the colour to something more relaxing for me - like the Kobalt scheme in Gedit, or green on black for the terminal. This helps my eyes. Now, I wonder what would be the most economical way to get most of my software to display text like this? most economical means that I don't want to tweak the settings of every single program (if can be avoided), most of my software would be iceweasel, liferea and icedove. I've looked at doing this via a colour scheme (high contrast inverted) in Gnome3 without success - with liferea and icedove, menus and sidebars had the inverted color scheme but the parts where actual text is displayed where still black on white. Maybe there's a better scheme for this purpose? I'm looking for a way to tweak few settings and achieve a result across many applications. If this is not possible, poit it out and I will aks seprate questions. My setup is Debian stable with Gnome3.


title: Removing windows partition from dual-boot

text: I have a dual boot of Windows 8 and Linux Mint 14. I want to remove the windows partitions and format them to ext4.               sudo fdisk -lu      gives me this..               Disk /dev/sda: 320.1 GB, 320072933376 bytes     255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0xa1fadbd9             Device Boot      Start         End      Blocks   Id  System     /dev/sda1   *        2048      411647      204800    7  HPFS/NTFS/exFAT     /dev/sda2          411648   530764799   265176576    7  HPFS/NTFS/exFAT     /dev/sda3       530767870   594198527    31715329    f  W95 Ext'd (LBA)     /dev/sda4       594199552   625142447    15471448   12  Compaq diagnostics     /dev/sda5       530767872   534962175     2097152   82  Linux swap / Solaris     /dev/sda6       534964224   594198527    29617152   83  Linux      What I want to do is delete `/dev/sda1` and `/dev/sda2` partitions, and create 2 new ext4 partitions with the arising unallocated space. I can do this using gparted. Now, here are my questions -   1. `/dev/sda1` has the boot flag set, would it be a problem if I delete /dev/sda1 partition to boot linux afterwards. Does Linux need the boot flag to be set?   2. Will I need the `/dev/sda4` partition after completely removing Windows partitions? Can I delete `/dev/sda4` and use it too?   3. I have backed up the files I need from the Windows partitions. I do not plan to touch the existing Linux partitions, Is there still any risk involved?