title: "Linux kernel source code directory" requested in Cisco VPN client install

text: I'm trying to install Cisco's vpn client, and it requests that I provide the directory containing linux kernel source code. Specifically, it reads: > In order to build the VPN kernel module, you must have the kernel headers > for the version of the kernel you are running. > > For RedHat 6.x users these files are installed in /usr/src/linux by default > For RedHat 7.x users these files are installed in /usr/src/linux-2.4 by > default For Suse 7.3 users these files are installed in > /usr/src/linux-2.4.10.SuSE by default > > Directory containing linux kernel source code [] where the last line is the prompt and the content in square brackets (in this case nothing) is the default directory. I'm running crunchbang linux and I cannot find the directory containing the linux kernel source code. **Where is the directory containing the linux kernel source code?** Or, **how can I find it?** Here's is what the manual, entitled _VPN Client User Guide for Linux and Solaris_ has to say about these kernel source requirements: > To install the VPN Client, you must have the kernel source that was used to > build the kernel that is running on the system. If the system is using a > kernel that came as part of the Linux distribution, or a custom built > kernel, the kernel code can be obtained in different ways: > > • For users running kernels that came with their distribution—You must > install the corresponding kernel-source rpm. The vpn_install script should > be able to automatically find the kernel source. > > • For users running a custom-built kernel—You must use the same copy of the > kernel source that was used to build the kernel you are running. Unpacking > the source code for the version of the kernel you are using is insufficient. > There are several files generated when the kernel is compiled that the VPN > Client uses. These files must exactly match with the kernel you are running. > Otherwise, the VPN Client installation might fail. Since I think I'm in the first case, I ran `sudo apt-get install rpm` (without knowing anything about rpm), and tried the installation again, hoping that the correct value would now be defaulted, but it wasn't and hence the installation still failed. **What is the "kernel-source rpm" and how do I install it?** **EDIT** As suggested, I tried to install `linux-headers-something`, but there were many auto-completions of `sudo apt-get install linux-headers` specifically, they were:               linux-headers-2.6.32-5-486     linux-headers-2.6.32-5-686     linux-headers-2.6.32-5-686-bigmem     linux-headers-2.6.32-5-all     linux-headers-2.6.32-5-all-i386     linux-headers-2.6.32-5-amd64     linux-headers-2.6.32-5-common     linux-headers-2.6.32-5-common-openvz     linux-headers-2.6.32-5-common-vserver     linux-headers-2.6.32-5-common-xen     linux-headers-2.6.32-5-openvz-686     linux-headers-2.6.32-5-vserver-686     linux-headers-2.6.32-5-vserver-686-bigmem     linux-headers-2.6.32-5-xen-686     linux-headers-2.6.36-2.dmz.5-liquorix-686     linux-headers-2.6-486     linux-headers-2.6-686     linux-headers-2.6-686-bigmem     linux-headers-2.6-amd64     linux-headers-2.6-liquorix-686     linux-headers-2.6-openvz-686     linux-headers-2.6-vserver-686     linux-headers-2.6-vserver-686-bigmem     linux-headers-2.6-xen-686      **How can I determine which one I should install?**


title: What does apt-get/aptitude do, when it "hangs"?

text: Everytime I install/remove something with apt-get or aptitude, it hangs for quite a few seconds after all operations (at least: all shown operations) have finished. After those few seconds (like 10 or 15) the command finishes and closes.               sudo apt-get install ...     Total disk space freed by localepurge: 0 KiB     [sleeps here for a few seconds]     computer#


title: Reload xserver-xorg-input-mouse

text: Can I reload `xserver-xorg-input-mouse` driver on the fly? For example, after I modify and recompile the source


title: GPU accelerated transcoding

text: What is the current state of GPU accelerated transcoding under linux? I'd like to set up a video converter server and like to use all the available resources besides the CPU. Is there any tool, which can utilize a video card for such a task?


title: How to get networkmanager to configure domain specific name servers with openresolv + dnsmasq

text: I often connect to multiple network simultaneously. Each of these networks provide nameserver configuration via dhcp. E.g. Network 1: (eth0):               domain company1.corp #     nameserver 192.168.0.253     nameserver 192.168.0.254      Network 2 (tun0):               domain company2.corp #     nameserver 10.102.204.51     nameserver 10.102.208.51      # Names changed When connected to both networks simultaneously:               # resolv.conf from NetworkManager     domain company1.corp, company2.corp     nameserver 192.168.0.253     nameserver 192.168.0.254     nameserver 10.102.204.51     # NOTE: the libc resolver may not support more than 3 nameservers.     # The nameservers listed below may not be recognized.     nameserver 10.102.208.51      Resolving service.company2.corp does not work because the first name server only knows about company1.corp names. So inspired by this article, I've setup openresolv (a resolvconf implementation) configuring a local dnsmasq service on my Arch linux install. If I configure the nameservers manually using resolvconf:               # resolvconf -d NetworkManager     # echo "domain company1.corp     nameserver 192.168.0.253     nameserver 192.168.0.254     " | resolvconf -a eth0     # echo "domain company2.corp     nameserver 10.102.204.51     nameserver 10.102.208.51     " | resolvconf -a tun0      Then I am able to resolve names from both company1.corp and company2.corp (the local dnsmasq server handles this.) Note that after the manual config, resolveconf -l shows the 2 configurations separately:               ~ # resolvconf -l     # resolv.conf from tun0     domain company2.corp     nameserver 10.102.204.51     nameserver 10.102.208.51          # resolv.conf from eth0     domain company1.corp     nameserver 192.168.0.253     nameserver 192.168.0.254      However, when letting network manager do the configuration, the 2 configurations are not separate, as the would be if network manager was writing to /etc/resolve.conf               ~ # resolvconf -l     # resolv.conf from NetworkManager     # Generated by NetworkManager     domain company1.corp, company2.corp     nameserver 192.168.0.253     nameserver 192.168.0.254     nameserver 10.102.204.51     # NOTE: the libc resolver may not support more than 3 nameservers.     # The nameservers listed below may not be recognized.     nameserver 10.102.208.51      My question is how can I get network manager to correctly call resolveconf so the the name servers for each interface are registered separately. (Unfortunately googling for this is useless because google thinks that "resolveconf" == "resolve.conf")


title: Using sed once to search/replace different strings

text: I'm using sed to find configuration directives in a php file. Essentially, I need to set the strings `database_name_here`, `username_here` and `password_here` with their appropriate values in the config-sample.php (and rename the file to config.php). My current solution uses sed three times, redirecting the output to temporary files.               sed -e 's/database_name_here/foo/g' config-sample.php > /tmp/config.1     sed -e 's/username_here/bar/g' /tmp/config.1 > /tmp/config.2     sed -e 's/password_here/bat/g' /tmp/config.2 > config.php      I was wondering how I could achieve the same results without having to create two temporary files?


title: Linux distribution for a netbook with 7-inch display with 800×480 screen resolution

text: What distros work well on an eeePC with an 800x480 7-inch non-touch display and a 2GB SSD flash drive? I tried a couple, but they're definitely not optimized for 800x480. I need something for rich text editing, for video, and for web browsing.


title: Change font in echo command

text: Is it possible to change the font attributes of the output of echo in either zsh or bash? What I would like is something akin to:               echo -n "This is the font: normal "     echo -n $font=italic "italic,"     echo -n $font=bold "bold,"     echo -n "and"     echo -n $font=small "small".      so that it print: "This is the font: normal, _italic_ , **bold** , small" within a line of text. Note that I cannot get markdown to format "small" as a small text...


title: How do I configure CentOS 6.4 to allow normal users to run startx, without installing Gnome/KDE?

text: I installed CentOS 6.4 x86 from the minimal installation CD into a qemu/kvm virtual machine and installed the basic X server using:               yum groupinstall "X Window System" "Fonts"      When I run `startx` as a normal user, however, the virtual machine's screen flickers with a bit of color, no desktop is displayed, and I'm returned to the console. I'm not sure what is relevant from the `Xorg.0.log` file, but here are the last few lines:               [   417.281] (**) Option "xkb_model" "pc105+inet"     [   417.281] (**) Option "xkb_layout" "us"     [   417.281] (WW) Option "xkb_variant" requires an string value     [   417.281] (WW) Option "XkbVariant" requires an string value     [   417.281] (**) Option "xkb_options" "terminate:ctrl_alt_bksp"     [   417.325] (II) config/hal: Adding input device Power Button     [   417.325] (II) Using input driver 'evdev' for 'Power Button'     [   417.325] (**) Power Button: always reports core events     [   417.325] (**) evdev: Power Button: Device: "/dev/input/event0"     [   417.325] (--) evdev: Power Button: Vendor 0 Product 0x1     [   417.325] (--) evdev: Power Button: Found keys     [   417.325] (II) evdev: Power Button: Configuring as keyboard     [   417.325] (**) Option "config_info" "hal:/org/freedesktop/Hal/devices/computer_logicaldev_input"     [   417.325] (II) XINPUT: Adding extended input device "Power Button" (type: KEYBOARD, id 8)     [   417.325] (**) Option "xkb_rules" "evdev"     [   417.325] (**) Option "xkb_model" "pc105+inet"     [   417.325] (**) Option "xkb_layout" "us"     [   417.325] (WW) Option "xkb_variant" requires an string value     [   417.325] (WW) Option "XkbVariant" requires an string value     [   417.325] (**) Option "xkb_options" "terminate:ctrl_alt_bksp"     [   417.330] (II) config/hal: Adding input device Macintosh mouse button emulation     [   417.330] (II) Using input driver 'evdev' for 'Macintosh mouse button emulation'     [   417.330] (**) Macintosh mouse button emulation: always reports core events     [   417.330] (**) evdev: Macintosh mouse button emulation: Device: "/dev/input/event1"     [   417.330] (--) evdev: Macintosh mouse button emulation: Vendor 0x1 Product 0x1     [   417.330] (--) evdev: Macintosh mouse button emulation: Found 3 mouse buttons     [   417.330] (--) evdev: Macintosh mouse button emulation: Found relative axes     [   417.330] (--) evdev: Macintosh mouse button emulation: Found x and y relative axes     [   417.330] (II) evdev: Macintosh mouse button emulation: Configuring as mouse     [   417.330] (**) evdev: Macintosh mouse button emulation: YAxisMapping: buttons 4 and 5     [   417.330] (**) evdev: Macintosh mouse button emulation: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200     [   417.330] (**) Option "config_info" "hal:/org/freedesktop/Hal/devices/computer_logicaldev_input_0"     [   417.330] (II) XINPUT: Adding extended input device "Macintosh mouse button emulation" (type: MOUSE, id 9)     [   417.331] (II) evdev: Macintosh mouse button emulation: initialized for relative axes.     [   417.331] (**) Macintosh mouse button emulation: (accel) keeping acceleration scheme 1     [   417.331] (**) Macintosh mouse button emulation: (accel) acceleration profile 0     [   417.331] (**) Macintosh mouse button emulation: (accel) acceleration factor: 2.000     [   417.331] (**) Macintosh mouse button emulation: (accel) acceleration threshold: 4     [   417.587] (II) VMWARE(0): VMMOUSE DEVICE_OFF/CLOSE     [   417.609] (II) evdev: Macintosh mouse button emulation: Close     [   417.609] (II) UnloadModule: "evdev"     [   417.609] (II) evdev: Power Button: Close     [   417.609] (II) UnloadModule: "evdev"     [   417.609] (II) evdev: AT Translated Set 2 keyboard: Close     [   417.609] (II) UnloadModule: "evdev"     [   417.609] (II) VMWARE(0): VMMOUSE DEVICE_OFF/CLOSE     [   417.910] (II) VMWARE(0): VMMouseUnInit     [   418.687] Server terminated successfully (0). Closing log file.      I can post the entire log file is necessary. My `/etc/pam.d/xserver` file looks like this:               auth    required        pam_localuser.so     account required        pam_unix.so      I only want the basic X window system, without Gnome or KDE. What else do I need to do to make the `startx` command work properly? I've found numerous guides online that ask me to install Gnome or KDE, but is it possible to use the basic X window system without them?


