title: How set environment variable based on whether a GUI is available?

text: How can I set up my .bashrc such that the value of an environment variable changes based on whether or not the current session has access to the gui / windowing system? For example, let's say I have an environment variable that controls which diff program my VCS will use. When I'm sitting at the machine, I'd like to use a GUI program. However, when I connect remotely via SSH, I'd like to have it automatically use a text-based terminal diff viewer instead. How can I check whether or not the windowing system is available?


title: Keep global variables values piping through functions

text: I wrote a little bash script using `sed` on some html pages to extract some urls. To avoid each time grabbing sed results in a variable then read it again I simply made 3 functions and piped together.               first_function $1 | second_function | third_function      Let's say that:   * the first function finds item urls in a list from a given _href_ (`$1`)   * the second function extracts from each of the piped urls an image `src`   * the third function assembles output HTML at the moment I echo `$lot_url` in `second_function` so I can `read` it in `third_function` along with `$img_url` and put it in HTML. It would be cleaner **if I could just hold it as a global variable that's accessible from** `second_function` to `third_function` but seems I can not. This becomes more necessary as the number of values to pass between functions grows. Here a full sample code:               first_function(){         curl -s "$1" | sed -nr '             #extract sub urls         '     }          second_function(){         while read lot_url; do             echo "$lot_url"             curl -s "$lot_url" | sed -nr '                 #extract img src             '         done     }          third_function(){         while read lot_url; read img_url; do             echo ""         done     }          first_function "$1" | second_function | third_function


title: Apply astyle on commited files using SVN hooks

text: I would like to apply some styling to code whenever someone commits to an SVN repository, for this I use `astyle` on the commited changes with an svn `pre- commit` hook. I can get the file names like this, but when I apply astyle, it seems the program cannot get the data from within the files:               for FILE in $($SVNLOOK changed -t "$TXN" "$REPOS" | cut -b 5-); do              # echo $REPOS/$FILE 1>&2             # prints the files' paths             astyle --style=gnu -n $FILE     done          # commit the changes from astyle here      Any idea how can I achieve this?


title: Apropos always returns several duplicate matches from whatis

text: When I run `apropos` or `man -k` in bash, it always returns the same item (at least one) twice: ![Bash screen-dump](http://i.stack.imgur.com/jWQkx.png) **Question** Why is it doing this; and would it indicate that there's a possible configuration issue with my system? I'm using OSX.


title: route traffic to github through specific network interface

text: okey, I'm a complete NAP, so take it easy on me :) My Situation; My computer is in this stupid cooperate network of the company i work for. They have alot of policies and stuff, so its not possible to make a tunnel/connect to github.com through the normal network interface. But because we still need to be able to do whatever we want, we have wireless, that is open. Smart, eeeh?! The good part; my machine has two interface; wired and wireless. What I want; I want to route all traffic to github.com through my wireless connection. Nothing more than this, so that I can go and do a "git fetch origin" or similar. What I found out, tried and failed; My first thought was "ah yeah, lets just add a route!", so thats what I did! But because I cant add a domain, I did a nslookup to find the IP of github, which is 207.97.227.243, so I added a rule like so; "ip route add 207.97.227.240/28 dev wlan0", but if I want to do a "git fetch origin", it says "the remote end hung up unexpectedly". (I configured 'origin' like so; "git remote add origin git@github.com/myusername/mygit.git") What I hope for; some ingenious guru that bashes my noob-knowledge and points me in the right direction! thank you so much for any hint..


title: Block editing *live* in Emacs or Vim

text: jEdit supports block editing, but Emacs and Vim seem to have some serious usability issues on the same subject. If someone could fill in the unknowns here it would be much more bearable to use either editor:   * **Actual rectangular selection** : Where the selection _on screen_ is a rectangle, not a linear selection which is then used to calculate a region as Emacs seems limited to.      * jEdit: Hold down `Ctrl` and select.     * Vim: Click `Ctrl-v` and select.     * Emacs: **Unknown** ; looks like a 400+ lines plugin is necessary.   * **Live rectangular editing** : See what the result will look like on _all_ lines as you edit after a block selection.      * jEdit: Just start typing, and you'll see the end result as you go.     * Vim: Click `Shift-i` and type. Will show the end result only on the first line until you press `Esc` to exit insert mode. **Unknown** whether there is some way to see the result on all lines immediately.     * Emacs: **Unknown** ; looks like the only way is `C-x` `r` `t` and setting the text to fill in after pressing `Ret`.   * **Start and end selection in positions outside the text** : For example, I'd like to remove the N first characters of each line, but the first and last lines contain less than N characters.      * jEdit: No problem, block selections can start outside the text.     * Vim: `:set virtualedit=block`.     * Emacs: **Might be possible** with `artist-mode` and/or `picture-mode`.   * **Paste block inline** : Paste the copied block as if you were pasting multiple lines, as in, push the text already there _down_ , not right.      * jEdit: The default. To paste a block as a block you need to do another block selection first.     * Vim: `O``Esc``V``p`.     * Emacs: **Unknown**. General Emacs block selection functionality can be found in the `cua-mode` plugin.


title: org.gnome.desktop.background defaults?

text: I seem to have the following settings in my gnome-fallback/flashback session. The following is via running               gsettings list-recursively      on the console.               org.gnome.desktop.background color-shading-type 'solid'     org.gnome.desktop.background picture-opacity 100     org.gnome.desktop.background picture-uri 'file:///home/shirish/.cache/gnome-control-center/backgrounds/fa77249a81b2d0071ee3d1b07a08c5b528872a402e7424d685917791cbe44594'     org.gnome.desktop.background primary-color '#000000000000'     org.gnome.desktop.background secondary-color '#000000000000'      What I am concerned with is that both the primary and secondary background colors seem to be black. Is there a way to turn it to whatever the defaults are, or are the defaults are black ? This is on debian-testing.


title: `ln -s` creates a symlink inside an existing folder instead of failing?

text: `$mkdir lnTest1 lnTest2` `$ln -s lnTest1 "lnTest2"` There is NO slash at the end of "lnTest2"!!               $ls lnT* -Rl |sed "s'$USER''g"     lnTest1:     total 0          lnTest2:     total 0     lrwxrwxrwx 1   7 Jun 22 22:48 lnTest1 -> lnTest1


title: log_success_msg: not found while booting with in initramfs

text: I use the log_success_msg in a script which is into the init-bottom directory of my customized initramfs. I get the following error message:               /scripts/init-bottom/__rootaufs.sh: line 154: log_success_msg: not found      This function is described into my initramfs-tools manpage. Additional information: Debian Wheezy and initramfs-tools Version 0.109.1 What do I miss. Should I call something to enable the log_success_msg function (and other similar functions) ?


title: Wiped out Windows partition table

text: I tried to install Linux (Mint distro) on my laptop computer after recieving a secondary disk. After installing Mint, I just rebooted the system. Nothing was happening (Actually, I was getting a message, from BIOS I guess, saying " **No bootable disk** " or something similar). So then I tried to boot on an Arch pendrive, but I was getting a blackscreen. I changed BIOS mode to legacy (from UEFI), and added `nomodeset` to boot cl in Grub (and `vga=0x37F` for comfort). I was finally booting on something. I did a `fdisk -l` and found that there was no Windows partition table. However, I have no idea why Mint wasn't booting as I had Linux Partitions. I then did `testdisk /dev/sda` (where sda is my Windows disk), chose `EFI GPT, Analyze`. My partition seemed like retrieved, so I chose each of it and wrote. After rebooting, on testdisk, only ESP and recovery partition were there. I then started to re partition my `/dev/sdb` to install Linux.As I wanted to format my partitions, I did a `mkfs.ext4` on sda1 and sda2 instead of sdb1 and sb2. Is there anyway to retrieve my Windows system (At least my data, as I didn't format data partition, only ESP and recovery).


title: using SUID bit to drop privileges

text: So this is a description of the system I'm working on :   * a "manager" process spawns all the other applications.   * The manager application runs as `root` user.   * so now, any process that it spawns also inherit `root` user privileges. The third point is clearly makes my application (let's call it 'player') a security risk so one solution would be to create a separate user and group, say 'worker' and then spawn the 'player' process as that user. The specific implementation is as follows :   * `chown` the binary (player.out) to the `worker` user and group `chown worker:worker player.out`   * set the SUID bit on it with `chmod a+s player.out`.      * this ensures that the process is started with (atleast) it's EUID set to 'worker'.   * inside the application main use `setregid()` and `setreuid` to set the RUID to the same value as the EUID :              if(setregid(getegid(), getegid()) != 0) {}     if(setreuid(geteuid(), geteuid()) != 0) {}      My question is in two parts :   1. Processes with SUID bit set are usually owned by `root` and are called setuid-applications to denote (possibly) that their permissions are elevated to root user irrespective of which user invoked the program.      * is there any special name for binaries that use the SUID bit to automatically _drop_ priveleges?   2. Is there any other, better way to ensure that the 'player' application drops priveleges? **Edit** : I should clarify that I have no control over the "manager" process that spawns the other processes. I only have control over my `player` application.


title: auditctl reports "File system watches not supported" on a very old system

text: When I run auditctl -l I got:               # auditctl -l     No rules     File system watches not supported      And I've already have AUDITSYSCALL enable in kernel,               # zgrep AUDIT /proc/config.gz     CONFIG_AUDIT_ARCH=y     CONFIG_AUDIT=y     CONFIG_AUDITSYSCALL=y     CONFIG_AUDIT_TREE=y      So what could be wrong here? I'm using `auditctl version 1.0.12` with kernel 2.6.32


title: How to figure out what changes to which files a given command does, or even intercept them?

text: Say I've got a program `mysterion` the execution of which will probably modify some files. In order to figure out whether this is harmful or not I'd like to run it in such a way that I can at the very least know which files got modified how, or maybe even somehow hook another program to it that decides whether to accept or deny those change _before_ they even happen. Can that be achieved somehow less tedious than a step-by-step debugging? Sure enough for the "determine changes" part I could snapshot the entire filesystem and `diff` it afterwards, but that would probably be like braking a nut with a sledgehammer...


title: Extracting mail addresses

text: I have a file that contains lines like this: `user=<xxxxxxx@asd.com.tr>,   user=<yyyyyyy@asd.com.tr>,   user=<zzzzzzz@asd.com.tr>,   user=<ccccccc@asd.com.tr>,   user=<bbbbbbb@asd.com.tr>,   user=<aaaaaaa@asd.com.tr>,` What is the best way to extract mail addresses from this file? I am new to bash and i want to do it best way.


title: No internet even with iptables ACCEPT all

text: I was trying to setup the firewall settings, and probably did something wrong. I don't have internet now unless I stop `iptables` service I tried flushing,and accepting everything               sudo iptables -F     sudo iptables -P OUTPUT ACCEPT     sudo iptables -P INPUT ACCEPT      But I still cannot access internet. if I stop the service,               sudo service iptables stop      then I can access inet. Starting again blocks it. Can you point me where the problem lies? (I'm running CentOS 6.4)


