title: Stop a task based on output

text: I have a task that runs written in Mono, however sometimes (randomly) the Mono runtime will hang after the task is complete and just print:               _wapi_handle_ref: Attempting to ref unused handle 0x2828     _wapi_handle_unref_full: Attempting to unref unused handle 0x2828     _wapi_handle_ref: Attempting to ref unused handle 0x2828     _wapi_handle_unref_full: Attempting to unref unused handle 0x2828     ...      to stderr forever. Is there a way of parsing stderr and killing the task when a certain pattern is matched? A timeout is out of the question because the task can legitimately take upwards of an hour to complete normally, but if there is no work to be done will exit instantly (or at least it's supposed to).


title: Linux server crash (kernel NULL pointer dereference + soft lockup - CPU#1 stuck)

text: I have a Linux 3.2.0-4-amd64 #1 SMP Debian 3.2.46-1 x86_64 GNU/Linux server that keeps crashing, usually once every 24-72 hours. I'm running `lighttpd`, `mysql`, `haproxy` and a couple of always-running `java` processes together with a bunch of shorter-lived `java` processes. Below I have linked the `/var/log/syslog` and `/var/log/messages`. They both contain the kernel NULL pointer dereference and the soft lockup bugs lines.   * syslog: http://pastebin.com/7VxdkEYu   * messages: http://pastebin.com/UdiN2y0d Does anyone have any idea on how to debug this?


title: Adding paths to PATH using a multi-line syntax

text: As far as I understand, the usual way to add a path to the `PATH` environment variable is by concatenating paths separated by the `:` character. For example, if I want to add three paths to it `/my/path/1`, `/my/path/2` and `/my/path/3`, I would have to do it as follows:               PATH=$PATH:/my/path/1:/my/path/2:/my/path/3      which is not easy to read. Is there a way to **define** or **add** paths to the `PATH` variable using a **multi-line syntax**? Perhaps using arrays? I am looking for something like this:               PATH =      $PATH     /my/path/1     /my/path/2     /my/path/3      In case there are interesting solutions that are shell specific, I am looking for a solution in zsh.


title: Can't get to desktop

text: After installing a base command line install of Ubuntu 10.04, I installed slim and xfce which worked fine for the first 2 or 3 reboots. However, now when I start up, it gets to the slim login screen, I enter in my username and press enter, then I just get a black screen with a couple of random looking characters at the top left of the screen. Why might this have started to happen?


title: Make vim / curl recognize https:// links

text: I recently noticed vim/vimdiff can open links (using curl, it seems), which is an awesome feature. I wanted to use it today, like this: vimdiff deps https://raw.github.com/symfony/symfony-standard/v2.0.10/deps But the `https://` does not seem to trigger this awesome mechanism too. There is no authentication on this page, I think `https://` is just there to provide data encryption. How can I force vim to recognize the `https://` protocol?


title: Why do I need to hit enter to get my shell prompt after my init.d script completes?

text: I had to write my own CentOS init.d script for celery because it only ships with one for Debian. You can see the script I wrote when I answered my own stack overflow question 3989656. But there's a problem with this script. if I invoke it:               sudo service celeryd start      then I need to hit enter to get a shell prompt after it completes. This is a problem because I want to invoke it via ssh from another machine by doing:               ssh 192.168.2.3 sudo service celeryd start      and ssh never returns. (I use fabric to start and stop remote services, and this hangs it because it invokes the ssh command above). What would cause this behavior, and how do I fix it in my script? Note that if I do "sh -x /etc/init.d/celeryd" as recommended by Thomas Themel in the comments, the output is:               runuser -s /bin/bash - apache -c 'ulimit -S -c 0 >/dev/null 2>&1 ; /usr/local/django/portalapps/manage.py celeryd --pidfile /var/run/celery.pid -f /var/log/celeryd.log -l INFO'      I don't understand how the daemon function in /etc/init.d/functions (which is what produces this series of bash commands) actually daemonizes the process.


title: sbopkg is not working with proxy

text: Sbopkg used to work on my computer untill the network admin started to make a compulsory for the user to use proxy before connecting to the Internet. So, when I tried to sync to slackbuilds, I'm getting these errors:               root@meh:~# sbopkg -r     Syncing with the remote repository into /var/lib/sbopkg/SBo/13.1.     rsync: failed to connect to slackbuilds.org: Connection timed out (110)     rsync error: error in socket IO (code 10) at clientserver.c(122) [Receiver=3.0.7]          Rsync reported a socket error which may be due to     a problem with the LINK value in sbopkg.conf.     (The repo's LINK is currently set to: slackbuilds.org::slackbuilds/13.1).     Please check your settings and try again later.


title: What is the most complete MS Word alternative?

text: I need to edit `*.doc` and `*.docx` files on Linux. What should I use?   * Emulation + MS Office   * OpenOffice   * OpenOffice variants   * Alternatives?


title: Should I install an antivirus?

text: Are builtin security features allied to secure user behavior enough to protect a Linux system? Or should I install an antivirus software?


title: yum installs an old version of cmake

text: For some reason when I run `yum` to get cmake it will install an older version. Could it be because my repo list is not complete? I'm on CentOS 6 using a minimal desktop install from the non-net install CD. Could anyone give me a repo link or something? Same thing happens on Scientific Linux. I would take compiling it myself as a last resort because I'm trying to ma `yum install cmake` work in a bash script.


title: Which library files are needed to run a binary with an alternate libc version?

text: I built Firefox 26 on Mint 16 because the Ubuntu 10.04 build utilities are too old to build it. It does need to run on 10.04, however, since that's the target OS I'm building for. It built and runs just fine on Mint 16. When moving the package over to 10.04 and attempting to run, I get errors because the OS uses a different libc version than Firefox was built against. The actual error is:               /lib/libc.so.6: version `GLIBC_2.17' not found      I've been doing a lot of research trying to solve this, and so far have discovered the following: I can point a binary at an alternate path for library files with               export LD_LIBRARY_PATH="/opt/lib"      I placed the `libc.so.6` from Mint 16 into `/opt/lib` on 10.04 and ran the above command. But after changing that variable, i get:               error while loading shared libraries: __vdso_time:        invalid mode for dlopen(): Invalid argument      Not just for firefox, but for every command, including things like `ls`. A bit more research suggests that I need a _set_ of library files to make this work, not just `libc.so.6`. The problem is, I don't know which ones I need to copy over? Then I discovered `ldd`. `ldd ./firefox` shows:               ./firefox: /lib/libc.so.6: version `GLIBC_2.17' not found (required by ./firefox)         linux-vdso.so.1 =>  (0x00007fffe9289000)         libpthread.so.0 => /lib/libpthread.so.0 (0x00007f80ee456000)         libdl.so.2 => /lib/libdl.so.2 (0x00007f80ee252000)         libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f80edf3d000)         libm.so.6 => /lib/libm.so.6 (0x00007f80edcba000)         libc.so.6 => /lib/libc.so.6 (0x00007f80ed934000)         /lib64/ld-linux-x86-64.so.2 (0x00007f80ee68b000)         libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007f80ed71c000)      And I thought, "maybe I just need to copy all of those on the list". Except I couldn't find a `linux-vdso` anywhere on Mint 16, and it's vdso that is being complained about. So my question is, which libraries do I need to move from Mint 16 to Ubuntu 10.04 into /opt/var, to make Firefox run on 10.04?


title: Downgrade php version on debian

text: I have a big problem with my sites after I migrated to a new server.   The only difference is the php version. On the old server I have `5.3.3-7+squeeze15` and on the new server there is `5.3.3-7+squeeze17`. Can I downgrade to the older version? If so then how? The distro I'm using is Debian Squeeze 6.0.8.


title: Invoking PolicyKit/polkit via xinit/startx?

text: I recently upgraded a minimal installation of Ubuntu (with no full-fledged DE) from precise to saucy and since doing so I'm no longer able to mount removable drives as a normal user. I googled a bit and found it's something related to policykit... but I can't find any example of how to invoke policykit in an .xinitrc file, i.e., without using a display manager. Also, the Ubuntu repos have the following packages:               lxpolkit     policykit-1     policykit-1-gnome     policykit-desktop-privileges      and they each have similar descriptions, so I'm not even sure which of them I should install. Does anyone using startx/xinit to start X have a working config with policykit and/or instructions they can share?


title: Check if folder is a mounted remote filesystem

text: What is the best way (reliable, portable, etc.) to check if a given folder is on a mounted remote (nfs) filesystem within a shell script? I am looking for a command that would look like:               chk-remote-mountpoint /my/path/to/folder


title: How to connect to Wi-Fi network in Arch Linux?

text: tl;dr After reading the Arch wiki articles on installation, wireless setup and WPA supplicant, trying the suggestions below and a host of forum threads, I'm unable to get _either_ of the following cards to connect to my wireless network when booting the Arch Linux 2013-09-01 ISO:   * Edimax Technology Co., Ltd EW-7811Un 802.11n Wireless Adapter (ID 7392:7811)   * Realtek Semiconductor Corp. RTL8192CU 802.11n WLAN Adapter aka. Bolse® 300Mbps Wifi Wireless N USB Micro Mini Adapter (ID 0bda:8178) * * * Approach 1 (default): The default way of doing this is supposed to be just `systemctl stop dhcpcd.service` followed by `wifi-menu`. It finds the network:               [SSID] + wpa 10      After a timeout it reports that the connection failed. If I run `wifi-menu` a _second_ time it doesn't ask for a password, but when finished it finally gives some debug hints:               Job for netctl@wlp0s29f7u5\x2dBTHub4\x2dGRK6.service failed. See 'systemctl status netctl@wlp0s29f7u5\x2dBTHub4\x2dGRK6.service' and 'journalctl -xn' for details.      The former reports that the service is "loaded" but not "active" (literally `inactive (dead)`). The latter says:               WPA association/authentication failed for interface 'wlp0s29f7u5'      Does this mean the key in `/etc/netctl/wlp0s29f7u5-BTHub4-GRK6` is wrong? I can't tell when programs want the _actual_ Wi-Fi password and when they want something like the `psk` value from `wpa_passphrase` (`man 5 netctl.profile` doesn't say, for example). * * * Approach 2 (`wpa_supplicant` and `wpa_passphrase` as per deeraf and warl0ck's suggestions and the wiki page):               # echo 'ctrl_interface=/var/run/wpa_supplicant' > wifi.conf     # wpa_passphrase essid passphrase >> wifi.conf     # wpa_supplicant -B -i interface -c wifi.conf     Successfully initialized wpa_supplicant     # dhcpcd -A interface     [...]     timed out     exited      * * * I tried connecting with `iw` directly, but got some strange output:               # iw dev wlp0s26f7u5 connect [SSID]     command failed: Operation not supported (-95)


title: How to install software from Arch boot disk to existing Arch system?

text: I've got an existing Arch Linux installation. After booting from the installation media, is there some way to install software either from the installation media or using the network I've set up using the installation media (that is, without setting up networking again after an `arch-chroot`)? The use case is that my installation with the base system doesn't seem to have the `wireless_tools` package installed which seems to be necessary to get a wireless connection. Since setting up a wired connection is infeasible at the moment, it would be great to use the boot disk for this.


title: Can I `ls` all files in a directory from "1", "2",...,"9", "10", "11", ..., "20", "21", ...?

text: I have a directory with files named "1", "2",...,"9", "10", "11", ..., "20", "21", ... inside. Can I list them in the order of "1", "2",...,"9", "10", "11", ..., "20", "21", ...? I have tried `ls -ls`. It doesn't list the files that way, but instead "1", "10", "11", ..., "19", "2", "20", "21", .... I guess a feature like that will be helpful sometimes.


title: Syntax of DISPLAY=:0 unity --replace or DISPLAY=:0 compiz --replace

text: Why don't the commands have a & between the setting of DISPLAY and running unity or compiz. I understand that both work (re-starting unity or compiz), but fail to see why are they the way they are.


title: How can I trap a program that returns 139 (segmentation fault) in bash?

text: I have a bash script that tests some programs and one of the program returns `Segmentation fault` so I tried to add a trap in the head of my script:               trap "echo 'segfault occured!'" SIGSEGV      That however didn't do anything. I used               echo $?      just after the program that produces the segfault and I get **139** as output. How can I add a trap for that specific error code?


title: Xen HW virtualization on Power architecture?

text: https://en.wikipedia.org/wiki/Xen#Hardware- assisted_virtualization.2C_allowing_for_unmodified_guests The wikipedia page says Xen has HW virtualization for Intel and AMD CPU's. **Q:** Does Xen supports HW virtualization on Power architecture? ps.: regarding: http://www.zdnet.com/ibm-and-linux-the-next-billion- dollars-7000020757/


I started an upgrade of my Kubuntu 12.04 system with this command, as usual:               sudo apt-get --show-upgraded dist-upgrade      I came back later and it had failed:               Preconfiguring packages ...     (Reading database ... 478306 files and directories currently installed.)     Preparing to replace  ...     Unpacking replacement base-files ...     Processing triggers for man-db ...     Processing triggers for install-info ...     ...     Processing triggers for initramfs-tools ...     update-initramfs: Generating /boot/initrd.img-3.8.0-32-lowlatency          gzip: stdout: No space left on device     E: mkinitramfs failure cpio 141 gzip 1     update-initramfs: failed for /boot/initrd.img-3.8.0-32-lowlatency with 1.     dpkg: error processing initramfs-tools (--unpack):      subprocess installed post-installation script returned error exit status 1     Errors were encountered while processing:      initramfs-tools     E: Sub-process /usr/bin/dpkg returned an error code (1)      here's the problem: $ df -h output:               Filesystem                    Size  Used Avail Use% Mounted on     /dev/sda1                     894M  879M     0 100% /boot      manually deleted older files and now some space is free               Filesystem                    Size  Used Avail Use% Mounted on     /dev/sda1                     894M  129M  717M  16% /boot      I ran this next:               sudo apt-get autoremove      Next: `sudo apt-get -f install` output:               The following extra packages will be installed:       initramfs-tools     The following packages will be upgraded:       initramfs-tools          dpkg: dependency problems prevent configuration of initramfs-tools:      initramfs-tools depends on initramfs-tools-bin (<< 0.99ubuntu13.3.1~); however:       Version of initramfs-tools-bin on system is 0.99ubuntu13.4.     dpkg: error processing initramfs-tools (--configure):      dependency problems - leaving unconfigured     No apport report written because the error message indicates its a followup error from a previous failure.                              Errors were encountered while processing:      initramfs-tools     E: Sub-process /usr/bin/dpkg returned an error code (1)      `sudo apt-get install initramfs-tools`   the above fails `dpkg -l initramfs-tools` output:               Desired=Unknown/Install/Remove/Purge/Hold     | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend     |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)     ||/ Name           Version        Description     +++-==============-==============-============================================     iF  initramfs-tool 0.99ubuntu13.3 tools for generating an initramfs      `sudo apt-get install --reinstall initramfs-tools` output:               The following packages will be upgraded:       initramfs-tools     1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.     1 not fully installed or removed.     Need to get 0 B/49.2 kB of archives.     After this operation, 0 B of additional disk space will be used.     dpkg: dependency problems prevent configuration of initramfs-tools:      initramfs-tools depends on initramfs-tools-bin (<< 0.99ubuntu13.3.1~); however:       Version of initramfs-tools-bin on system is 0.99ubuntu13.4.     dpkg: error processing initramfs-tools (--configure):      dependency problems - leaving unconfigured     No apport report written because the error message indicates its a followup error from a previous failure.                              Errors were encountered while processing:      initramfs-tools     E: Sub-process /usr/bin/dpkg returned an error code (1)      Here is the output of `apt-cache policy initramfs-tools-bin initramfs-tools`:               initramfs-tools-bin:       Installed: 0.99ubuntu13.4       Candidate: 0.99ubuntu13.4       Version table:      *** 0.99ubuntu13.4 0             500 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages             100 /var/lib/dpkg/status          0.99ubuntu13 0             500 http://us.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages     initramfs-tools:       Installed: 0.99ubuntu13.3       Candidate: 0.99ubuntu13.4       Version table:          0.99ubuntu13.4 0             500 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages      *** 0.99ubuntu13.3 0             100 /var/lib/dpkg/status          0.99ubuntu13 0             500 http://us.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages      As suggested below, here are my next steps:               $ sudo apt-get update     $ sudo apt-get -f install initramfs-tools=0.99ubuntu13 initramfs-tools-bin=0.99ubuntu13          Reading package lists... Done     Building dependency tree            Reading state information... Done     The following packages were automatically installed and are no longer required:       ...     Use 'apt-get autoremove' to remove them.     The following packages will be DOWNGRADED:       initramfs-tools initramfs-tools-bin     0 upgraded, 0 newly installed, 2 downgraded, 0 to remove and 4 not upgraded.     1 not fully installed or removed.     Need to get 59.2 kB of archives.     After this operation, 2,048 B disk space will be freed.     Do you want to continue [Y/n]?      Get:1 http://us.archive.ubuntu.com/ubuntu/ precise/main initramfs-tools all 0.99ubuntu13 [49.2 kB]     Get:2 http://us.archive.ubuntu.com/ubuntu/ precise/main initramfs-tools-bin amd64 0.99ubuntu13 [9,988 B]     Fetched 59.2 kB in 0s (124 kB/s)                 dpkg: warning: downgrading initramfs-tools-bin from 0.99ubuntu13.4 to 0.99ubuntu13.     (Reading database ... 478624 files and directories currently installed.)     Preparing to replace initramfs-tools-bin 0.99ubuntu13.4 (using .../initramfs-tools-bin_0.99ubuntu13_amd64.deb) ...     Unpacking replacement initramfs-tools-bin ...     Setting up initramfs-tools-bin (0.99ubuntu13) ...     dpkg: dependency problems prevent configuration of initramfs-tools:      initramfs-tools depends on initramfs-tools-bin (>= 0.99ubuntu13.3); however:       Version of initramfs-tools-bin on system is 0.99ubuntu13.     dpkg: error processing initramfs-tools (--configure):      dependency problems - leaving unconfigured     No apport report written because the error message indicates its a followup error from a previous failure.                              Errors were encountered while processing:      initramfs-tools     E: Sub-process /usr/bin/dpkg returned an error code (1)      Next I tried Giles's suggestion:               sudo dpkg --configure -a --force-depends     sudo apt-get install -f     sudo apt-get dist-upgrade      **Result: it is solved! Thanks!**


title: How to change which program is executed by default

text: Surely this is an easy question, that I just don't know how to search for, but if I have two identically named executable files, one in _/usr_ and one in _/usr/local_ (for example), how can I change which one is executed by default without specifying the path, as in _/usr/local/file_ , if `$ which` returns _/usr_? Centos6.4 btw.


title: Gnome3/cinnamon set keyboard shortcut

text: I cannot find where I can set keyboard shortcut for switching languages. **Update:**   New problem: I cannot set `Alt`+`Shift` combination for that.


title: Why I cannot download pdf files?

text: I use Debian (Linux) and since some day I cannot download any `.pdf` file. I don't know if it's because of the web browser (I'm using Epiphany and the other ones do not work). I don't know how to use the terminal properly, so any simple answer would be welcome.


title: Can't connect to a wireless network in Arch Linux netctl

text: I just installed arch linux on my laptop.   But after rebooting, I can't connect to the internet.   Wi-fi is the only available connection to me.   I used the command wifi-menu then after choosing my wifi and entering my passkey, I still can't connect to the internet.   This is the error I got:   > Job for netctl@wlp6s0\x2dWifi.service failed. See 'systemctl status > netctl@wlp6s0\x2dWifi.service' and 'journalctl -xn' for details.   > This the output after running systemctl status netctl@wlp6s0\x2dWifi.service > netctl@wlp6s0\x2dWifi.service - Networking for netctl profile wlp6s0x2dWifi   >  Loaded: loaded (/usr/lib/systemd/system/netctl@.service; static   >  Active: inactive (dead)   >  Docs: man:netctl.profile(5) Please help. I tried to follow the wiki for netctl but it doesn't work. Maybe i just missed something.


title: Sound is staticy on Squeeze

text: I have recently setup a Debian Squeeze virtual machine, which uses OpenBox, via VirtualBox and got things work somewhat right, but I am having issues with sound. When I launch Google Chrome, which is the only browser I have in the VM, and go to YouTube, in order to test the sound via a video, everything sounds staticy. How do I get rid of the static? This is what the machine reports to be the sound card > 00:05.0 Multimedia audio controller: Intel Corporation 82801AA AC'97 Audio > Controller (rev 01)


title: The -F option for ls

text: For command `ls`                  -F, --classify               append indicator (one of */=>@|) to entries      Wikipedia says `*` represents executable and `/` dir. Regular files are not followed by any of the above symbols. But `*` follows text file and pdf file too. Are they executables? Do the `-F` indicators always mean same as the first field in `-rwxrwx---`? It seems like there is no difference between hardlinks and the files in either the `-F` indicators or the first field in `-rwxrwx---`. How do you distinguish them? Thanks.


title: Will a '*' (star) in globbing match only characters (i.e , a-z and 0-9)?

text: I havie a simple question here: does a `*` (star wildcard) match only characters (letters and numbers) in glob style? Or will it also match special characters? In bash, `*` matches everything, while in csh `*` it matches only alphanumeric characters. Is there any rule of compatibility for this? Can anyone clarify?


title: Using port 587 with sendmail

text: I have been using sendmail to send out mails using internally available mail server. But currently port 25 is blocked for security reasons. I would like to know if there is a way to specify port number in the sendmail utility. I am trying to make use of the secure SMTP-MSA port 587 as an alternative assuming I could get that port opened up. I was not able to find anything in the man pages for sendmail. Is there any alternate utility that could do this?


title: Running a command without ./

text: I am trying to understand something that might be very simple for a lot of you but is quite puzzling from me as a daily Windows user. I am following the docker installation on Mac OS X. One of the steps is:               $ chmod +x boot2docker      The next step is using boot2docker like this:               $ boot2docker init      However this does not work for me. What works is:                $ ./boot2docker init      So the tutorial assumes that I need to implicitly run with `./` or is there a way in bash to avoid typing that and execute something?


title: Mac Terminal - moving files

text: I am trying to use Mac Terminal command to move files to a new location. I have a list of almost 2000 filenames with full paths in a text file. (All of them are in one parent directory, but distributed within multiple sub- directories.) I want to move these files into a single folder outside the parent directory. How do I do this? I need the command to do something like this:               mv 'files listed in abc.txt' to destination      Thanks in advance.


title: how to make getopts just read the first character post `-`

text: I have a shell script `testShell.sh` which uses `getopts` as below:               #!/bin/bash     while getopts ":j:e:" option; do         case "$option" in             j) MYHOSTNAME=$OPTARG ;;             e) SCRIPT_PATH=$OPTARG ;;             *) ;;         esac     done          echo "j=$MYHOSTNAME"     echo "e=$SCRIPT_PATH"     shift $((OPTIND - 1))     echo "remaining=$@"      When I test run it like following:               $ testShell.sh  -jvalue1 -evalue4 -Djvalue3  -pvalue2      The output which I get is following:               j=value3     e=2     remaining=      But I would like the output as:               j=value1     e=value4     remaining=-Djvalue3 -pvalue2      **Is it possible to make sure that** `getopts` **only looks at first character post** `-` **symbol?** so that it doesn't interpret `-Djvalue3` as `-jvalue3` and `-pvalue2` as `-e2`.


title: Print a multiline variable in a column

text: I have a script that collects values from a cluster. The values, in some cases, have multiple lines. I have a printf format that specifies how the data should be positioned however, it doesn't take into account multiple lines and therefore the spacing is skewed.               The data should look like this:          Service Group          AutoStart List          System List     foo                    sys1                    sys1                            sys2                    sys2      Instead it looks like this               Service Group          AutoStart List          System List     foo                    sys1                         sys2                    sys1     sys2      The AutoStart List and System List should be identical, however regardless of that fact I've not figured out how to force the values into the correct columns.               sgheader="\n\033[4m\033[1m%-30s %-30s %-15s\033[0m\033[0m"     sgformat="\n%-30s %-30s %-15s"                    printf "${sgheader}" "Service Group" "Autostart List" "System List"      printf "${sgformat}" "${svcgroup}" "${autostrtlist}" "${hosts}"


title: Use CTRL-SPACE to open menu on Linux Mint

text: I'd like to use the keyboard shortcut `CTRL` + `SPACE` to open/close the Linux Mint menu (similar to how `Command` + `SPACE` is used on OS X to show/hide Spotlight). I tried going to Settings -> Keyboard -> Shortcuts -> Cinnamon and setting `CTRL` + `SPACE` for the key "Menu button". Upon restarting, the key combination doesn't work at all. This is a vanilla install of Linux Mint 17.


I, actualy, don't know where to ask this, but this can be related to Linux. **Firefox on Arch Linux always asks about download destination** , even if there's a default download destination folder set up through options interface or even about:config. **How can I fix that?** _Additional info:_ It's been normal till 22.0. I've tried to re-create profile or even create new, clean one, and try there and still got the same problem. I've also tried to ask this question on #firefox @ freenode, but haven't got any reply.


title: Virtual box for centos PAE

text: I am trying to get virtualbox to install on a very touchy box. It keeps complaining. /etc/init.d/vboxdrv setup KERN_DIR=/root/linux-2.6.18.5 That runs and gives this error:               Attempting to install using DKMS          Creating symlink /var/lib/dkms/vboxhost/4.1.0/source ->                      /usr/src/vboxhost-4.1.0          DKMS: add Completed.     You can use the --kernelsourcedir option to tell DKMS where it's located.     Failed to install using DKMS, attempting to install without     make KBUILD_VERBOSE=1 SUBDIRS=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 -C /root/linux-2.6.18.5 modules     test -e include/linux/autoconf.h -a -e include/config/auto.conf || (            \             echo;                                                           \             echo "  ERROR: Kernel configuration is invalid.";               \             echo "         include/linux/autoconf.h or include/config/auto.conf are missing.";      \             echo "         Run 'make oldconfig && make prepare' on kernel src to fix it.";  \             echo;                                                           \             /bin/false)            ERROR: Kernel configuration is invalid.              include/linux/autoconf.h or include/config/auto.conf are missing.              Run 'make oldconfig && make prepare' on kernel src to fix it.          mkdir -p /tmp/vbox.0/.tmp_versions     rm -f /tmp/vbox.0/.tmp_versions/*            WARNING: Symbol version dump /root/linux-2.6.18.5/Module.symvers                is missing; modules will have no dependencies and modversions.          make -f scripts/Makefile.build obj=/tmp/vbox.0       gcc -m32 -Wp,-MD,/tmp/vbox.0/linux/.SUPDrv-linux.o.d  -nostdinc -isystem /usr/lib/gcc/i386-redhat-linux/4.1.2/include -D__KERNEL__ -Iinclude  -include include/linux/     autoconf.h -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -O2 -pipe -msoft-float -mpreferred-stack-boundary=2  -ffreestanding -Iincl     ude/asm-i386/mach-default -fomit-frame-pointer  -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign -include /tmp/vbox.0/include/VBox/SUPDrvMangling.h      -I/root/linux-2.6.18.5/include -I/tmp/vbox.0/ -I/tmp/vbox.0/include -I/tmp/vbox.0/r0drv/linux -I/tmp/vbox.0/vboxdrv/ -I/tmp/vbox.0/vboxdrv/include -I/tmp/vbox.0/vboxd     rv/r0drv/linux -D__KERNEL__ -DMODULE -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -DVBOX_WITH_HARDENING -DCONFIG_VBOXDRV_AS_MISC -DRT_ARCH_X86      -DVBOX_WITH_64_BITS_GUESTS   -DMODULE -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(SUPDrv_linux)"  -D"KBUILD_MODNAME=KBUILD_STR(vboxdrv)" -c -o /tmp/vbox.0/linu     x/SUPDrv-linux.o /tmp/vbox.0/linux/SUPDrv-linux.c     cc1: error: include/linux/autoconf.h: No such file or directory      Is there anyone with experience compiling linux kernels (and hopefully virtualbox) that could help me with this?


title: Terminal application erased from Ubuntu 13

text: I had a bit of rough time with Ubuntu yesterday when the home screen went blank and no program icons or sidebars were visible. Today after recovering from it and saving the essential data, I have found that the terminal applications packed with Ubuntu has erased itself from applications and instead new terminal applications called UXTerm and xTerm have appeared in its place. They do almost the same job but have many limitation such as not being able to copy and paste from terminal screen. I really want to get back my old terminal application :(


title: Change the DNS server in etisalat USB modem

text: I need to use the open DNS : 208.67.222.222,208.67.220.220 in my network connection. I use etisalat 3.75 USB modem HUAWEI in my Ubuntu 12.04 PC. I had tried to add this DNS in : > /etc/network/interfaces > > /etc/resolv.conf with no success.


title: Debian Wheezy problem with packages and architectures

text: I recently installed Debian wheezy on my desktop PC. Here is the `uname -a` command:               Linux devnet 3.2.0-4-amd64 #1 SMP Debian 3.2.46-1+deb7u1 x86_64 GNU/Linux      Once the installation finished, I started installing some packages (chromium and JAVA7), but I've come across a problem and I don't know how to solve it. When trying to install chromium, I get the following error:               caled@devnet:~$ sudo apt-get install chromium      Then asks for password and lists packages to be installed, everything fine. But then I get:               /bin/sh: 1: /usr/sbin/dpkg-preconfigure: not found     dpkg: error processing /var/cache/apt/archives/libc-bin_2.13-38_amd64.deb (--unpack):      package architecture (amd64) does not match system (i386)     Errors were encountered while processing:      /var/cache/apt/archives/libc-bin_2.13-38_amd64.deb     E: Sub-process /usr/bin/dpkg returned an error code (1)      Ok, from that I get that it is having a problem installing the libc-bin package for the amd64 architecture, but that is the correct architecture for my PC, uname -a says so. I've tried multiple approaches: allowing i386 packages               sudo dpkg --add-architecture i386      Also installing dependencies:               sudo apt-get -f install      I also thought that it might be a trouble with my locales, but I generated my locales as root:               locale-gen      Finally, I gave it a shot by installing just the `libc-bin` package using synaptic, but still nothing has worked. Any ideas what I could be missing? Any help will be greatly appreciated, stating to feel frustrated...


title: Grub v2: kernel "has invalid signature"

text: Can somebody explain what this exact error message means?               grub> linuxefi /boot/i386/loader/linux     error: /boot/i386/loader/linux has invalid signature.      What is Grub trying to tell me? That the file isn't a valid ELF binary? Or that it isn't 64-bit? Or something else? (This is Grub v2.00, not Grub Legacy.)


title: Most innocuous package to install to test yum?

text: I'm trying to test yum is working in CentOS from a local repo. To do this I need a package that:   1. Isn't already installed with standard OS install   2. Is small in size   3. Has few or no dependencies   4. Doesn't affect everyday operation of OS or perform anything in the background   5. Is available in the standard repo So what package could I yum that would meet these criteria?


title: Using UART bluetooth module via hciattach

text: I have a bluetoothmodule here on my UART and would like to use it via hciattach. It is a KC21v6.3 Module from kc-Wirefree. As far I found out, it has a CSR-Chip on it. So is tried the following:               # hciattach -n -s 115200 /dev/ttyS0 csr      That gives me a "Initialization timed out." If I try the same with the type "any" it works so far that I get a "Device setup complete".               # hciconfig      gives me a:               hci0:   Type: BR/EDR  Bus: UART             BD Address: 00:00:00:00:00:00  ACL MTU: 0:0  SCO MTU: 0:0             DOWN              RX bytes:22 acl:0 sco:0 events:0 errors:0             TX bytes:150 acl:0 sco:0 commands:30 errors:0      But after that, when i try to               # hciconfig hci0 up      I always get an               Can't init device hci0: Connection timed out (110)      I have no idea what to try any-more. Don't I have to specify the "csr" chip? Or does it have anything to do with the firmware of my KC21 (it understands AT Commands and also has an "AT HciMode" Command) ... I already tried this one before using the "hciattach" command, but nothing changed. Any help would be appreciated. kindly regards Tom


title: Which drive had a "journal commit I/O error"?

text: I received a message:               kernel:[123456.789012] journal commit I/O error      Which disk drive had the journal error?


title: What does lo in iptables mean exactly?

text: I have seen countless examples of this rule in iptables:               -A INPUT -i lo -j ACCEPT      I thought `lo` means localhost (a.k.a. `127.0.0.1`), but when I commented it out, I can't access the server using its private ip address `192.168.1.3`, which means it is more than just localhost. Further, does this rule refers to the source ip, destination ip, or both. Meaning, if I were to spoof a source coming from `127.0.0.1`, would it be accepted? I tried looking in the man page but could not find an answer to this. It would be helpful if someone can point to me in the right direction.


title: -bash: pkcs12: command not found

text: I am trying to export the private key and certificate to p12 file using below command in my mac os X - Mountain Lion:               pkcs12 -export -out privkey.pem -inkey privkey.pem -in rsaCert.crt      but I am getting this error: > -bash: pkcs12: command not found To verify if it is there or not, I typed below man command:               man pkcs12      which is showing appropriate manual page. Any ideas?


title: Using the Echo Command with Sleep command

text: So I asked a question on here a few weeks ago and the response I got was helpful but I figured I would add some info to get a better response. I work with a computer system that has 8 servers (4 primary 4 alternates) and has 16 nodes on those servers (4 on each server with the same on each alternate). The nodes can't load until the servers come online. So I have been writing 2 lines of codes that are separate until I can figure out how to connect them together.               for i in `echo server1; echo server2; echo server 3; echo server4; echo server5; echo server6; echo server7; echo server8`; do     echo $i     /remcmd $i username password 'superuser /reboot'     echo     done      Then my second command would be               for i in `echo node1; echo node2; echo node3; echo node4; echo node5; echo node6; echo node7; echo node8; echo node9; echo node10; echo node11; echo node12; echo node13; echo node14; echo node15; echo node16     /remcmd $i username password 'superuser /reboot'      Is there a way to reboot the servers then wait for 9 minutes then to reboot the nodes. I have tried piping but did some research and it doesn't like it. Any help anyone could give, I would appreciate it.


title: Is there a limit of GPIOs that can be used in Linux?

text: When it comes to use GPIOs, is there a limited number that can be used in Linux (except through the limitation of the physical availability/amount of the ports/pins) or is it theoretically possible to use an infinite number of GPIOs in my program(s)?


title: Linux iptables DNAT 53306 to 127.0.0.1 3306

text: mysql real port is `3306`。 I want public network using `53306` to visit mysql, and `3306` is not allowed access from public network. How to write the iptables rules `DNAT 53306 to 127.0.0.1 3306`?


title: In meminfo, sometimes Mapped more than Cached

text: In `/proc/meminfo`, AFAIK > Cached >= Mapped But after `/proc/sys/vm/drop_caches`, it goes to > Cached < Mapped               Cached:            66132 kB     Mapped:            67792 kB      `/proc/meminfo` contents after:               MemTotal:         369020 kB     MemFree:           34588 kB     Buffers:             184 kB     Cached:            66132 kB     SwapCached:            0 kB     Active:           246624 kB     Inactive:          29688 kB     Active(anon):     209728 kB     Inactive(anon):     9920 kB     Active(file):      36896 kB     Inactive(file):    19768 kB     Unevictable:          12 kB     Mlocked:              12 kB     HighTotal:             0 kB     HighFree:              0 kB     LowTotal:         369020 kB     LowFree:           34588 kB     SwapTotal:             0 kB     SwapFree:              0 kB     Dirty:                 4 kB     Writeback:             0 kB     AnonPages:        210040 kB     Mapped:            67792 kB     Shmem:              9644 kB     Slab:              27520 kB     SReclaimable:       7500 kB     SUnreclaim:        20020 kB     KernelStack:        3160 kB     PageTables:         5004 kB     NFS_Unstable:          0 kB     Bounce:                0 kB     WritebackTmp:          0 kB     CommitLimit:      184508 kB     Committed_AS:    1832660 kB     VmallocTotal:     499712 kB     VmallocUsed:        2708 kB     VmallocChunk:     417128 kB      Anyone know this issue?


title: UNIX: Submit job only after previous job completes?

text: I would like to submit the same .sas job iterating over an argument, but I would like job only to be submitted after the previous is completed. Here is my attempt:                   #!/bin/ksh              export weeks="1 2 3"         for week in $weeks         do              sas -log job$week.log job.sas > /dev/null & pid_ind=$!         wait $pid_ind              echo "job complete for week $week"         done      This results in all the jobs being submitted almost at once, and then they sit in the queue. Can anyone elaborate on the 'wait' command? I am trying to hold off submission until the previous SAS job was _completed_ , not submitted.


title: Should apache still be making error_log files?

text: I have a VirtualHost set up like this               <VirtualHost my.ip.address.here:80>        DocumentRoot /home/todieama/public_html/dev/hop/public_html/        ServerName dev.example.com        ServerAlias dev.example.com        ErrorLog /home/todieama/public_html/dev/hop/public_html/application/logs/apache.log        ServerAdmin some@example.com        UserDir enabled todieama        <IfModule mod_suphp.c>          suPHP_UserGroup todieama todieama        </IfModule>     </VirtualHost>      When a PHP error is caught, it gets logged in the apache.log file defined above, and also in error_log in dev/hop/public_html. Should it still be logging here? I'd like to stop if it's possible.


title: Nginx with ngx_pagespeed (Ubuntu)

text: I need to install nginx with ngx_pagespeed. I use this instruction: https://github.com/pagespeed/ngx_pagespeed#how-to-build But when I finish installation, nginx file here:               /usr/local/nginx/sbin/nginx     /usr/local/nginx/conf/nginx.conf     /usr/local/nginx/logs/nginx.pid      And I've no nginx start script here:               /etc/init.d      And I can't run nginx like this:               service nginx start      And no nginx autorun. If I install nginx like this:               sudo apt-get install nginx      Nginx location:               /usr/sbin/nginx     /etc/nginx/nginx.conf     /run/nginx.pid      I can start nginx like this:               service nginx start      And nginx autostart after server rebooting and nginx process owner www-data. My question. Is it possible to install nginx with ngx_pagespeed but like standard configuration?:   1. Locations: /usr/sbin/, /etc/nginx/, /run/   2. Starting "service nginx start/restart/stop"   3. Autoload process after server rebooting   4. Use process owner www-data


title: Moving Older Version Files to another folder via a script

text: I am trying to find a way of getting my cmd script to look through my folder, find the older versions of the pdf docs in the folder and move them to another folder called older versions. Problem I am having is the name of the file changes with the version. IE DE-321-DLS-R04.pdf has become DE-321-DLS-R05.pdf I am not to sure where to start. I have seen scripts that use the date but filenames are different. Please help.


title: telnet :pressed Enter key, there were two carriage returns in the text

text: When using Putty to connect to the router using telnet protocols, and then I pressed Enter key, there were two carriage returns in the text, how do I get rid of one of them?


title: Putty use local internet proxy for remote machine

text: Is there a way you can use your local internet proxy for remote computer with tunneling via SSH. My machine has access to internet via proxy. But the remote computer does not. I don't have admin rights there. Here is the schematic :               Internet   Internet        /\         /\        ||         ||       proxy       XX        ||         ||        \/         \/        A<---SSH--->B      What I think I need to do is I have to remote port forward to a local port then forward that port to my proxyurl. What settings should be done in putty to make this work. Can anyone help.


title: Upgrading dpkg on 64-bit debian

text: Recently I tried to install Steam on my debian, but I ran into a problem. It requires `dpkg` version `1.16.2` (for multiarch) but the one installed on the system is `1.15.8.13` The problem is that running `apt-get install dpkg` tells me that `dpkg` is the newest version. My searches yielded absolutely nothing about this issue My machine:               Linux xel 2.6.32-5-amd64 #1 SMP Fri Feb 15 15:39:52 UTC 2013 x86_64 GNU/Linux      My sources.list:               # deb cdrom:[Debian GNU/Linux 6.0.6 _Squeeze_ - Official amd64 NETINST Binary-1 20120930-15:53]/ squeeze main          # deb cdrom:[Debian GNU/Linux 6.0.6 _Squeeze_ - Official amd64 NETINST Binary-1 20120930-15:53]/ squeeze main          #deb http://http.us.debian.org/debian/ squeeze main non-free contrib     #deb-src http://http.us.debian.org/debian/ squeeze main non-free contrib          #deb http://security.debian.org/ squeeze/updates contrib non-free     #deb-src http://security.debian.org/ squeeze/updates contrib non-free #Added by software-properties     #deb-src http://http.us.debian.org/debian/ squeeze/updates main contrib non-free          ## squeeze-updates, previously known as 'volatile'     #deb http://ftp.sk.debian.org/debian/ squeeze-updates main contrib non-free     #deb http://ftp.sk.debian.org/debian/ squeeze main contrib non-free     #deb-src http://ftp.sk.debian.org/debian/ squeeze main contrib non-free #Added by software-properties     #deb-src http://ftp.sk.debian.org/debian/ squeeze-updates main contrib non-free          deb http://ftp.sk.debian.org/debian stable main contrib non-free     deb-src http://ftp.sk.debian.org/debian stable main contrib non-free          deb http://ftp.debian.org/debian/ squeeze-updates main contrib non-free     deb-src http://ftp.debian.org/debian/ squeeze-updates main contrib non-free          deb http://security.debian.org/ squeeze/updates main contrib non-free     deb-src http://security.debian.org/ squeeze/updates main contrib non-free


title: "emacs: standard input is not a tty" when starting Emacs at login

text: I have Fedora 20 and Gnome3 classic, and I am trying to use the CTRL/ALT/Fn terminal windows. When I want to edit a file with emacs I use the following script so that my Hints file is automatically displayed and emacs is run as a backgound job. This works fine in the non-login terminal from Gnome desktop applications, but in the log-in terminal I get error messages: (obtained by redirection with '&> e' in the CTL/ALT/F2 window)                   home/Harry/bin/emx: line 4: t: Permission denied           +---------------------------------------------------+           | EmacsHints.txt found and displayed                |           | Usage: ./emx <filename> ..                        |           |   .. Opens EmacsHints.txt and <filename> in emacs |           +---------------------------------------------------+         emacs: standard input is not a tty      Please can someone explain these, and tell me how to avoid them and use the emx script (no doubt modified) successfully in both log-in and non log-in terminals? Revised version of my emx script, I have include my notes and debugging stuff:               #!/bin/sh     emxhn="EmacsHints.txt"     emxhf="/home/Harry/emacs/$emxhn"     ps aux | grep $emxhn > t     T=`wc -l t` # no spaces allowed between T and = and value     # echo $T     wc -l t > t1     T=`awk '$1' t1`     # echo $T          echo "+---------------------------------------------------+"          # In the test "" needed round $T else it is split into two commands ..     # .. so are the spaces after [ and before ]     # could be if ( [...] ) then or if [...] ; then      if [ "$T" = "2 t" ]; then      #  echo "+----------------------------------------------+"      echo "| $emxhn already present"\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \  "|"     else      emacs $emxhf &      echo "| $emxhn found and displayed"\ \ \ \ \ \ \ \ \ \ \ \ \ \ \  "|"     fi          if [ "$#" = "1" ]; then      emacs $1 &     else      echo "| Usage: ./emx <filename> .." \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \  "|"      echo "|" \   ".. Opens $emxhn and <filename> in emacs" "|"     fi            echo "+---------------------------------------------------+"      Yes, I see, I have fallen into the X-Y trap, asking X when I should have asked Y, so here's Y I use emacs a lot but not all the time, and I also have a Hints file, in which I note how to do the tasks I encounter, and I like to have these Hints available while I am using emacs. I tried to automate this so that whenever I start emacs, if the Hints are not already there, then the file is opened as well. That script was my attempt to do so, and has been ok while I have run emacs from a non-login terminal within my Gnome3 classic style GUI. Trying it in a log-in terminal with CTL/ALT/F2 gave the error messages quoted. I have used and loved Unix and Fedora Linux for many years, but obviously there's still an awful lot more to learn.


title: Linux command line. Move all files and directories in directory, except some files and directories

text: I have a folder `A` which has files and directories, I want to move all those files and directories to another folder `B`, except `file`, `file2`, `directory`, and `directory2`. How can this be done?


title: Cannot open GUI after ssh -X and chroot

text: I ssh ( with -X option ) to another computer then I I do a chroot. I then encounter problems running X11 apps. As one example, after the ssh I would run emacs and it would open a new window as a X11 app. After running the chroot and doing ssh I would see emacs running as a console app. I don't get errors since emacs can be run it as an X11 app or a console app, but with other GUI apps I get the error message:               "cannot open display: localhost:10.0"      PS: Just to head off anyone who wants to suggest checking $DISPLAY, that is set correctly. I was wondering if there are any logs to check to see if I can identify the problem.


title: Disk Partitioning - Can't create partition

text: I've been following this example to restore capacity to my microSD --> SD card corrupt and stuck at 32MB, any way to fix it? Everything seems to work until I get to               mkfs /dev/sdx1      It tells me there no such file or directory. If I go to my /dev directory it never created sdx1. I've tried several methods but nothing worked. Any suggestions?


title: Shell function definition: why is there a space after the opening brace?

text: You probably know of that fork bomb:                :(){ :|:&};: #WARNING: harmful code      I wonder why it is necessary, for it to parse, to include a space after the opening curly brace.


title: How to make `xargs` ignore child's exit and keep processing further

text: I sometimes run long `xargs` jobs overnight and it is really annoying to discover in the morning that `xargs` died somewhere in the middle, for example because of a segmentation fault in one single special case, as happened this night. If even one `xargs` child is killed, it does not process any more input: Console 1:               [09:35:48] % seq 40 | xargs -i --max-procs=4 bash -c 'sleep 10; date +"%H:%M:%S {}";'     xargs: bash: terminated by signal 15     09:35:58 3     09:35:58 4     09:35:58 2     <Exit with code 125>      Console 2:               [09:35:54] kill 5601      Can I somehow prevent `xargs` from stopping to process any more input once a child process dies and instead continue processing?


title: Make RPM Satisfy Dependency Requirements of Other Installed Packages

text: So, I am installing a java app that I wrote which uses jnetpcap. This requires libpcap of at least v1.0.0. My CentOS 5.8 only has libpcap 0.9.4, which is required by other installed packages. I've got the RPM for libpcap 1.4.0 built but when I try to install it, I get the following:               # rpm -Uvh /root/rpmbuild/RPMS/i386/libpcap-1.4.0-1.i386.rpm     error: Failed dependencies:             libpcap.so.0.9.4 is needed by (installed) ppp-2.4.4-2.el5.i386             libpcap.so.0.9.4 is needed by (installed) isdn4k-utils-3.2-56.el5.i386             libpcap >= 14:0.8.3-6 is needed by (installed) ppp-2.4.4-2.el5.i386      and checking the dependencies of one of those:               # rpm -qR ppp-2.4.4-2.el5.i386     ...     libpcap >= 14:0.8.3-6     libpcap.so.0.9.4      Updating the OS is a non-starter, plus, it's a closed system, never net connected, so it matters little. Now, I _may_ be able to remove the packages which are stalling things, but, assuming I cannot, how can I force the install of this package, such that it will satisfy the older dependency requirements? ie: have it "provide" libpcap 0.9.4 soas to satisfy the requirements of already installed software.


title: how to get string between braces along with string without braces using awk

text: My input is:               ABC_DFG_FRE     s(DFR_GHY_JUY)     BGR_KIU_PLO     s(VFR_KJU_MKJ)      output sholud be:               ABC_DFG_FRE     DFR_GHY_JUY        BGR_KIU_PLO       VFR_KJU_MKJ


title: Linux Mint 13 not installing

text: I just decided to move to Linux. I downloaded the Mint 13 iso and wrote it to a DVD. I installed it on my Win7 laptop with VMware workstation to test and all worked fine. So I decided to reboot my laptop so I can format and install Mint... But, it reboots and starts the loading process then hangs with this:               ISOLINUX 4.04 20110711 ETCD Copyright (c) 1994-2011 H. Peter Anvin et al      It does not start the installation or Live CD. I tested on my work laptop and it starts the proccess without delay. Can my old laptop be too old? 1.8ghz, 1gbram 120gb hdd.


title: KDE Kubuntu System Monitor ProcessTable.sgrd and SystemLoad2.sgrd malformed XML

text: When trying to open the System Monitor, I received an error saying that the files `ProcessTable.sgrd` and `SystemLoad2.sgrd` contain malformed XML. The resource graphs no longer appeared after the program loaded. How can I fix that?


title: How to invoke Gnome 3 activity screen using command line?

text: ### What I'm trying to do I'm using a Logitech MX Revolution mouse, which has a button below the scroll wheel mapped to search, which I remapped to middle click. For doing so, I had to remap `XF86Search` to middle click using `xbindkeys`, which works fine – when I change the "Search" hotkey to something else, for example `Ctrl`+`XF86Search` in the Gnome Settings. Now I want another mouse button to invoke the Gnome Activity screen (the one with the overview of open windows). `Alt`+`F1` also opens this view (or `Ctrl`+`XF86Search` now would do it, and even just pressing the super key). ### Invoking the Gnome Activity screen I try to send `Alt`+`F1` using               /usr/bin/xvkbd -text "\[Alt_l]\[F1]"      but it seems Gnome 3 does not fetch this key (which is not totally unexpected, as `xvkbd -text` sends it to the focussed window). What choices do I have do invoke the Gnome Activity screen?


title: Searching for a specific file with testdisk

text: Is there a way to recover just `.webm` files from a formatted partition using `testdisk` or `photorec`? I have not enough space to recover all files and then find `.webm` files afterwards.


title: Date computations without GNU tools

text: I have to perform some date calculations and conversion in a shell script. For example computing the difference in day between a date formatted as `Nov 28 20:27:19 2012 GMT` and today. There are several possibilities (GNU `date`, `gawk`, `perl`, etc.) but I would like to be able to run it on systems without GNU tools (e.g., BSDs, Solaris, etc.) At the moment the most portable solution I have is perl but it could require the installation of additional modules for the date conversion. What should I choose? **Edit** : looking at the comments I realized that I need to clarify that the tool I am writing will be publicly distributed. I am not looking on a way to perform computations on my machine r on how to install GNU tools. I want to use tools that are likely to be found on the majority of the machines.


title: Keep xscreensaver running

text: Every now and then, xscreensaver dies. When it does, my session unlocks and won't lock until I restart it. Is there a way to automatically detect that xscreensaver has died, restart it, and lock the session?


title: performance monitoring

text: Is there some performace monitoring tool which would run in background gathering info about all system activity? Somethimes my system (Arch linux, 32 bit) slows down terribly and the `top` utility doesn't show anything. I imagine some daemon which would gather info and log it, so when the slowdown pass away I would be able to find what was the problem.


title: Diskless workstations

text: For various reasons I need a setup with one server, and two diskless workstations. The workstations are to be "fat clients", which means I want to enable them to use their own CPU, memory, etc, for everything. Ideally, the workstation users should not have to notice that they are running diskless at all (except for the PXE booting, obviously...). The workstations should run OpenSuse (some version between and including 11.2 and 11.4) since that is what we use. They don't necessarily have to run a vanilla openSuse install, but as close as possible. The general idea is to PXE boot the workstations, and then let them mount their (root) filesystems on the server via NFS. I tried simply copying an existing OpenSuse 11.4 installation to a directory which I then exported via NFS. The kernel and initrd were then exposed via PXE/TFTP. The problem is that the initrd from the install is tailored to the machine it was installed on, so using it as is did not work. I have made some attempts to use LTSP (KIWI-LTSP for OpenSuse) with very limited success. So, now to my actual question(s): **1) Apart from modifying the initrd by hand to work with the diskless workstations, is there anything else I could use to aid me?** **2) One idea I had was to use the same root ("/") for both workstations, and then mount stuff like /var and /tmp as tmpfs. Are there any pitfalls to avoid here?** **3) Any other ideas on how to accomplish this setup? All ideas are very welcome!**


title: How do you use the command coproc in Bash?

text: Can someone provide a couple of examples on how to use `coproc`?


title: At what point did the /home directory appear?

text: Originally in Unix, `/usr` was used for user (home) directories. So if I had a user named `alex`, my home directory would be `/usr/alex`. (Interestingly, Plan 9, the successor to Unix, still has user directories in `/usr`.) Nowadays, of course, we store home directories in `/home`. (At least on GNU/Linux. I don't know about other Unices, but OS X doesn't count.) At what point did this become standard practice? What Unix flavor did it appear in? How long did adoption by other Unices take? Has `/home` been adopted by everyone? I've done some searching on here, but turned up nothing.


title: How can I set up a usb printer as a network printer using a linux server?

text: Basically right now I have a USB only printer, it's very nice. There are 5 people in my household and we all are constantly wanting to use the printer. Windows has a built in way to share the printer, but this only works when the computer is on. I have several low power small machines that I use to run Ubuntu Server Edition. Is there an existing Linux application that would allow me to basically use the USB printer as if it were a networked printer? Also I don't know how possible this would be but if there were a way to run the Apple AirPrint server on the Linux box too that would be awesome, then we could all print from our iDevices as well.


title: How can I stop GNOME Keyring from offering to remember a keyring password?

text: I use a Firefox extension to put my passwords into GNOME Keyring. I protect this keyring with a password. Whenever I start Firefox, GNOME prompts me for the keyring password: ![enter image description here](http://i.stack.imgur.com/q6s0Y.png) However, notice how each time this happens, there's a checkbox to automatically unlock this keyring on login. I don't want this to happen, so I have to uncheck the box every time. How can I make it so that this checkbox is _never_ checked automatically? I've tried Googling for both a description of my problem and for GNOME Keyring docs, I've poked around the relevant dconf values, I've looked at the Arch Wiki page on GNOME Keyring and even looked at `gnome-keyring-daemon(1)`. All with no luck.


title: Can not change permissions of files/directories in a chrooted filesystem

text: I am using **Ubuntu 12.04 LTS 64 bits** to chroot into a just extracted to my harddrive (with `unsquashfs`) Squash File System from a Kali Linux v1.0.5 32 bits pendrive for customizations:               luis@Fujur:$ sudo chroot /media/Datos/Temporal/squashfs/modificando     root@Fujur:/# ls     0    boot  etc   initrd.img  media  opt   root  sbin     srv  tmp  var     bin  dev   home  lib         mnt    proc  run   selinux  sys  usr  vmlinuz      I have been able to modify files (`/etc/rc.local`, add users with `adduser` and some other minor changes to the extracted filesystem), but the created new users have this problem:               root@Fujur:/# ls /home -la     total 8     drwxrwx--- 1 root plugdev    0 mar 24 22:45 .     drwxrwx--- 1 root plugdev 4096 sep  5  2013 ..     drwxrwx--- 1 root plugdev 4096 mar 24 00:29 luis     drwxrwx--- 1 root plugdev    0 mar 24 22:45 potato      as you can see, **the owner is "root", and the group is "plugdev"** , when both should be the same name of the user account (luis/potato in this example). Knowing **why this happen** should be fine, but I think I could solve it if I could **change file/directory permissions** , but I can not neither:               root@Fujur:/tmp# cd /home/     root@Fujur:/home# ls -la     total 8     drwxrwx--- 1 root plugdev    0 mar 24 22:45 .     drwxrwx--- 1 root plugdev 4096 sep  5  2013 ..     drwxrwx--- 1 root plugdev 4096 mar 24 00:29 luis     drwxrwx--- 1 root plugdev    0 mar 24 22:45 potato     root@Fujur:/home# chown potato potato     root@Fujur:/home# ls -la     total 8     drwxrwx--- 1 root plugdev    0 mar 24 22:45 .     drwxrwx--- 1 root plugdev 4096 sep  5  2013 ..     drwxrwx--- 1 root plugdev 4096 mar 24 00:29 luis     drwxrwx--- 1 root plugdev    0 mar 24 22:45 potato      and even on `/temp` there is no chance:               root@Fujur:/# cd /tmp     root@Fujur:/tmp# ls -la     total 4     drwxrwx--- 1 root plugdev    0 mar 24 22:52 .     drwxrwx--- 1 root plugdev 4096 sep  5  2013 ..     root@Fujur:/tmp# mkdir test     root@Fujur:/tmp# ls -la     total 4     drwxrwx--- 1 root plugdev    0 mar 24 22:57 .     drwxrwx--- 1 root plugdev 4096 sep  5  2013 ..     drwxrwx--- 1 root plugdev    0 mar 24 22:57 test     root@Fujur:/tmp# chmod a+x test     root@Fujur:/tmp# ls -la     total 4     drwxrwx--- 1 root plugdev    0 mar 24 22:57 .     drwxrwx--- 1 root plugdev 4096 sep  5  2013 ..     drwxrwx--- 1 root plugdev    0 mar 24 22:57 test     root@Fujur:/tmp# chmod a-x test     root@Fujur:/tmp# ls -la     total 4     drwxrwx--- 1 root plugdev    0 mar 24 22:57 .     drwxrwx--- 1 root plugdev 4096 sep  5  2013 ..     drwxrwx--- 1 root plugdev    0 mar 24 22:57 test      It is such a strange thing: I can make directories and files, even editing files, but not changing permissions. Maybe I have not _chrooted_ correctly? When I *chroot` into a partition to restore GRUB I do:               $ sudo mount --bind /dev /mnt/dev      prior to `chroot`, but I think this is not the case.   I believe I could be misusing the `chroot` command. Any ideas, please? ADDED: this is the result of `mount`.   Outside (before) chroot:               root@Fujur:/# mount     /dev/sda6 on / type ext4 (rw,errors=remount-ro)     proc on /proc type proc (rw,noexec,nosuid,nodev)     sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)     none on /sys/fs/fuse/connections type fusectl (rw)     none on /sys/kernel/debug type debugfs (rw)     none on /sys/kernel/security type securityfs (rw)     udev on /dev type devtmpfs (rw,mode=0755)     devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)     tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)     none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)     none on /run/shm type tmpfs (rw,nosuid,nodev)     /dev/sda7 on /media/Datos type fuseblk (rw)     gvfs-fuse-daemon on /var/lib/lightdm/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=lightdm)      Inside (after) chroot:               root@Fujur:/# mount     warning: failed to read mtab      EDIT: Just tested and I have the same problem outside `chroot`, this is: **without chrooting**. I can not change file/directories permissions. Still there are no errors, but the changes are not made.


title: Log to multiple files while process in background (nohoup)

text: I have bash script that logs to two log files in parallel.               echo "$(date) | [STATE] Activating IP forwarding" >> $logsPath$logFileName     echo $(date +"%Y-%m-%d %H:%M")","$previousState >> $logsPath$usageStatsFileName     echo $(date +"%Y-%m-%d %H:%M")","$currentState >> $logsPath$usageStatsFileName      It works fine if I run script in foreground, but when I send it to background nothing is logged to these files.               nohup nice ./rfid_reader.sh&      Can you give me some hint what shall I do to be able to run script in background and still have logs in mentioned two files?


title: Complete usable Debian wheezy image on 1 dvd

text: Is it possible to have a complete Debian wheezy installon on 1 dvd. I find it split up into 3 dvd's on the site. https://www.debian.org/CD/http-ftp/ I just want to have a good install as the debian installer can't seem to connect over wifi.


title: Detach/reattach an application run on X over SSH?

text: I have a development server that I leave running all the time, and a development laptop that I turn off/on everyday. I have a GUI application on the server that I'd like to run over SSH -X, and I'd like to leave it running even when my dev laptop is powered off. Is there a way to detach and then re-attach to that application over SSH -X? I'd prefer not to use VNC in my case.


title: Do I need pata_atiixp or ata_generic kernel modules on a SATA only system?

text: I don't have any IDE drives and my only SATA hard drive is running in AHCI mode, but my initrd image loads the pata_atiixp module. Is it safe to disable this module? And what about the ata_generic onde?


title: Check package version using apt-get/aptitude?

text: Before I install a package I'd like to know what version i would get. How do I check the version before installing using `apt-get` or `aptitude` on debian or ubuntu?


title: How do I use pushd and popd commands?

text: What are the practical uses of both `pushd` and `popd` when there is an advantage of using these two commands over `cd` and `cd -`? **EDIT** : I'm looking for some practical examples of uses for both of these commands or reasons for keeping stack with directories (when you have tab completion, `cd -`, aliases for shortening `cd ..`, etc.).


title: Meaning of "target" in virsh XML VM definitions.

text: I recently found that the target=hda tag in virsh was actually not translating into guest OS (guest OS's use /dev/sdX as the disk device names, in general, it seems). virt-install and /dev/hda vs. /dev/sda I am thus now wondering, what is the meaning of the "target dev" declarations which comprise my virt-install / virsth dumped XML files?               <disk type='file' device='disk'>           <driver name='qemu' type='raw' cache='none'/>           <source file='/VirtualMachines/bthadoop-sda.raw'/>           <target dev='hda' bus='ide'/>           <alias name='ide0-0-0'/>           <address type='drive' controller='0' bus='0' target='0' unit='0'/>         </disk>         <disk type='file' device='disk'>           <driver name='qemu' type='raw' cache='none'/>           <source file='/var/lib/libvirt/images/sandbox1'/>           <target dev='hdb' bus='ide'/>           <alias name='ide0-0-1'/>           <address type='drive' controller='0' bus='0' target='0' unit='1'/>         </disk>


title: zpool import - cannot import: one or more devices is currently unavailable

text: I have moved a ZFS pool from one SunFire server running some pre-release of Solaris 11 to another server running latest Solaris 10 and now can't import it. It was properly `zfs export` from the old one. At the same time I migrated one another zpool (`extpool2`) and it imported just fine. Here is what I get on the new server:               root@kria ~ # zpool import       pool: extpool         id: 8401594403030600070      state: ONLINE     status: The pool is formatted using an older on-disk version.     action: The pool can be imported using its name or numeric identifier, though             some features will not be available without an explicit 'zpool upgrade'.     config:                  extpool      ONLINE               raidz1-0   ONLINE                 c2t8d0   ONLINE                 c2t10d0  ONLINE                 c2t12d0  ONLINE                 c2t14d0  ONLINE          root@kria ~ # zpool import -f extpool     cannot import 'extpool': one or more devices is currently unavailable      But they _are_ available - all 4 are online, /dev/ entries are there and they show up in `format` device list. The `extpool` zfs version is 31 (I checked that before moving it) and the host supports at least ver 32 (checked its rpool version). I also did `zdb -l` and got this failure:               root@kria ~ # zdb -l /dev/dsk/c2t8d0     ------------------------------------------     LABEL 0     ------------------------------------------     ------------------------------------------     LABEL 1     ------------------------------------------     failed to unpack label 1     ------------------------------------------     LABEL 2     ------------------------------------------     ------------------------------------------     LABEL 3 - CONFIG MATCHES LABEL 2     ------------------------------------------      Any idea what to do?


title: HDMI not detected by `xrandr`

text: There's no output from my HDMI port and my TV shows NO Signal. My Current OS: Linux Mint 15 Things I have tried with no success:   1. Change the HDMI cable   2. Install another operating system ( Windows 7, Windows 8 and Ubuntu)    3. Tried to connect to a different TV Eventually I thought that my HDMI port was damaged, until I ran the following command `aplay -l`: output:               **** List of PLAYBACK Hardware Devices ****     card 0: Intel [HDA Intel], device 0: STAC92xx Analog [STAC92xx Analog]     Subdevices: 1/1     Subdevice #0: subdevice #0     card 0: Intel [HDA Intel], device 3: HDMI 0 [HDMI 0]     Subdevices: 1/1     Subdevice #0: subdevice #0      As you guys can see, I saw HDMI 0, so there's nothing wrong with my HDMI port. Furthermore `xrandr` does not detect it, please take a look at `xrandr` output as well:               Screen 0: minimum 320 x 200, current 1366 x 768, maximum 32767 x 32767     LVDS1 connected 1366x768+0+0 (normal left inverted right x axis y axis) 344mm x 194mm        1366x768       59.6*+        1360x768       59.8     60.0          1024x768       60.0          800x600        60.3     56.2          640x480        59.9       VGA1 disconnected (normal left inverted right x axis y axis)     DP1 disconnected (normal left inverted right x axis y axis)     TV1 disconnected (normal left inverted right x axis y axis)      HDMI is not listed, please guys I need your help with this, there's no response when I connect my HDMI cable to the computer. There's no video/audio output on my TV screen.


title: How to burn an iso while downloading it

text: I'm in a real hurry so I thought there is a way to do that but I don't know how. I thought about piping `wget -c cdimage.ubuntu.com/daily- live/current/utopic-desktop-amd64.iso | BurningApp` but I don't know how either. I usually use Unetbootin to "burn" it to a USB Flash Storage Device.Currently I'm running Lubuntu 14.04/10. Please note I want to burn it to a USB Flash Storage Device.


title: delete lines in a csv file older than 7 days

text: I have a csv that I need to remove all lines that are older than 7 days. This is the format of the csv               Person ID  VIP  CS  SS  LT  FTLT  PS  Modified Datestamp     T001028    1    1   1   0   0     0   05-07-2013     T001250    1    1   1   0   0     0   08-05-2012     T001261    1    1   1   0   0     1   04-04-2013     T001345    1    1   1   0   0     0   04-03-2013     T078503    1    1   1   0   0     0   04-03-2013     T079819    1    1   1   0   0     1   3/22/2013     T080119    1    1   1   0   0     1   04-02-2013     T090574    1    1   1   0   0     0   11/15/2012     T091106    1    1   1   0   0     1   3/22/2013      The format of the column Modified Date is MM/DD/YYYY - Any Ideas.... be looking to execute something on a RedHat 5 linux box.


title: Screen size in FreeBSD in VirtualBox

text: I am installing FreeBSD 10.0 on VirtualBox, and I can't figure out how to change the size of my screan, in the virtualbox? The freebsd in the virtualbox treats my screen like it's 1/4th the size of my actual screen? ![screenshot](http://i.stack.imgur.com/nBID3.png) I want it to fill my screen without the text and images expanding.


title: How to make ubuntu as my default OS?

text: I have installed both Ubuntu and windows in my laptop. Every time I switch on my laptop I have to wait and spend some time to select one of this. Is there any option to set one of this OS as my default OS and when required to boot with other OS I have to press "function" or any other keys ?


title: Count result in a find/exec statement

text: I have some Perl files which I have to modify through a simple `sed` call. Basically, I have to remove the first line of all of them. Currently, I managed to do this :               find <PATH> -type f -name "*.pl" -exec sed -i '1d' {} \;      However, I am using this line in a script and I would it to be a bit more... talkative. Thus, I decided to echo a counter (in real time), that would show how many files have been processed so far. I know the count of Perl files can be retrieved through               PERL_FILE_COUNT=$(find <PATH> -name "*.pl" | wc -l)      Currently, I have this               remove_first_line()     {         count=0         echo -ne "Removing first line of Perl files ..."         find <PATH> -type f -name "*.pl" -exec sed -i '1d' {} \; >/dev/null 2>&1              if [ $? -eq 0 ]             then echo "OK"             then echo "FAILED"         fi     }      Now, what I would like as an output, would be something like this:               "Removing first line of Perl files ... 1/209209"      And the value should be automatically updated. But I don't see how to increment the `count` variable with my find/exec statement. Basically, each time `sed` finished working a file, it should increment the `count` variable.


title: Installing software the first time a system boots after CentOS installation

text: I have a custom text based CentOS 6.4 installation that installs the OS, then after the first boot I have a custom `rc.local` file that installs custom applications and prepares the system for our customers. When this install completes, the original `rc.local` that came with the OS is copied back into place for normal operation. This has worked fine for years but would like to know if there is a better way to install software after the first boot? OR ... Is this the best way to install additional applications after the OS is installed?


title: What's the difference between 'expansion' and 'substitution' in terms of shell programming's terminology?

text: **Expansion** and **Substitution** seems to be interchangeble at same context in shell programming language. For example, some documents such as Bash reference manual, Bash Hackers Wiki use the word 'expansion' to explain 'shell parameter **expansion** '. However, some other documents seem to prefer the word 'substitution'. Advanced Bash-Scripting Guide uses parameter **substituion**. Is there any difference between 'expansion' and 'substitution' in terms of shell programming terminology?


title: Setting up a repository server

text: Is it possible to set up a server to mirror a distro's repository, but only download/store requested upgrades or new packages rather than download them all? So all computers on the LAN can connect to this server for all upgrades so they only have to be downloaded once. I've looked at apt-mirror but that seems to download everything.


title: arm-linux-gcc command not working

text: I have installed the following : > yum install gcc-arm-linux* but when i am trying to run the following command: > ./arm-linux-gcc it is giving the output as: > ./arm-linux-gcc: no such file or directory how can i resolve this? please help


title: postfix: save all incoming Mails in MySQL DB and have all addresses Verified for big servers

text: I am new to all that server based stuff. New to Postfix and new to Ubuntu.   I have an Ubuntu v-server with Postfix, PHP and MySQL installed. Also I have an own domain. So far, I managed to receive any mail, that is sent to anything@domain.com, and save those directly into my DB.   That I managed to do with this little howto: Triggering a PHP script when your Postfix server receives a mail. But now my big problem is, that I need to receive mails by bis servers like iTunes or so. Unfortunately, because I have no users on my Postfix server (what is meant to be!, because I really want to receive and save any mail), iTunes and so, wont send me mails, due to recipient address verification, like mentioned in Postfix Address Verification Howto. I think, because i filter every mail sent to my server, the verifications test by the iTunes server doesn't get an answer and so doesn't hesitate to mark that mail address unverified. Is there a way to answer to any verification requests as verified? I don't know if that makes sense, so please correct me if I'm wrong. I really appreciate any kind of help. edited: I think, the easiest way to solve my problem is, to just allow postfix to receive the mails normally too and not filter them. what i mean is, when someone sends me an email, i so far, trigger a php script as soon as a mail arrives, and filter it to my db, so it doesn't arrive on any mail account. how do i not filter, but keep going the normal process too? i filter the mails the way like exlained in the howto: triggering a php script, mentioned above. or just tell me, if, if i use that kind of filtering, big servers like iTunes, when checking recipient verification, still send you mails, or if they stop. do you have any experience with that?


title: Why mutt keeps asking for imap username and password?

text: Unsetting mutt's configuration variables `imap_user`, `imap_pass` (and perhaps `preconnect`, `imap_authenticators` as well) via an `account-hook . "unset ... "` call, seems to be common practice, if not a necessity, for handling multiple imap accounts (see Managing multiple IMAP/POP accounts (OPTIONAL), Mutt imap multiple account, mutt: gmail IMAP unresponsive, an account-hook related configuration file in funtoo.org). Currently I handle only one account via IMAP. Plans for multiple account handling, lead me to follow instructions found in the last of the above mentioned links (someone's example of mutt configuration). Therefore, I used in a similar way the following:               account-hook . 'unset imap_user; unset imap_pass; unset tunnel'     account-hook 'imaps://mail.domain.net:993/INBOX/' "set imap_user=UserName@domain.net"     account-hook 'imaps://mail.domain.net:993/INBOX/' "set imap_pass=${my_password}"      This is stored in a separate file (named `account_hooks`) and sourced from inside `muttrc`. For reasons I don't understand, mutt keeps asking for the _username_ and the _password_. However, if the variables `imap_user` and `imap_pass` are set directly in `muttrc`, e.g.               set my_password="`gpg --decrypt ~/.mutt/password.gpg`"     set imap_authenticators='login'     set imap_login = 'UserName@domain.net'     set imap_user = 'UserName@domain.net'     set imap_pass ="${my_password}"      everything works fine. The `account_hooks` file is the first one sourced and no other `account-hook . "unset ..."` call(s) exist(s) anywhere else. Why does, the separate file _account_hooks_ , not feed properly the variables of interest in this case (i.e. _imap_user_ and _imap_pass_ )?


title: Need to run su command If I am a user with sudo access

text: I am a user in Oracle Linux server with sudo access. If I run `su` command, system prompts for password. When I input my account password, system gives message `Incorrect password` while I login successfully with the same password.   * Why is it happening?    * Need to execute su or sudo command after login if I have sudo access?    * Need to prefix sudo with every command?


title: Cut a field in a string with bash

text: I need to lower all upper-cases of file and folder names from a path, recursively inside other folders found; I need to do that with a bash script. Here my code:               for file in $(find $1 -type f)     do         tmp=$(echo $file | rev | cut -d/ -f1 | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz)         tmp2=$(echo $file | rev | cut ????)         tmp=$tmp$tmp2         mv $file $(echo $tmp | rev)     done     for file in $(find $1 -type d | sort -r)     do         tmp=$(echo $file | rev | cut -d/ -f1 | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz)         tmp2=$(echo $file | rev | cut)         tmp=$tmp$tmp2         mv $file $(echo $tmp | rev)     done      The problem is at line 4, [`tmp2=$(echo $file | rev | cut ????)`] I don't know how I can select all the fields delimited with `/` after the first field. With line 3 I can isolate the file name and with the `tr` command modify all upper-cases, but then comes the trouble. Same for folders t the second 'for' construct.


title: Shell Scripting: how to use part of the file path as the file name?

text: I have a group of directories, each containing exactly 1 jpeg image, like so-               /psds/folder1/image.jpg     /psds/someotherfolder/picture.jpg     /psds/yetanotherfolder/thumbnail.jpg      What is the appropriate way to rename the jpegs to the name of their containing folder? What I want is:               /psds/folder1/folder1.jpg     /psds/someotherfolder/someotherfolder.jpg     /psds/yetanotherfolder/yetanotherfolder.jpg


title: How do I apply parameters to specific kernels with GRUB 2?

text: I have several kernels in `/boot`. One of them, `linux-cc`, is for heavy computation, i.e., 100Hz, no preemption, no graphics. I've created a `systemd` target, named `compute.target`, that only brings the system up and then starts an `ssh` server. I'm using GRUB2, and I'd like to add the `systemd.unit=compute` parameter **only** to the mentioned kernel. I've read How do I add xen kernel boot parameters in grub2?, but it does not apply to my situation (I've tried adding `GRUB_CMDLINE_LINUX_CC="systemd.unit=compute`" to `/etc/default/grub`, but it didn't work). Does anyone know how to do this? I'm using ArchLinux, and I would like to keep using `grub-mkconfig` if it is possible. P.S.: Maybe I could add this parameter as a hard-coded kernel option, but it does not seem very flexible.


title: How to remove the (1) from filenames using the find command

text: I recently converted all of my FLAC files to a lower sampling rate of 44.1 kHz and bit depth of 24 bits (because iPhone/iPod don't support anything above that) using XLD on my Mac OS 10.7 (Lion). Although I told XLD to overwrote all previous files, XLD appended a `(1)` at the end of very file like from               some_song.m4a      to               some_song(1).m4a      So now I want to remove that `(1)` from all the FLAC files I converted. I know I could have probably used some program or even an AppleScript to rename the files, but I wanted to learn using the old school way of command line. I know that `find . -name *\\(1\\).m4a` will grab all the converted FLAC file. Next I know I have to do something with `-exec` and `mv` to rename all the found files. But what I can't figure out is how to keep the original filename and only remove the `(1)`. Maybe I need to do some group regex capturing to store the part of the filename that I don't want to modify? Or maybe it's not possible to do everything in one line and I should create a shell script (which I'm not that comfortable doing, but I'm willing to give it a try). Any tips or suggestions are welcomed! Thanks!


title: How to get hgk working on RedHat Linux?

text: I plan to get hgk to work.However, no matter how I configure the redhat linux, it still does not have any response. Here is information for my machine.   1. RedHat 5.3   2. Mercurial 1.8.1-1   3. I installed mercurial-hgk_1.8.1-1.elf5.x86_64.rpm by rpm and it generated a directory `/usr/bin/hgk` When I typed `hg help`, it didn't show the view..etc the additional extensions commands. Here are things I have tried.   1. Manually created a `.hgrc` file at home directory and put the configuration as              [extensions]     hgk = /usr/lib64/python2.4/site-packages/hgext/hgk.py        2. Add all these configurations at hgrc files of my local repository such at               /home/Cassie/CassieRepo/Repo1/.hg        Nothing happened -- When I typed `hg help` or `hg view`, the mercurial still does not recognize the additional `view` command. I typed `hgk`. Here are the outputs.               Error in startup script: can't read "env(HG)": no such variable         while executing     "exec $env(HG) debug-config"         (procedure "getconfig" line 4)         invoked from within     "getconfig"         invoked from within     "array set config [getconfig]"         (file "/usr/bin/hgk" line 4054)      I typed `rpm -ql mercurial | grep bin` and here are the outputs.               /usr/bin/hg      I typed `python -c 'import sys; print sys.path` and here are the outputs.               ['', '/usr/lib64/python24.zip', '/usr/lib64/python2.4', '/usr/lib64/python2.4/plat-linux2', '/usr/lib64/python2.4/lib-tk', '/usr/lib64/python2.4/lib-dynload', '/usr/lib64/python2.4/site-packages', '/usr/lib64/python2.4/site-packages/Numeric', '/usr/lib64/python2.4/site-packages/gtk-2.0', '/usr/lib/python2.4/site-packages']


title: PHP file permissions for Development machine

text: I've just upgraded my development machine and have moved over a website I was working on. However, the permissions don't seem to have moved over properly. The dev machine is a Linux machine which runs Apache, where all the folders and sub-folders were set to 755 and all the files and files within all sub folders were set to 644. Instead of me having to run the commands: chmod 755 chmod 644 Is there a quicker way of doing this without having to do each and every file and folder individually?


title: Dual Boot Windows 8.1 & Linux Fedora 19 (BootLoader Error)

text: I installed Win 8.1 in first drive `C:` and then attempted to install Fedora 19 in `D:` but after install, all packages in bootloader installation Fedora show the following error:               An unknown error has occurred this program has an unknown error      you may report the bug below or quit the program file           /usr/lib/python2.7/site-package/pyanaconda/bootloader",line 1550     in install raise boot loader error (bootloader install failed)      I have tried to install Fedora 19 with Win 7 Sp1 - Win 8 - Win 8.1 but all of the time these show the above error. Most people on the internet said I must disable UEFI secure boot but I don't have any UEFI in my pc! It seems my motherboard does not support UEFI. **BIOS Information :**               OS Name Microsoft Windows 8.1 Enterprise     Version 6.3.9600 Build 9600     System Model    P5K     System Type x64-based PC     BIOS Version/Date   American Megatrends Inc. 0704, 10/30/2007     SMBIOS Version  2.4     BIOS Mode   Legacy     BaseBoard Manufacturer  ASUSTeK Computer INC.      **--- I dont have any UEFI Firmware Settings** I used some step by step guide from videos in Youtube but that didn't help me. What can I do? Do you think I need Update my BIOS ? Do you think I can not install fedora as dual boot beside Win 8 because my Asus`s BIOS is old and does not support Boot Secure ? Can I have whole my installation error (bootLoader error) message into a text file ? that I share it here maybe help to solve mystery !


title: How to best encrypt and decrypt a directory via the command line or script?

text: I have a directory of text files under bazaar version control and keep a copy (a branch, actually) on each of my machines. I want to encrypt and unencrypt the directory via the command line. Ideally, I would also be able to have a script run at logout to check if the directory is encrypted and encrypt it if not, all without user intervention. I do not, however, want the dir to be decrypted on login. (I want the script as a guard against forgetting to encrypt manually. This is especially important for the netbook.) I'm running ubuntu 10.04.1 and two versions of crunchbang linux, one a derivative of ubuntu 9.04, the either of a late June snapshot of the Debian Squeeze repos. What is the best way to do this? (I tried to tag with `encryption` and `directories`, but lack the rep to create a tag.)


title: Setting Framebuffer splash resolution when exiting X

text: I installed a copy of BackTrack 5 R2 (Ubuntu 10.04) to my HDD and dual-booted with Windows 7. After a bit of tweaking I set about updating the native Intel drivers because it was only allowing me to choose between 800x600 and 1024x768 resolutions and I have a widescreen laptop. Uninstalled current drivers, added the new repository, and updated the latest Intel drivers. Start X and voila! 1366x768 resolution. Perfect...almost. BT uses a custom framebuffer bootsplash that is hard-coded to 1024x768 resolution. When I start X server (KDE) my resolution changes as it should. However, when I end my session, the resolution does not change back and I'm stuck staring at a bland framebuffer because the theme won't work at the wider resolution. Now I realize this isn't the end of the world, but I'm wondering if there is a way to configure this so that it will return to the 1024x768 resolution when I end my X session. I've tried resetting the resolution with `fbset` but it only shrinks the usable portion of the screen. It does not stretch the output to fill the display.


title: PC Boots to grub> prompt after putting partition table entries in disk order

text: I am using Centos 6.5. I tried to get the disk space using               fdisk -l | grep Disk      What I got was               Partition table entries are not in disk order      I tried to fix the problem with the method outlined here. I rebooted the PC but it doesn't go to CentOS. It just goes to the                grub>      prompt which has the form               GNU GRUB version 0.97 (639K lower / 1039296K upper memory)          [Minimal BASH-like line editing is supported.  For the first word, TAB lists possible command completions.  Anywhere else TAB lists possible completions of a device/filename.]


title: scp (v4) copy from remote to multiple local filenames

text: I did a bunch of googling and I think what I am trying to do is not possible with openssh/scp v4.x but wanted to ask here in case someone has a creative workaround. I want to copy multiple files from a remote host (I don't want the whole dir but I know the filenames and they are static names) to a local dir but I want each file to have a new name - I want the machine name pre-pended to the filename. Also, the reason why I am trying to do it this way is to only have 1 login (no ssh keys) for each remote host (don't want to type password for each file). here's what I have:               machine="server1.nyc.ny"     logdir="/var/log/jboss"     logs="garbage.log splunk.log jboss.log"          for BOX in ${machine[@]};do     scp $BOX:$logdir/\{"${logs[0]}","${logs[1]}","${logs[2]}"\} ./     done      this works for getting all the files with 1 login to the remote host but ultimately, I'll have multiple remote hosts so I want to pre-pend the machine name to the log file name - ie: _server1.nyc.ny-garbage.log_ the same syntax for getting the files doesn't work for destination. my ssh/scp is v4 so I can't use ControlPersist options. any creative solutions? much thanks! ps: the array of log filenames is not necessary here but I use it because some users have ssh keys so a nested loop using these arrays works great for them. I need a solution for users who don't have ssh keys and therefore minimize the amount of password typing.


title: How start byobu with session splited horizontaly?

text: All is in the title. I can't get the right ~/.byobu/window file


title: How can I print a2ps a file --portrait without being all squished?

text: I installed a2ps for printing but the output is landscaped. I tried using --portrait which 'kinda' worked... but didn't. The orientation was switched 90' but it's only 50% of the width and the text is tiny.


title: Copy symlinks from ext3 to cifs share

text: I'm using `scp` to copy files from a Linux disk (ext3 file format) to a Windows disk (NTFS exposed using CIFS over the network). I've found that `scp` follows symbolic links and copies their contents instead of copying the symbolic link. I wish to instead copy the link itself. Is there a way to do this? I don't have to use `scp`, other copy methods are acceptable, as long as it can be copied over a network.


title: How can I find the Secure Attention Key (SAK) on my system and can I disable it?

text: In answer to My process was killed but I cannot understand the kernel notice, I was pointed to some documentation on the Secure Attention Key (SAK) on Linux. I have a embedded system generated using buildroot which uses `busybox` and the busybox init system. I am unable to find either `rc.local` or `rc.sysinit` on my system anywhere. I have looked online but I cannot find any documentation (other than the link above) that tells how I can identify what the SAK is for my system. Can anyone tell me how I can get this information and also if I can turn the SAK off? As my system is embedded and isolated from the internet I am not overly concerned with security breaches or hack attempts. The SAK seems to pop up out of nowhere and kills my main embedded application which is totally unacceptable so if I can turn this off it would be better for my needs (even if this means I have to reconfigure and build my kernel)


title: How to fix boot failure due to incorrect fstab?

text: It seems that I have added incorrect record to `/etc/fstab`:               //servername/share    /mnt/share    cifs     defaults,username=myuser     0 0      When I did `mount -a`, it asked user password to mount network share. It seems that it cannot proceed without password on boot, so it is just hung. How can I fix fstab to prevent boot failure?


title: how to add shortcut keys to custom.desktop in RHEL6?

text: i have created custom.desktop in the /usr/share/xsession directory for launching single application. i want to add one or two desktop shortcuts along with the single application.


title: How did this bogus entry sneak into my apt sources?

text: A while ago, I decided to try dropbox. Since I could `apt-get` it, I thought it was free software. However, I quickly discovered that the `apt-get` command only downloaded a _downloader_ for dropbox daemon. So I stopped that dead in its tracks, did an `apt-get remove`, aaaand... wait a second. The repository won't go away! In fact, if I `apt-get update`, it's still in there:               Ign http://linux.dropbox.com wheezy InRelease                                                                                It's not in my `/etc/apt/sources.list`, so how did it get there?


title: what is the difference between spin locks and semaphores?

text: What are the basic differences between spin locks and semaphores in action?


title: Prevent a USB external hard drive from sleeping

text: Does anyone know if there is an elegant way to tell an external usb drive not to spin down after a period of inactivity? I've seen cron based solutions that write a file every minute, but nothing that smells of nice unixey elegance. There must be a hdparm, or scsi command that I can issue (usb drives are accessed via the sd driver in OpenBSD) to the drive to tell it to not sleep. I'm afraid that this is probably a _feature_ built into the controller in the enclosure, and as such not much can change it aside from ripping the drive out of it's enclosure and plopping it directly in the machine, but I figured I would ask, on the off chance. Ideally, I'm looking for an OpenBSD solution, but I know there are others out there w/the same problem so any solutions will be considered for the answer.