title: Hosting Git Repositories as per GitHub

text: I'm wondering how exactly GitHub does what they do as far as hosting Git repositories goes. For example, I'm assuming that they manage repository push permissions based on values in some SQL table somewhere, something like:               create table user (id int primary key auto_increment,              username varchar(255),             password varchar(255));          create table repository (id int primary key auto_increment,             name varchar(255));          create table repository_member(id int primary key auto_increment,             user_id int,             repository_id int);      Pretty straightforward, right? I've used Gitosis (ironically hosted on GitHub) in the past, but something which uses a database would be a lot better than editing and committing changes to a couple text files on the hard drive. Is there another service which would make it easier to host tons of Git repositories and be able to heavily integrate it into a web application like GitHub does?


title: How do use awk along with a command to show the process ID with the 'ps' command

text: I'm able to to show the `PID` (2nd) column with the below command, but instead I want to show `pwdx <PID>` and also the `COMMAND`(8th) column. Thanks in advance, Chirag               ps -ef | grep runner | awk {'print$2'}     2432     6346     6348     6350     6352     7407     7410     7416     10824     17305     17494     29658


title: Can a home directory have both .cshrc and .bashrc files?

text: Or are they both not allowed at the same time?


title: rsh runs perfectly in normal user but not in root, very strange, why?

text: When I run command, `rsh localhost pwd` as a root It shows below output.               connect to address 127.0.0.1 port 544: Connection refused     Trying krb4 rsh...     connect to address 127.0.0.1 port 544: Connection refused     trying normal rsh (/usr/bin/rsh)     rcmd: socket: Permission denied      When I run the same command from normal user named `service`. Then it shows below output.               connect to address 127.0.0.1 port 544: Connection refused     Trying krb4 rsh...     connect to address 127.0.0.1 port 544: Connection refused     trying normal rsh (/usr/bin/rsh)     /home/service      Why this behavior happening?


title: Where is a good place to put applications that come pre-compiled?

text: Certain applications like Blender and Eclipse come precompiled in a tarball. Usually I put the directories in my home folder and access them from the command line. Is there a better place to put them and still adhere to POSIX standards (to a degree).


title: Reorder Multiple Line Blocks with Sed