title: How to find the page size, associativity, and TLB size and number of entries?

text: Under an Ubuntu system, are there commands for looking up:   * the page size,   * n in n-way cache associativity,   * TLB cache's size and number of entries?


title: How to use VNC for gaming?

text: I was just wondering if it's possible to set up a windows 7 VPS/VNC server to be used for gaming on my local network. I have a macbook pro as my main computer, it doesn't quite have the horsepower that I want for some of the games that I play, but my local home server has great potential and actually was originally a gaming computer. My question is, is it possible for you to give a VPS access to the Graphics Card and access the server using a VNC? And also which platform would be best for this? e.g. virtualbox or KVM or something similar I was thinking possibly VirtualBox would be better, but I'm not sure how good it is on Linux. Also it might be worthwhile to note that I am running CentOS 6.


title: Why would I use a rsync mirror?

text: Most Linux distributions offer mirrors that use rsync. I know that rsync is best used on mirrors because it only copies the delta between the local file and the remote one. What benefits do I get as a user from using a rsync mirror?


title: Yum and recommended/suggested packages

text: I'd like to install a software package on my _Fedora_ System, but it has a lot of unreasonable dependencies (which I know for sure they are not actually required). I used to work on _Debian_ , where _apt-get_ allows you to systematically exclude **recommended** and **suggested** packages, installing only the strictly required dependencies. Is there a way to do so with _Yum_?


title: How to stop telnet access for a particular IP address?

text: How can I stop telnet access for a particular IP address on the command line?


title: fail2ban permission denied on script

text: I've just upgraded from RHEL 5 to 6.5 and setup `fail2ban` anew. I can't seem to get my custom action to work now, supposedly because of a permission issue. I wan't to know what am I doing wrong, and how can I make `fail2ban` run the script successfully. I have a `fail2ban` action set up to run a generic shell script. I prefer things this way.               actionstart = <script> <jail> start      Where `<script>` is specified in the `jail.local` file:               action   = run-script[jail=drupal-reg-lim,script=/path/to/script.sh]      But I get a 126 exit code when I try to run the script, which, according to tldp.org, means that there is a "Permission problem or command is not an executable". This happens regardless of the contents of `script.sh` - whether it is completely empty, or only has a shebang (`#!/bin/sh`). Trying to run `sudo /path/to/script.sh` works. I tried changing the `actionstart` so that it would log, and placed the script as `/etc/fail2ban/action.d/script.sh`:               actionstart = <script> <jail> start || logger -dit fail2ban-run-script <script> <jail> start failed: exitcode = $?      Actually outputs the following into `/var/log/messages`:               Apr 23 05:49:25 xx1 fail2ban-run-script[8236]: /etc/fail2ban/action.d/script.sh drupal-reg-lim start failed: exitcode = 126      Also trying to run `sh` works. Only running a script fails. I also tried `chmod 777 script.sh`:               -rwxrwxrwx. 1 root root      10 Apr 23 05:12 script.sh      Another thought was that this might have to do with the SELinux security context (logging `id` output gave me `uid=0(root) gid=0(root) groups=0(root) context=unconfined_u:system_r:fail2ban_t:s0`), but I haven't been successful at testing this (`sudo -t fail2ban_t -r system_r /bin/sh` fails with `Permission denied` even though `fail2ban` can run `sh`; I might be doing something wrong in my `sudo`). Something that might be useful to know is that `fail2ban` uses Python's `os.system()` to execute the command. But my attempt at recreating it this way has failed too:               >>> import os     >>> print os.system('/etc/fail2ban/action.d/script.sh || echo "No"')     0      All of this leaves me with nothing. I'd be glad to get any kind of help. (Side note: actually, `fail2ban` didn't get the 126 exit code for some reason, and simply spit out an error with a code of 0x7e00, which means the process has stopped but the exit code is zero. Took me some time to figure out, so thought I'd share.)


title: Arch Linux 64bit Android ADB?

text: I am trying to use the Android SDK on Arch Linux 64bit but when I try to run ADB from the correct dirrectory it says the file does not exist, but it is there. On Ubuntu when you have this problem you install ia32-lib but there is none in Arch Linux. Is there something I have to do.


title: What is the lowest level I can see my system running?

text: Let me try and clarify. Is there any way for me to see very very low level activity on my computer? Stuff like:   * register content   * opcodes being sent   * specific memory addresses Or anything lower than this (not sure its possible). I'm trying to figure this out to learn a bit more about how modern computers run at this low of a level.


title: Sort using custom pattern

text: Is there a way to output file's contents using custom patterns? For instance, having a file `myfile` with following contents:               a     d     b     c      ..how would one sort it using following pattern: print lines starting with "b" first, then print lines starting with "d" and then print lines in normal alphabetical order, so expected output is:               b     d     a     c


title: Create single executable file from directory

text: I'm looking to create a single executable file from a directory, to make a 'standalone' app. So say my directory structure is:               -app       --assets       --bin       --views       runme       go.sh      and within `go.sh` I have a line to simply run `runme`:               ./runme --myswitch      So when you double click the `executable` file, it will run `go.sh`, and the rest of the app will go and do its work. I've looked into using `gcc`, but this seems specific to C apps? Not just running a script. * * * Specifically, this is trying to make a standalone Xulrunner application. The docs just suggest create a `.tar.bz2` file, rather than a `.exe` style file, which is what I'm looking for. https://developer.mozilla.org/en- US/docs/Mozilla/Projects/XULRunner/Deploying_XULRunner_1.8


title: Wake-on-LAN with BusyBox?

text: Is it possible to implement the wake-on-lan magic packet in bash? I'm using a old, customized BusyBox and don't have `ether-wake`. Is it possible to replace it with some other shell command, like:               wakeonlan 11:22:33:44:55:66


title: How to configure gpg2 to pass smartcard PIN unless pinentry programm?

text: My configuration:   * Centos 6.5   * gnugp2-2.0.14-6.el6_4.x86_64   * gnupg2-smime-2.0.14-6.el6_4.x86_64 I configured `gpg2` to use my signature key in smartcard gnupg V2.0. I imported my gpg signature key to the rpm store. I need to sign an rpm package using `rpm --addsign myApp.rpm`. It works fine, but `rpm` prompts once for the smartcard PIN, and `gpg2` (with `pinentry` programm) prompts three times for the smartcard PIN. I expected that `rpm --addsign` passes the PIN (get in first prompt) to `gpg2` and `gpg2` doesn't ask again for the PIN. Is it possible to have only _one_ prompt to sign the rpm package with `gpg2`?


title: Using mutt and not revealing IP address

text: Here is `mutt` setup: I use `offlineimap` to fetch the mail and use `msmtp` to send the mail. My concern is that when using this (`msmtp`), it appends my IP address in the header in every email that is sent. Since `msmtp` doesn't support a `SOCKS` proxy, I can't use a SSH tunnel to my VPS. Is there anyway I can configure this setup to not reveal my IP address by using some sort of a tunnel to my VPS so that its IP is revealed and not mine? I searched a lot but the closest I could find was a SSH tunnel but I guess that was for the case if I was using `mutt`'s inbuilt `SMTP` support and not a MTA such as `msmtp`.


title: Splitting large PDF into small files

text: Using **pdftk** it is possible to extract page ranges from a pdf using               pdftk a.pdf cat 124-end output b.pdf dont_ask      I have a bunch of huge PDFs with about 500 pages and over 100 MB, is it possible to automatically split those in pieces of maximal 5 MB?


title: XAUTHORITY environ variable set repeatedly on every login

text: I am running a Suse Linux 11.04 system. My problem is that when I do a fresh login into a shell as root, a new Xauthority file of the form `xauth*****` gets created in the `/root/` directory. Upon exiting from the shell, a few `.xauth` files remain behind. I tried it on other systems but this does not happen. Also why is the `XAUTHORITY` environment variable set only for `root` and not for my other users in the system? `man xdm` says the follwing about the `XAUTHORITY` environment variable > DisplayManager.DISPLAY.userAuthDir > > When xdm is unable to write to the usual user authorization file > ($HOME/.Xauthority), it creates a unique file name in this directory and > points the environment variable XAUTHORITY at the created file. It uses /tmp > by default. So in my system I do this:               xauth      Using authority file `/root/.xauthPpRsfU`               xauth>       I exit `[Ctrl+d]` and I log back in, I see that now it is starting to use a different `.xauth*` file.               xauth      Using authority file `/root/.xauthq1xt4z`               xauth>      Why does it need to keep on creating a diffent `xauth` file everytime I login? Also why in root because the default location is `/tmp/`? I have not set `.DisplayManagaer.DISPLAY.userAuthDir` to `/tmp` in the `xdm` configuration file. I dont see this behaviour on any other system. In RHEL and Ubuntu all is fine. For pointers I am not the only one who faces this issue. I guess this post is similar: `$XAUTHORITY` appears from 'nowhere' on su+tmux. Does anyone know how I can fix this?


title: Assignment in braces vs outside braces in awk

text: From this question, I answer with this solution:               awk 'FNR==NR{a[FNR]=$2;next}{$NF=a[FNR]}1' file2 file1      It works as expected. But the first solution I thought is:               $ awk 'FNR==NR{a[FNR]=$2;next}$NF=a[FNR]' file2 file1     A 63 9 6     B 45 3 5      It does not work, since when `awk` had not print the first line in `file1`. It make me suprise, and don't know why `awk` skip the first line. Here is some examples:               $ awk 'FNR==NR{next}$1=123' file2 file1      123 23 8 T     123 63 9 9     123 45 3 J            $ awk 'FNR==NR{a[FNR]=$2;next} FNR in a' file2 file1     A   23  8   T     A   63  9   9     B   45  3   J      You can see, from both examples, `awk` works as expected. First assigning new value to a field of current record affected record value, and `awk` print new value. The second show that `awk` had process all record in `file2`, no record is skipped. Why `awk` skip the first line in my first solution? I use `gawk 4.0.1`, and also tested with `mawk 1.3.3`.


title: Setting CPU frequency guidelines

text: I'm changing my CPU frequency because of noisy fan. I used `sudo cpufreq-selector -g powersave` for this purpose, but I replaced my Linux system `Xubuntu` with `Lubuntu` because it utilizes better resources. My version is `11.10` and I'm not using `Gnome` nor `KDE` nor `XFCE` nor `LXDE` (only `Xmonad`). There is something wrong with `cpufreq-selector` > $ cpufreq-selector > > Failed to acquire org.gnome.CPUFreqSelector: Connection ":1.35" is not > allowed to own the service "org.gnome.CPUFreqSelector" due to security > policies in the configuration file `cpufreq-info` shows > $ cpufreq-info Report errors and bugs to cpufreq@vger.kernel.org, please.   >  analyzing CPU 0:   >  driver: acpi-cpufreq   >  CPUs which run at the same hardware frequency: 0   >  CPUs which need to have their frequency coordinated by software: 0   >  maximum transition latency: 10.0 us.   >  hardware limits: 600 MHz - 1.60 GHz   >  available frequency steps: 1.60 GHz, 1.40 GHz, 1.20 GHz, 800 MHz, 600 MHz   >  available cpufreq governors: conservative, ondemand, userspace, powersave,   > performance current policy: frequency should be within 1.60 GHz and 1.60 > GHz.   >  The governor "ondemand" may decide which speed to use   >  within this range.   >  current CPU frequency is 1.60 GHz.   >  cpufreq stats: 1.60 GHz:98.40%, 1.40 GHz:0.02%, 1.20 GHz:1.58%, 800   > MHz:0.01%, 600 MHz:0.00% (38) I also tried this guide because my processor is the same (only the frequency is 1.6 instead of 1.73). I'm not sure if something happened after `sudo modprobe speedstep_centrino` command Could you help me to figure out what's wrong here and why I can't slow the frequency down?


title: sshd_config MaxSessions parameter

text: I have problem with "MaxSessions" parameter in sshd. I would like to restrict number of sessions via one ssh connection. For example for tcp forwarding.   When I set MaxSessions to 0, logons are not working (thats fine, thats how it should work) but when I set to 1 I can have multiple sessions (even 1 disables multiplexing) via one ssh connection and set it to 2 or more has no effect as well then.   Maybe you can direct me to right solution. I test it like this: Open ssh connection from putty (win) to server(BSD). Port forwarding is in use (for http). So I use SOCKS in browser.   I download two files simultaneously from two different websites and it works for both through this tunnel but it should not (MaxSessions is set to 1).   * sshd - OpenSSH 5.2 portable for FreeBSD   * OS - FBSD 6.2 Thank you for any help.


title: How to split stdout to go to several output files?

text: Say, I have a command `command` which prints huge number of lines to stdout:               line1     line2     .....     lineN      I want to save the output to disk, but not as a single file, but as a sequence of files each having 1000 lines of stdout:               file0001.txt:     -------------     line1     ....     line1000          file0002.txt:     -------------     line1001     ....     line2000          etc      I've tried to google the answer, but every time google points me to `tee` command, which is useless in this situation. Probably, I'm entering wrong queries.


title: How to disable "Shake password dialog when authentication fails" of Gnome Screensaver?

text: Is there any way to disable the animation which occurs when attempting to unlock gnome Screensaver and failing? Currently the password dialog shakes back and forth and for some reason on some laptops, this animation causes the entire system to be unresponsive for about 5 - 7 seconds. Can be very frustrating because it increases the chances of a second, third, etc mistyped passsword. I'm currently on Fedora 11 but this issue also occurs in Ubuntu. The Ubuntu change log calls this feature "Shake the dialog when authentication fails"               gnome-screensaver (0.0.17-0ubuntu1) dapper; urgency=low            …           * New upstream release:         - 0.0.16:           - Shake the dialog when authentication fails           …           -- Daniel Holbach <daniel.holbach@ubuntu.com>  Mon, 24 Oct 2005 21:14:22 +0200


title: Do I need hardware support for KVM for virtio paravirtualisation

text: Unfortunately I need to run virtual system on the machine without hardware support for visualisation. From kvm page I read that kvm is needed however it is not mentioned whether they mean the kernel support or the page was written before qemu started using kvm and virtio. I have the kvm module loaded but machine is too old to have hardware support (AMD Opteron 148). I run into problems when I tried to use virtio so I would be grateful for answer as it would help with troubleshooting.


title: How to create bootable flash for "efi-shell"

text: Current Intel server chipsets include a built-in "efi-shell" which appears to basically be a simplified 'NIX with a command set suitable for manipulating some nifty UEFI boot options. It is also the case that some of Intel's firmware upgrade tools now require "efi-shell" to run. Sadly, I do not have a server chipset even though this board does support UEFI booting. The efi-shell can be downloaded from http://www.sourceforge.net/projects/efi- shell. However, I can find no bootable ISO or any other form of bootable image. I have attempted to make a bootable flash with `unetbootin` with no success. Any thoughts on how I might make a copy of efi-shell bootable so I can run the Intel firmware upgrade on my RAID card?


title: Debian Sid /etc/debian_version

text: I have a question that I fear is already answered but the answer has thusfar successfully eluded me. I installed Debian Wheezy via netinstall CD, changed sources to reflect Sid instead of Wheezy, did upgrade, reboot, dist-upgrade (should've done dist- upgrade from the start, I know), and rebooted again. When I cat /etc/debian_release, it still shows 7.0. Will that change or is it supposed to change?


title: Shell script passing null value while executed as cron job

text: We are using the below commands to get pagesapce values and I need to check percent of used pagespace. For this I have used the below code, but when running this script it's passing a null value into the function.               MAX=`free -m | grep Swap | gawk '{ print $2 }'`     MIN=`free -m | grep Swap | gawk '{ print $3+300 }'`     DIV=`echo $MIN/$MAX*100|bc -l`     PAGESPACE=`print $(( round(DIV) ))`      I am passing the `PAGESPACE` as argument in one of my functions. function:               monPar 0 0 $PAGESPACE 80 90 db1adm "PAGE SPACE" now      If I run this script manually, it gives correct values. The problem is when this script runs in crontab: it passes 0 values into function.


title: How to stop apt from uninstalling the packages while updating

text: I using apt in terminal to install an update. When i used `apt-get -f install` it showed               0 upgraded, 7 newly installed, 428 to remove and 3 not upgraded.     4 not fully installed or removed.     Need to get 5691kB of archives.     After this operation, 451MB disk space will be freed.     Do you want to continue [Y/n]?      I dont want to remove 428 packages. These are linked with other applications. (Some packages are Ruby1.8, Perl, python libraries and so on). How should i install the 7 packages without removing 428 packages.


title: redirect error out to standard output

text: I can save the error out in the same file as standard out. I have used this method below. The problem is that the error out is "always" shown at the top. In the example given below the error relates to the second last sql command where value "india" can not be saved. The error message should be shown next to that statement and not at the top of the file.               # cat import.txt     drop table if exists testme;     create table testme (id int , name varchar(255));     insert into testme values (1, 'abc');     insert into testme values (2, 'abc', 'india');     insert into testme values (3, 'xyz');          # mysql test -vvf  < import.txt  >standard.txt 2>&1          # cat standard.txt     ERROR 1136 (21S01) at line 5: Column count doesn't match value count at row 1     --------------     drop table if exists testme     --------------          Query OK, 0 rows affected          --------------     create table testme (id int , name varchar(255))     --------------          Query OK, 0 rows affected          --------------     insert into testme values (1, 'abc')     --------------          Query OK, 1 row affected          --------------     insert into testme values (2, 'abc', 'india')     --------------          --------------     insert into testme values (3, 'xyz')     --------------          Query OK, 1 row affected      The expected output will look something like this...               # mysql test -vvf  < import.txt     --------------     drop table if exists testme     --------------          Query OK, 0 rows affected          --------------     create table testme (id int , name varchar(255))     --------------          Query OK, 0 rows affected          --------------     insert into testme values (1, 'abc')     --------------          Query OK, 1 row affected          --------------     insert into testme values (2, 'abc', 'india')     --------------          ERROR 1136 (21S01) at line 4: Column count doesn't match value count at row 1     --------------     insert into testme values (3, 'xyz')     --------------          Query OK, 1 row affected      The error out should be placed exactly next to the statement that it relates to. Or else the redirected output file is not useful.


title: Compiling old solaris programs under Linux

text: I've got sources for a program developed under Solaris in ANSI-C. I am told it was developed around 1996-1997. I'm currently struggling with compiling it under a current Ubuntu. I got pretty far and I think only the GUI is still missing. They used a library called guide for this it seems. Does anyone know, if this library still exists somewhere? The relevant parts of the Makefile:               INCL    = -I$(GUIDEHOME)/include -I$(OPENWINHOME)/include     LOAD    = -L$(GUIDEHOME)/lib -L$(OPENWINHOME)/lib     LIB     = -lguide -lguidexv -lxview -lolgx -lX -lm     TAG     = -target sun4


title: Run script on "Safely remove" action in KDE

text: I have a Linux box with KDE 3.5.10. I do not plan to upgrade it soon, so please don't answer that. Now, I want to run a script each time I select the "Safely Remove" option on a mounted USB stick/HDD. The script must run before the filesystem is unmounted. Is it possible to do that?


title: I can't install new packages and can't update and upgrade

text: I'm trying to install some program on Ubuntu, but when I try it I got the following error.-               E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)     E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?      Searching on the WEB, I applied this.-               sudo lsof /var/lib/dpkg/lock     sudo kill -TERM <PID>     sudo dpkg --configure -a     sudo apt-get update && sudo apt-get upgrade      Apparently it works until the second line, but when I execute the third line the terminal doesn't answer (marks that it continues downloading a program that I tried previously to install. I left the PC works with this, one day, waiting for the end of this but nothing happened). The previous program that I tried to install is Dropbox. Thanks for any help.


title: Detecting images containing only black pixels

text: I am looking for a method for detecting if an image contains only black pixels. When I say method I mean an existing command line tool. I could write up something myself but I'm sure something probably exists already.


title: Firewalld SELinux

text: Is there any way to better explanation `firewall-cmd` than the one given in Fedora18 wiki. I am trying to convert iptables to FirewallD in cmd line without GUI but cannot find a decent example or tutorial to work around the issue.


title: Why does cd default to ~?

text: When you type `cd`, it basically does the same thing as `cd ~`. Why? I'm wondering if it's just a hard-coded behavior or if bash is expanding the command or something.


title: New to unix, Where should i start?

text: > **Possible Duplicate:**   >  Beginning to learn Unix and Linux I was working with .net for the past few years and now i am put into a project that has unix. I really dont know unix. where should i start? Any suggestion...


title: "Packing" linux up onto USB drive

text: I have been using my Linux Mint Nadia for some time and customized it a little, I was wondering if I can "pack it" onto a USB and make it into an ISO which I can boot on another computer and it will have all the settings and files that I currently have? Is that possible?


title: How Do I Package a Django Website for Debian (Not a Python Package or Egg)?

text: I have been searching for the last two weeks and chased myself into multiple dead ends trying to figure out the path that takes me where I want to go. However I finally have to admit that my answer isn't clearly posted anywhere, and here we are. I'll start off my clarifying: I don't want to build a redistributable Django "App" which seems to mean "plugin" - This isn't a python plugin, it's a full fledged website with an FCGI server, /etc/init.d script, config file in /etc/djangoapps and a requirements.txt for the plugins my site uses. I want to build a deb package to allow me to deploy to a Dev and Prod server from a build server (I'm using Bamboo, but Jenkins should be the same principle.) I also want to do this on Debian 7 Wheezy, not Ubuntu. PKGME Seems to do the job on Ubuntu and Debian 8, however it fails to install in a functional state in Wheezy, and I was unable to find a way to fix it. So I went with trying setuptools, stdeb, and debuild to create my package, which causes me to wind up with an egg, inside a deb, that does not contain any of my /etc or /usr files. So what is the proper method here?