text: I am trying to reorder generated output as follows; given a tex fragment as follows, I want to move the `/^Constant/` down below `/Dummies/`, with the line before and after `/^Constant/`. Further, I would like a stable result, one that does not make a change if `Constant` is already below the last `Dummies` row (it runs as part of a script to fix up my research results, and so far that script is stable). This is the tex fragment input:               [1em]     Application Grade&                  &                  &  -0.0857\sym{***}& -0.00412\sym{***}\\                     &                  &                  & (0.0149)         &(0.00107)         \\     [1em]     Constant        &   -3.701\sym{***}&   -0.311\sym{***}&        0         &        0         \\                     &  (1.130)         & (0.0853)         &      (.)         &      (.)         \\     [1em]     Major Dummies   &       No         &       No         &      Yes         &      Yes         \\     [1em]     Semester Dummies &       No         &       No         &      Yes         &      Yes         \\     \hline      This is the desired output, which remains stable (returns the same) if given as input:               [1em]     Application Grade&                  &                  &  -0.0857\sym{***}& -0.00412\sym{***}\\                     &                  &                  & (0.0149)         &(0.00107)         \\     [1em]     Major Dummies   &       No         &       No         &      Yes         &      Yes         \\     [1em]     Semester Dummies &       No         &       No         &      Yes         &      Yes         \\     [1em]     Constant        &   -3.701\sym{***}&   -0.311\sym{***}&        0         &        0         \\                     &  (1.130)         & (0.0853)         &      (.)         &      (.)         \\     \hline      The following code will do so, but it is not stable. Basically it matches on `Constant`, drops and re-inserts `[1em]` (which it has to do on a separate call since `i\` affects the output, not the pattern space), and pastes below the target. It's not stable because it will add bogus `[1em]`s after `Semester Dummies`. Frankly, its a bit ugly (requiring separate calls to `sed`).               sed -E -i'' -e'/^Constant/ {N;h;N;d;}; /^Semester Dummies/ {G;};' fragment.tex     sed -E -i'' -e '/^Semester Dummies/ {a\     \[1em\]     };' fragment.tex      I believe a one-liner will do it, matching the multiline pattern `/^\\[1em\\]\nConstant.*/` (after a call to `N;N;`), putting this in the `h`old buffer, and then pasting it (`G;`) after `/Semester Dummies/`. But after many hours, man pages, web searches, and upgrading to `gnused` for good measure, I cannot get such a script to work. This expresses the basic idea but is not valid (s cannot conditionally `h`old as I do here):               sed -E -i'' -e'/\[1em\]/ {N;N;s/^\[1em\]\nConstant.*//h;}; /Semester Dummies/ {G;}' fragment.tex      I tried many variations relying on `N;P;D;h;G;` with various addressing but I still don't understand the execution order for multiply addressed commands when you are messing with the pattern space (calling `N;`). `N` and `P` work nicely, but as far as I can tell, `D` is completely useless. Yes, I know it is easier with `awk` and `perl`; in fact, I would be interested in seeing all three solutions for comparison--but here I am specifically asking how to do it in `sed`.


title: how to install Padre in linux(CentOS)?

text: How to install `Padre IDE` tool in Linux(Centos) for Perl scripting language?


title: sysctl: /proc/sys/net/ipv[46]/conf/: what's the difference between "all", "default" and "eth*"?

text: In sysctl, the `/proc/sys/net/ipv[46]/conf/` keys have the following subkeys: `all`, `default`, and a key for each network interface. For example, on a machine with a single network interface eth0, it will look like this:               iserv ~ # ll /proc/sys/net/ipv[46]/conf/     /proc/sys/net/ipv4/conf/:     insgesamt 0     dr-xr-xr-x 0 root root 0 12. Sep 23:30 all/     dr-xr-xr-x 0 root root 0 12. Sep 23:30 default/     dr-xr-xr-x 0 root root 0 12. Sep 23:30 eth0/     dr-xr-xr-x 0 root root 0 12. Sep 23:30 lo/          /proc/sys/net/ipv6/conf/:     insgesamt 0     dr-xr-xr-x 0 root root 0 12. Sep 23:30 all/     dr-xr-xr-x 0 root root 0 12. Sep 23:30 default/     dr-xr-xr-x 0 root root 0 12. Sep 23:30 eth0/     dr-xr-xr-x 0 root root 0 12. Sep 23:30 lo/      All the respective settings exist in each key separately. For example, if I want to disable IPv6 Router Advertisements with the `accept_ra` value, this value exists four times:               iserv ~ # sysctl -a 2>/dev/null | grep "accept_ra "     net.ipv6.conf.all.accept_ra = 1     net.ipv6.conf.default.accept_ra = 1     net.ipv6.conf.lo.accept_ra = 1     net.ipv6.conf.eth0.accept_ra = 1      My question now is: which of these values do I need to change? I figured `all` (to change all existing interfaces) and `default` (to change all new interfaces that may appear later), but changing these still leaves the value at 1 for lo and eth0:               iserv ~ # sysctl -w net.ipv6.conf.all.accept_ra=0     net.ipv6.conf.all.accept_ra = 0     iserv ~ # sysctl -w net.ipv6.conf.default.accept_ra=0     net.ipv6.conf.default.accept_ra = 0     iserv ~ # sysctl -a 2>/dev/null | grep "accept_ra "       net.ipv6.conf.all.accept_ra = 0     net.ipv6.conf.default.accept_ra = 0     net.ipv6.conf.lo.accept_ra = 1     net.ipv6.conf.eth0.accept_ra = 1      Will the machine now accept Router Advertisements on eth0, or will it not?


title: Playback of valid file aborts in Exaile

text: I have a FLAC music file that, according to               > flac -t file.flac          flac 1.2.1 ...          file.flac: ok      is valid. Nevertheless, Exaile (and Rhythmbox) abort playback a few seconds in. MPD happily plays the file. Exaile does not print any warning or error message to shell. The machine I observe this on is Ubuntu 14.04 without `flac` or `libav` installed; Exaile seems to be using `gstreamer0.10` for playback. What can be the reason for this?


title: Why does "Connection Failed: 2002" display randomly on my PHP/MySQL website?

text: I'm running **CentOS 6** with **Apache/PHP/MySQL**. PS. I'm sort of a novice at Linux, but I did my best to gather info before coming here. I'm now a bit stuck.   * I recently upgraded PHP to version 5.5.12.    * I had previously upgraded MySQL to version 5.6. However, this issue didn't begin until I later did the PHP upgrade mentioned above. Nearly every day, and sometimes multiple times per day, my website will start displaying the following in the browser, in place of any website content:               Connection Failed: 2002      I read that this is probably generated by MySQL. The error persists until I manually restart `mysqld`. This is starting to happen more and more frequently, sometimes several times per hour. Here is a relevant section of my MySQL error log from one of those occurrences (they all pretty much look like this):               2014-07-28 11:22:46, , mysqld_safe, Number of processes running now: 0     2014-07-28 11:22:46, , mysqld_safe, mysqld restarted     2014-07-28 11:22:52, 0, Warning, TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).     2014-07-28 11:22:52, 1503, Note, Plugin 'FEDERATED' is disabled.     2014-07-28 11:22:52, 1503, Note, InnoDB: Using atomics to ref count buffer pool pages     2014-07-28 11:22:52, 1503, Note, InnoDB: The InnoDB memory heap is disabled     2014-07-28 11:22:52, 1503, Note, InnoDB: Mutexes and rw_locks use GCC atomic builtins     2014-07-28 11:22:52, 1503, Note, InnoDB: Compressed tables use zlib 1.2.3     2014-07-28 11:22:52, 1503, Note, InnoDB: Using Linux native AIO     2014-07-28 11:22:52, 1503, Note, InnoDB: Using CPU crc32 instructions     2014-07-28 11:22:52, 1503, Note, InnoDB: Initializing buffer pool, size = 128.0M     , , , InnoDB: mmap(137363456 bytes) failed; errno 12     2014-07-28 11:22:52, 1503, ERROR, InnoDB: Cannot allocate memory for the buffer pool     2014-07-28 11:22:52, 1503, ERROR, Plugin 'InnoDB' init function returned error.     2014-07-28 11:22:52, 1503, ERROR, Plugin 'InnoDB' registration as a STORAGE ENGINE failed.     2014-07-28 11:22:52, 1503, ERROR, Unknown/unsupported storage engine: InnoDB     2014-07-28 11:22:52, 1503, ERROR, Aborting      This is not from the initial `mysqld` run at bootup -- that one starts fine. It looks like `mysqld` is starting itself again at random times (I'm not sure if that's normal?) and encountering this error. * * * PS. I can trigger the error by running this:               $ valgrind mysqld      ...which in the SSH console returns:               1868 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!      This replaces my website with `Connection Failed: 2002` the same way, but I'm not sure if that happens for the same reason as the random occurrences. I figured I'd mention this just in case it provides clues.


title: how can I backup and restore of partitions and logical volumes?

text: This is my disk scheme               sda1                       /boot          ext4     sda2                       /somefiles     ext4     sda3:                                     lvm         volgroup1/lvolume1     /              ext4     sda4:                                     lvm         volgroup2/myvolume     /myvolume      ext4           1-How can I make a snapshot of sda2 and store it on `volgroup2/myvolume` ?   1.b- How can I restore that partition to original state by using that snapshot? 2-How can I make a snapshot of `volgroup1/lvolume1` and store it on `volgroupe2/myvolume`?   2.b- How can I restore that volume to original state by using that snapshot? 3-Do I need another OS or a live CD to make or restore snapshots of `volgroup1/lvolume1`?


title: Is %a an option of stat?

text: Usage: stat [OPTION]... FILE...     Display file or file system status.            -L, --dereference     follow links       -f, --file-system     display file system status instead of file status       -c  --format=FORMAT   use the specified FORMAT instead of the default;                               output a newline after each use of FORMAT           --printf=FORMAT   like --format, but interpret backslash escapes,                               and do not output a mandatory trailing newline.                               If you want a newline, include \n in FORMAT       -t, --terse           print the information in terse form           --help     display this help and exit           --version  output version information and exit          The valid format sequences for files (without --file-system):            %a   Access rights in octal       %A   Access rights in human readable form          ...      Is `%a` also an option? How can we use it? Thanks.


title: How does an emulated keyboard work?

text: I have read that some USB devices emulate a keyboard and the information these devices send will be as if the information was typed on a keyboard. For example: a magnetic card reader can use an emulated keyboard to give information about the card. This is a question I had asked about keyboard, BT keyboard and `stdin` which explains how they work. So where does an application have to listen to the input generated by an emulated keyboard?


title: Remove (text based) Linux Logo that comes after booting

text: I ported Petalinux on Zynq board by Xilinx. I am having a log message as shown below:               .     .     .     .     .[Wed Feb 12 14:55:44.166 2014]      Hash algo:    sha1     [Wed Feb 12 14:55:44.166 2014]      Hash value:   266e39ed71a93229a26f0cf7e9f5317b64c2e407     [Wed Feb 12 14:55:44.166 2014]    Verifying Hash Integrity ... crc32+ sha1+ OK     [Wed Feb 12 14:55:44.166 2014]    Booting using the fdt blob at 0x14bafcc     [Wed Feb 12 14:55:44.169 2014]    Uncompressing Kernel Image ... OK     [Wed Feb 12 14:55:44.555 2014]    Loading Device Tree to 07ffa000, end 07fffb98 ... OK     [Wed Feb 12 14:55:44.555 2014]      [Wed Feb 12 14:55:44.555 2014] Starting kernel ...     [Wed Feb 12 14:55:44.555 2014]      [Wed Feb 12 14:55:45.223 2014] INIT: version 2.88 booting     [Wed Feb 12 14:55:45.511 2014] Starting Bootlog daemon: bootlogd.     [Wed Feb 12 14:55:45.553 2014] Creating /dev/flash/* device nodes     [Wed Feb 12 14:55:45.957 2014] Configuring network interfaces... ifconfig: socket: Address family not supported by protocol     [Wed Feb 12 14:55:46.003 2014] ifconfig: socket: Address family not supported by protocol     [Wed Feb 12 14:55:46.015 2014] starting Busybox inet Daemon: inetd... done.     [Wed Feb 12 14:55:46.025 2014] Starting uWeb server:     [Wed Feb 12 14:55:46.052 2014] petalinux <error> (httpd): Failed to create server socket: Address family not supported by protocol     [Wed Feb 12 14:55:46.062 2014] INIT: Entering runlevel: 5     [Wed Feb 12 14:55:46.076 2014] Stopping Bootlog daemon: bootlogd.     [Wed Feb 12 14:55:47.122 2014]      [Wed Feb 12 14:55:47.122 2014]  _____       _           _      _     [Wed Feb 12 14:55:47.122 2014] | ___ \     | |         | |    (_)     [Wed Feb 12 14:55:47.122 2014] | |_/ / ___ | |_   __ _ | |     _  _ __   _   _ __  __     [Wed Feb 12 14:55:47.122 2014] |  __/ / _ \| __| / _` || |    | || '_ \ | | | |\ \/ /     [Wed Feb 12 14:55:47.122 2014] | |   |  __/| |_ | (_| || |____| || | | || |_| | >  <     [Wed Feb 12 14:55:47.122 2014] \_|    \___| \__| \__,_|\_____/|_||_| |_| \__,_|/_/\_\     [Wed Feb 12 14:55:47.122 2014]      [Wed Feb 12 14:55:47.122 2014] PetaLinux v2013.10 (Yocto 1.4) Xilinx-ZC702-14_7 ttyPS0     [Wed Feb 12 14:55:47.122 2014]      [Wed Feb 12 14:55:47.136 2014] Xilinx-ZC702-14_7 login: root      at time stamp [Wed Feb 12 14:55:47.122 2014], there is a big size logo of petalinux. I have seen such logos on many flavors including `Angstrom Linux`. How do we remove such Logos, which file is to be edited?


title: Inotify notifies only single change

text: I set the `inotify_add_watch` to watch `/dev/disks`. The entries in this directory are: `by-id` and `by-uuid`. When I plug-in a pen-drive, this directory gets added with two more directories: `by-path` and `by-label`. But output of my program gives only 1 change: > wd=1 mask=1073742080 cookie=0 len=16 name=by-path and exits. Does inotify only notify 1 event or is there a problem with my program? Reference for code used is found here.


title: 29GB Log File on Linux Mint on a 38GB Partition

text: Had a low-space warning, Google'd the problem (had 1.8GB free at the time), found topics about running `$ sudo du -x -d1 -h /var | sort -hr` and I did:               30G     /var     29G     /var/log     353M    /var/cache     315M    /var/lib     11M     /var/backups     72K     /var/spool     8.0K    /var/tmp     4.0K    /var/opt     4.0K    /var/mail     4.0K    /var/local      and `df -h`:               Filesystem      Size  Used Avail Use% Mounted on     /dev/sda9        39G   36G 1021M  98% /     udev             10M     0   10M   0% /dev     tmpfs           788M  988K  787M   1% /run     tmpfs           5.0M     0  5.0M   0% /run/lock     tmpfs           2.0G   28M  2.0G   2% /run/shm     /dev/sda1       496M   52M  445M  11% /boot/efi     /dev/sda11      824G  337G  487G  41% /home/user/saved     none            4.0K     0  4.0K   0% /sys/fs/cgroup      In that time, I lost about a GB worth of space. Now I have 1.1GB of space. I see the `/var/log` is eating about 80% of my partition, what do I do? (Note: /dev/sda11 is my mounted data partition, and I also have a "safe" file that I save stuff on mounted on the path `/home/user/saved` as FAT32 can't do symbolic links, and it's been this way without problems) PS. I'm on Linux Mint Debian Edition UPDATE: Here's a look on the log folder: using ls -s               user@mint /var/log $ ls -s         6379896 kern.log.1         6379372 messages.1         6377424 ufw.log.1         2622576 kern.log         2622504 messages         2622224 ufw.log         2613532 syslog.1         146316 syslog.6.gz         102076 kern.log.2.gz         102044 messages.2.gz         101840 ufw.log.2.gz         98904 syslog.3.gz         28216 syslog.7.gz         22848 syslog.5.gz         16996 syslog.2.gz         15660 syslog.4.gz               user@mint /var/log $ sudo du -x -d1 -h /var/log | sort -hr         29G /var/log         148K    /var/log/apt         88K /var/log/ConsoleKit         56K /var/log/mdm         44K /var/log/samba         36K /var/log/tor         36K /var/log/cups         16K /var/log/clamav         12K /var/log/fsck         8.0K    /var/log/hp         4.0K    /var/log/unattended-upgrades         4.0K    /var/log/ntpstats`


Can a Linux computer receive scanned images from a scanner using WSD (Web Services on Devices)? **Background:** At my work we have an Epson WP-4545 printer, and the printer part works fine from Linux, but for scanning, we can chose between "to usb- memory", or "to computer (WSD)", the 2nd option works fine with windows (borrowed a windows computer to try), but we Kubuntu and Gentoo.   1. Is there some program, or tool, that I can install to be able to receive image to the Linux computers, too?   2. Are there other names for WSD? googleing on WSD or "Web Services on Devices" didn't give much information at all.   3. Or, maybe there some other reasons for why I can't find any information, like copyright laws and patents?


title: Network connections don't work after a restart using NetworkManager

text: ### openSUSE 12.3 with Network Manager **NOTE:** The same behaviour occurs for eth0, but it's primarily wlan0 I'm concerned with. Whenever I restart or switch wifi networks, DNS resolution seems to be the issue. `nm-tool` shows I have a valid IP and my router's address for DNS, but if I try to access anything by domain name, it fails. I successfully can run `ping 8.8.8.8` (google's DNS) just to make sure I'm getting to the outside world. The only thing that seems to bring me back online is opening a terminal, logging in as root and running `dhclient`. Anyone have any ideas what I should check to figure out why NetworkManager isn't working as expected?


title: Is there some sort of "no newline at eof" rules for bash scripts?

text: I have two files, an env file and a run file. When I deploy them to my Ubuntu Server box I get the error: > ./start-admin: line 10: syntax error: unexpected end of file If I deploy and then add a newline to the end of the file, it will show the error. If I then remove it the error goes away. If I deploy again and don't add the newline, it still shows the error, but if I then add a newline the error goes away. What could possibly cause that? Below are my scripts: env:               if [ "x${WD}" == "x" ];  then echo "missing required conf \"\${WD}\"" >&2; exit -1; fi          export JAVA_HOME=/usr/lib/jvm/jre-1.7.0-openjdk.x86_64     export JAR_FILE="$WD/mfa-admin.jar"     export MYSQL_URL=url1     export MYSQL_USER=root     export MYSQL_PASSWORD=pwd     export DB_URL=url2     export DB_USER=user     export DB_PASSWORD=pwd2          export EMAIL_HOST=mail-inbox     export EMAIL_PORT=25     export EMAIL_PERMISSION=false     export FAKE_EMAIL=email     export ACTIVATION_URL=url          export BIND_HOST=0.0.0.0     export BIND_PORT=8282      start:               WD=`dirname $0`;          JAVA_OPTS=""          if [ -r "$WD/admin.env.conf" ]; then       . $WD/admin.env.conf     fi          # required stuff     if [ "x${JAVA_HOME}" == "x" ];                              then echo "missing required conf \"\${JAVA_HOME}\""                                                  >&2; exit -1; fi     if [ "x${JAR_FILE}" == "x" ];                               then echo "missing required conf \"\${JAR_FILE}\""                                                   >&2; exit -1; fi     if [ "x${MYSQL_URL}" == "x" ];                   then echo "missing required conf \"\${MYSQL_URL}\""        >&2; exit -1; fi     if [ "x${MYSQL_USER}" == "x" ];                  then echo "missing required conf \"\${MYSQL_USER}\""       >&2; exit -1; fi     if [ "x${MYSQL_PASSWORD}" == "x" ];              then echo "missing required conf \"\${MYSQL_PASSWORD}\""   >&2; exit -1; fi     if [ "x${DB_URL}" == "x" ];                      then echo "missing required conf \"\${DB_URL}\""                            >&2; exit -1; fi     if [ "x${DB_USER}" == "x" ];                     then echo "missing required conf \"\${DB_USER}\""                           >&2; exit -1; fi     if [ "x${DB_PASSWORD}" == "x" ];                 then echo "missing required conf \"\${DB_PASSWORD}\""                       >&2; exit -1; fi          if [ "x${EMAIL_HOST}" == "x" ];                  then echo "missing required conf \"\${EMAIL_HOST}\""                       >&2; exit -1; fi     if [ "x${EMAIL_PORT}" == "x" ];                  then echo "missing required conf \"\${EMAIL_PORT}\""                       >&2; exit -1; fi     if [ "x${EMAIL_PERMISSION}" == "x" ];            then echo "missing required conf \"\${EMAIL_PERMISSION}\""                 >&2; exit -1; fi     if [ "x${FAKE_EMAIL}" == "x" ];                  then echo "missing required conf \"\${FAKE_EMAIL}\""                       >&2; exit -1; fi     if [ "x${ACTIVATION_URL}" == "x" ];              then echo "missing required conf \"\${ACTIVATION_URL}\""                   >&2; exit -1; fi          if [ "x${BIND_HOST}" == "x" ];                    then echo "missing required conf \"\${BIND_HOST}\""                         >&2; exit -1; fi     if [ "x${BIND_PORT}" == "x" ];                    then echo "missing required conf \"\${BIND_PORT}\""                         >&2; exit -1; fi          JAVA_OPTS="${JAVA_OPTS} -Dmysql.URL=\"${MYSQL_URL}\" "     JAVA_OPTS="${JAVA_OPTS} -Dmysql.USER=\"${MYSQL_USER}\" "     JAVA_OPTS="${JAVA_OPTS} -Dmysql.PASSWORD=\"${MYSQL_PASSWORD}\" "     JAVA_OPTS="${JAVA_OPTS} -Ddb.URL=\"${DB_URL}\" "     JAVA_OPTS="${JAVA_OPTS} -Ddb.USER=\"${DB_USER}\" "     JAVA_OPTS="${JAVA_OPTS} -Ddb.PASSWORD=\"${DB_PASSWORD}\" "          JAVA_OPTS="${JAVA_OPTS} -DEMAIL_HOST=\"${EMAIL_HOST}\" "     JAVA_OPTS="${JAVA_OPTS} -DEMAIL_PORT=\"${EMAIL_PORT}\" "     JAVA_OPTS="${JAVA_OPTS} -DEMAIL_PERMISSION=\"${EMAIL_PERMISSION}\" "     JAVA_OPTS="${JAVA_OPTS} -DFAKE_EMAIL=\"${FAKE_EMAIL}\" "     JAVA_OPTS="${JAVA_OPTS} -DACTIVATION_URL=\"${ACTIVATION_URL}\" "          JAVA_OPTS="${JAVA_OPTS} -DBIND_HOST=\"${BIND_HOST}\" "     JAVA_OPTS="${JAVA_OPTS} -DBIND_PORT=\"${BIND_PORT}\" "          JAVA="$JAVA_HOME/bin/java"          eval \"$JAVA\" $JAVA_OPTS -cp "${WD}:${JAR_FILE}" VertxNode


title: Low PPPoE speed in Linux (Ubuntu)

text: We have 2 PC with Ubuntu 12.04 and connect with 1000M/bit cable. We then start `iperf` on both PCs and get 900m/bit speed using the `iftop` tool. However, when we setup PPPoE server on the 1st PC, and PPPoE client on the 2nd PC, and direct `iperf` over PPPoE, we get only 430M/bit. ### questions   * Is it normal that PPPoE on Linux so slow?   * Is there any way to get speeds similar to the direct connect option?


title: information about txop in ath9k wlan driver

text: I'm trying to implement the rate control algorithm into ath9k wireless LAN driver. I need to find if the transmission of first packet in the TXOP has failed or succeeded (ack received or not). I looked in the mac80211 API didn't find anything related to the TXOP. Where can I find information about this?


title: Choosing a desktop linux distro based on work server distro

text: for several years I've managed a server or two on CentOS distro with cPanel (or not) and I was wondering if I should actually use a desktop linux distro based on CentOS/RHEL instead of going for something Debian/Ubuntu (like mint). I've always really been using Windows for desktop and OS X for some time too. My idea is to be able to learn faster how I work on my servers by my daily desktop usage too. Suggestions appreciated!


title: Ubuntu 12.10 doesn't recognize my active windows 7 partitions

text: Ubuntu 12.10 64-bit doesn't recognize my active windows 7 partitions. When choosing the installation option as something else during USB boot it shows my hard disk, but not all the partions I have. I tried GParted inside Ubuntu and it shows my hard disk as unallocated.               ubuntu@ubuntu:~$ sudo fdisk -l          Disk /dev/sda: 500.1 GB, 500107862016 bytes     255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0xe02de301          Device Boot      Start         End      Blocks   Id  System     /dev/sda1   *      206848      411647      102400    7  HPFS/NTFS/exFAT     /dev/sda2          411648   169154841    84371597    7  HPFS/NTFS/exFAT     /dev/sda3       169156545   976766975   403805215+   f  W95 Ext'd (LBA)     /dev/sda5       169156608   275140607    52992000    7  HPFS/NTFS/exFAT     /dev/sda6       275142656   296790015    10823680    7  HPFS/NTFS/exFAT     /dev/sda7       296792064   509788129   106498033    7  HPFS/NTFS/exFAT     /dev/sda8       509788160   734705663   112458752    7  HPFS/NTFS/exFAT     /dev/sda9       734705664   976766975   121030656    7  HPFS/NTFS/exFAT          Disk /dev/sdb: 3900 MB, 3900702720 bytes     190 heads, 32 sectors/track, 1253 cylinders, total 7618560 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0xc3072e18          Device Boot      Start         End      Blocks   Id  System     /dev/sdb1   *          32     7618558     3809263+   c  W95 FAT32 (LBA)


title: perl one liner + print VALUE in the end of the line

text: The following perl one liner checks if `$CURRENT_VERSION` matches `$NEW_VERSION` exactly, and prints it if it does. Example:               CURRENT_VERSION=223.3.12.4.5.3     NEW_VERSION=223.3.12.4.5.3     DATE=17.3.2013                    echo $CURRENT_VERSION  | \       perl -ne 'BEGIN { $STR = shift(@ARGV); } print if /\Q$STR\E/; ' $NEW_VERSION      223.3.12.4.5.3      What do I need to add to the perl one liner to print the `$DATE` value at the end of the line? For example:               CURRENT_VERSION=223.3.12.4.5.3     NEW_VERSION=223.3.12.4.5.3     DATE=17.3.2013                    echo $CURRENT_VERSION  | \       perl -ne'BEGIN { $STR = shift(@ARGV); } print if /\Q$STR\E/; ' \       $NEW_VERSION < add syntax to  print $DATE >      223.3.12.4.5.3  17.3.2013


title: How to colorize "root" in red in CentOS?

text: This is the content of /etc/bashrc, I would like to modify it for show "root" as red but don't know where to add the color code.               # /etc/bashrc          # System wide functions and aliases     # Environment stuff goes in /etc/profile          # It's NOT a good idea to change this file unless you know what you     # are doing. It's much better to create a custom.sh shell script in     # /etc/profile.d/ to make custom changes to your environment, as this     # will prevent the need for merging in future updates.          # are we an interactive shell?     if [ "$PS1" ]; then       if [ -z "$PROMPT_COMMAND" ]; then         case $TERM in         xterm*)             if [ -e /etc/sysconfig/bash-prompt-xterm ]; then                 PROMPT_COMMAND=/etc/sysconfig/bash-prompt-xterm             else                 PROMPT_COMMAND='printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"'             fi             ;;         screen)             if [ -e /etc/sysconfig/bash-prompt-screen ]; then                 PROMPT_COMMAND=/etc/sysconfig/bash-prompt-screen             else                 PROMPT_COMMAND='printf "\033]0;%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"'             fi             ;;         *)             [ -e /etc/sysconfig/bash-prompt-default ] && PROMPT_COMMAND=/etc/sysconfig/bash-prompt-default             ;;           esac       fi       # Turn on checkwinsize       shopt -s checkwinsize       [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ "       # You might want to have e.g. tty in prompt (e.g. more virtual machines)       # and console windows       # If you want to do so, just add e.g.       # if [ "$PS1" ]; then       #   PS1="[\u@\h:\l \W]\\$ "       # fi       # to your custom modification shell script in /etc/profile.d/ directory     fi          if ! shopt -q login_shell ; then # We're not a login shell         # Need to redefine pathmunge, it get's undefined at the end of /etc/profile         pathmunge () {             case ":${PATH}:" in                 *:"$1":*)                     ;;                 *)                     if [ "$2" = "after" ] ; then                         PATH=$PATH:$1                     else                         PATH=$1:$PATH                     fi             esac         }              # By default, we want umask to get set. This sets it for non-login shell.         # Current threshold for system reserved uid/gids is 200         # You could check uidgid reservation validity in         # /usr/share/doc/setup-*/uidgid file         if [ $UID -gt 199 ] && [ "`id -gn`" = "`id -un`" ]; then            umask 002         else            umask 022         fi              # Only display echos from profile.d scripts if we are no login shell         # and interactive - otherwise just process them to set envvars         for i in /etc/profile.d/*.sh; do             if [ -r "$i" ]; then                 if [ "$PS1" ]; then                     . "$i"                 else                     . "$i" >/dev/null 2>&1                 fi             fi         done              unset i         unset pathmunge     fi     # vim:ts=4:sw=4      In Debian I do it in this line:   `PS1='${debian_chroot:+($debian_chroot)}\\[\033[01;32m\\]\u\\[\033[00;37m\\]@\\[\033[01;34m\\]\h\\[\033[01;37m\\]:\\[\033[01;36m\\]\w\\[\033[01;35m\\]\$\\[\033[00m\\] '` but in CentOS no idea. edit: Also I am thinking that maybe editing that file is going to take effect on both normal user and root user. But looking in the specifics .bashrc they only point to /etc/bashrc.


title: awk + paste for cleaning up PATH?

text: I have seen this code in `.cshrc` init files on a few machines. I went through a few awk tutorials in trying to understand how it works, but I am still unable to decrypt it.               setenv PATH `echo $PATH | awk 'NF&&\\!x[$0]++' RS='[:|\n]' | paste -sd:`      What does it do?


title: What's the quickest way to add text to a file from the command line?

text: Occasionally I have a thought that I want to write into a file while I am at the terminal. I would want these notes all in the same file, just listed one after the other. I would also like a date / time tag on each one. Is it possible to do this without having to open the file each time? Can I just enter it into the terminal and have it appended to the file each time with a command or script? I am using GNU BASH.


title: How do I get "top" command to wrap its output?

text: The "command" column gets truncated by the width of the screen and I am unable to see the last part of it. I have tried to reduce the font size so I can see a longer part of the command line but it still won't do.


title: Alias a command to run in the background

text: I'd like a keyboard shortcut to work as so:               > e foo.txt      to expand as               > emacs foo.txt &      It's simple to use `alias e=emacs`, but how do I insert the `&` after the filename? I realize it may not be possible using just `alias`, so I'll accept any bash solution. If a shell script is needed please explain how it works.


title: Change Password of a user in /etc/shadow

text: I would like to change the password of a user in the `/etc/shadow`. I **can't** use password changing programs like `passwd`. It must be done by editing the `/etc/shadow`. The `/etc/shadow` is on a mounted hard drive and chroot is not working. For example:               root:$asdf.1AH.MJ3sivd4$YFoFnasdf4cZW9H6G6cbT4.1VBmasdfmv.a0wCU/i3zEFasdfasdf4W.:15843:0:99999:7:::     otheruser:$asdf.1AH.MJ3sivd4$YFoFnasdf4cZW9H6G6cbT4.1VBmasdfmv.a0wCU/i3zEFasdfasdf4W.:15843:0:99999:7:::      Can anybody provide me a shell script to change the password of root with `sed` or `awk` or something like that?


title: Can I make the O/S drive READ ONLY and prevent metadata write back?

text: Sorry to ask a (probably) stupid question. I am a hardware designer struggling with provision of safe shutdown power to an embedded system. I am aware the Linux normally makes a heavy use of the filesytem and makes metadata updates whenever a file is read -i.e. there is a consequential write for every file access. I believe it is possible to delay this write. I am wondering what happens if this is an indefinate delay (i.e. it never occurs). Some background: For operational reasons it is preferable not to use battery backup to provide power during system shutdown- which means I am looking at a 1 to 5 second power down hold-up. This doesn't seem long enough for the O/S to shut down form our S/W engineers' testing. We are all "new" to Linux having been using conventional embedded RTOS up to this point. We will boot from a FLASH drive and run in RAM in the machine so if we have zero FLASH writes then it wouldn't normally be corrupted on a power fail. We will store system NV data in FLASH that is controlled by a small micro that guarentees a write success in 10ms so that's fine - however I am struggling to understand what, if anything, Linux has to write back to the drive it booted from - and if we prevent it doing so what consequence would there be? Unfortunately we're running from a uSDHC card at the moment so I can't simply write protect it in hardware to find out :-( Can anyone help me or point me at where to learn this information.


title: How to make Compose work in GTK and Qt apps?

text: I used Gnome for a long time, but preferred vanilla X input method (`xim`) over the default GTK behaviour. I just set `GTK_IM_MODULE` and `QT_IM_MODULE` enviroment variables to `xim`, and didn't have any problem with multiple- layout config, `Compose` key, custom `~/.XCompose` and `misc:typo` typography extensions. Recent Gnome 3.6 completely screwed keyboard input by shipping a half-baked and buggy `ibus` and forcing it upon the users. I just couldn't get the keyboard working as well as before (even with `ibus` disabled), and had to abandon Gnome completely. Now I use a simple window manager, and configure my keyboard with `setxkbmap`. While the keyboard works well again, I couldn't get get Compose key working everywhere. Compose works in plain X11 apps (`xterm`), but it doesn't work in neither GTK2, nor GTK3, nor Qt apps. I use current Archlinux versions:               xorg-xinput 1.6.0     xorg-server 1.13.1     xf86-input-keyboard 1.6.2     gtk2 2.24.14     gtk3 3.6.4     qt 4.8.4      and enable `Compose` key like this:               setxkbmap ... -option 'compose:menu'      and export `GTK_IM_MODULE`, `QT_IM_MODULE` variables:               $ echo $GTK_IM_MODULE $QT_IM_MODULE      xim xim      `Compose` key is propoperly recognized by X11:               $ xev | grep -A2 --line-buffered '^KeyRelease' | sed -n '/keycode /s/^.*keycode \([0-9]*\).* (.*, \(.*\)).*$/\1 \2/p'     135 Multi_key      It works properly in `xterm`, sequences from my `~/.XCompose` included. It doesn't work in neither GTK nor Qt apps. Let say, if I enter `Compose` `'`, then apps echo `'` immediately, without waiting for the third key in the sequence. Now I suppose something has changed in either Xorg (because `Compose` doesn't work in Qt apps either), or in GTK _and_ Qt. `*_IM_MODULE` variables are not enough now. What else is required to make modern GTK and Qt recognise `xim` and its Compose sequences? P.S. There is a similar (and unanswered) question about Compose key not working in GTK. Unlike the asker, I don't have `ibus` installed.


title: How to remove the prefix from an e-mail in a table?

text:
this is the INPUT:               $ echo -e '
XXX	XXX	XXX	XXX	XXX	XXX	XXX	XXX	someone.something@example.com
\n
YYY	YYY	YYY	YYY	YYY	YYY	YYY	YYY	foo.bar@example2.com
'
XXX	XXX	XXX	XXX	XXX	XXX	XXX	XXX	someone.something@example.com

YYY	YYY	YYY	YYY	YYY	YYY	YYY	YYY	foo.bar@example2.com
      this is the OUTPUT with SOME MAGIC!               $ echo -e '
XXX	XXX	XXX	XXX	XXX	XXX	XXX	XXX	someone.something@example.com
\n
YYY	YYY	YYY	YYY	YYY	YYY	YYY	YYY	foo.bar@example2.com
' | SOMEMAGIC
XXX	XXX	XXX	XXX	XXX	XXX	XXX	XXX	example.com

YYY	YYY	YYY	YYY	YYY	YYY	YYY	YYY	example2.com
      **My question:** how can "SOMEMAGIC" remove the prefixes before "@" and the "@" itself? The unique delimiter is the               "	"      XXX and YYY could be anything, so it could be ex.: "someone.something@example.com" too :\ p.s.: So the question is, how can someone remove the prefix from: someone.something@example.com so it will be: example.com in this table?


title: Metaphor for the concept of shell?

text: I'm finding myself helping out some classmates in my computer science class, because I have prior development experience, and I'm having a hard time explaining certain things like the shell. What's a good metaphor for the shell in the context of the Terminal on Mac, contrasted with a remote shell via SSH?


title: Bash syntax highlighting of subshells

text: Considering the large amount of questions which turn out to be related to subshells in Bash ("Why doesn't my variable increment in this piped `while read` loop?"), I just thought it would be very nice to refer to some editor or service where code which will be executed in subshells is formatted differently from the code executed in the parent shell. It might be useful as an educational device (see the difference between `code | code` and `code < <(code)` instantly). Does this exist? Bonus points if anyone implements it for jEdit or VIm. Obviously it doesn't have to be perfect (no syntax highlighting is, in my experience), but I suspect things like `(foo=bar; echo $foo;)` and `command | while read ...` shouldn't be too difficult for a start.


title: rlwrap-like tool with command autocompletion

text: I am often using `rlwrap sqlite database.sqlite` to browse an SQLite table. It works great but I would like to have a tool that would create an index tables (and possible its columns as well) and let me autocomplete them using `<TAB>`. Is there any such tool or should I create it by my own? Should I then write extension for `rlwrap`?


title: How to get GNOME volume applet back?

text: I'm running GNOME 2.30 (Squeeze) and have lost my Volume Control applet. I can't find it in my **Add to Panel** window. ![alt text](http://i.stack.imgur.com/RtlDV.png)    [ **update** ] Note that the Volume Control applet appears again in the window, and I have no idea what fixed the issue.


title: grep works fine in command line but returns nothing in script

text: I'm trying to write a small script to get me list of files that match certain criteria into a file.               #!/bin/sh     cd /var/www_data/patch/     grep --include=\*.{php,ini,conf,sh} -ril -P "'([\d\w\-\_\.]+)(@domain.com)'" "/var/www_data/something/" 2>&1 > mails      The `grep` line works perfectly in command line but if I launch it via script, resulting file will have size of 0 bytes. Any ideas why this is happening?


title: Using update-rc.d

text: As per this question, I'd like to start a `/etc/init.d` script on boot. I have the following script comments:               # Startup script for Wowza Media Server     #     # chkconfig: - 80 20     # description: Wowza Media Server is a media server     #     #### BEGIN INIT INFO     # Provides:          WowzaMediaServer     # Required-Start:    $syslog $time $local_fs $remote_fs     # Required-Stop:     $syslog $time $local_fs $remote_fs     # Default-Start:     3 4 5     # Default-Stop:      S 0 1 2 6     # Short-Description: Wowza Media Server 3 Init Script     # Description:       Wowza Media Server 3 Init Script     ### END INIT INFO      I understand that for Debian and Ubuntu systems, rather than using `chkconfig`, I need to use `update-rc.d`. I've done this in the past, but it seems that `update-rc.d` just links the script to all runlevels. Is this really the case? I need this script to only run when starting after networking is up; I'm running a script that needs to `curl` a URL in order to determine the public DNS name of the host (EC2). How can I add this script to auto-start using `update-rc.d` in the way I'm looking to do it?


title: virsh, how to list autostart domains?

text: In `virsh` how do I see which domains are marked as autostart? `virsh list` does not show which domains are marked as autostart.


title: Linux Radeon HD 7730M driver

text: ![enter image description here](http://i.stack.imgur.com/dcg4E.png)I can not find drivers for this product, and recently I have been having an error when resuming from sleep..."UVD not responding, trying to restart the VCPU!" Is there a solution to this error?


title: 6.7 Linux headers `make mrproper` fails in lfs 7.5

text: I'm building lfs-7.5. When I run `make mrproper` in chapter **6.7** , it says: > make: gcc: command not found and on running `bash /tools/bin/gcc`, it says: > bash: /tools/bin/gcc: no such file or directory This is the same problem as here. Even the information given by the person who asked the question in the comments is same as mine. He says that he did " **third pass** " of `gcc` in **chapter 5**. If this was the case then the author of LFS would have clearly indicated to us to perform 3 passes. I'm guessing that I'm making a subtle mistake somewhere, but I can't seem to find out where. According to the support provided by LFS authors, they ask us to redo the whole thing from the beginning. I agree with them, but without knowing where the mistake might have happened we are bound to make the same mistake again (as I did). The output provided by the person who asked the question in the LFS support question matches mine. This is the link. Another question about the same topic here did not yield any answers. Please help. BTW, when I found out that `gcc` was not linked to the libraries in `/tools/lib` of LFS, I manually created a simlink from `libc.so.6` to `/lib` and `/lib64` under `/mnt/lfs` where I mounted the LFS partition. But when I was executing `make headers_check` in **6.7** (after `make mrproper`), it complained that it didn't find `libz.so` and when I searched in `/tools/lib`, I couldn't find it.


title: How to preserve .d files after kernel compilation?

text: I'm compiling third-party kernel modules. Their build system goes to `/usr/src/linux-headers-[version]` (of a custom kernel chroot) and runs `make` from there. I want to find out, which files - sources and headers - have been used for the compilation, and which have not. Standard `scripts/Makefile.build` creates `*.d` files for each compiled source, and I'd like to use that... but these files are **deleted** after short processing. (That is `rule_cc_o_c` definition in `Makefile.build`.) What could be a way to collect these files with minimal modifications to the standard build system?


title: Swap Utilization Increase with Oracle Coherence

text: We are using Oracle Coherence on linux servers. However, we noticed that because of Coherence processes running, often our swap utilization % increases too much, sometimes becoming more than 98%, even touched 100% a few times. Once we kill all the coherence related processes, then it becomes normal. Is there any way we can make coherence processes to only use a particular size of Swap space ? Currently increasing swap space is not in our scope. Please suggest.


title: User authentication over Dante proxy server

text: Below is my Dante SOCKS Proxy server configuration that I connect to without any authentication:               internal: eth0 port = 53200     internal: 127.0.0.1 port = 53200     external: eth0          clientmethod: none     method: none     user.privileged: root          client pass {     from: 0.0.0.0/0 to: 0.0.0.0/0     log: error # connect disconnect     }     pass {     from: 0.0.0.0/0 to: 0.0.0.0/0     protocol: tcp udp     log: error # connect disconnect     }      I have set up a user group in linux with many members. I want members of this group to be able to connect to the proxy server using authentication (via proxifier). How can I enforce user authentication with Dante ?


title: Install CentOS from hard drive - kernel panic

text: I want to dual-boot CentOS and Windows XP. The computer has two partitions (C: and D:) and I want to install CentOS 6.2 on the D: drive. So I downloaded the i386 ISO package, used UNetbootin to deploy that ISO on the hard drive and booted to UNetbootin. After I select the Install CentOS option, I get the following               Kernel Panic - not syncing: Attempted to kill init!     panic occured, switching back to text console      and nothing else. Any advice? Please note that I don't have a CD Drive, and also I do not have any USB storage at hand.


title: Set process exclusivity in Linux

text: I am trying to measure the performance of a process. I have widely ranging performance measurements on small bit of single-threaded deterministic code that should perform the same every time. I would like to set exclusive use of a processor for the process in order to test if the performance fluctuation is due to scheduling of other processes, context switches, etc. I don't care about affinity because I don't care which core it runs on. What I do care about is that my single-threaded process has exclusive access to the core it runs on, whichever core that is. Is this possible? I don't think 'nice' does what I want because that just lets me set a priority. Some other task with the same priority may share processor time with my process. I also don't care if my process has to wait in a queue. I just want to ensure that once it starts running, it is not interrupted. Thanks


title: What is the worst scenario, if the hard disk or motherboard don't support the `hddparm -s`?

text: I have a desktop PC, that dubs as a RAID-6 server. When I don't need the RAID- related stuff, I'd like to spin off all the hard drives involved in RAID (I hate the noise). Unfortunately, even if everything is stopped, the system probes the drives from time to time causing the hard drives to spin up. From the `hdaparm` man page one can read, that issuing commands like `hddparm -s /dev/sdc` can prevent the disk from ever spinning up again... unless the motherboard supports it:                  -s     Enable/disable  the power-on in standby feature, if supported by               the drive.  VERY DANGEROUS.  Do not use  unless  you  are  abso‐               lutely  certain  that both the system BIOS (or firmware) and the               operating system kernel (Linux >= 2.6.22)  support  probing  for               drives  that  use this feature.  When enabled, the drive is pow‐               ered-up in the standby mode to allow the controller to  sequence               the  spin-up of devices, reducing the instantaneous current draw               burden when many drives share a power supply.  Primarily for use               in  large RAID setups.  This feature is usually disabled and the               drive is powered-up in the active mode  (see  -C  above).   Note               that  a  drive may also allow enabling this feature by a jumper.               Some SATA drives support the control of this feature by  pin  11               of the SATA power connector. In these cases, this command may be               unsupported or may have no effect.      I still don't understand, what is the worst scenario if the hard drive or motherboard don't support it. Does it mean, that the hard drive will be bricked? Or will it be enough to take the hard drive to a friend, who happens to have compatible motherboard which would map the spinned-down hard drives, to re- enable it? * * * **Another question** : What exactly features should my hard drive support? My hard drive seems to support `Power-Up In Standby feature set`, which may not be the same as _power-on in standby feature_ mentioned by the man. How can I check necessary features it in for motherboard? What name does this feature have? The `hdparm -I /dev/sdc`:               Enabled Supported:        *    SMART feature set             Security Mode feature set        *    Power Management feature set        *    Write cache        *    Look-ahead        *    Host Protected Area feature set        *    WRITE_BUFFER command        *    READ_BUFFER command        *    NOP cmd        *    DOWNLOAD_MICROCODE             Power-Up In Standby feature set        *    SET_FEATURES required to spinup after power up             SET_MAX security extension        *    48-bit Address feature set        *    Device Configuration Overlay feature set        *    Mandatory FLUSH_CACHE        *    FLUSH_CACHE_EXT        *    SMART error logging        *    SMART self-test        *    General Purpose Logging feature set        *    64-bit World wide name        *    {READ,WRITE}_DMA_EXT_GPL commands        *    Segmented DOWNLOAD_MICROCODE        *    Gen1 signaling speed (1.5Gb/s)        *    Gen2 signaling speed (3.0Gb/s)        *    Gen3 signaling speed (6.0Gb/s)        *    Native Command Queueing (NCQ)        *    Host-initiated interface power management        *    Phy event counters        *    NCQ priority information        *    DMA Setup Auto-Activate optimization        *    Software settings preservation        *    SMART Command Transport (SCT) feature set        *    SCT Write Same (AC2)        *    SCT Features Control (AC4)        *    SCT Data Tables (AC5)             unknown 206[12] (vendor specific)             unknown 206[13] (vendor specific)


title: Matching string with a fixed number of characters using grep

text: I am trying to find all `6` letter words using `grep`. I currently have this:               grep "^.\{6\}$" myfile.txt       However, I am finding that I am also getting results such as: `étuis`, `étude`. I suspect it has something do with the symbols above the `e` in the above words. Is there something I can do to ensure that this does not happen? Thanks for your help!


title: Help on editing a script using grep and sed

text: First I'm new to unix so excuse my simple question, also be aware that I work on AIX. I have a lot of sql files that contains the following string:               ${DB_USERNAME}.${TABLE_NAME}      Can anyone please tell me how could I change it in each file so that it remains only               ${TABLE_NAME}      I have tried following pattern of sed.               sed 's/^[^\.]\+\.//'      But it returns only ".". Can someone help me with this `sed` expression ? I need to change files directly. As I think we should pipe output of grep to sed. remember I am on AIX


title: How can I set quotas (space limitation) for samba users?

text: I configured samba server in CentOS 6. It will be working fine. The windows users share the files through samba. I want to set space limitation for samba users.


title: Ubuntu 14.04 hard drive partitioning help wanted

text: I'm in need of some assistance with manual partitioning from the Ubuntu 14.04 install GUI. I'm trying to do a fresh install of Ubuntu 14.04 desktop. I have a 60GB SSD as that I want all my OS files on (root, home, etc.), and then I have 3 2TB HDDs that I want to partition so I can later configure them into a raid5 array using MDADM. I want my 60GB drive to be encrypted as well as my 3-drive raid array. What would be the easiest way of doing this? Should I use the default encryption for the SSD and encrypt my raid drives later on once I have the raid array configured? Do I encrypt the raid array or the 3 individual drives? I'm new to the Ubuntu manual partitioning and don't quite understand how to assign mount points and how to size swap partitions. I've also had trouble with disk alignment in the past regarding the raid array disks. Any support at all would be greatly appreciated. If anyone could link some tutorials or give me a quick walk-through on partitioning with multiple drives it would be much appreciated. Overview of request (for clarity): Drive1 (SSD 60GB): Encrypted, Boot Drive (/, /home, etc.) Drive2 (HDD 2TB): Disk1 Raid Array Drive3 (HDD 2TB): Disk2 Raid Array Drive4 (HDD 2TB): Disk3 Raid Array Raid Array: Encrypted


title: XFCE keyboard layout switcher broke .Xmodmap Caps Lock remapping

text: I have successfully remapped Caps Lock to Enter, using ~/.Xmodmap:               clear Lock     keycode 66 = Return      Remapping scancode for Caps Lock But after switching to XFCE and installing keyboard switching plugin, the remapping is broken. So I have to manually run every time after I login:               xmodmap ~/.Xmodmap      How can I fix it?


title: Which runlevel is best for a Linux (Debian) server (DBMS/SCM)?

text: I currently try to harden the system and the security of a Debian server running a database and a source code management. I just want networking and me (one user) to be able to login. Which runlevel is best for this? I found out that my current runlevel is **2** , but maybe **1** or **3** would be better. If so, how can I achieve this?


title: How does a Linux terminal work?

text: If you fire up a terminal and call an executable (assuming one thats line oriented for simplicity) you get a reply to the command from the executable. How does this get printed to you (the user) does the terminal do something like `pexpect`? (poll waiting for output ) or what? How does it get notified of output to be printed out? And how does a terminal start a program? (is it something akin to python's os.fork()? ) I'm puzzled how a terminal works, I've been playing with some terminal emulator and I still don't get how all this magic works. I'm looking at the source of konsole (kde) and yakuake (possibly uses konsole) an I can't get where all that magic happens.


title: Keyboard layout switch (Ctrl+Shift) in a new xorg

text: I've been using similar config for years:               Section "InputClass"         Identifier "keyboard-all"         MatchIsKeyboard "on"         Driver "evdev"         Option "XkbLayout" "us,ru,de"         Option "XkbVariant" ",winkeys,"         Option "XkbOptions" "terminate:ctrl_alt_bksp,grp:ctrl_shift_toggle"     EndSection      After updating to a newer version of my distro both right `Ctrl`+`Shift` and left `Ctrl`+`Shift` switch keyboard layout only in one direction us -> ru -> de. It used to work like this before:   * Right `Ctrl`+`Shift`: us -> ru -> de   * Left `Ctrl`+`Shift`: us -> de -> ru (reverse order) Is there any way to restore the old behavior?


title: Trying to open a browser on startup on my Raspberry Pi

text: I have Raspbian running on my Raspberry Pi, and I want to have a browser appear when it starts up. I am able to open a Midori window to the right page on start up, but my problem is that I receive a "cannot resolve host name" error, such like I would get if I was not connected to the internet. I followed the instructions listed on http://www.niteoweb.com/blog/raspberry-pi- boot-to-browser which were to enter in the command line:               $ sudo nano /etc/xdg/lxsession/LXDE/autostart      Comment everything and add the following lines:               @xset s off     @xset -dpms     @xset s noblank     @midori -e Fullscreen -a http://google.com      This process does open a Midori window on startup, but with the error mentioned above. If the page is refreshed then it works, but I want to be able to bring up a url without having a mouse or keyboard. I read that at the beginning of startup, internet may not be connected yet, so I created a bash script that delayed the process by twenty seconds before opening the Midori window. This did no work either, the same error persisted. I have also tried the process with chromium, to no avail as well.


title: Viewing system console messages in GUI

text: Under Linux, is it possible to view error messages that show up on the text mode terminal while in GUI mode, instead of having to press `Ctrl`+`Alt`+`F1` or `Ctrl`+`Alt`+`F2` to view the messages every time and then switching back to GUI mode by pressing `Ctrl`+`Alt`+`F7`? Thank you.


title: how do I add newlines between lines printed on the command line?

text: Mail logs are incredibly difficult to read... how could I ouput a blank line between each line printed on the command line. For example say, i'm grep-ing the log. That way multiple wrapped lines aren't being confused.


title: What does "warning: override: VZ_FAIRSCHED changes choice state" mean?

text: I am building a Linux kernel, via the Debian linux-2.6 source package. Now there's CONFIG_VZ_FAIRSCHED=y in a sub-config, which gets merged into the final .config, where apparently also "y" gets used:               # grep FAIRSCHED debian/config/**/*     debian/config/featureset-openvz/config:CONFIG_VZ_FAIRSCHED=y      The .config used during build:               # grep FAIRSCHED debian/build/build_amd64_openvz_amd64/.config     CONFIG_VZ_FAIRSCHED=y      I could understand the warning, if now "n" would be used, but nothing appears to have been changed?! This is the output during the `make -f debian/rules.gen binary- arch_amd64_openvz_amd64 binary-indep` call:               make[2]: Entering directory `/var/lib/vz/private/linux.nobackup/linux-2.6/debian/build/source_amd64_openvz'       HOSTCC  scripts/basic/fixdep       HOSTCC  scripts/basic/docproc       HOSTCC  scripts/basic/hash       GEN     /var/lib/vz/private/linux.nobackup/linux-2.6/debian/build/build_amd64_openvz_amd64/Makefile       HOSTCC  scripts/kconfig/conf.o       HOSTCC  scripts/kconfig/kxgettext.o       SHIPPED scripts/kconfig/zconf.tab.c       SHIPPED scripts/kconfig/lex.zconf.c       SHIPPED scripts/kconfig/zconf.hash.c       HOSTCC  scripts/kconfig/zconf.tab.o       HOSTLD  scripts/kconfig/conf     scripts/kconfig/conf -R arch/x86/Kconfig     .config:3518:warning: override: VZ_FAIRSCHED changes choice state      What is this warning referring to?


title: How to rename /dev/sdax(partitions) in Linux

text: I made a partition like `/part` on my machine with some important data... But I can't stand the name of it... I want a clear solution to resolve it and change the name of it to for example `/test`... As you see this is my `/etc/fstab` information:               # /etc/fstab: static file system information.     #     # Use 'blkid' to print the universally unique identifier for a     # device; this may be used with UUID= as a more robust way to name devices     # that works even if disks are added and removed. See fstab(5).     #     # <file system> <mount point>   <type>  <options>       <dump>  <pass>     proc            /proc           proc    nodev,noexec,nosuid 0       0     # / was on /dev/sda5 during installation     UUID=a21a99c4-e5b4-4197-ac5e-80d0fab1f30c /               ext4    errors=remount-ro 0       1     # /home was on /dev/sda6 during installation     UUID=2e37d833-ca34-4fa7-a5d8-a4423a5af9bc /home           ext4    defaults          0       2     # /part was on /dev/sda7 during installation     UUID=47e6e0b1-0e57-4184-a378-375b9ce315c5 /part           ext4    defaults          0       2     # swap was on /dev/sda1 during installation     UUID=485e9f78-4dce-4404-af4e-f43985525264 none            swap    sw                0       0      The point is: My information are important and I scare to manipulate it without being sure... I want a safe solution... How is it possible?


title: reverse order of paragraphs in file

text: I have a file containing text in paragraphs (lines with text separated by one or more empty lines). I would like to reverse the order of paragraphs (i.e. last paragraph will become the first, ...), preferably by using sed. I am looking for a sed command which would do to a file of paragraphs, what `tac` would do to a files of lines.


title: How can I override the kernel default options for mount?

text: I'm struggling with a program that creates a file system in a file and mounts it as a loopback device. The purpose of the program is to create a clone of the root file system and it thinks it's being all smart by also copying over the UUID of the block device. However because I'm using XFS, the loopback mount fails because of the duplicated UUID value. I can manually mount using `mount -o nouuid`, but the program re-creates the device and tries to mount it itself. Because it's not using fstab, I can't set the default mount options there. Is there a way I can tell the kernel what the default options are when running mount and set the `nouuid` option so that even a `mount` command called without specifically specifying that option will use it?


title: After restoring a backup my permissions seem to be borked

text: I made a complete backup of the system with "rsync -aAXv", and set up my encryption. After restoring everything, and booting up and trying to login, openbox didn't want to start, and "startx" didn't work either. After a bit of testing I noticed that I didn't have the permissions to create the necessary temporary files and therefore x and openbox didn't start. I just ran "ls -l" on /home/john/.Xresources -rw------- 1 john john 54 Sep 6 11:10 /home/john/.Xauthority" When I try to run openbox, I get this: "Openbox-Message: Unable to make directory '/home/john/.cache/openbox': Permission denied Openbox-Message: Unable to make directory "/home/john/.cache/openbox/sessions": Permission denied Openbox-Message: Failed to open the display from the DISPLAY environment variable. Where does the problem come from? Can using pcmanfm to copy files (ctrl-c + ctrl-v) cause this? I first had to copy the backup from my external harddrive (ext4) to my laptop (btrfs) and then back before I restored the files on my desktop pc.


title: Virtual Host only works when SELinux is set to permissive - why?

text: Wondering why my virtual hosts will only work when SELinux is set to "permissive". When SELinux is set to "enforce" my virtual hosts are ignored and default host is shown. **Apache/2.2.15 (Unix)** **Here is my httpd.comf:** http://pastebin.com/2LRzLZ8Z **Virtual files contains:**               <VirtualHost *>         DocumentRoot "/srv/vhosts/foo.com/htdocs"         ServerName mysite.com         <Directory "/srv/vhosts/foo.com/htdocs">             allow from all             Options +Indexes         </Directory>     </VirtualHost>      **Works:**               SELinux status:                 enabled     SELinuxfs mount:                /selinux     Current mode:                   permissive     Mode from config file:          enforcing     Policy version:                 24     Policy from config file:        targeted      **Doesn't work:**               SELinux status:                 enabled     SELinuxfs mount:                /selinux     Current mode:                   enforcing     Mode from config file:          enforcing     Policy version:                 24     Policy from config file:        targeted


title: Run root script or command as root in startup application in linux mint

text: I have a wireless adapter that used to work in Linux mint 16 (dwa 171) after installing drivers for it. Now it won't work the same way anymore since I upgraded to linux mint 17. I've found the only way to make it work properly is to run the command `sudo service network-manager restart` I already tried putting this command in rc.local, rc2.local and rc3.local with no real luck. I want this command to run automatically right after login in with startup application program. Please tell me how to.


title: Get ip of running interface

text: Is there a way to get to the ip of whatever interface (e.g. enp0s25, wlp3s0) I am using to connect to the internet? And in a low-resource way I can build into conky? Is it time for me to learn sed and awk, or is there a tool for it? CLEAR QUESTION: How do I find the ip used by the interface connected to the LAN?


title: Can't execute server messages outputed when printing to laser 3 on openSUSE

text: This is my 1st post and I have a sporadic printing issue I'm needing some help with. I have 3 laser printers setup on my secure network; all ping on different IP addresses; 2 of which are printing without problems. The third on the other hand is outputting an error to the cli and various logs "Can't execute server." when a print job is sent to it either via application or manually using the "lpr –Plaser3 filename" command. I've tried restarting servers for cups and spooler; I've also checked user and groups permissions on the */spooler & */epsonserv directories all of which look ok and no change in the problem. The printer is setup identical to the others in /etc/cups/printers.conf and locally in the device's submenus. The print job is being created and save to /user/spooler but does not make it to the networked device. Has anyone seen this type of error as it relates to printing?


title: Combine fdisk and df in the same output

text: `sudo fdisk -l` gives :               255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0xdb20e840             Device Boot      Start         End      Blocks   Id  System     /dev/sda1   *        2048   104859647    52428800    7  HPFS/NTFS/exFAT     /dev/sda2       104859648   310630399   102885376    7  HPFS/NTFS/exFAT     /dev/sda3       310632840   372065399    30716280   83  Linux     /dev/sda4       372072446   838281215   233104385    5  Extended     /dev/sda5       372072448   392552447    10240000   83  Linux     /dev/sda6       392554496   453994495    30720000   83  Linux     /dev/sda7       453996544   515436543    30720000   83  Linux     /dev/sda8       515438592   515456169        8789   82  Linux swap / Solaris     /dev/sda9       515457024   552321023    18432000   83  Linux     /dev/sda10      552323072   585091071    16384000   83  Linux     /dev/sda11      585093120   617861119    16384000   83  Linux     /dev/sda12      617876028   822656519   102390246    7  HPFS/NTFS/exFAT     /dev/sda13      822657024   838281215     7812096   82  Linux swap / Solaris      While `df -h` gives :               Filesystem      Size  Used Avail Use% Mounted on     /cow            1.9G   30M  1.9G   2% /     udev            1.9G  4.0K  1.9G   1% /dev     tmpfs           385M  1.1M  384M   1% /run     /dev/sr0        913M  913M     0 100% /cdrom     /dev/loop0      874M  874M     0 100% /rofs     none            4.0K     0  4.0K   0% /sys/fs/cgroup     tmpfs           1.9G  8.0K  1.9G   1% /tmp     none            5.0M     0  5.0M   0% /run/lock     none            1.9G   80K  1.9G   1% /run/shm     none            100M   24K  100M   1% /run/user     /dev/sda9        18G  1.2G   16G   8% /media/xubuntu/b90d1c45-7805-421b-9ba7-88ab7ed04fd3     /dev/sda7        29G  4.2G   24G  16% /media/xubuntu/964f9a2f-3641-4754-8319-1decea626931     /dev/sda6        29G   20G  7.8G  72% /media/xubuntu/4f6e6be0-a703-4cb6-a425-9ae73f31eb82     /dev/sda5       9.5G   22M  9.0G   1% /media/xubuntu/3c662996-cf77-41a3-9b5d-d7520f8d534a     /dev/sda3        29G  3.4G   24G  13% /media/xubuntu/57f03636-d50f-43fe-97c0-192b761d7054     /dev/sda12       98G   18G   81G  19% /media/xubuntu/5943EBDD309DF483     /dev/sda11       16G  935M   14G   7% /media/xubuntu/a2176105-4afc-4f19-b182-c027925e249e     /dev/sda10       16G   40M   15G   1% /media/xubuntu/4397bd85-5172-4dc4-a4ce-e9690d3ac7f9     /dev/sda1        50G   32G   19G  64% /media/xubuntu/OSDisk      How can I combine these two results using `awk` or something else to have in the same command that result in the following output.               **Device  -  System_Type  -  Size   -  Use%    -    Mount_Point**


title: Prompt user to login as root when running a shell script

text: The problem I am getting is, when I enter the command,               su - root      at the beginning of my shell script file, it prompts the user to enter the password and then does **NOT** continue with the rest of the shell script. I then have to manually locate and run the shell script via terminal. I want the script to make sure that the user logs in as root and then continue with the rest of the shell script. In other words, I want to run the script as any user but as soon as the script begins to execute, the user must change to root and then continue on with the rest of the script as root until it is done. Can this be done?


title: remove duplicate entry from file1 if entry present in file2

text: I want to delete duplicate entry _e_ from `file1` if _e_ is also present in `file2`. Input `file1`:               x1  y1     x2  y2     x3  y3     x4  y4     y1  x1     x5  y5     y3  x3     x6  y6     x5  y5      Input `file2`:               y1  x1     y2  x2     y3  x3     y4  x4     x1  y1     y5  x5     x3  y3     y6  x6     x5  y5      Desired output:               x1  y1     x2  y2     x3  y3     x4  y4     x5  y5     x6  y6      I have used following shell script:               awk 'FNR==NR {             lines[NR,"col1"] = $1        lines[NR,"col2"] = $2        lines[NR,"line"] = $0        next         }            (lines[FNR,"col1"] != $1) {($1 in lines)         print lines[FNR,"line"]         next     }' file1.txt file2.txt      But it is giving following output:               x1  y1     x2  y2     x3  y3     x4  y4     y1  x1     x5  y5     y3  x3     x6  y6


title: background gui process in shell script

text: In the below script, ivfstudio commands open a gui. Even launched as a background process, I need to close it first so that the next commands are executed. **How to make it "really background" ?**               #!/bin/sh          cmd=`ivfstudio ilv/my_app.iva -execute GenerateAll `;          (     $cmd & ;     echo "toto" ;     `sleep 30` ;     PID = `ps aux | grep -i ivfs | grep my_user| grep -i generateall | awk -F " " '{print $2}' \`;  ) ) ` ;     echo  $(PID) ;     `kill $(PID)` ;     )          exit      **EDIT SOLUTION:**               #!/bin/sh          cmd="ivfstudio my_project.iva -execute GenerateAll > /dev/null 2> /dev/null"          nohup $cmd &     echo "toto"          `sleep 30`     PID=`ps aux | grep -i ivfs | grep my_user| grep -i generateall | awk -F " " '{print $2}' `          echo  $PID     `kill $PID`               exit


title: Random crashes on elementary OS

text: I've been trying different distros on my laptop because I'd really like to switch to Linux but I can't seem to make it work. I installed Fedora and elementary OS (which worked before) on my laptop and after a whole day of installing both of them crash randomly. elementary OS crashed during installation few times and the only thing I saw was a block of text from where I only understood that the process is `install.py` and it said Bad RIP value. Once I managed to install elementary OS I tried updating it and then it crashed again, this time the process was `dpkg` and again, Bad RIP value. The laptop is Acer Aspire 5741G (latest BIOS and VGA BIOS) with i5 430M, 3GB of DDR3 and HD5470 512MB.


title: Using Linux kernel config file from version to version

text: I have currently Linux Kernel 2.6, which works for my hardware. Now I want to compile Linux kernel 3.2 for the same hardware. Can I use the same `.config` of 2.6 directly for v3.2? Is there any documentation/guide about how to do migrate the `.config` file from one kernel version to the other?


title: chroot into a sshfs folder

text: I am trying to chroot into a sshfs-mounted directory:               mkdir remoteroot     sshfs remote:/ remoteroot/     sudo chroot remoteroot/      but I get `chroot: cannot change root directory to remoteroot/: Permission denied`. Am I doing something wrong or is this simply not supported? If so, are there alternatives?


title: Using alot MUA with nottoomuch-addresses

text: I try to use the MUA alot to work with the nottoomuch-addresses.sh script for autocompletion of addresses within alot like described in: http://alot.readthedocs.org/en/latest/configuration/contacts_completion.html               [[[abook]]]           type = shellcommand           command = nottoomuch-addresses.sh           regexp = \"(?P<name>.+)\"\s*<(?P<email>.*.+?@.+?)>           ignorecase = True      When I try the autocompletition within alot it gives me the error message: `completition error: abook command "nottoomuch-addresses.sh" returned with return code 2` As it is only a script and not a shell command I tried to giv the whole PATH to the script and I treid to move the script into the alot configuration folder but the problem reamins the same. So I wonder what to do


title: NFS mount properties (options) in FreeBSD

text: I am trying to determine how to examine the actual properties of an NFS mount in FreeBSD. In CentOS (6.4 tested) one can `cat /proc/mounts` or execute `nfsstat -m` to determine all of the mount properties. Specifically I am trying to determine why on a FreeBSD VM I have 3 times better performance on an NFS mount than on a CentOS VM. My `fstab` on FreeBSD is:               server:/share /mountpoint nfs rw 00      What this implies for other options. What are the default options?


title: Is it possible to redefine the tilde ('~', home directory)?

text: Is it possible to redefine the home directory? _e.g._ to `/ext1/username` instead of `/home/username`, i.e. expanding the `~` to another directory (as opposed to changing the actual home directory where users' home files are located). (This question is mostly academic, as it seems like bad practice to do so. I also have no choice in the matter of using `csh`, despite having read the Top 10.)


title: Make xargs pass as first parameter

text: I'm trying to produce this behaviour:               grep 192.168.1 *.txt      By passing a string into grep via Xargs but it is going on the end instead of as the first parameter.               echo 192.168.1 | xargs grep  *.txt      I need to tell xargs (or something similar) to put the incoming string between 'grep' and '*' instead of on the end. How do I do this?


title: Check recursively if directories in a path exist

text: I want to check recursively if directories in a given path exist; if they do not, I want to create them. So if I have the path `/dir1/dir2/dir3/dir4`, if want to check first if `dir1/` exists, and if not, create it, then do the same for `dir2/` etc.


title: compiling bash 4.2 with patches

text: I want to compile bash 4.2 from source. but http://ftp.gnu.org/gnu/bash/bash-4.2.tar.gz is more 2 years old. Should i apply all the patches from http://ftp.gnu.org/gnu/bash/bash-4.2-patches?


title: how to prevent reboot being stopped by nfsmount?

text: I can't imagine there isn't a simple strategy to solve this issue of stale nfs handles preventing a machine from shutting down normally, but I'm not sure what that would be. It's pretty annoying to have to force a reboot just because a wifi connection dropped out at some point while watching endless 'waiting for nfsmount' messages.


title: How to create partition in ubuntu server 12.10

text: I'm trying to create partition during Ubuntu Server installation(12.10).Now I have a 500GB hard disk where I need to create a partition of 200GB for root file system and another 20GB for swap space and the remaining 280GB logical partition called **backup** for storing backup files during upgradation .   I'm new to server installation,   How can I achieve the following:   1. I'm not familiar with RAID array partition and LVM partition. Which is better and how can I do partitioning using any of this.    2. Is there any link that can guide me in this partitioning.    3. How can I create a partition called **backup** and use this partition using command line.


title: List ports tunnelled on OpenSSH server

text: Is there any way to list the tunnels that SSH clients connected to my OpenSSH server have set up? I can use e.g. `lsof -i` to show connections that are being actively tunnelled, but I'd like to be able to list tunnels that the clients have set up but may not currently be in use. (It's just struck me that this may be an entirely client-side thing, i.e. the server only knows the client is set up to tunnel a port when something tries to connect through the tunnel, in which case the answer will be "you can't" - but I'll take that as an answer if so.) (Background: I'm running a MineCraft server on a machine that won't be able to do much else while it's running. If I can monitor when users have tunnels set up, I can run up the MC server on demand.)


title: USB keyboard won't work with usbhid driver

text: I have an HP thin client (model t5325) which runs Debian Linux (kernel 2.6.22.18-1-armel). We are testing some kiosk keyboards from Operator Interface Technology which are presenting themselves to Linux as HID devices, but the OS will not bind the `usbhid` driver to the device and allow them to function properly. Here is what the devices list show for the keyboard when connected:               T:  Bus=01 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#= 13 Spd=12  MxCh= 0     D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1     P:  Vendor=04d8 ProdID=ffd5 Rev= 1.73     S:  Manufacturer=Operator Interface Technology, Inc.     S:  Product=QVP01T     S:  SerialNumber=00003502     C:* #Ifs= 2 Cfg#= 1 Atr=80 MxPwr=100mA     I:* If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=01 Driver=(none)     E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=10ms     I:* If#= 1 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=02 Driver=(none)     E:  Ad=82(I) Atr=03(Int.) MxPS=   3 Ivl=10ms      As you can see, the "Driver" for the two interfaces on the device shows "(none)" and isn't bound to anything. I have tried to bind the device directly to the driver to no avail:               root@TC-40041:/sys/bus/usb/drivers/usbhid# echo -n "1-1.1:1.0" > bind     -bash: echo: write error: No such device      I have also tried adding the vendor/product ID to the `new_id` file for the `usbhid` driver and get the same result:               root@TC-40041:/sys/bus/usb/drivers/usbhid# echo 04d8 ffd5 > new_id     root@TC-40041:/sys/bus/usb/drivers/usbhid# echo -n "1-1.1:1.0" > bind     -bash: echo: write error: No such device      The `1-1.1:1.0` comes from the USB device list:               root@TC-40041:/proc/bus/usb# ls -l /sys/bus/usb/devices     total 0     lrwxrwxrwx 1 root root 0 Nov 30 12:08 1-0:1.0 -> ../../../devices/platform/ehci_marvell.70059/usb1/1-0:1.0     lrwxrwxrwx 1 root root 0 Nov 30 12:08 1-1 -> ../../../devices/platform/ehci_marvell.70059/usb1/1-1     lrwxrwxrwx 1 root root 0 Nov 30 14:10 1-1.1 -> ../../../devices/platform/ehci_marvell.70059/usb1/1-1/1-1.1     lrwxrwxrwx 1 root root 0 Nov 30 15:11 1-1.1:1.0 -> ../../../devices/platform/ehci_marvell.70059/usb1/1-1/1-1.1/1-1.1:1.0     lrwxrwxrwx 1 root root 0 Nov 30 15:11 1-1.1:1.1 -> ../../../devices/platform/ehci_marvell.70059/usb1/1-1/1-1.1/1-1.1:1.1     lrwxrwxrwx 1 root root 0 Nov 30 12:08 1-1:1.0 -> ../../../devices/platform/ehci_marvell.70059/usb1/1-1/1-1:1.0     lrwxrwxrwx 1 root root 0 Nov 30 12:08 usb1 -> ../../../devices/platform/ehci_marvell.70059/usb1      The keyboard works okay when plugged into a Windows 7 PC (though it did go through a discovery process and install a device driver on its own). The vendor claims the keyboards are designed as generic HID interfaces and should work on any modern operating system with USB support. We have similar keyboards from another vendor which present themselves in much the same way to the operating system and they bind to the `usbhid` driver without error and work perfectly. These do not. Have we missed anything? Are there other way we can attempt to bind the driver or have these keyboards work properly with Debian Linux?


title: Debian Wheezy netinstall can't configure DHCP

text: I am reinstalling my Debian system with the Wheezy netinstall image on a USB drive. I have a wireless router that also comes with ethernet ports, so I could either connect to my LAN via wifi OR ethernet. The installer was able to detect my wireless (wlan0) and wired (eth0) interfaces, but one of the following always happens: (1) If I try network autoconfiguration for eth0, the process would always fail at the DHCP autoconfigure step (i.e. can't get IP address?). Please note that this works on the machine, before the re-install I am attempting. (2) If I try network autoconfiguration for wlan0, it successfully authenticates with my wifi network via WPA2, and configures DHCP successfully. However, I get an error saying there is no "default route" setup. What does "default route" mean? I have tried to cancel/delete all DHCP leases and restarting my router to no avail. I also tried getting into the shell (which is ash) but there's no ifconfig etc. that I could access. Can anyone help with troubleshooting this problem? I am eager to reinstall Debian Wheezy soon. Thanks!


title: Track daily directory changes (and email them)

text: I have a Debian powered NAS server (ReadyNAS) with a deep file hierarchy. I'd like to get notified daily about what has changed in some of its directories and their subdirectories. So if someone accidentally deletes a file during the day, I'd get notified about it at night by email (which would contain summary of all changes) and restore the file from backup in the morning of the next day. At first I wanted to write a PHP CL or Python script which would recursively scan the directories, but then I thought that perhaps there is some neat unix tool that does it better. Something like dircmp :) How would you do it? Thanks


title: KDE; each monitor another desktop

text: Is it possible to configure for example 4 desktops and switch them separately for each monitor?


title: Ctrl-S doesn't work in rtorrent when accessed via screen. Can't start torrents

text: I run `rtorrent` remotely on a seedbox. When I log in with a web interface I'm able to start torrents, and when torrent files get dropped into my watched folder that works too. However, when I try to start them by SSHing in to my seedbox and `-r` resuming the `screen` session that contains my instance of `rtorrent`, I can't seem to use the `Ctrl`+`S` keyboard shortcut to start torrents. I can stop and delete them with the `Ctrl`+`D` shortcut, and as far as I can tell all the other keyboard shortcuts work. I've tried this from the Terminal app in OSX and from Cygwin on Windows. Thanks for your insight!