title: Querying names of a text document

text: Print the lines that contain male ﬁrstnames in a file named muser.txt. Print the ﬁrstnames of all males from Italy. Print the number of diﬀerent ﬁrstnames of all males from Italy. ex of doc:               Linda:F:Las Vegas, USA:18:telnet     Steve:M:Leipzig, Germany:33:ftp     Henry:M:Milan, Italy:19:sftp     Alice:F:Izmir, Turkey:32:pop3s     Robert:M:Verona, Italy:21:scp     Olga:F:Gorontalo, Indonesia:19:pop3s     Kimberly:F:Lille, France:25:ping     Henry:M:Oslo, Norway:26:ftp     Carol:F:New Delhi, India:23:pop3s     Thomas:M:New Delhi, India:32:http


title: TAB autocomplete in Bourne Shell

text: I don't know how to get the TAB key to autocomplete filenames, commands, or anything at all. I'm on a Unix-like system (OS/390) and depend on several scripts that work in sh (Bourne shell, not BASH), but not in other shells (tcsh, for example), so I can't switch shells. I usually connect to this system via ssh or telnet from Ubuntu's GNOME Terminal running bash locally. Other people connect to the OS/390 system via telnet from the Windows XP command prompt, and they are able to autocomplete with the TAB key after issuing "set -o emacs". When I issue "set -o emacs", I get some of the appropriate functionality (ctrl-p to step backward through the history, for example), but not autocomplete. I am aware of the "set -o vi" option, but using "ESC-*", etc does not appeal to me because I know that the simple TAB key works for other people. Is there something about Ubuntu, the GNOME Terminal, bash, or ssh that sends a different tab character than a Windows XP command prompt running telnet? Does anyone have an idea as to why I might not be able to get tab to autocomplete while people on that same remote machine, running the same shell, can? Or know how I might fix this? Thanks!


title: Encrypting drive which has content

text: I have 2 hard drives 3TB each. The first of these drives is full with very important content. I have encrypted the second 3TB drive using the following technique: https://www.youtube.com/watch?v=J_g-W6hrkNA and have copied the files from the non encrypted first drive to the encrypted second drive. I now want to encrypt the first drive. How do I go about doing that? It has content in it, so I am assuming if I use the above link to encrypt it, the drive will be wiped?


title: How do I add an entry in /etc/fstab for a windows share?

text: I want to be able to mount our file server's file share (on a Mac OS X server, shared via AFP and Windows File Sharing) on my Ubuntu 10.10 linux laptop. I want to be able to mount it as my normal user, and be prompted for the password each time. What do I add to `/etc/fstab` to make this happen? I know I did it before, but I forgot how now. **EDIT:** The share in question is called "G4 320", and I am trying the following line in fstab:               //server_ip/G4\040320    /media/G4/    cifs    user,username=something    0    0      But I'm getting the following via `dmesg`: > CIFS VFS: cifs_mount failed w/return code = -6 **EDIT2:** As requested, more debug info. Output of `dmesg` with my fstab line:               [151994.740138] CIFS VFS: cifs_mount failed w/return code = -6     [152007.760136] CIFS VFS: cifs_mount failed w/return code = -6     [152132.770147] CIFS VFS: cifs_mount failed w/return code = -6     [152221.700152] CIFS VFS: cifs_mount failed w/return code = -6     [152245.340132] CIFS VFS: cifs_mount failed w/return code = -6      Output of `dmesg` with the `credentials` line from Michael:               [153117.088656] CIFS VFS: No username specified     [153117.088668] CIFS VFS: cifs_mount failed w/return code = -22     [153164.358300] CIFS VFS: No username specified     [153164.358312] CIFS VFS: cifs_mount failed w/return code = -22      `/var/log/messages` seems to have no useful information. **EDIT3** : OK. Thanks again to Michael I almost have it! If I put the following in `/etc/fstab` then it works:               //10.1.0.15/G4\040320H  /media/G4       cifs    user=AzureDiamond,password=hunter2       0       0      However:   1. I do not want my password in there...   2. I now need to use `sudo` to mount the share. How can I resolve those two issues?


title: Is it possible to have vim key bindings in terminal?

text: I'm getting used to vim bindings (like pressing w to go to word, dw to delete a word, and such) and it's modes (insert, normal, visual), and, out of curiosity would like to know: is there some kind of implementation of this behaviour of modes and bindindgs from vim to my terminal? Have insert mode, normal mode and such... Thanks!


title: Getting SVN 1.6/1.7 on Fedora 20

text: I have a remote repository which is running 1.6 that I have no admin rights to, thus I'm trying to install a version of SVN that is compatible with 1.6. Doing a `yum --showduplicates list subversion` shows me that there is only 1.8 available in the repository. Can anyone provide some pointers as to how I can get SVN 1.6/1.7 on Fedora 20? The only thing that I can find for SVN 1.6/1.7 seems to be the source code.


title: How to enable double tab autocompletion list in bash?

text: I've worked in Linux before where when I press tab it autocompletes until it becomes ambiguous. If I pressed tab twice at that point it would give me a list of all possible completions. My current Linux environment does not have the second feature(enabled?). So if I press tab it will autocomplete but it won't list all possible completions after that. How can I add/enable this feature? EDIT: turns out it's in csh not bash


title: Is there a reason that Apple's USB vendor ID on Linux is a close anagram of Broadcom's?

text: I was poking around in `lsusb` and I noticed that Apple's USB vendor ID, `05ac`, is a very close anagram of Broadcom's, `0a5c`. Is there a historical/political/other reason for this, or is it just a coincedence?


title: Application deployment over ssh

text: My job requires frequently updating versions of Centos-compiled software on customers PCs over multiple ssh hops. Recently this got to the point of unmanageable by hand. What software can be utilized to automate the process? What I need is something that will accept a bunch of updated files, transfer them over scp/ssh and automatically run unpack/replace script on remote host. Is there such software or is that writable by simple bash scripting? Ideally, what I want is to write(on my own machine) "helperappname hostname packagefile" and have helper app perform the deployment. or something like that.


title: reprepro and gpg-agent - passphrase won't be cached

text: I'm getting a little frustrated here, maybe you got an idea what the problem could be:   * I have a buildprocess with a few reprepro commands at the end   * The buildscript is executed with sudo              ( cd "$PUBLISHDIR" && \     reprepro -Vb . -C untested remove squeeze foobar && \     reprepro -Vb . -C untested includedeb squeeze ./foobar_*.deb && \     reprepro -Vb . -C untested list squeeze foobar )        * I have gpg set up and the key is added. the agent is running              ps lax | grep gpg-agent          1  1002 25345     1  20   0  19284   996 -      Ss   ?          0:00 /usr/bin/gpg-agent --daemon --sh        * My gpg-agent.conf is set up too              # ignore-cache-for-signing     enable-ssh-support     write-env-file /home/daily/.gnupg/gpg-agent-info     default-cache-ttl 31536000     default-cache-ttl-ssh 31536000     max-cache-ttl 31536000     max-cache-ttl-ssh 31536000     debug-all        * And i start the agent like this in the .bashrc              GNUPGHOME=~/.gnupg     GPGAGENT=/usr/bin/gpg-agent     PID_FILE=$GNUPGHOME/gpg-agent-info          if grep -qs '^[[:space:]]*use-agent' "$GNUPGHOME/gpg.conf" "$GNUPGHOME/options" && test -x $GPGAGENT & then       if [ -r "$PID_FILE" ]; then         . "$PID_FILE"         count=`ps lax | grep "/usr/bin/gpg-agent" | grep "$SSH_AGENT_PID" | wc -l`         if [ $count -eq 0 ]; then           if ! $GPGAGENT 2>/dev/null; then             $GPGAGENT --daemon --sh > "$PID_FILE"             . "$PID_FILE"             echo "INFO::agent started"           fi         else           echo "INFO::agent already running"         fi       fi     fi     ssh-add      But no matter how often I run the whole process, it will always ask me for the passphrase during the sign-process of reprepro. I thought the agent would cache this passphrase and next execution it will be stored and not beeing asked anymore... but it does ask for the passphrase... again and again... can anyone think of a mistake or something else maybe why it always asks for the passphrase?


title: Lotus Note installation on Linux Mint 14?

text: I'm trying to install IBM Lotus Note 8.5.3 on Linux Mint 14 using terminal. Problem is that it's not installing and showing following error               sudo apt-get install ibm-lotus-notes-8.5.3.i586.deb     Reading package lists... Done     Building dependency tree            Reading state information... Done     E: Unable to locate package ibm-lotus-notes-8.5.3.i586.deb     E: Couldn't find any package by regex 'ibm-lotus-notes-8.5.3.i586.deb'      I've install Lotus Note 8.5.3 on Ubuntu 12.04, without any problem. How can I solve this problem now on Linux Mint 14?


title: "PS/2 Generic Mouse" gets lost. How to reload without reboot?

text: I am running Ubuntu 12.04LTS on a ThinkPad E420s. My Trackpoint is recognized as "PS/2 Generic Mouse". My problem is that it doesn't load/disappears after booting or after suspension. I can't move it, and it is not listed in `xinput -list`. I always have to restart again and again until it is recognized. Even when it is loaded, it always takes a long time (like 5-10s). For this reason, I cannot run scripts to configure my trackpoint automatically on startup because the device is not yet there. I wonder whether there is a bash command that will wake my Trackpoint up, or whether I can even avoid the problem in the first place. I asked this question on various Linux sites, but got no help. Any help is greatly appreciated.


title: OpenSuse 12.3 keeps renaming network interfaces?

text: After installing OpenSuse 12.3 (x64) on a server box with a single (onboard) NIC (assigned to eth0), all works fine so far (static IP, static route, no "Network Manager" - just the good old way). Because this box will be a server, I added two additional NICs. Now the problems start to show. The device names changed in a way, that the functional eth0 (on board, external IP) is **now re-assigned** to eth2 (or eth1, probably depending on unknown preconditions). How to solve this? Any idea how to set up a network configuration with **device names based on established convention** (eth0 = external IP, eth1 .. ethN fur subnets 1..N)? Never ever there have been any problems in preceeding SuSE versions. Maybe it's caused by an arcane systemd which looks like it cannot be disabled anymore?


title: Linux (RedHat) `sudo su -l <<user_acct>>` does not source profile

text: As stated, having trouble with loading the default profile of `<<user_acct>>` when doing `sudo su -l <<user_acct>>`. Inside `.profile`,               if [ -r "${HOME}/.profile.custom" ]; then         . "${HOME}/.profile.custom"     fi      From what I've read (for example, answers similar to this one), `-l` should have triggered a login shell and therefore sourced `.profile`, but it doesn't seem to be working because the environment variables set in `.profile.custom` is not there (vs. if I just ran `. .profile`, they show up. **Revised question** : Any thoughts why or **how to get around this issue**? **Update** I found a solution for my problem after all... Turns out it was rather trivial - just set the environment variables in `.bash_profile` instead and they are set. According to the `bash` man page, as discussed here, > When bash is invoked as an interactive login shell, or as a non-interactive > shell with the --login option, it first reads and executes commands from the > file /etc/profile, if that file exists. **After reading that file, it looks > for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads > and executes commands from the first one that exists and is readable.** The > --noprofile option may be used when the shell is started to inhibit this > behavior. .. the key lies in the **_first_** one that exists. _Lesson learned: read the "fine" print_


title: Centos installation

text: I want to install CentOS 6.4 on HP DL380 G4 server. First of all I select `install or upgrade an existing system`, but it boot something like without graphic (like basic video card). My main problem is in partitioning type: it shows this and won't let me custom partitioning:                                             |partitioning type|          installation require partitioning of your hard drive. the default layout is suitable      for most users. select what space to use and which drive to use as the install layout                                         Use entire drive                               Replace existing Linux system                               Use free space                        [*] cciss/c0d0 .... MB (compaq amart arrey)                                     OK                 BACK       I want to manually make the partitioning myself, but selecting each one of them don't let me to do that. What to do?


title: Databases for embedded Linux?

text: I need to choose a database for an application on an embedded linux platform. Any suggestions on which databases are typically used with embedded linux? Please let me know. Regards Radha.


title: What is the meaning of this test expression []?

text: I've seen someone use command:                ps -ef | grep [h]ttpd  and Output is:               apache   25125 31006  0 21:54 ?        00:00:00 /usr/sbin/httpd     apache   26869 31006  0 22:04 ?        00:00:00 /usr/sbin/httpd     apache   27349 31006  0 22:07 ?        00:00:00 /usr/sbin/httpd     apache   27696 31006  0 22:09 ?        00:00:00 /usr/sbin/httpd     apache   28534 31006  0 22:14 ?        00:00:00 /usr/sbin/httpd     root     31006     1  0 16:16 ?        00:00:00 /usr/sbin/httpd     apache   31011 31006  0 16:16 ?        00:00:00 /usr/sbin/httpd      2 brackets surrounding the letter "h" where the `grep` to do?


title: Force Debian kernel version

text: I need Debian with kernel 2.6.34.8 Is there any way to force Debian with it? I don't want to install and then compile version I need.


title: Enable running mono apps by double-clicking on the .exe file

text: I always wondered if running Mono apps will ever be available for Linux by just double clicking on the `.exe`. Now, in order to have a launcher on GNOME, the best way is to add a new bash file which will do the 'mono myapp.exe' for you. I remember there were some ideas to have that in Linux long time ago, but nothing recently...


title: Java uses max 8 cores on Debian, even though 16 are available

text: I have two servers at hand, both with 16 cores. The first is running Debian, the second running Ubuntu. I have written a small multithreaded java app that creates 16 threads. On the Debian machine, the program uses at most 8 cores, while on the Ubuntu machine the program uses all 16 cores. Since my program and the hardware are identical, the used cores must somehow be limited by Linux itself. What is the cause for this limit? How can I increase this limit? ### /proc/cpuinfo (i = 0 to 15):               processor   : i     vendor_id   : GenuineIntel     cpu family  : 6     model       : 44     model name  : Intel(R) Xeon(R) CPU           E5630  @ 2.53GHz     stepping    : 2     cpu MHz     : 2533.390     cache size  : 12288 KB     physical id : 1     siblings    : 8     core id     : 10     cpu cores   : 4     apicid      : 53     initial apicid  : 53     fpu     : yes     fpu_exception   : yes     cpuid level : 11     wp      : yes     flags   : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 popcnt aes lahf_lm ida arat epb dts tpr_shadow vnmi flexpriority ept vpid     bogomips    : 5066.86     clflush size    : 64     cache_alignment : 64     address sizes   : 40 bits physical, 48 bits virtual     power management:      ### java -version:               java version "1.6.0_26"     Java(TM) SE Runtime Environment (build 1.6.0_26-b03)     Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)      ### uname -a:               Linux servername 2.6.38-2-amd64 #1 SMP Thu Apr 7 04:28:07 UTC 2011 x86_64 GNU/Linux


title: Is it possible to set Gnome Terminal's title to "user@host" for whatever host I'm connected to?

text: I'd like to set the terminal title to `user@host` so I can easily tell which machine I'm connected to from the window title. Is there a way to do this from SSH or from GNOME Terminal?


title: Storing a list in a variable

text: I am trying to store the name of list of files that contain `781` in their name. I will be using this list to perform some operations and after that I will delete this list. I have two options to do this. **Option 1** : I can store the list in a temporary file using below command.               ls -lart *781* | awk '{print $9}' > tempo      File `tempo` will contain the list and I will delete this file later after using. **Option 2** : If I can somehow store the list in a variable and use that variable instead. I am trying below code to implement this but this doesn't work.               filelist=`ls -lart *781* | awk '{print $9}'`     echo $filelist      But above code doesn't give any output. Please help me out with the syntax. **Edit** : I am using k-shell.


title: Xen on openSUSE 11.4

text: I have done a few installs of openSUSE to use as a Xen dom0 and have not got it working yet. These are the steps I followed:   1. Installed openSUSE 11.4 from Live KDE CD.   2. Installed all updates via YaST>Package Management.   3. Installed Xen via YaST>Install Hypervisor (installed all xen and kernel packages required).   4. Reboot into Xen kernel. After this if I go into YaST>Create Virtual Machine I can specify all the relevant options for my first VM (domU) but when I click finish I get this error: `Failed to start vm-install` If I then go into YaST>Virtual machine Manager then right click the Xen Hypervisor and click Connect I get the following errors:               Unable to open a connection to the Xen hypervisor/daemon.          Verify that:     - A Xen host kernel was booted     - The Xen service has been started      and               unable to connect to 'localhost:8000': Connection refused          Traceback (most recent call last):     File "/usr/share/virt-manager/virtManager/connection.py", line 983, in _try_open     None], flags)     File "/usr/lib64/python2.7/site-packages/libvirt.py", line 107, in openAuth     if ret is None:raise libvirtError('virConnectOpenAuth() failed')     libvirtError: unable to connect to 'localhost:8000': Connection refused      I am definitely in the correct Kernel and all processes appear to be started as per:               kaon:/home/danny # uname -a     Linux kaon.cybertron.local 2.6.37.6-0.7-xen #1 SMP 2011-07-21 02:17:24 +0200 x86_64 x86_64 x86_64 GNU/Linux     kaon:/home/danny # ps -ef | grep xen     root 15 2 0 19:54 ? 00:00:00 [xenwatch]     root 16 2 0 19:54 ? 00:00:00 [xenbus]     root 1735 1 0 19:55 ? 00:00:00 xenstored     root 1742 1 0 19:55 ? 00:00:00 xenconsoled --pid-file=/var/run/xenconsoled.pid     root 2017 1 0 19:55 ? 00:00:00 /usr/bin/python /usr/sbin/xend start     root 2019 2017 0 19:55 ? 00:00:00 /usr/bin/python /usr/sbin/xend start     root 2975 2956 0 20:00 pts/1 00:00:00 grep xen      I have posted this issue on the openSUSE forums here but no one has been able to help. The only other thing I've found Google searching that relates to this error is a mismatch between the versions of xen and xen-tools installed which I have confirmed is not my case, both packages have matching versions as expected.


title: Ctrl + left/right arrow keys issue

text: After the last system update the _ctrl + left/right arrow_ command on _zsh_ terminal doesn't do anything. Also ctrl+ u has something wrong because usually that command erase from the cursor to the beginning of the line, while now erase entire line.. Someone knows how to solve these problems? thank you all.


title: Having Latest Versions of all Apps in Ubuntu 12.10

text: As we all know that Arch Linux repository is updated with all the latest releases of all the softwares. But in Ubuntu, The repo is not updated that often resulting in user using the older versions of the softwares. I need a workaround,Tip or repo for Ubuntu 12.10 such that I should be able to get all the latest versions of the apps released.


title: How to set OOM killer adjustments for daemons permanently?

text: Running some Linux servers with single or just a few vital system service daemons, I would like to adjust the OOM killer for those daemonized processes in case something odd happens. For example, today some Ubuntu server running MySQL got a killed MySQL daemon because tons of `apt-checker` processes were consuming all memory and the kernel thought it was a good idea to kill MySQL. I know I can adjust the score using the `/proc/$(pidof mysqld)/oom_score_adj` file to give the kernel some clue I don't prefer MySQL to be killed, yet that doesn't survive a restart of the service. Should I edit init/upstart scripts from the package to include these adjustments? I don't think that's a very elegant solution as I would make adjustments to files belonging to a package. Would it be possible to hook into upstart/init scripts in general and conditionally adjust it? Or would you suggest running an indefinite script like `while true{ adjust_oom(); sleep 60;}`?


title: What does this process STAT indicates?

text: ![enter image description here](http://i.stack.imgur.com/7M4pP.png) If you check the `STAT column` in above image you will see `Ss S S< SN and R+` What does this indicates ? `Process states`. If yes,Then what is the significance of `'Ss S< SN and R+'`?


title: gvim colors the same as is the terminal

text: Is there a command I can put in the `.vimrc` to make gvim look like vim's setup in the terminal? Same back ground, syntax highlighting, colors, and font. To add to my question, is there a may for gvim to follow vim's vimrc? That is, there layouts and actions are identical?


title: What is a good desktop *nix aside from Linux, *BSD, and OS X?

text: What other common or semi-common or simply not super-rare *nixes are there in desktop use aside from distributions of Linux, various BSDs and Mac OS X?


title: How to sync multiple Palm PDA devices?

text: I am using a Palm Tungsten E2 PDA which I sync to a linux machine via jpilot. jpilot is kind of ugly but it works and it is sufficient to look up things on the computer. Now I want to sync the same data to a 'backup' Palm PDA (m150). First tests with jpilot did not work as expected, because it seems that the devices differ too much and jpilot is too dependent on different database file formats (i.e. I guess the devices internally use different database schemas). Syncing to the backup PDA m150 works with j-pilot, when a fresh `~/.jpilot` config is used. How can I solve this? Is there is some GUI which supports to sync to multiple devices (and abstracts away device differences)? Since I am using Ubuntu 10.04 I assume that KDE Akonadi is not a solution because it is too alpha.


title: My Postfix installation is sending out spam; how to stop it?

text: Since a few days, my web/mailserver (centos 6.4) is sending out spammails by the bunch, and only stopping the postfix service is putting an end to it. SMPT is set up to only accept connections over ssl and using username/pwd. And I already changed the password of the (suspected) infected emailaccount. Email was set up via iRedMail. Any help on identify and stopping this is more then welcome! ADDED: Some logs excerpts:               Mar 23 05:01:52 MyServer postfix/smtp[9494]: 4E81026038: to=<bet@magiccablepc.com>, relay=mail.suddenlinkmail.com[208.180.40.132]:25, delay=3, delays=0.07/0/2.4/0.5, dsn=2.0.0, status=sent (250 Message received: 20140323040153.YPML21660.txedge-vm03.suddenlink.net@MyServer.org)     Mar 23 05:02:01 MyServer postfix/smtp[9577]: 209BA26067: to=<gino.c@bigpond.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=14, delays=12/0/0/2, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as B654226078)     Mar 23 05:02:01 MyServer postfix/smtp[9495]: 8278726077: to=<harry@gunship.org>, relay=mx-biz.mail.am0.yahoodns.net[98.139.171.245]:25, delay=0.88, delays=0.25/0/0.47/0.14, dsn=4.7.1, status=deferred (host mx-biz.mail.am0.yahoodns.net[98.139.171.245] said: 421 4.7.1 [TS03] All messages from [IPADDRESS] will be permanently deferred; Retrying will NOT succeed. See http://postmaster.yahoo.com/421-ts03.html (in reply to MAIL FROM command))      A mailheader of an undeliverable report:               Return-Path: <MAILER-DAEMON>     Delivered-To: info@fotografieluna.be     Received: from localhost (icantinternet.org [127.0.0.1])              by icantinternet.org (Postfix) with ESMTP id 4669E25D9D              for <info@fotografieluna.be>; Mon, 24 Mar 2014 14:20:15 +0100 (CET)     X-Virus-Scanned: amavisd-new at icantinternet.org     X-Spam-Flag: YES     X-Spam-Score: 9.501     X-Spam-Level: *********     X-Spam-Status: Yes, score=9.501 tagged_above=2 required=6.2              tests=[BAYES_99=3.5, BAYES_999=0.2, RAZOR2_CF_RANGE_51_100=0.5,              RAZOR2_CF_RANGE_E8_51_100=1.886, RAZOR2_CHECK=0.922, RDNS_NONE=0.793,               URIBL_BLACK=1.7] autolearn=no     Received: from icantinternet.org ([127.0.0.1])              by localhost (icantinternet.org [127.0.0.1]) (amavisd-new, port 10024)              with ESMTP id FOrkYnmugXGk for <info@fotografieluna.be>;              Mon, 24 Mar 2014 14:20:13 +0100 (CET)     Received: from spamfilter2.webreus.nl (unknown [46.235.46.231])              by icantinternet.org (Postfix) with ESMTP id D15BA25D14              for <info@fotografieluna.be>; Mon, 24 Mar 2014 14:20:12 +0100 (CET)     Received: from spamfilter2.webreus.nl (localhost [127.0.0.1])               by spamfilter2.webreus.nl (Postfix) with ESMTP id 7FB2EE78EFF              for <info@fotografieluna.be>; Mon, 24 Mar 2014 14:20:13 +0100 (CET)     X-Virus-Scanned: by SpamTitan at webreus.nl     Received: from mx-in-2.webreus.nl (mx-in-2.webreus.nl [46.235.44.240])              by spamfilter2.webreus.nl (Postfix) with ESMTP id 3D793E78E5A              for <info@fotografieluna.be>; Mon, 24 Mar 2014 14:20:09 +0100 (CET)     Received-SPF: None (mx-in-2.webreus.nl: no sender authenticity        information available from domain of        MAILER-DAEMON@athosian.udag.de) identity=pra;        client-ip=62.146.106.25; receiver=mx-in-2.webreus.nl;        envelope-from=""; x-sender="MAILER-DAEMON@athosian.udag.de";        x-conformance=sidf_compatible     Received-SPF: None (mx-in-2.webreus.nl: no sender authenticity        information available from domain of        postmaster@athosian.udag.de) identity=mailfrom;        client-ip=62.146.106.25; receiver=mx-in-2.webreus.nl;        envelope-from=""; x-sender="postmaster@athosian.udag.de";        x-conformance=sidf_compatible     Received-SPF: None (mx-in-2.webreus.nl: no sender authenticity        information available from domain of        postmaster@athosian.udag.de) identity=helo;        client-ip=62.146.106.25; receiver=mx-in-2.webreus.nl;        envelope-from=""; x-sender="postmaster@athosian.udag.de";        x-conformance=sidf_compatible     Received: from athosian.udag.de ([62.146.106.25])        by mx-in-2.webreus.nl with ESMTP; 24 Mar 2014 14:20:03 +0100     Received: by athosian.udag.de (Postfix)              id 3B16E54807C; Mon, 24 Mar 2014 14:19:59 +0100 (CET)     Date: Mon, 24 Mar 2014 14:19:59 +0100 (CET)     From: MAILER-DAEMON@athosian.udag.de (Mail Delivery System)     Subject: ***Spam*** Undelivered Mail Returned to Sender     To: info@fotografieluna.be     Auto-Submitted: auto-replied     MIME-Version: 1.0     Content-Type: multipart/report; report-type=delivery-status;               boundary="36D9C5488E5.1395667199/athosian.udag.de"     Content-Transfer-Encoding: 7bit     Message-Id: <20140324131959.3B16E54807C@athosian.udag.de>


title: How can I replace the default kernel with an earlier kernel?

text: I am working on petalinux, Linux for xilinx FPGAs. The source code is here This Linux is having 3.x kernel, and I have been asked to change the kernel to some earlier release version. What are the general steps for replacing the kernel? I have downloaded an eralier version form kernel.org. What is the next step?


title: Apache ownership and permissions for wordpress

text: I'm new to running a VPS, but I managed to get the whole system setup and secured without any issues :) My question concerns Apache and the different ways it can operate. For this particular machine I am the only user, and I will be using the box mainly to run WordPress on a LAMP Stack with Ubuntu 12.04.3 LTS. I have Apache installed and it is running as the `www-data` user. For the purposes of this example, lets call my user `foo`. If I just set up a base configuration of WordPress, the system won't be able to write to the directories, for reasons I still don't quite understand, because `www-data` is the Apache user, and isn't `foo`, the owner of the files. From what I understand, I **don't** want to make my files owned by `www-data` as this can be very dangerous and insecure. However, might it be a good idea to make my files group writable, or is that not the best option either? If someone could shed a little light on the workings of Apache for a newbie like myself, that would mean a lot, as well as the best configuration to put my server in so that the files are writable by my user but can be accessed by applications such as WordPress.


title: bzr get last commit message using bash

text: I am using bash to try and get the last commit message of the most recent revision on a tree. In the documentation the closest thing I found was:               bzr log -l 1 --line      Which outputs:               45: Firstname Lastname 2013-11-20 some message here      I want to use bash regex to extract the message however the fact that the name field can be:               Firstname Lastname     Firstname Initial Lastname     Firstname Lastname <email>     Initials     Username <email>     Username      It makes it a lot harder. I don't need you to build me a regex I would just like to know:   1. If bazaar has some command that shows the message (cant find in http://doc.bazaar.canonical.com/bzr.2.5/en/user-reference/index.html)   2. Should I use regex and use the date as the anchor to parse out message?


title: Can I make a USB port on my Linux computer look like a mass storage device?

text: I'm running Kubuntu 12.04 on my PC. I want to make one USB port on my computer appear as if it is a USB mass storage device to other devices. In other words, something connected to this USB port will think my whole PC is just an external HDD or a media player or some other USB mass storage device. Is this possible? If so, how would I do it?


title: git push fails with remote: error: hook declined to update refs/heads/master

text: I'm recently trying to start my own project on a community git repo, and I've been having some complications. I'm new to git, but here's what I've been trying to do to just test it. I run the following commands and they all run ok.               git config --global user.name "MYNAME"     git config --global user.email "MYEMAIL"     mkdir testproject     cd testproject     git init     touch README     git add README     git commit -m 'first commit'     git remote add origin git@git.xxxxx.org:community/testproject.git      and all of the above commands run with no error. However, when I the run the next command I get a huge error.               git push -u origin master      and the error is.               Counting objects: 3, done.     Writing objects: 100% (3/3), 204 bytes | 0 bytes/s, done.     Total 3 (delta 0), reused 0 (delta 0)     Username for 'http://git.xxxxxx.org': MYEMAIL     Password for 'http://MYEMAIL.com@git.xxxxxx.org':      remote: /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/spec_set.rb:92:in `block in materialize': Could not find rake-10.1.0 in any of the sources (Bundler::GemNotFound)     remote:         from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/spec_set.rb:85:in `map!'     remote:         from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/spec_set.rb:85:in `materialize'     remote:         from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/definition.rb:114:in `specs'     remote:         from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/definition.rb:159:in `specs_for'     remote:         from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/definition.rb:148:in `requested_specs'     remote:         from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/environment.rb:18:in `requested_specs'     remote:         from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:13:in `setup'     remote:         from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler.rb:120:in `setup'     remote:         from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/setup.rb:17:in `<top (required)>'     remote:         from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'     remote:         from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'     remote: error: hook declined to update refs/heads/master     To http://git.xxxxxx.org/community/testproject.git      ! [remote rejected] master -> master (hook declined)     error: failed to push some refs to 'http://git.xxxxxx.org/community/testprojact.git'      I'm not really sure what to do from here, but any help is much appreciated. Also, I'm running Arch if it matters. **Edit:** I've tried re-installing rake and it didn't work. My current version of rake was 10.1.1, so I tried removing it and replacing it with version 10.1.0 and that also didn't fix it. However when I was installing rake, I got an error:               WARNING:  You don't have /home/josh/.gem/ruby/2.0.0/bin in your PATH,               gem executables will not run.      Could this be contributing to the problem?


title: Move /var to different partition

text: my disk space on the / partition is very limited. ~~As there are other partitions available~~ I'd like to move /var to /differentPartition/var. The simplest solution coming to mind is just moving the current files and linking to the new directory. However I'm not really sure if that's a good idea and if it is as simple as that... Am I about to break my system? P.S: SUSE Linux Enterprise Server 11 SP1 (x86_64); Linux version 2.6.32.43-0.4-default (geeko@buildhost) (gcc version 4.3.4 [gcc-4_3-branch revision 152973] (SUSE Linux) ) #1 SMP 2011-07-14 14:47:44 +0200 Edit:               # cat etc/fstab          devpts  /dev/pts          devpts  mode=0620,gid=5 0 0     proc    /proc             proc    defaults        0 0     sysfs   /sys              sysfs   noauto          0 0     debugfs /sys/kernel/debug debugfs noauto          0 0     usbfs   /proc/bus/usb     usbfs   noauto          0 0     /dev/sda1 /               ext3    defaults        1 1      I was confused not to see my other disk here. The OS is running in a virtual box though and I figure virtual hard drives are treated differently to "normal" disks? So to clarify things, I'd like to move /var to a virtual hard drive... Edit 2:               # mount          /dev/sda1 on / type ext3 (rw)     proc on /proc type proc (rw)     sysfs on /sys type sysfs (rw)     debugfs on /sys/kernel/debug type debugfs (rw)     devtmpfs on /dev type devtmpfs (rw,relatime,mode=0755,nr_inodes=0,mode=755,size=27g)     tmpfs on /dev/shm type tmpfs (rw,mode=1777)     devpts on /dev/pts type devpts (rw,mode=0620,gid=5)     fusectl on /sys/fs/fuse/connections type fusectl (rw)     securityfs on /sys/kernel/security type securityfs (rw)     none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)


title: Installing Xcache-3.1.0 on CentOS 5.9 32-bits

text: I'm renting a VPS that is running suPHP, so my hosting company told me I can't install APC because of that. (I did not ask why.) So I wanted to test out Xcache and followed this guide for installing it on my CentOS 5.9 32-bit. However, I got some errors on installing it:               [root@1332 ~]# wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm     --2013-11-25 13:49:50--  http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm     Resolving download.fedoraproject.org... 85.236.55.6, 80.239.156.215, 66.35.62.166, ...     Connecting to download.fedoraproject.org|85.236.55.6|:80... connected.     HTTP request sent, awaiting response... 302 FOUND     Location: http://mirror.nl.leaseweb.net/epel/6/i386/epel-release-6-8.noarch.rpm [following]     --2013-11-25 13:49:50--  http://mirror.nl.leaseweb.net/epel/6/i386/epel-release-6-8.noarch.rpm     Resolving mirror.nl.leaseweb.net... 94.75.223.121, 2001:1af8:4030:1:0:dead:beef:cafe     Connecting to mirror.nl.leaseweb.net|94.75.223.121|:80... connected.     HTTP request sent, awaiting response... 200 OK     Length: 14540 (14K) [application/x-redhat-package-manager]     Saving to: `epel-release-6-8.noarch.rpm'          100%[===================================================================================================================>] 14,540      --.-K/s   in 0s          2013-11-25 13:49:50 (46.2 MB/s) - `epel-release-6-8.noarch.rpm' saved [14540/14540]          [root@1332 ~]# rpm -ivh epel-release-6-8.noarch.rpm     warning: epel-release-6-8.noarch.rpm: Header V3 RSA/SHA256 signature: NOKEY, key ID 0608b895     error: Failed dependencies:             rpmlib(FileDigests) <= 4.6.0-1 is needed by epel-release-6-8.noarch             rpmlib(PayloadIsXz) <= 5.2-1 is needed by epel-release-6-8.noarch          [root@1332 ~]# yum install php-xcache xcache-admin     Loaded plugins: fastestmirror, security     Loading mirror speeds from cached hostfile      * base: mirror.colocenter.nl      * epel: ftp.nluug.nl      * extras: ftp.tudelft.nl      * updates: centos.mirror1.spango.com     Excluding Packages in global exclude list     Finished     Setting up Install Process     No package php-xcache available.     No package xcache-admin available.     Nothing to do      I don't really understand that the server doesn't have the packages available. * * * I found the first problem: Sounds like this is not a 6.x machine. `rpm -q centos-release` stated centos-release-5-9.el5.centos.1 So I installed the 5.x version and this came up: package epel- release-5-4.noarch is already installed But, still "nothing to do":               [root@1332 etc]# yum install php-xcache xcache-admin     Loaded plugins: fastestmirror, security     Loading mirror speeds from cached hostfile      * base: mirror.colocenter.nl      * epel: ftp.nluug.nl      * extras: ftp.tudelft.nl      * updates: centos.mirror1.spango.com     Excluding Packages in global exclude list     Finished     Setting up Install Process     No package php-xcache available.     No package xcache-admin available.     Nothing to do      Did `yum clean-all` and `yum update`               [root@1332 /]# php -v     PHP 5.3.25 (cli) (built: Jun  3 2013 17:25:29)     Copyright (c) 1997-2013 The PHP Group     Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies         with the ionCube PHP Loader v4.4.0, Copyright (c) 2002-2013, by ionCube Ltd., and         with Zend Guard Loader v3.3, Copyright (c) 1998-2010, by Zend Technologies      Okay, so I'm following another guide for CentOS 5, but I get stuck again:               [root@1332 opt]# yum install php-devel     Loaded plugins: fastestmirror, security     Loading mirror speeds from cached hostfile      * base: centos.mirror.triple-it.nl      * epel: mirror.1000mbps.com      * extras: centos.mirror1.spango.com      * updates: centos.mirror.triple-it.nl     Excluding Packages in global exclude list     Finished     Setting up Install Process     No package php-devel available.     Nothing to do      I'm now looking into that problem...               yum search 'php-devel'     Loaded plugins: fastestmirror, security     Loading mirror speeds from cached hostfile      * base: centos.mirror.triple-it.nl      * epel: mirror.1000mbps.com      * extras: centos.mirror1.spango.com      * updates: centos.mirror.triple-it.nl     Excluding Packages in global exclude list     Finished     Warning: No matches found for: php-devel     No Matches found      Found the reason: php* has been excluded in yum.conf Got around that I don't need it all and I need to follow this guide But, yet again, I get stuck:               [root@1332 home]# ./configure .enable-xcache     -bash: ./configure: No such file or directory      The README file in the directory of Xcache says nothing on the that. As you can see, I'm kind new to this.


title: How to determine which host generated a core file?

text: I have a setting where several machines share the same filesystem via NFS. Through a queueing system processing jobs can be submitted to several computing machines (with different properties). Sometimes, a job will crash and leave behind a core file (with a name like `core.1234`). Is there a way to find out which host generated that core file? What its hostname was? (This is on Linux 64 bits, if it makes a difference).


title: Is there a way to find out which webpages are being accessed by clients on a UNIX webserver?

text: My web server is running CentOS and every time a certain page is accessed on my forum, `httpd` locks up and I can never seem to pinpoint the exact file. Is there any way to view the pages that currently have requests open on a CentOS/UNIX-based server?


title: Problem to launch java at Debian: "error while loading shared libraries: libjli.so"

text: I'm trying to launch java:               $ java -version     java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory          $ ldd /usr/lib/jvm/java-6-openjdk/jre/bin/java             linux-gate.so.1 =>  (0xb779f000)             libz.so.1 => /usr/lib/libz.so.1 (0xb7780000)             libpthread.so.0 => /lib/i686/cmov/libpthread.so.0 (0xb7767000)             libjli.so => /usr/lib/jvm/java-6-openjdk/jre/bin/../lib/i386/jli/libjli.so (0xb7762000)             libdl.so.2 => /lib/i686/cmov/libdl.so.2 (0xb775e000)             libc.so.6 => /lib/i686/cmov/libc.so.6 (0xb7603000)             /lib/ld-linux.so.2 (0xb77a0000     $ ls /usr/lib/jvm/java-6-openjdk/jre/bin/../lib/i386/jli/     libjli.so      But java works under root:               $ sudo java -version     java version "1.6.0_18"     OpenJDK Runtime Environment (IcedTea6 1.8.7) (6b18-1.8.7-2~lenny1)     OpenJDK Client VM (build 14.0-b16, mixed mode, sharing)      UPD: /usr/lib/jvm/java-6-openjdk/jre/bin/java is actually my java command:               $ type java     java is hashed (/usr/bin/java)     $ ls -l /usr/bin/java     lrwxrwxrwx 1 root root 22 Jul 14 10:15 /usr/bin/java -> /etc/alternatives/java     $ ls -l /etc/alternatives/java     lrwxrwxrwx 1 root root 40 Jul 14 10:36 /etc/alternatives/java -> /usr/lib/jvm/java-6-openjdk/jre/bin/java      UPD2: I'm also tried to set root PATH:               $ sudo su     # echo $PATH     /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin     # exit     $ export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin     $ java -version     java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory      UPD3: I'm tried:               # comm -3 <(declare | sort) <(declare -f | sort)      under root. But there is no usable enviroment variables for java. UPD4: `strace -f java -version` result: http://dumpz.org/67368/


title: using lines of output as an array in bash

text: I have a mysql database on a shared web host. It's grown too large, and a single dump process with zipping is getting killed. I want to dump and zip each table in individually. With this command               mysqldump -uuser -ppass database < show_tables.sql      I can get it to return all the names of the tables like so:               table1     table2     etc     ...      How can I feed this into a bash script so that I can feed each line into a command of this syntax               mysqldump -uuser -ppass database table_name_goes_here > and_here.sql      ? **Edit** Sorry folks, I made a mistake in the original formatting. The output from the `show tables` query is not a single line with space-delimited table names; it is actually one table name per line, as it is formatted now. I apologize for the confusion.


title: What is transaction check in Yum installation

text: What is the "Transaction Test" that will be done during installation using yum? Please explain with details..


title: Upgrading Apache 2.2.16 (package version) to the latest version 2.2.26 (compiled version) on Debian Squeeze

text: I have Debian Squeeze which is shipped with Apache 2.2.16, the latest version of the package. For PCI compliance I need to upgrade to the latest 2.2.26. But this version does not exist as a binary package so I need to compile and install it manually. The problem is I have no experience in compiling, and I wonder how I can compile and install the 2.2.26 version at the same location as the existing version, and keeping all the config files. How can I do this? I don't know where exactly Apache2 is installed, and how to configure the config file to point to that location.


title: How do I track why X11 keyboard shortcuts don't work?

text: I am on Arch Linux. I am completely stuck trying to figure out why some of the key combinations work on regular DELL 101 key usb keyboard in X11, but not on the mechanical gaming one. I have 2 keyboards (ttesports and Corsair K60) which malfunction in X11 exactly the same way: all works, except `Ctrl`+`Alt`+`Fn`, `Ctrl`+`Alt`+`Backspace` and CapsLock LED. Keyboard is configured by the following section in config file:               Section "InputClass"             Identifier "system-keyboard"             Driver       "evdev"             MatchIsKeyboard "on"             Option "XkbLayout" "us,ru"             Option "XkbOptions" "grp:lalt_lshift_toggle,terminate:ctrl_alt_bksp"     EndSection      In order to diagnose, I plugged in both DELL and ttesports keyboards at the same time. I'm trying to see what's different when I click `Ctrl`+`Alt`+`F2`. I use `xev` to track what events are generated. When I press `Ctrl`+`Alt`+`F2`, both keyboard generate identical output (except serial), but only the DELL one switches to VT2, the ttesports leaves the screen as-is. Output is:               KeyRelease event, serial 36, synthetic NO, window 0x2000001,         root 0x287, subw 0x0, time 74514015, (2239,-23), root:(2385,850),         state 0xc, keycode 68 (keysym 0x1008fe02, XF86Switch_VT_2), same_screen YES,         XLookupString gives 0 bytes:          XFilterEvent returns: False      As far as I could tell, both keyboards work identically in console mode (not X11 that is), in a sense that every shortcut works fine as far as I could tell. How do I track why one keyboard switches the VT, and the other doesn't? **EDIT:** I also tried to track the CapsLock behavior. I used `showkey` command on the console. It shows keycode 58 press/release when I use CapsLock button on either keyboard. However:   * Pressing `CapsLock` on either keyboard toggles CapsLock state.   * Pressing `CapsLock` on DELL keyboard makes CalsLock LED toggle on DELL keyboard only.   * Pressing `CapsLock` on ttesports keyboard toggles actual CapsLock state, but CapsLock LED doesn't toggle on neither of 2 keyboards.   * Pressing `CapsLock` on ttesports keyboard, when CapsLock LED is on on DELL keyboard does not turn it off, althoug it does turn off actual CapsLock state.


title: Using a secondary DNS when lookup fails in primary?

text: I use a VPN to connect my development machine to my school's CS dept. The development machine is Ubuntu as we do C programming in Unix. I used `vpnc` to do that. The school uses some DNS entries that only resolve on their DNS servers, i.e., internalserver.csdept.school.edu I am normally attached to the VPN whenever booted for convenience. However I noticed the other day that when I disconnect the VPN all my DNS queries fail. This obviously means that `vpnc` set up the school's DNS to be used. However I'd rather not use their DNS all the time (tracking and privacy and whatnot). Is there a way I can restore my ISP's DNS and then if the lookup fails, have it use my school's DNS?


title: Ubuntu Kernel Compilation?

text: I'm trying to compile and install kernel 3.13.1 on ubuntu 13.10 using following commands:               sudo apt-get install gcc      sudo apt-get install libncurses5-dev      cd Downloads/      sudo tar -xvf linux-3.0.tar.bz2 -C /usr/src/      cd /usr/src/linux-3.0/      sudo make menuconfig      sudo make oldconfig      sudo make       After the last command it gets compiled, but when I try to install that using the command:               sudo make modules_install install       is gives an error saying: > file 'include/config/auto.cnfig.cmd' has modification time 3.6e+04 sec in > future   >  cannot stat /usr/src/linux/modules.builtin no such file or directory exist Can anyone help me out installing that?


title: How to make sudo use root password for some commands and user password for others

text: I know in `/etc/sudoers`, one can put _Defaults rootpw_ , but then `sudo` asks for the root password for all commands. Is there any way I can have `sudo` ask for the root password for some commands and the user password for others?


How can I change the background of the Xfce notification area? Changing the background color of the whole Xfce4-panel doesn't work as expected and now it looks like this: ![enter image description here](http://i.stack.imgur.com/HXGZ0.png) How can I change it?


title: How can I install more recent versions of software than what Debian provides?

text: Suppose I want a more recent version of software than is available for my current version of an operating system, what can I do? Cases to consider:   1. There are semiofficial/official sources of additional packages available for that version of the OS. E.g. backports.org for Debian or PPAs for Ubuntu.   2. There are no more recent versions of the package available for that version of the OS, but there are more recent versions available for more recent versions of the OS. This is the standard case for backporting.   3. There are no packaged versions of more recent versions of the software available. Options available are to package the more recent version. * * * Per Let's compile a list of canonical Q&As this is intended as a place to put canonical answers for the following. Answers should probably be made community wiki.


title: Grep from the end of a file to the beginning

text: I have a file with about 30.000.000 lines (Radius Accounting) and I need to find the last match of a given pattern. The command:               tac accounting.log | grep $pattern      gives what I need, but it's too slow because the OS has to first read the whole file and then send to the pipe. So, I need something fast that can read the file from the last line to the first.


title: LVM2: Obtaining lv and vg names from path (volume group name and logical volume name)

text: Let's assume we have lv path:               lvpath=/dev/mapper/vg2-Music      Than I split `lvdisplay -c` with cut:               vgname="$(lvdisplay -c "$lvpath" | cut -d ':' -f 2 )"     lvname="$(basename "$(lvdisplay -c "$lvpath" | cut -d ':' -f 1 )" )"      result:               $ echo VG: $vgname LV: $lvname     VG: vg2 LV: Music      question: Is there more convenient way of doing this ? Can I rely on `lvdisplay -c` that will always provide path in form `/dev/VGname/LVname` ? (In case of `/dev/mapper/VGname-LVname` basename sould be exchanged with sed) Is there tool from LVM2 package to obtain LVname from path?


title: No wireless in Archlinux Gnome3

text: Successfully installed Gnome3 on archlinux (not the fallback mode). EDIT: My wired internet connection works fine. However, I can't see the network icon (or wireless networks) in the tray. When I open `Network Connections` from Gnome3 the Wired and Wireless tabs are empty. I think I tried everything I could think of:   1. putting `network-manager` in `DAEMONS` in `rc.conf` and relogging, but nothing happens.   2. installing `network-manager-applet`   3. Googling, but threads like these leave much to be desired. Any help appreciated.


title: Rm command recovery for this situation

text: İn my desktop, i have a dir. called exam, and i wanted to remove it from the console and wrote `rm * /exam`, and apparently it removed some other files from my desktop. Please tell me that there is a way for a recovery. Edit: i am not even sure which files are removed, so i dont know their file names.


title: Text Manipulation Across multiple lines

text: I Have a file that has text like this:               AAAA     BBBB     CCCC     DDDD          1234     5678     9012     3456          EEEE           7890      etc... And i want to match up the Alphabetic lines with the Numeric lines so they are like this:               AAAA 1234      BBBB 5678     CCCC 9012     DDDD 3456          EEEE 7890      Does anyone know of a simple way to achieve this?


title: Compiz in Arch Linux, no window title available?

text: I already enabled emerald as the window decoration provider command, and I have a theme configured for emerald. But when I start compiz by `compiz --replace`, I get no window title bar. Is there something I forgot to configure?


title: Use imagemagick to convert opaque color to alpha

text: I have an image with a black background with white elements in the foreground. The image has smoothing, so there are 'in-between' pixels that aren't strictly black or white. I'd like to make the background transparent. I found several links on how to do this with imagemagick, but all of them strictly replace one color (say #000000FF" with full alpha "#00000000"). I want to preserve blending... so if there's a gray pixel "#777777FF", it'd get transformed into something like "#FFFFFF77", or whatever would make sense. Does anyone know how to do this?


title: Comparing two files in a script

text: #!/bin/bash     while read file1 <&3; do          while read file2 ; do                    if [ $file1 == $file2 ] ; then              $file1 >> /infanass/dev/admin/test/newlist.txt             fi         echo "$file1"         echo "$file2"      done 3</infanass/dev/admin/test/file2.txt     done 3</infanass/dev/admin/test/file1.txt      I want to read one line from file1.txt and then loop through file2.txt and see if there is a match and if there is write it out too a new text file.. I think I have a infinite loop..


title: OS errors : kernel: EDAC k8 MC0: extended error code: ECC chipkill x4

text: We noticed the server crashes with below errors. Not sure it is related to any defected piece of the hardware or totally not related to Server detail:Red Hat Enterprise Linux ES release 4 (Nahant Update 6) [root@athena log]# uname -a Linux athena.nsdecatur.local 2.6.9-67.0.7.ELsmp #1 SMP Wed Feb 27 04:47:23 EST 2008 x86_64 x86_64 x86_64 GNU/Linux # messages               Sep 17 15:08:16 athena kernel: EDAC k8 MC0: general bus error: participating processor(local node response), time-out(no timeout) memory transaction type(generic read), mem or i/o(mem access), cache level(generic)     Sep 17 15:08:16 athena kernel: MC0: CE page 0x2c2766, offset 0xb10, grain 8, syndrome 0xac08, row 1, channel 0, label "": k8_edac     Sep 17 15:08:16 athena kernel: MC0: CE - no information available: k8_edac Error Overflow set     Sep 17 15:08:16 athena kernel: EDAC k8 MC0: extended error code: ECC chipkill x4 error     Sep 17 15:08:17 athena su(pam_unix)[19579]: session opened for user oracle by (uid=0)     Sep 17 15:08:17 athena su(pam_unix)[19579]: session closed for user oracle     Sep 17 15:08:17 athena su(pam_unix)[19634]: session opened for user oracle by (uid=0)     Sep 17 15:08:17 athena su(pam_unix)[19634]: session closed for user oracle     Sep 17 15:08:18 athena kernel: EDAC k8 MC0: general bus error: participating processor(local node origin), time-out(no timeout) memory transaction type(generic read), mem or i/o(mem access), cache level(generic)     Sep 17 15:08:18 athena kernel: MC0: CE page 0x39c857, offset 0xd50, grain 8, syndrome 0x1cc8, row 1, channel 0, label "": k8_edac     Sep 17 15:08:18 athena kernel: MC0: CE - no information available: k8_edac Error Overflow set     Sep 17 15:08:18 athena kernel: EDAC k8 MC0: extended error code: ECC chipkill x4 error     Sep 17 15:08:18 athena su(pam_unix)[19715]: session opened for user oracle by (uid=0)     Sep 17 15:08:18 athena su(pam_unix)[19715]: session closed for user oracle     Sep 17 15:08:18 athena su(pam_unix)[19758]: session opened for user oracle by (uid=0)     Sep 17 15:08:19 athena su(pam_unix)[19758]: session closed for user oracle     Sep 17 15:08:20 athena su(pam_unix)[19807]: session opened for user oracle by (uid=0)     Sep 17 15:08:20 athena su(pam_unix)[19807]: session closed for user oracle     Sep 17 15:08:20 athena su(pam_unix)[19850]: session opened for user oracle by (uid=0)     Sep 17 15:08:20 athena su(pam_unix)[19850]: session closed for user oracle     Sep 17 15:08:20 athena kernel: EDAC k8 MC0: general bus error: participating processor(local node origin), time-out(no timeout) memory transaction type(generic read), mem or i/o(mem access), cache level(generic)     Sep 17 15:08:20 athena kernel: MC0: CE page 0x39c857, offset 0xd50, grain 8, syndrome 0x1cc8, row 1, channel 0, label "": k8_edac     Sep 17 15:08:20 athena kernel: EDAC k8 MC0: extended error code: ECC chipkill x4 error     Sep 17 15:08:21 athena su(pam_unix)[19899]: session opened for user oracle by (uid=0)     Sep 17 15:08:21 athena kernel: EDAC k8 MC0: general bus error: participating processor(local node origin), time-out(no timeout) memory transaction type(generic read), mem or i/o(mem access), cache level(generic)     Sep 17 15:23:54 athena syslogd 1.4.1: restart.     Sep 17 15:23:54 athena syslog: syslogd startup succeeded     Sep 17 15:23:54 athena kernel: klogd 1.4.1, log source = /proc/kmsg started.


title: How can I use apue.h on mac 10.9.4

text: I tried to compile source code from Advanced Programming in the UNIX® Environment on my mac, but after `make`, the compiling just quit with this error:               ...      clang: error: unknown argument: '-R.' [-Wunused-command-line-argument-hard-error-in-future]     clang: note: this will be a hard error (cannot be downgraded to a warning) in the future     make[1]: *** [t4] Error 1     make: *** [all] Error 1


title: What is the difference between fsck options -y and -p?

text: The ext2/3/4 filesystem checker has two options that seem to be very similar, `-p` and `-y`. Both _seem_ to perform an automatic repair, but the manpage states that `-p` can exit when it encounters certain errors while for `-y` no such thing is mentioned. Is this the only difference?