title: what is a background process?

text: Here is a common definition of a background process: "A background process is a program that is running without user input. A number of background processes can be running on a multitasking operating system, such as Linux, while the user is interacting with the foreground process Some background processes, such as daemons, for example, never require user input. Others are merely in the background temporarily while the user is busy with the program presently running in the foreground. So that other process can be sleeping and taking up swap space, until activated, which thus makes it currently a background process." Given that definition, wouldn't that make a process like apache2 a background process since it never interacts with user input in terminal? And wouldn't that consider most process background processes, since most processes running on a system do not deal with user input in the terminal? Oddly enough, I personally wouldn't consider apache2 a background process since a user does interact with it through http requests (just not a terminal).


title: Gnu Parted Error in HardDisk of Linux?

text: Anyone help me, why the error getting when excuting the fdisk -l command in linux.               # fdisk -l /dev/sdb           WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.


title: Emacs key problem

text: I am using Cygwin to connect to an Ubuntu installation, and for some reasons my `Ctrl``h` for the help has been remapped to `Ctrl``Del`. When I actually type `Ctrl``c`,`h` I get the error: > No operation mapped for Ctrl + c <DEL>. There was a key mapping for ctrl + h to ctrl + delete in the init.el, now I have deleted it but still ctrl + h acts as a ctrl + DEL. How can I reset this?


title: Why does my linux keep crashing?

text: I am running Debian 6.0 Squeeze. Every half hour or so a dialog pops up on the side of my screen with the message - > Kernel failure. A report has been sent to the developers to help them fix > the error. (Not the exact text but that's what it says) Occasionally, say once a day it freezes and then reboots completely causing me to loose all my work. I thought Linux was renowned for its stability. But here it seems to be worse than windows. What is happening? Note - I used a USB stick and a Live Usb maker to install the system. Could that be a reason for the problem?


title: How to upgrade my linux Debian installation?

text: I run the following command to upgrade my system -               aptitude update     aptitude dist-upgrade      However it gives me updates for the softwares and libraries that I have installed. This is not what I want. I want to upgrade the operating system itself, to apply any security patches or bug fixes. What is the way to do that? I am running Debian 6.0 Squeeze.


title: Unable to launch Fedora 18 LiveCD using USB device

text: I just bought a new motherboard which has BIOS and UEFI. I have a previously working LiveCD installed on my usb, created with LiveUSB Creator. I tried using it to boot but got stuck at the grub command line. Next, I followed the instructions here to create a new LiveCD using `livecd-iso-to-disk` command line method with the following options `\--format --reset-mbr --efi --overlay- size-mb 600`. I did the install on the second partition of my usb stick with 2GB allocated to this. Then I check that the partition is indeed bootable using `parted`. However, the boot process was again halted at grub with the following errors: > error: file `/isolinux/vmlinuz0' not found.   > error: you need to load the kernel first. Is this my problem or the motherboard problem? How do I go about solving it? **UPDATE:** This appears to be a file/folder naming issue with some motherboards not able to find the kernel. I did the following renaming:               /syslinux to /isolinux     /isolinux/syslinux.cfg to /isolinux/isolinux.cfg      I manage to get the kernel to load. But it got stuck at `dracut`, this time with the following warnings:               dracut-initqueue[229]: Warning: Could not boot.     dracut-initqueue[229]: Warning: /dev/disk/by-label/Fedora-18-x86_64-Live-Desktop.is does not exist     dracut-initqueue[229]: Warning: /dev/mapper/live-rw does not exist      I am wondering if this is again a naming issue. Why is it looking for `.is` instead of `.iso`? Anyone has any idea? Thanks.


title: Why isn't my environment variable visible from the command line?

text: I'm trying to run the James SMTP server on Lion (Mac OS X 10.7.2). When I do this:               sudo JAVA_HOME=/Library/Java/Home ./james-2.3.2/bin/run.sh      it works fine. However, I'd like to make JAVA_HOME an environment variable so it is visible to other applications too. I edited ~/.bash_profile to look like this:               export JAVA_HOME=/Library/Java/home      and the variable appears to be visible from the command line like so:               $ echo $JAVA_HOME     /Library/Java/home      But when I run james again like this, I get a warning about JAVA_HOME:               $ sudo ./james-2.3.2/bin/run.sh     ERROR: JAVA_HOME not found in your environment.          Please, set the JAVA_HOME variable in your environment to match the     location of the Java Virtual Machine you want to use.      Any ideas what I'm doing wrong? Why can't the command to run james see the JAVA_HOME environment variable? Any info is greatly appreciated, thanks!


title: How do I delete a folder but not the contents?

text: My directory (in Linux) looks like `com/com/{various,files}` where `com` and `com` are folders of the same name and the second `com` holds the various files. I want the first `com` removed, but the second and files in the second kept.


title: No valid sudoers sources

text: I've gone through the Google searches, but the results always have an extra clue that I'm not seeing. The error:               [testuser@testhost] $ sudo -ll     sudo: no valid sudoers sources found, quitting     sudo: unable to initialize policy plugin      That's it. No parse errors in /etc/sudoers, nothing.   * /etc/sudoers is owned by root:root and has 0440 permissions.   * I ran `visudo` to uncomment the included `%wheel` group privilege.   * My test user is a member of `wheel`.   * I've even removed and reinstalled `sudo-1.8.6p3-7.el6.x86_64` on this RHEL 6.4 test VM. What else can I look at? Answers to questions:   * The VM I'm testing on is secure; I can't copy/paste to an outside site. (I'm asking this question from a different host outside the firewall.) `stat /etc/sudoers` shows a regular file of `size 4000` and `access 0440`. The contents of the file are default (via the remove and reinstall) with the exception of the `%wheel` group being uncommented.   * `ls -ld /etc/sudo*` shows      * `/etc/sudo.conf` (0640, root:root)     * `/etc/sudoers` (0440, root:root)     * `/etc/sudoers.d` (0750, root:root, empty directory)     * `/etc/sudo-ldap.conf` (0640, root:root) The overall goal is privileges via ldap, which I've done before successfully. Thanks! [CORRECTION: The uncommented `%wheel` group is not password-free. The test user must enter a password for wheel privileges.] [UPDATE 1011h: Modifying `/etc/sudo-ldap.conf` with the correct `sudoers_base` got me access to the LDAP database (anonymous bind during testing) and a successful result to `sudo -ll`. That's a workaround for me, but doesn't solve the initial problem of whatever is preventing sudoers from working locally.]


title: Delete duplicate images. Need Software for computing average color of an image

text: I want to delete duplicates in a massive bunch of images. Well as I have dups of the same picture in a different resolution I will make the deletion myself. BUT I want to do this in linear time. So I thought it woud be smart to sort the images via renaming the images with an average color prefix with a little script. The problem is that I don't know any software that is able to compute the average color in the CLI. Is there any?


title: Why can't I login in as the ftp user?

text: After installing vsftpd I have the user ftp on my system. I assigned a password to this account. However, I still cannot login as the ftp user (on the command line, without any ftp-protocol involved).               su - ftp     password:     ... still the previous user is logged on      People will wonder why I want to do this. Well, I want to expose the whole file system via ftp. People will say, you should not do that, well...


title: How to target multiple selections with xclip

text: When copying text to the clipboard, xclip provides several selection targets:                -selection         specify which X selection to use, options are:         "primary" to use XA_PRIMARY (default),          "secondary" for XA_SECONDARY          "clipboard" for XA_CLIPBOARD      Is there a way to target multiple selections? I have tried the following options   1. `echo "Hello world" | xclip -i -selection primary -selection clipboard`   2. `echo "Hello world" | xclip -i selection primary | xclip -i selection clipboard`   3. `echo "Hello world" | xclip -i selection primary,clipboard` but none of them worked.


title: how to apply this patch

text: There is a patch fix for perl module net::ssh2 it fixes a seg fault error that happens on some machines. It's located here: https://rt.cpan.org/Public/Bug/Display.html?id=36614 I downloaded the patch but i'm not sure how to apply it. I removed the module i previously installed, went to the build folder and did patch ssh2.xs < p1 it asked me if the patch was in reverse. I wasn't sure so i hit yes. IT says patch succeed then tells me ok. modules installed. I don't think either the patch worked or i'm moving my patched version in correctly. I feel that way because i still get the seg fault and everyone say this fixes it. Can someone guide me here?


title: What are character special and block special files in a unix system?

text: How are character special files and block special files different from regular files in a Inix-like system? Why are they called “character special” and “block special” respectively?


title: Browser-based front-end to linux

text: I'd like to ask if anything like this exists. A browser-based tool for looking at a Linux system, managing it, and helping newbies diagnose problems. What I'm thinking of is something like this :   * it's a program that you install and run locally, but acts as a web-server so that the user interface is a browser   * it's a combination of documentation, sys-admin tool and tutorial. So that, of course, you can look at man pages through it, or run commands. But more interestingly, you might read a "HOW-TO" page that says "look at the apache config files at /etc/apache2/apache2.conf " and that becomes a link to the file itself, letting you open it up and read it.   * can be extended with plug-in editors / highlighters. Perhaps a log file will be easier to read if it can be syntax coloured and errors highlighted in red.   * plug-ins can be shell scripts. And can be used to write diagnostic tests. So, for example, if you need to look in one of 8 different places to find out what sort of audio setup your linux box has, someone could write a shell (or perl) script that looks in these places, extracts the relevant information and displays it on a page alongside tutorial information about how to solve a particular problem. I'm sure you can think of many similar scenarios. So, does anything like this exist? Unix is an awesome system with built-in man support, command-line tools and scriptability. But is an impenetrable jungle for the uninitiated. On the other hand, hypertexts with linked html pages are much easier to navigate and aid discovery. And the browser can display diagrams and documents more readably than the terminal or Emacs. Is there any project that tries to bring the best of these two worlds together?


title: Alias or Intercept complex bash command with args

text: How do you create a bash alias for a command with flags? ~~For example, if I run`ls -l`, I want that to alias to `ls -a`. This doesn't work: `alias "ls -l"="ls -a"` ~~ Another example: If I type `reboot now`, I want that to simply run `reboot`. Would bash functions be useful here? * * * EDIT: Sorry for the silly `ls -l` example. This is what I really want: if you executed `reboot now`, I want it to actually execute `reboot`. This is why.


title: Guess complete filename

text: I have some files with really long names lying around on my server and writing the complete names is kind of a pita so I'm asking if my Linux system (Debian 7) can guess the complete filename? I want to write something like               rm some_file_1      instead of               rm_some_file_1_very_long_information_bla_bla_foo_bar_meow      There is no other file than `some_file_1_very_long_information_bla_bla_foo_bar_meow` whose name contains `some_file_1`


title: echo bytes to a file

text: I'm trying to connect my rasberry Pi to some display using the i2c bus. To get started I wanted to manually write stuff, bytes in particular to a file. How do you write specific bytes to a file? I already read that one and I figured my problem should be solved by something like this               echo -n -e \x66\x6f\x6f > byteFileForNow      However, when I open up that file with nano, instead of **foo** I see: > x66x6fx6f So the backslashes were escaped, but not the bytes themselves. I also tried the same only without the **-e** this time, so I would've exepected to see **\x66\x6f\x6f** , but got the same as before. So echo is escaping backslashes, backslashes alone and backslashes regardless of if it is supposed to.   Any idea how to fix this?   According to the man-page that should've done what I'm looking for.


title: Fastest way to concatenate files

text: I've got 10k+ files totaling over 20GB that I need to concatenate into one file. Is there a faster way than               cat input_file* >> out      ? The preferred way would be a bash command, Python is acceptable too if not considerably slower.


title: Texlive fonts screwing up my truetype fonts

text: I have been running into this strange issue. When I install texlive fonts, they automatically register as system fonts. If I install the texlive variant of an already installed truetype font (for example Dejavu) it gets overridden by the texlive font and looks horrible. I'm using OpenSuSe 12.3 and 13.1


title: How to write text into the first line of a file?

text: I've been looking around `sed` command to add text into a file in a specific line. This works to add text after line 1:               sed '1 a\      But I want to add BEFORE line1. It would be:               sed '0 a\      but I get this: `invalid usage of line address 0`. Any suggestion achieve this?


title: Sharing variables across multiple shell scripts

text: I am trying to summarize multiple shell scripts within one large shell script, such as this:               #!/bin/sh     bash script1.sh     bash script2.sh     bash script3.sh      All scripts share the same variables "var" and "var2". I wanted to delete the variable definitions from the individual shell scripts and put it into the large shell script instead, so that when I change the value of the variables I only have to do that once. However, when I do               #!/bin/sh     var1="1"     var2="2"     bash script1.sh     bash script2.sh     bash script3.sh      the variables are not recognised by the references $var1 and $var2 in the individual shell scripts. Apologies if the question has been asked before, I am new to scripting in general and didn't know what to search for. It would also be nice to know how I could loop over the scripts with multiple variable inputs, such as               var1="1 2 3 4 5"     var2="a b c d e"     for i in $var1;do for j in $var2;do     script1.sh     script2.sh     done;done      Thanks in advance for any useful tips.


title: A script to identify whether a file descriptor has gone bad

text: **Problem** : I have a server program running which connects to a remote program using TCP sockets. There many of them (say 20). My problem is one of the socket descriptor has gone bad and has recieved EOF. But due to bug in program it never closes it but adds it back to select() set and causes unnecessary pain. **What I did to find it** : I attached to DDB, and called read(fd,..) to each of them. The bad descriptor returned 0 and I tapped it there. Though this worked for me, but had a cost of wasting bytes from other sockets and the other functions may behave wrongly. **What I am looking for** is to get an idea on a non-intrusive mechanism that solves my purpose without affecting the running programs. By the way my NetBSD system understands tcsh only.


title: Script to find the default Desktop Environment?

text: Assume a Linux Desktop Environment system is installed. When powered on and credentials entered, whatever Desktop Environment is started i would consider the default Desktop Environment. The user may pick another Desktop Environment such as KDE or XFCE, but that would not be the default. What is a distribution agnostic snippet of code to find the default Desktop Environment or better yet, the DE last used. The code must run from a remote SSH session or CTRL- ALT-F2 text only console. The impetus for this question is that i recently emailed the output of nvidia- bug-report.sh to NVIDIA. NVIDIA tech support replied back days later asking "What OS?", "GNOME or KDE?", "What Distribution?" - all meta data that could be automatically collected and catalogued by their own script. Since the Desktop Environment has crashed, nvidia-bug-report.sh needs to run from a CTRL-ALT-F2 text console or remote SSH session. Clearly, neither of these have the $DESKTOP_SESSION variable. Answer would return one or more items in order of confidence from a list similar to `"gnome|kde|mate|cinnamon|lx|xfce|jwm|none"`. ![Choosing between GNOME or KDE in Ubuntu.](http://i.stack.imgur.com/Ha4dj.jpg)   ![Choosing Desktop Environment Session Type in Fedora.](http://i.stack.imgur.com/XGMEd.jpg) ![Choosing between GNOME or KDE in CentOS.](http://i.stack.imgur.com/ZWNQq.png) Would like scripts similar to " How can I get distribution name and version number in a simple shell script? "


title: What does "3>&1 1>&2 2>&3" do in a script?

text: I saw this line in a script:               DEVICE=`dialog --inputbox "Festplatten-Laufzeit auslesen. Gebe Sie das      gewünschte Device an: " 0 70 "" 3>&1 1>&2 2>&3`      What is               3>&1 1>&2 2>&3      doing? I know that 1 = stdout and 2 = stderr, but what are the `3` and the `&` for?


title: List all dotfiles current directory using zsh

text: How can I list all dotfiles in a directory using zsh.?


title: luks single signon

text: I've got LUKS (Linux Unified Key Setup) running on a couple of my Linux boxes. I've looked online but haven't seen anyone document how to make it work in a single signon option, but was hoping someone could either point me in the right direction or give a definitive no that won't work (or more likely, no that won't work without writing some extra PAM etc. code). Specifically, what I would like to do is boot up my system (which has let's assume 4 user accounts). When I get prompted for my passphrase, it unlocks LUKS and boots up, and then tries that same passphrase to log in the user that's associated with that passphrase. (LUKS supports 8 different passphrases but I'd be fine if there was just a single user supported (my primary username) and if I wanted to log in to a different account, I could log out / switch user. Update: I'm encrypting the whole disk.


title: How can I install my webcam on Debian?

text: I'm trying to install the webcam driver for my Logitech C210. After some googling Linux UVC driver seems to be what I need. I followed their typical use in hope to get it installed:               git clone git://linuxtv.org/media_build.git      cd media_build      ./build      make install      Now, I get these errors when I try to `./build`:               make -C /home/pi/media_build/v4l allyesconfig     make[1]: Entering directory `/home/pi/media_build/v4l'     make[2]: Entering directory `/home/pi/media_build/linux'     Applying patches for kernel 3.1.9+     patch -s -f -N -p1 -i ../backports/api_version.patch     patch -s -f -N -p1 -i ../backports/pr_fmt.patch     patch -s -f -N -p1 -i ../backports/v3.1_no_export_h.patch     patch -s -f -N -p1 -i ../backports/v3.1_no_pm_qos.patch     Patched drivers/media/dvb/dvb-core/dvbdev.c     Patched drivers/media/video/v4l2-dev.c     Patched drivers/media/rc/rc-main.c     make[2]: Leaving directory `/home/pi/media_build/linux'     ./scripts/make_kconfig.pl /lib/modules/3.1.9+/build /lib/modules/3.1.9+/build 1     Preparing to compile for kernel version 3.1.9     File not found: /lib/modules/3.1.9+/build/.config at ./scripts/make_kconfig.pl line 33, <IN> line 4.     make[1]: *** [allyesconfig] Error 2     make[1]: Leaving directory `/home/pi/media_build/v4l'     make: *** [allyesconfig] Error 2     can't select all drivers at ./build line 451.      Btw im trying to do this on the Raspberry PI, architecture is ARM cpu.


title: linum auto-activation in .emacs fails

text: I added the following lines to my .emacs.d/init.el to auto-activate linum at startup:               (require 'linum)     (global-linum-mode 1)     (setq linum-format “%d “)      But no way, i still have to manually `M-x linum-mode` to make it display line numbers in my C buffers (and all other buffers).   Any idea? (GNU Emacs 23.2.1, modified by Debian)


title: Resizing root partition in LVM broke Grub

text: I'm using Debian Wheezy hosted on W7 in Virtualbox. I needed to enlarge root partition then added a new virtual disk to virtual machine. Doing the steps mentioned below brings me to grub prompt. I:   * Added new virtual disk   * Formatted and mounted   * Created PV   * Added to same VG with root partition   * Extended root partition LV with `lvextend`   * Resized the file system. Everything went well and I checked that with `df` command and `lvscan` but after reboot I couldn't boot the system. What point have I missed and how to recover the system?


title: How do I change the default text editor in the Debian (squeeze) distro

text: "Joe's own editor" does not come naturally to me. How do I change to using nano or vim? I've tried               export EDITOR=nano      but it doesn't seem to be respected. I'd like `visudo` to respect this as well.


title: X11 session environment

text: I want to run specific command in X11 session automatically, as soon as I take the session. e.g. If I do               Xephyr :2 -once -query <ip_address>      then post successful authentication, a command e.g. `export ABCD=small` need to get executed automatically.


title: How can I stop ssh from trying to create ~/.ssh?

text: I'm working on an rsync-based backup for a FreeNAS system. Part of the backup process involves logging into the remote system that serves as the backup storage. Whenever I do that, I get the message               Could not create directory '/root/.ssh'.      I'm assuming this is due to the fact that `/root` is read-only, because when I try to create `~/.ssh` manually, I receive:               mkdir: /root/.ssh: Read-only file system      Because of this, I have already moved the `known_hosts` file more appropriate for my backup process and am using `-o UserKnownHostsFile` to resolve any issues related to that. However, `ssh` still tries to create the `~/.ssh` folder when I invoke it. How can I get it to not try to create the folder?


title: Linux based internet file server

text: I am looking for a linux based file server that I can use to store all my files and access remotely through Internet. I have come across a few different alternatives, most promising amahi, but most of these servers prefer the server to manage DHCP, which I can not do as first of all, restarting all the devices on my network would be a seriously tedious task and the router currently managing the DHCP will have more up-time than my server. I also have a windows home server, which is connected to the Internet through my router, but I can't mount it when I'm not at the local network, I can only manage the files through a browser, which is really unpractical. So basically what I want is: A home file server that can be mounted as a disk, or viewed in finder in any other way, in OSX (and windows, but I'll mostly be using OSX) and I must be able to do this both at the local network and from any other location, without having to manage the DHCP from the server. I have thought of setting up openVPN (or another vpn connection if available) to access the local network remotely as if my machines was physically there, but I have no idea of how to setup the router to make this work, especially since I already have a server connected to the router.


title: How to stop waking all attached drives on reboot / deactivating swap?

text: A fresh install of Debian 6.0.6 for a system has 13 SATA drives attached. 12 refurbished WD-10EARS drives are yet unpartitioned. 1 WD1500BLFS drive is configured for OS and swap. Swap partition is configured on /dev/sda5 according /etc/fstab               root@debian:~# cat /etc/fstab | grep swap     # swap was on /dev/sda5 during installation     UUID=641cc8ad-838d-4e92-8c2c-0b73359a5aa3 none            swap    sw              0       0      Because the 12 drives have no disk activity, the drive state goes from "active/idle" to "standby" after a while.               root@debian:~# hdparm -C /dev/sdm          /dev/sda:      drive state is:  active/idle          root@debian:~# hdparm -C /dev/sdm          /dev/sda:      drive state is:  standby      When issueing a `reboot` command the console shows "`Deactivating swap...`" and then staggered all 12 drives start to spinup as verified by sound and power consumption. Having a drive state change from standby to active can take up to 30 seconds. In other words a reboot now takes between 3 and 7 minutes. How long would a reboot take when 70 drives are attached! _Update #1_ The issue is related to "sd" (storage device) that wishes to " **Synchronizing SCSI cache** " on each drive. How to stop changing all drives its state from "standby" to "active" on reboot (most likely caused by the "deactivating swap" process)?               # uname -mrsn     Linux debian 2.6.32-5-amd64 x86_64


title: ps output differs when run from command line and from script

text: I have to create list of PID's of the running processes. Here is the script               ps     echo "fields are "     ps | cut -d' ' -f1      `ps` is showing                 PID TTY          TIME CMD      2168 pts/4    00:00:00 sh      2177 pts/4    00:00:00 mailx      5191 pts/4    00:00:00 sh      6494 pts/4    00:00:00 sh      6495 pts/4    00:00:00 ps     12154 pts/4    00:00:00 sh     12172 pts/4    00:00:00 mailx     15618 pts/4    00:00:00 bash      But the output of cut pipeline is just               12154     12172     15618


title: Change the PS1 prompt in a subshell sh called from parent bash

text: When I am running an interactive `bash` session, I sometimes experiment with `sh`. I call `sh` directly from this `bash` session. My question is, how can I change the `PS1` prompt of this subshell? I would like the prompt to be something like `sh$`, notifying me that I am using `sh` and not `bash`. What I have tried so far is:   * I made a configuration file analogous to `.bashrc` named `.shrc`   * I put only one line in it: `export PS1='$(echo ${0})\$ '`   * I then modified `~/.profile` to say the following:              # if running bash     if [ -n "$BASH_VERSION" ]; then     # include .bashrc if it exists         if [ -f "$HOME/.bashrc" ]; then             . "$HOME/.bashrc"         fi     # if running another shell     else         if [ -f "$HOME/.shrc" ]; then             . "$HOME/.shrc"         fi     fi        * I restarted the terminal, but the changes are not being applied.   * If I run `. ~/.shrc` in `sh` manually, the changes _do_ get applied. What am I doing wrong?


title: Problems with Maple 16 GUI on Arch Linux

text: I have installed Maple 16 (computer algebra system) to the directory /opt/maple16/ and the installation and registration progress is finished succesfully. I am running Arch Linux. The terminal version of the program (maple) works fine, but when I start the GUI version (xmaple), the actual interface doesn't show up, however it does display the 'hint of day' window and it is possible to use, for instance, Ctrl + S for saving. The program also opens two windows, the actual empty maple document and an empty java window. I have tried runing it as both a normal user and as root, but that does not seem to change anything. I am using Awesome WM, but I'm not sure if that might be part of the problem. What might the problem be and have anyone experienced the same problems? How can I debug a problem like this?


title: diff reports two files differ, although they are the same!

text: I have two files which look identical to me (including trailing whitespaces and newlines) but diff still says they differ. Even when I do a `diff -y` side by side comparison the lines look exactly the same. The output from diff is the whole 2 files. Any idea what's causing it?


title: Why is `sudo pkill -HUP -f "nginx: master process"` returning code 129 and no output

text: I'm trying to trigger a reload of the Nginx master process by using `pkill` and `sudo`. The server reloads fine, but I was just curious if anyone knows why the command `sudo pkill -HUP -f "nginx: master process"` returns code 129?               # Running as root     $ pkill -HUP -f "nginx: master process"     $ echo $?          # Output is as expected:     0          # Running as a user (sudo is set to not prompt for a password)     % sudo pkill -HUP -f "nginx: master process     % echo $?          # Output is weird (considering sudo should be passing along the return     #                  code of the command it is executing):     129      Running on Ubuntu 12.04.1 LTS running on EC2 ... surprisingly Ubuntu 12.04.1 LTS running on a physical computer (not installed using cloud images) runs fine.


title: List all users and last time they read mail, pipeing to multiple output

text: I have one system that I would like to do a little clean up, so I would like to get all user accounts and last date they accessed they mail. It is a Debian system. So far I got to this:               cut -d: -f1 /etc/passwd | xargs -n1 finger | grep "Mail last read"       But I dont know how to write that username in front of Mail last read Sun Aug 12 03:06 2012 (CEST) Thank you


title: Is it possible to get a hardcopy in Tmux?

text: I keep flip flopping between tmux and screen, and right now I'm back on the tmux kick. I've been doing some setup for a friend, and I want to make a hard copy of the session so he can see the commands that I've run. I know this is possible in screen, but can I do it with tmux? The man page doesn't seem to have anything related to hardcopy...


title: CentOS Run Command as Root on Startup

text: I need to designate my network card device `p4p1` with a certain IP address on startup. The command I am using is as follows : `/sbin/ip addr add 129.100.14.2/24 dev p4p1` this works from the command line when I am root. I tried putting this command in `/etc/rc.local` but it is not executed. I suspect it is because of the root requirements of the command. Can someone help me out here? Where should I put this command?


title: How can I pause in a shell script?

text: How can I make my shell script pause before continuing?


title: Two networks cannot be accessed simultaneously

text: I have two networks on a server. One being my internal network, and the other being an external IP address. This is on Debian Lenny. Here is my `/etc/network/interfaces` file:               # This file describes the network interfaces available on your system     # and how to activate them. For more information, see interfaces(5).          # The loopback network interface     auto lo     iface lo inet loopback          # The primary network interface     auto eth0     iface eth0 inet static             address 172.16.130.250             netmask 255.255.255.0             broadcast 172.16.120.255             gateway 172.16.130.1          auto eth1     iface eth1 inet static             address 24.249.hidden ipaddy             netmask 255.255.255.224             broadcast 24.249.hidden broadcast.255             gateway 24.249.hidden gateway      I can reboot my system and sometimes eth1 is accessible from SSH, and other times eth0 is accessible. Then sometimes eth1 will just stop being pingable alltogether. This is a fairly fresh install of Debian, and the only thing I have running is VMWare Server 2.0, bridged to both of my network connections.


title: Mnemonics for Unix functions?

text: Does anyone have any useful mnemonics for remembering the order of function parameters or the return values of Unix system calls? I am suffering from "memory leaks".


title: vnc4Server Issue

text: I initially installed VNC4SERVER to run Guacamole (render VM through browser) on an AWS EC2 Linux (Ubuntu 12.04) instance. It worked fine and then I shutdown the instance. After a few days I started it again, and then I noticed VNC not working properly. I went into terminal and checked it out, and here were the logs:                 GNU nano 2.2.6                               File: /root/.vnc/ip-10-148-67-7:2.log                                                                              04/06/13 17:28:46 Xvnc version TightVNC-1.3.9     04/06/13 17:28:46 Copyright (C) 2000-2007 TightVNC Group     04/06/13 17:28:46 Copyright (C) 1999 AT&T Laboratories Cambridge     04/06/13 17:28:46 All Rights Reserved.     04/06/13 17:28:46 See http://www.tightvnc.com/ for information on TightVNC     04/06/13 17:28:46 Desktop name 'X' (ip-10-148-67-7:2)     04/06/13 17:28:46 Protocol versions supported: 3.3, 3.7, 3.8, 3.7t, 3.8t     04/06/13 17:28:46 Listening for VNC connections on TCP port 5902     Font directory '/usr/share/fonts/X11/Type1/' not found - ignoring     Font directory '/usr/share/fonts/X11/75dpi/' not found - ignoring     Font directory '/usr/share/fonts/X11/100dpi/' not found - ignoring     No VNC extension on display :2     gnome-session[3440]: WARNING: GSIdleMonitor: IDLETIME counter not found     gnome-session-is-accelerated: No composite extension.     gnome-session-check-accelerated: Helper exited with code 256     gnome-session[3440]: WARNING: Session 'gnome-classic' runnable check failed: Exited with code 1     GNOME_KEYRING_CONTROL=/tmp/keyring-Qol7F5     GPG_AGENT_INFO=/tmp/keyring-Qol7F5/gpg:0:1     GNOME_KEYRING_PID=3458      Can anyone help? Any piece of information or advice would be highly appreciated.


title: cpulimit does not detect Node.JS process

text: I was able to limit python process to use only 50% CPU with the following `cpulimit -l 50 -e python` but when I tried to do the same for Node, and it is not able to detect the process at all. Does anyone know? In the `ps aux`, I can see `node`, so I am not sure what is missing `cpulimit -l 50 -e node` The platform I am running on is Ubuntu 14.04, but I'd imagine this issue should be linux flavor agnostic. My current work around is `cpulimit -l 50 -p $(pidof node)` However, it means that it does not detect any new instances of node processes.


title: SSH authentication by public key and password in the same time

text: Something is not clear to me with SSH authentication. I have a Talend job which connects to sFTP (using SSH protocol) and on the property page of the component, I have the choice between: 1. `Password` authentication 2. `Public key` authentication When I choose `Password` authentication the data to enter are `username` and `password`. but when I choose `Public key` authentication the data to enter are `username`, `password`, `private key path` and `private key passphrase`. I though when a public key authentication is set on a server there is no need for a password. Is the SSH enables an authentication using public key **and** password in the same time as a security enforcement or it is just a fallback which means if the public key is not authorized, the standard username/password will be used (if the sshd server permits it)?


title: crontab -e , then 0 * * * * = every hour; then xclock

text: After sudo crontab -e (it wrote "/tmp/crontab.XXXX70pN9h" 1L, 19C 1,1 All Then I saved the file. And to check..? (how? i don't know)               And to check I      ps -e | grep cron     29818 ?        00:00:00 cron      So.. but I decided to check again but               sudo cat /etc/cron.hourly     cat: /etc/cron.hourly: Is a directory     xi@localhost ~ $ sudo ls /etc/cron.hourly      Nothing! i.e. in directory As I understand first 0 in the hour-position means every hour?


title: what type of device drivers are available in linux

text: The different types of device drivers used in linux are character device and block device. Is there another classification?


title: Limit log sizes in particual ufw's logs

text: (Ubuntu 14.04 x86) I have enabled `ufw` and enabled logging (level low - the default). Even on low there is an entry about every second (it is accessible from the Internet - I guess just port scans trying their luck). My concern is: the log file could grow over time taking up disk space I would rather have for other things. I could find no mention of what it is limited to in `ufw`'s man pages - is it limited? How can I limit it? More generally what strategy does Linux use for limiting logs such as `syslog`?


title: UNIX be-spoke Shell-Script / Commands

text: Sorry in advanced if this question would be better suited on SO. Basically, I'm getting used to using the command line interface (linux etc..) and I come across commands like: > git [command] .. e.g. > git push I have a project (developed in C++) and wondered if it _is_ possible to be able create custom made commands, for example: (assume my project is called 'MyProject'): > MyProject compile Which would then execute the `gcc` command to compile? Note: I know it is possible to create your own commands, like "compile" but I want to create commands that have a 'Reference' and then the 'Command'. Hope someone can help me


title: updating `/etc/resolv.conf` on a read only filesystem

text: I currently have a busybox based embedded linux system. The filesystem is a readonly mounted jffs2 filesystem. One problem I've run into is that `/etc/resolv.conf` can't be updated by DHCP. Is it possible to use a different file than `/etc/resolv.conf`, say `/tmp/resolv.conf` (`/tmp` is mounted as tmpfs). Or am I being overly paranoid in mounting JFFS2 as read only? The root filesystem is read only because I don't want to wear out the flash.


title: Temporary Permissions when installing DokuWiki?

text: I'm trying to upgrade to the latest version of DokuWiki, and I'm finding that the easiest way to do this is to install the upgrade plugin and just click a few buttons. But there are permissions issues writing some of the files. How can I briefly change the permissions so that the plugin can work its magic without compromising security?


title: Is making /etc directory read only a bad idea?

text: I have an embedded system setup built using buildroot and using initramfs. It runs on compact flash device where I have created separate ext3 partitions to mount `/etc/` and `/var` directories as well as custom directory to store data. I am not entirely certain if this is a good idea or not, but I need access to sytem log output and also need to be able to modify files in `/etc` as they require a static IP address to be configured here. Once the `/etc/network/interfaces` file has been edited to set the IP, I have no further need to manually edit anything in `/etc` so I was wondering if making this mount as read only when the devices are out in the field is a good idea or whether it is possible that other applications on my system need to write to any files in `/etc` ? I run a fairly minimal system, really just dropbear and busybox are running (as well as my custom controller application that controls the devices). I have looked around on various forums and sites and this idea does not seem too controversial, but my knowledge is fairly limited. I realise I could just try mounting it as read only, but it seems possible that things could break silently so is it a bad idea??


title: Show contents of many files

text: From the command line, **what is the easiest way to show the contents of multiple files?** My directory looks like below.               ./WtCgikkCFHmmuXQXp0FkZjVrnJSU64Jb9WSyZ52b     ./xdIwVHnHY7dnuM9zcPDYQGZFdoVORPyMVD2IzjgM     ./GZnATXO1e5Hh3Bz1bhgJjjwheIjjZqtnXR0hfOyj     ./mWz7ehBNoTZmtDh8JG6sxw2lMJFwIovPzxDGECUY     ./JN65F5v3RL2ilHPqNSx9N9D4lvVpqpbJ9lASd8TJ     ./At9PS4y4nTiXUO0Z0USnbYkTPBla1msQRpwuruqE     ./YiPyMZPCaUDZTiTczAvWII9bJrUqLXCFtH2pXEA2     ./JoakdlbRFPwAvWp1d4n8RvMoyMeizCoiriL2Sn2U     ./wFPWZUus8Yu7UtESGABLCoqDg36cT90USO0xuyUr     ./qseI9PgV1EJfZCDyGGeVytajqG7JeX0r7eA5S1JW     ./zgFJpNgXyCsaVh38aCuMGuzHwIbwSNB6rQDdh27x     ./.htaccess      Now I'd like to view the contents of all files except `.htaccess`. It might look something like:               WtCgikkCFHmmuXQXp0FkZjVrnJSU64Jb9WSyZ52b:     Contents of file WtCgikkCFHmmuXQXp0FkZjVrnJSU64Jb9WSyZ52b.          xdIwVHnHY7dnuM9zcPDYQGZFdoVORPyMVD2IzjgM:     Contents of file xdIwVHnHY7dnuM9zcPDYQGZFdoVORPyMVD2IzjgM.          [...]      I think this should be doable with a combination of find, xargs and cat, but I haven't figured out how. Thanks for your time!


title: emacs colors based on $TERM environment variable

text: I want to know if it is possible to make emacs, when running in a gnu screen or tmux session, use the same colors as when `TERM=xterm`. In a gnu screen or tmux session, `TERM=screen` and emacs uses a different set of colors as compared to when `TERM=xterm`. For example, when `TERM=xterm-256color`, the foreground color of `font-lock- comment-face` is 'Firebrick'. But when `TERM=screen-256color`, it is set to 'chocolate1'. For tmux to work properly, the TERM variable **must** be set to screen or some derivative, so resetting TERM is not an option for me.


title: How do I give all the permissions to a file for a single user that's not me?

text: When I want to grant access to another user to my file, I use `chmod 777 file`, but if I want to be sure I'm granting permission just for that user, how can I do it? **-- update** The file is owned by "root", so it's mine if I access it with `sudo`, I suppose (or maybe I'm confused.. please correct me). I want to share a folder called `/Data` in the root. The other user I want to share it is the root of an embedded system, which I'm accessing with telnet and NFS. The files inside `/Data` are generated by me, and every time I generate them, I have to use the command `chmod 777 /Data` so I can access them from the embedded system. I'm using Ubuntu in my computer, and a compiled-here-linux in the embedded system.


title: VBoxManage: Error: Can't be used as the requested device

text: I used the soluton from this thread but always i get               VirtualBox error: The medium 'lvol.vmdk' can't be used as the requested device type (0x80004005)      I've tried all controllers SATA, SCSI, IDE and SAS still not working. Host SO: Ubuntu 12.04.1 amd64 VirtualBox 4.1 lvol.vmdk was create with               vboxmanage internalcommands createrawvmdk -filename /VDK/lvlol.vmdk -rawdisk /dev/vg/lv      the raw disk have:               1 primary ext3 156MB     2 primary swap 2147MB     3 primary ext3 4137MB


title: Vim R plugin installation problem on Ubuntu in Android phone

text: There was another thread on vim-R-plugin but since it was bit old, I started this new thread. Also my situation is kind of different, since I am trying this on a mobile device, Samsung vibrate. I was following instructions in the following site: http://www.lepem.ufc.br/jaa/r-plugin.html#r-plugin-installation I got stuck installing an R package called vimcom. No matter how I tried it always come up with the error : > .onLoad failed in loadNamespace()for 'vimcom', details:....... > ........................ Ubuntu version is Maverick: 10.04 R-version 2.11 Any help would be highly appreciated, got stuck with it all day!


title: Unable to install anything on a linux on HP t610 Thin Client

text: I'm trying to install a Dymo Label Printer on HP t610 Thin Client which has a light read only Linux on it and is connecting to a Citrix environment for users to bring up their virtual desktop. I have installed the printer driver in the Linux but at the end of the installation it gives me error saying that in order to be able to print I need to install a package and when I try to intall that package from a terminal server I get this error:               root@HPc8cbb82fddb9:/writable/usr/lib/dymo-cups-drivers-1.2.0# sudo apt-get install INSTALL     Reading package lists... Done     Building dependency tree... Done     W: Not using locking for read only lock file /var/lib/dpkg/lock     W: You may want to run apt-get update to correct these problems     E: The package hptc-zero-login needs to be reinstalled, but I can't find an archive for it.      Actually I cannot install anything on this linux. Can someone help?


title: Change cursor shape (or color) to indicate vi mode in bash

text: **To clarify:** I am not asking how to change the cursor when using vim within a terminal. I want the cursor to change when switching between input and command mode within Bash's vi-mode:               set -o vi <CR> type some text <ESC> (the cursor changes shape/color)     i (cursor change back) etc...       I found a script that makes changing color of the cursor on mode changes possible in **zsh** , but I don't want to change shells just for this one feature. Is there a way to get the cursor to change shape, like in gvim, (or even just color) when switching between command and insert modes on the Bash command line?


title: Command-line editing vim style

text: I recently discovered terminal's feature, you can set the keys `emacs` or `vi` style I prefer the second. so if you do               set -o vi      You can use `k j l h` keys to navigate on the command line. And you can switch between 'Normal' and 'Insert' modes like in `vim`. However there's no way to visually distinguish one mode from another, even cursor doesn't change. Which makes vi-style pretty much useless. Is there a way to make it truly `vim`-like?


title: Using constants in gnome-shell theme css

text: Is that possible to use kind of _constants_ in `gnome-shell.css` theme file? Something linke               @import url("/usr/share/gnome-shell/theme/gnome-shell.css");          @PANEL_ALPHA:0.5;          #panel {         background-color: rgba(0,0,0,@PANEL_ALPHA);     }          .panel-corner {         -panel-corner-background-color: rgba(0,0,0,@PANEL_ALPHA);     }      I also tried with `@const PANEL_ALPHA:0.5;` but it doesn't work.


title: How to see the output produced by make install in freebsd

text: When in freebsd you install any software using               cd /usr/ports/mysql56-server     make install      It produces a lot of output on the screen. How you can read that output latter in a file. I tried               cd /usr/ports/mysql56-server     make install > /home/mysql.install.log      BUT IT FAILED -( ........... Any Suggestion??


title: Compute average file size

text: I am looking for a handy one-liner for computing the average file size in a directory. What I want is: size of all files / number of files in directory


title: Server freezes because of fail2ban

text: Lately I've experienced some problems with my server freezing or having network problems (I can't really tell which at this point). I'm running OpenSSH on port 443 and it seems fail2ban's anti SSH DDoS filter is the culprit. Because I'm running on a port normally reserved for HTTPS¹ I sometimes get invalid requests:               # /var/log/auth.log     Aug 25 11:46:38 void sshd[13782]: pam_unix(sshd:session): session closed for user tim     Aug 25 11:46:38 void sshd[13782]: syslogin_perform_logout: logout() returned an error     Aug 25 11:46:41 void sshd[15911]: Bad protocol version identification 'CONNECT 194.109.153.5:11111 HTTP/1.0' from 194.109.21.230     Aug 25 11:46:45 void sshd[15915]: Bad protocol version identification 'CONNECT 194.109.153.5:11111 HTTP/1.0' from 194.109.21.230     Aug 25 11:46:53 void sshd[15912]: Did not receive identification string from 194.109.21.230     Aug 25 11:46:53 void sshd[15910]: Did not receive identification string from 194.109.21.230     Aug 25 11:46:57 void sshd[15916]: Did not receive identification string from 194.109.21.230     Aug 25 11:46:57 void sshd[15914]: Did not receive identification string from 194.109.21.230      Which in turn triggers fail2ban:               # /var/log/fail2ban.log     2014-08-25 11:46:58,609 fail2ban.actions: WARNING [ssh-ddos] Ban 194.109.21.230     2014-08-25 11:56:58,852 fail2ban.actions: WARNING [ssh-ddos] Unban 194.109.21.230      This is not something I previously worried about, just a little noise in my logs, but didn't affect my server. The last few days however I've gotten proxyscanned multiple times by `194.109.21.230 (proxyscan.xs4all.net`. The result is disconnecting, possibly the server freezing, which I notice quickly as I'm also using this server as an IRC client. Looking at my Munin graphs it looks like it froze in the same period fail2ban banned a seemingly unimportant IP: ![Munin - memory](http://i.imgur.com/H1EAezT.png) I'm not sure how this could be related, but I also recently experienced a RCU stall² on the same server. Before this date I never experienced the server freezing even if fail2ban triggered. Since then I've fixed `/etc/ntp.conf`, but only after experiencing the freezes.               # /var/log/syslog     ... (multiple 'host name not found' for ntpd)     Aug 20 20:24:22 void ntpd_intres[8124]: host name not found: 1.tid.uio.no     Aug 20 20:40:25 void ntpd_intres[8124]: host name not found: 0.ntp.uio.no     Aug 20 20:40:25 void ntpd_intres[8124]: host name not found: 1.tid.uio.no     Aug 20 20:57:44 void kernel: [18225085.384024] INFO: rcu_sched detected stall on CPU 0 (t=18892 jiffies)     Aug 20 20:57:44 void kernel: [18225085.384024] sending NMI to all CPUs:     Aug 20 20:57:44 void kernel: [18225085.384024] NMI backtrace for cpu 0     Aug 20 20:57:44 void kernel: [18225085.384024] Modules linked in: tun iptable_nat nf_nat iptable_mangle xt_tcpudp nf_conntrack_ipv4 nf_defrag_ipv4 xt_state nf_conntrack xt_mark bridge stp xt_multiport iptable_filter ip_tables x_tables vmwgfx snd_page_alloc parport_pc parport processor thermal_sys snd_timer snd soundcore evdev pcspkr serio_raw ttm drm button i2c_piix4 i2c_core ext4 crc16 jbd2 mbcache sg sr_mod cdrom ata_generic virtio_blk virtio_net floppy ata_piix libata virtio_pci virtio_ring virtio scsi_mod [last unloaded: scsi_wait_scan]     Aug 20 20:57:44 void kernel: [18225085.384024]     Aug 20 20:57:44 void kernel: [18225085.384024] Pid: 8124, comm: ntpd Not tainted 3.2.0-4-686-pae #1 Debian 3.2.41-2+deb7u2 Bochs Bochs     ... (call stack)      As for now I just added an iptables rule blocking the proxyscanning server:               iptables -A INPUT -p tcp --dport 443 -s 128.39.74.65 -j DROP      I would like to force the issue by blocking myself out to see if the same thing happens every time, and if it's fixed after a reboot. Couldn't come up with a command that actually triggers ssh-ddos, failing to authenticate or `wget` doesn't seem to be enough. Any tips? Could the RCU stall( ***** ) be related to fail2ban/freezes, and if so, why? Rebooting would probably help, but I'm curious as to how this could happen and the reason for my server freezing. **Edit:** Freeze not long after the RCU stall:               # /usr/var/log/auth.log.1     Aug 20 21:09:28 void sshd[9115]: Bad protocol version identification 'CONNECT 194.109.153.5:11111 HTTP/1.0' from 194.109.21.230     Aug 20 21:09:40 void sshd[9114]: Did not receive identification string from 194.109.21.230     Aug 20 21:09:40 void sshd[9116]: Did not receive identification string from 194.109.21.230          # /usr/var/log/fail2ban.log.1     2014-08-20 21:10:28,747 fail2ban.actions: WARNING [ssh-ddos] Ban 194.109.21.230     2014-08-20 21:20:29,515 fail2ban.actions: WARNING [ssh-ddos] Unban 194.109.21.230      _¹ I'm running it on 443 because not all networks I frequent allow the use of 22. It also has the added bonus of less incoming SSH attacks._   _² RCU stall (CPU), not kernel panic. See comments._


title: Is this crazy vim register voodoo (incrementing alpha registers) possible within a macro?

text: I have 4 lines.               foo ["bar"]     baz ["k"]     daskhfkjhadsfj ["askfjhfjdsh"]     dfjhafkjhfha ["skkksks"]      I'd like to do a macro that takes the word and yanks it into a register, but I want the register to increment. e.g.:               f"l"ayf"j0     f"l"byf"j0     f"l"cyf"j0     f"l"dyf"j0      Is there a way to get this command done in such a way that the registers autoincrement, so I can later paste them:               jjjj     f"ap        j     f"bp      I'm aware of register numbering and yi" - i'd like to use this with alpha registers instead. I'm also aware that a collision might occur with my chosen register: You can assume that my macro will be recorded in z and I want to use, say, a-f for registers used. Can you suggest a way to get this accomplished using a macro?


title: Automatically starting smuxi-server

text: Smuxi (isn't that a weird name?) is an IRC client, which has a decoupled server and client setup. The server sits in some always-on machine in "the cloud" and the client connects to it from a local machine. This is particularly useful if the client machine does not have good or reliable connectivity. If the client loses the connection, it can reconnect to the server, and not lose any of the ongoing chat. So, that brings me to my question. the Smuxi server documentation is a little sparse, It says > If you want the smuxi-server to automatically start in the background when > your system boots, continue reading the following sections. This is highly > dependent of your operating system as each system provides its own way to > auto start services. There are then some highly instructive blank spaces starting with words like "Debian", "Ubuntu", and "Other Linux". The section then has > To always start the smuxi-server automatically when the Linux server boots, > add this to your /etc/rc.local file: >   >   >     sudo -u your_linux_user bash -c 'nohup smuxi-server > $HOME/smuxi- > server.log &' >   I'm not sure whether I should be taking this advice. I use Debian, and this script has the words > This script is executed at the end of each multiuser runlevel. I'm not sure what that means. Does that mean it executes multiple times? Isn't that a bad thing? Anyway, I'm looking for advice (or possibly scripts) for a way to start the server automatically on boot, and also a way to run it manually and have it background automatically. I could run it inside screen, but that feels a little... hacky. Since I'm using Debian wheezy, I'd like a method that would work with that systems default setup.


title: How can I mount a dm_crypt device during boot, it fails all the time

text: **EDIT: Problem solved, i updated from Debian 6.0.6 to 7.0.0, everything works now!** I have a complex problem at booting. Basically, I have a debian apache box, as a music server in my home network. The root, swap and data hard drives are dm_crypted. The booting should look like this:   1. GRUB   2. Ask root pass phrase   3. Setup swap fs(gets random pw at boot)   4. Booting continues   5. Ask data passphrase   6. Booting finishes   7. Server is accessible via http & SSH Some logs: fstab crypttab update-initramfs /var/log/boot `uname -a` returns the following: > Linux linux-server 2.6.32-5-amd64 #1 SMP Sun Sep 23 10:07:46 UTC 2012 x86_64 > GNU/Linux debian version: `6.0.6` Version of cryptsetup: `2:1.1.3-4squeeze2` What I did:   * I ran `update-initramfs -u -k all -v`   * I can mount the device with `cryptsetup / mount` after boot.  I think the problem is that the external hard drive is not available to the system between step 4 & 5, so `cryptsetup` fails, mount fails, `fschk` fails and the boot process switches into emergency mode. Any help would be appreciated! **EDIT: Problem solved, i updated from Debian 6.0.6 to 7.0.0, everything works now!**


title: Browser fails to reach any host on Solaris 8

text: I'm running Solaris 8 on a Sun Ultra 2 connected to a Verizon router. nslookup seems to work (it finds google.com) but the existing browser (Netscape 4.76 - yes - it's very old) fails to reach any web page "Unable to connect to server (TCP Error. Network is unreachable)". Obviously I'm a novice when it comes to these connectivity issues. Any help will be appreciated.


title: Xterm Ctrl+Arrow shortcut keys

text: I'm using xterm version 293. While navigating in a command, I normally use the short-cut keys as `Ctrl+LeftArrow` or `Ctrl+RightArrow` to move back and forth. But while doing so, rather expected behaviour, `Ctrl+LeftArrow` prints **5D** and `Ctrl+RightArrow` prints **5C** How to make the `xterm` work as per expectation ? **EDIT:** e.g. In xterm, if I type:               shw$ This is a test      If the cursor is after **is** and I press `Ctrl+LeftArrow`, then I'm expecting that cursor should move On **i** of is (and again pressing `Ctrl+LeftArrow`, cursor must go at **T** of This). But instead, I get the result as               shw$ This is5D a test      Same for `Ctrl+RightArrow`


title: Is there ever a reason to use `cat` when you've got `less`?

text: I used to use `cat` to view files. Then I learned that `less` is usually better, and is a must if the file is longer than a few dozen rows. My question: Is there ever a reason to use `cat` instead of `less`? Is there any situation where `cat` is a better solution?


title: Get only files specified in egrep

text: I could to like ask how to get only the files that contains or match with this command               [ "$(egrep -l 'GE.[100|120|140|159].' /home/test_dir/* xargs egrep -l 'EA.[NT|[HD|HS|QR].')" ];      My problem with this is that there were files present in my `test-dir` directories whose contents does not match in the `egrep` command but when I run the script those files were extract or included in the output.


title: How to convince APT that a cross-arch package is installed manually?

text: I have a qemu-armhf chroot environment on an amd64 machine (it's mainly for compiling Raspberry Pi code). As such it can run both armhf and amd64 binaries but it's faster doing the latter. There are certain packages (such as make) where I've installed the amd64 version inside the chroot in order to get better speed. That works well up until I need to apt-get some other armhf package and it happens to have make listed as a dependency, whereupon I get this:               The following packages have unmet dependencies:      build-essential : Depends: make but it is not going to be installed      dpkg-dev : Depends: make but it is not going to be installed     E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).      If I try the suggested command, then it says it wants to install `make:armhf` and uninstall `make:amd64`. I don't want it to do that. How do I tell APT that `make:armhf` is already installed (because I want it to use `make:amd64` to satisfy dependencies) without actually installing it? I've tried using `apt-mark manual make` but it says that it is not installed. * * * I know this probably isn't the right way to do it, but I've been looking at the `/var/lib/dpkg/status` file to try to work out how it thinks the package definitions work and to try to trick it into agreeing that make:amd64 satisfies make:armhf as well. In particular I noticed that "libbz2-1.0" is a package that's listed as installed twice; once as:               Architecture: armhf     Multi-Arch: same     Pre-Depends: multiarch-support      and once as:               Architecture: amd64     Multi-Arch: foreign     Pre-Depends: multiarch-support      So I tried duplicating the entries for "make" similarly, setting all of those values above. But now APT's just saying that "make" and "make:amd64" are conflicted. Why is it a conflict when make does it but not when libbz2-1.0 does it? (I hope it's not special-casing libraries; that seems like it should be a bug.) * * * Per this answer, I tried building a dummy package with `equivs` and installing that (after removing my manual fiddling above), but installing it produces these errors:               # dpkg -i /var/cache/apt/archives/make_3.81-8.2_amd64.deb (real amd64 make)     # dpkg -i make_3.81-8.2_armhf.deb (fake armhf depends on the above)     Preparing to replace make 3.81-8.2 (using make_3.81-8.2_armhf.deb) ...     Unpacking replacement make ...     dpkg: dependency problems prevent configuration of make:      make depends on make:amd64 (= 3.81-8.2).      So again the problem looks like it thinks make:armhf is a _replacement_ for make:amd64, and I don't know how to tell it that I want these two packages to coexist. (It doesn't seem to have a problem with the idea of two libbz2 packages coexisting, for example.)


title: apt-get unable to fetch archives

text: I'm trying to install a package using `apt-get` as root on a Linux Mint host:               # apt-get install gparted     Reading package lists... Done     Building dependency tree            Reading state information... Done     The following extra packages will be installed:       libgtkmm-2.4-1c2a     Suggested packages:       xfsprogs reiserfsprogs reiser4progs jfsutils kpartx dmraid gpart     The following NEW packages will be installed:       gparted libgtkmm-2.4-1c2a     0 upgraded, 2 newly installed, 0 to remove and 343 not upgraded.     Need to get 1,557 kB of archives.     After this operation, 5,870 kB of additional disk space will be used.     Do you want to continue [Y/n]? Y     WARNING: The following packages cannot be authenticated!       libgtkmm-2.4-1c2a gparted     Install these packages without verification [y/N]? Y     Err http://archive.ubuntu.com/ubuntu/ oneiric/main libgtkmm-2.4-1c2a i386 1:2.24.2-1       404  Not Found [IP: 91.189.92.201 80]     Err http://archive.ubuntu.com/ubuntu/ oneiric/main gparted i386 0.8.1-1ubuntu4       404  Not Found [IP: 91.189.92.201 80]     Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/g/gtkmm2.4/libgtkmm-2.4-1c2a_2.24.2-1_i386.deb  404  Not Found [IP: 91.189.92.201 80]     Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/g/gparted/gparted_0.8.1-1ubuntu4_i386.deb  404  Not Found [IP: 91.189.92.201 80]     E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?      As you can see, `apt-get` is unable to fetch files. I've checked my network connection: I'm able to `ping` the host where apt-get fails to fetch the files:               # ping 91.189.92.201     PING 91.189.92.201 (91.189.92.201) 56(84) bytes of data.     64 bytes from 91.189.92.201: icmp_req=1 ttl=128 time=51.4 ms      Tried as well with `apt-get update` and `\--fix-missing` but none worked. Any idea how to solve the issue ?


title: Less command change color of "~" and "(END)"?

text: How do I change the color of the "~" characters that go along the edge of a Less command output. And how to change the color "(END)" at the bottom?


title: Configure wireless network from the command line

text: I know I can use ifconfig to configure my ethernet network interfaces. But can I also configure my wireless network interfaces using ifconfig. (It seems to be listed as eth1 in ifconfig output, why is that ?) Specifically :   1. How do I check from command line if my wireless is enabled    2. How do I enable / disable the wireless using commandline    3. Out of a few available wireless networks how do I chose one and connect to it    4. How do I configure the parameters (like username, password, security settings and certificate information) from the command line   5. Sometimes an available wireless network is not visible for some reason. In such a case, I select "Connect to hidden wireless network" and type the name of the connection. How do I do the same from my terminal    6. I recently installed xmonad, I'd like to know how to start the graphical network manager from command line    7. How do I change my system-wide proxy settings from command line ?  (I am using Ubuntu natty.)


title: Get CPU utilization stats from C program

text: I want to read the CPU utilization stats from a C program, I am interested in the percentage of use of CPU, _steal time_ etc. These stats are shown in the 3rd row from the `top` command. I tried to parse `top` 's output with `awk` (`top -n 1 -b | awk '{print $0}'`), but it seems that `top` gives always the same 'fictional' values before it starts showing correct stats. Is there a way from code, or by parsing some command's output to get the CPU utilization stats? **Edit:** The platform is Linux Thank you.


title: From shell, killing a process if wallclock runtime exceeds some predetermined value

text: I want to start a process from a shell script, allow it to interact with the user (so I cannot just background it, grab the PID, launch `sleep` followed by sanity checks and `kill`), but if it is still running after a set period of time (say, two minutes), then and only then do I want to kill it. The intention is to simply implement a wallclock-run-time timeout for a program that doesn't have that capability built in. Is there a way to do this, preferably from a bash shell script?


title: X server problem on slackware 14 and poulsbo module (gma500)

text: I have installed slackware 14 on my acer aspire one za3. I cannot start the X server. Here the output of command `startx`               xauth:  file /home/emanuele/.serverauth.1984 does not exist     X.Org X Server 1.12.3     Release Date: 2012-07-09     X Protocol Version 11, Revision 0     Build Operating System: Slackware 14.0 Slackware Linux Project     Current Operating System: Linux darkstar 3.2.29-smp #2 SMP Mon Sep 17 13:16:43 CDT 2012 i686     Kernel command line: BOOT_IMAGE=Linux ro root=803 vt.default_utf8=0     Build Date: 23 August 2012  02:27:55PM          Current version of pixman: 0.26.2     Before reporting problems, check http://wiki.x.org     to make sure that you have the latest version.     Markers: (--) probed, (**) from config file, (==) default setting,     (++) from command line, (!!) notice, (II) informational,     (WW) warning, (EE) error, (NI) not implemented, (??) unknown.     (==) Log file: "/var/log/Xorg.0.log", Time: Wed Oct  3 18:46:58 2012     (==) Using system config directory "/usr/share/X11/xorg.conf.d"     vesa: Ignoring device with a bound kernel driver          Fatal server error:     no screens found          Please consult the The X.Org Foundation support       at http://wiki.x.org     for help.      Please also check the log file at "/var/log/Xorg.0.log" for additional information.          Server terminated with error (1). Closing log file.     xinit: giving up     xinit: unable to connect to X server: Connection refused     xinit: server error      Seem to me that the psb module is loaded. Here the output of `lsmod|grep psb`               psb_gfx               180538  0      drm_kms_helper         22825  1 psb_gfx     drm                   151850  2 drm_kms_helper,psb_gfx     i2c_algo_bit            4543  1 psb_gfx     i2c_core               16454  6 i2c_algo_bit,i2c_isch,drm,drm_kms_helper,videodev,psb_gfx     video                   9938  2 poulsbo,psb_gfx      And this is the output `lspci` of my vga card               00:02.0 VGA compatible controller [0300]: Intel Corporation System Controller Hub (SCH Poulsbo) Graphics Controller [8086:8108] (rev 07) (prog-if 00 [VGA controller])     Subsystem: Acer Incorporated [ALI] Device [1025:0244]     Flags: bus master, fast devsel, latency 0, IRQ 7     Memory at b0080000 (32-bit, non-prefetchable) [size=512K]     I/O ports at 1800 [size=8]     Memory at c0000000 (32-bit, non-prefetchable) [size=256M]     Memory at b0000000 (32-bit, non-prefetchable) [size=256K]     Expansion ROM at <unassigned> [disabled]     Capabilities: [d0] Power Management version 2      I don't understand why it does not work. Where is the problem? **Edit:** after a `rmmod poulsbo psb_gfx`, X start (with vesa driver i suppose). May be a bug?


title: How to know which compiler is used to compile Python programs?

text: How can I know which compiler is used when I type `python myapp.py` in terminal?


title: Find all users who have more than N processes and echo them in shell

text: I'm writing a script in ksh. I need to find all users who have more than N processes and echo them in the shell. N is read from ksh. I know that I should use `ps -elf`, but how do I parse it, find users with >N processes, and create an array with them? I'm having a little trouble with arrays in ksh. Maybe a simple solution can help me instead of having to to create an array. One person recommended that I use               ps -elf | awk '{a[$3]++;}END{for(i in a)if (a[i]>N)print i, a[i];}' N=3      but it doesn't work correctly.


title: What is the Linux equivalent to C:\Program Files?

text: I understand that in Windows as well as Linux and Unix, a program|application|software can be installed in any directory. Also if packages are installed using the distribution's packaging system, it'll place files in the correct location. But at times, a software installation prompts for a path to place files. In case of a Linux distro where is this default place (`C:\Program Files` or `C:\progra~1` equivalent)? Is it different for various distributions? If yes, where would this be for `RHEL`, `Suse` and `Ubuntu`?


title: USB device messages flooding dmesg (and console)

text: When USB mouse is plugged into my laptop, dmesg is flooded with following messages:               usb 3-1: USB disconnect, device number 28     usb 3-1: new low-speed USB device number 29 using xhci_hcd     usb 3-1: New USB device found, idVendor=045e, idProduct=00cb     usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0     usb 3-1: Product: Microsoft USB Optical Mouse     usb 3-1: Manufacturer: PixArt     usb 3-1: ep 0x81 - rounding interval to 64 microframes, ep desc says 80 microframes     input: PixArt Microsoft USB Optical Mouse as /devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1:1.0/input/input39     hid-generic 0003:045E:00CB.001C: input: USB HID v1.11 Mouse [PixArt Microsoft USB Optical Mouse] on usb-0000:00:14.0-1/input0     usb 3-1: USB disconnect, device number 29     usb 3-1: new low-speed USB device number 30 using xhci_hcd     usb 3-1: New USB device found, idVendor=045e, idProduct=00cb     usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0     usb 3-1: Product: Microsoft USB Optical Mouse     usb 3-1: Manufacturer: PixArt     usb 3-1: ep 0x81 - rounding interval to 64 microframes, ep desc says 80 microframes     input: PixArt Microsoft USB Optical Mouse as /devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1:1.0/input/input40     hid-generic 0003:045E:00CB.001D: input: USB HID v1.11 Mouse [PixArt Microsoft USB Optical Mouse] on usb-0000:00:14.0-1/input0      It looks as if the mouse was constantly being removed and then re-discovered. When I am logged in console (i.e `CTRL+ALT+F1`) these messages flood my console as well. Is there a way to fix this problem, so that these messages don't bother me?


title: Create directories from a list of files with spaces in name

text: I have a directory with a list of files in it. All these files have spaces in their names. I would like to create a directory, for each file, with the name of the file except the extension (which is .doc for all of them). E.g.: **My directory content**               first file.doc      second file.doc      third file.doc      **Expected result**               first file/first file.doc      second file/second file.doc     third file/third file.doc      I have this command to know the directory name I have to create:               find . -maxdepth 1 -name "*.doc" | awk -F ".doc" '{print $1}'      With this, the result is:               first file     second file     third file      I know need to create a directory per entry. I've tried the following with no success:               find . -maxdepth 1 -name "*.doc" | awk -F ".doc" '{print $1}' -exec mkdir '{}' \;     #error with awk: it cannot open the file -exec because it does not exist          mkdir `find . -maxdepth 1 -name "*.doc" | awk -F ".doc" '{print $1}'`     #it creates several directories per name because there are spaces in the names          mkdir `"find . -maxdepth 1 -name "*.doc" | awk -F ".doc" '{print $1}'"`     #-bash: find . -maxdepth 1 -name *.doc | awk -F .doc '{print }': command not found          mkdir "`find . -maxdepth 1 -name "*.doc" | awk -F ".doc" '{print $1}'`"     #it tries to create a unique directory with all the file names as a single name, which is not good of course      If I could, I would just remove all the spaces in the file names, but I need to keep them for project constraints :/ Once I can create these directories, I will have to figure out how to move all the files in their matching directories. It all can be done in a single command, I'll take it :) I'm using bash and RedHat 2.6. Thanks for your help. Laurent


title: How to disable line wrap in a terminal?

text: I need to view large logs files using a bash shell. I was using `less` to open the files, but since the lines are too lengthy there is some kind of line/word wrapping going on. Since the files are Log4J logs, and there is a pattern in the beginning of each line, having lines wrapped makes it difficult to analyze the output, so I started using `less -S` which chops long lines. But now I need to use `tail -f`, and it also line wraps the output. Is it possible to disable line wrap in a bash shell for all the commands? **Note:** there is an answer to a different question that mentions the escape sequence `echo -ne '\e[?7l'`, but it seems to not work on bash.


title: Dynamically change /etc/hosts

text: Each time I change my IP address I have to go edit `/etc/hosts` and change the line:               myPc-Vaio  192.168.1.x      I need this change for some programs I am using, so I can't just set the line to `127.0.0.1`. Is there some automation to change that line on each network change? edit. I am on kubuntu 13.10 and I am using dhcp servers with ubuntu's default dhclient to obtain new ip addresses (default configuration).


title: Testing a string containing only spaces (tabs, or " ")?

text: My code below doesn't work:               stringZ="    "          if [[ "$stringZ" == ^[[:blank:]][[:blank:]]*$ ]];then       echo  string is  blank     else       echo string is not blank     fi       Result:               string is not blank   # wrong      How can I test this?


title: Change status bar applications' default icon

text: in fvwm, you can change the default icon of any window using `Style <regex> Icon <icon_name.xpm>`. In other words, I want to over ride the default icon set for an application without having to hack at system files. How can I achieve the same effect in awesome? In particular, how can I make sure that the application icon in the status bar is the one I set and not the default?


title: Create a recursive diff directory. Copy reference and diff. Recreate original directory

text: I have several directories/web site resources, each has total size of several gigabytes. They are more than 90% the same. Sometimes only a few files are modified.   I need to download these files for backup purposes periodically. Storage space is no concern, but it is taking too long to download. I would like to:   Use one such directory as reference (d1).   1. For another directory(d2), list all files that are identical between d1 and d2, save it into common.txt. Identical means relative path(within d1 and d2), filename and contents are the same, ignoring the owner/group and timestamps.   2. Copy all files, that are in d2 but not in d1 (includes different files) into d3.  Then I will download tarballed d1, d3 and common.txt to another machine. Copy d3 to d2.   3. Copy files listed in common.txt from d1 to d2.  Could you please suggest how to resolve steps (1), (2), (3)?


title: cat /dev/null > file.log does not truncate large file in Darwin

text: In the past, on linux systems, I've been able to truncate large, open log files (that is, a file that is being actively written to by a process) using `cat /dev/null > file.log`. However, on 10.9 (Mavericks), that doesn't seem to be the case. I've got an 11GB file that is being logged to by an application, but when I perform the same command with said file, nothing seems to happen. When I try this on a file of trivial size, it does work. Here is `ls -l /dev/null`: `crw-rw-rw- 1 root wheel 3, 2 Dec 16 12:49 /dev/null` I've also tried `cp /dev/null file.log` to no avail. Thinking that I might take advantage of the truncate function (`man 2 truncate` in Darwin) I compiled this and ran it against two files, one of trivial size and the other the actual log file. Again, it worked against the trivial file and did not work on the much larger log.               /*      * Copyright (c) 2013 Thomas de Grivel <thomas@lowh.net>      *      * Permission to use, copy, modify, and distribute this software for any      * purpose with or without fee is hereby granted, provided that the above      ...      * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.      */          #include <unistd.h>          int main (int argc, const char **argv)     {             int e = 0;             while (--argc) {                     argv++;                     if (truncate(*argv, 0)) {                             e = 4;                             warn("%s", *argv);                     }             }             return e;     }      The process returns `0` regardless of which file I use.


title: libbfd-2.22.so missing while compiling Binutils/Glibc/Zlib

text: When I try to compile Binutils, Glibc and Zlib using chroot on my LFS system, I get this error: > ar: error while loading shared libraries: libbfd-2.22.so: cannot open shared > object file: No such file or directory I compiled Binutils before without using chroot, the files libbfd.a, libbfd.so, libbfd-2.22.so and libbfd.la exist both in /tools/lib/ and /usr/lib/ I don't know where the compiler is searching for it. How to continue compilation?


title: dd command for windows filesystem

text: `dd` is a handy tool for backing up a whole drive or filesystem in some situations. Now I am thinking about what if I use the tool for backing up Windows file-systems / drives (Windows 2003/2008) which is mounted as second hard disk within Linux?


title: How to copy large files over the network

text: I need to copy large files over the network, but I am not sure about the command line to use for it. I have been using rsync, but I feel maybe I could zip the files first? I am a Unix beginner, so lots to learn!


title: xorg.conf 2 cards 3 monitors - why is one monitor stretched?

text: I have 2 nvidia cards with three monitors Left (0), Middle (1), and Right (2). I have to use xinerama to make them all one desktop because xrandr only joins 0 and 1, leaving 2 as a separate desktop. My understanding is that xrandr can ONLY join two desktops, which is why I am using xinerama. After MUCH trouble, I have three displays, all one desktop. But, there is a problem. Screens 0 and 2 work fine. Screen 1 is double-wide. It scrolls left- right as I mouse across it. The left half of the display is a mirror of screen 0. The right half of the display is what should be on screen 1. I've tried to make an image that shows what it is like: ![The middle monitor shows screen 0 and screen 1](http://i.stack.imgur.com/v09or.png) I don't understand what can cause one and only one screen to mirror another screen. Further, how does it mirror one screen on half the display, but not the other half? For reference, my xorg.conf is reduced to the bare minimum. My layout section only has Screen0 0 0, Screen1 Right of Screen0, Screen2 Right of Screen1, and xinerama on. My device sections only have the PCI address of the cards. My screen sections only have the device setting. So, there isn't a setting that would cause this, but I figure I'm missing a setting that stops it - if I just knew what that setting was.


title: How can I delete data from in a hexdump file from one offset to another?

text: I've created a disk image which was zeroed, formatted to ext4 file system, and then had several various files copied to it. I'm trying to extract these files using a combination of xxd and dd, but with certain files I find their size has increased and cannot be properly interpreted by their default viewer/player. The reason behind this is because the file system is inserting several almost identical chunks of what I guess is some form of metadata periodically on the image. The data starts off as, or pretty similar to the hex code below, followed by what seems to be a random assortment of characters. Each of these chunks is exactly 8MBs (8388608 bytes) in length and appears 8 times on this 300MB image.               Offset      0  1  2  3  4  5  6  7   8  9 10 11 12 13 14 15          00000000   70 2C 01 00 00 B0 04 00  00 0C 00 00 D9 C3 00 00   p,   °      ÙÃ       00000016   59 2C 01 00 01 00 00 00  00 00 00 00 00 00 00 00   Y,                   00000032   00 20 00 00 00 20 00 00  E8 07 00 00 19 0F 3E 51           è     >Q     00000048   5D 0F 3E 51 01 00 FF FF  53 EF 01 00 01 00 00 00   ] >Q  ÿÿSï           00000064   FD 0E 3E 51 00 00 00 00  00 00 00 00 01 00 00 00   ý >Q                 00000080   00 00 00 00 0B 00 00 00  80 00 00 00 3C 00 00 00           €   <        00000096   42 02 00 00 79 00 00 00  26 09 09 F0 95 77 41 E7   B   y   &  ð•wAç     00000112   81 0F 90 77 76 86 93 C1  00 00 00 00 00 00 00 00      wv†“Á         Is there a command or tool available to allow me to simply ignore these chunks of metadata or allow me to remove them from the file? I've already attempted to extract the non metadata chunks of information out and cat them back together but this seems to waste time as well as causing some of the files to carved incorrectly even if they were carvable beforehand. The code for that looks like this;               inputFile="zeroedImage.ext4     signature="70 2c 01 00 00 b0 04 00"     counter=0     occurance=`xxd -g 1 $inputFile | grep -c "$signature"`     startPosition[0]=0          while [[ $counter < $occurance ]]     do         signatureLocation=`xxd -g 1 -s +${startPosition[$counter]} $inputFile | grep -m 1 "$signature"`         signatureLocationShort=${signatureLocation%$signature*}         signatureByteSpaces=`echo $signatureLocationShort | awk -F " " "{print NF}"`         signatureHexOffset=`echo $signatureLocationShort | cut -f 1 -d ":" | tr [:lower:] [:upper:]`         signatureDecOffset=`echo "ibase=16;$signatureHexOffset" | bc`                   endPosition[$counter]=$(($signatureDecOffset-1))              if [[ ${startPosition[$counter]} -gt ${endPosition[$counter]} ]]         then             echo "No space between chunks"         else             difference=$((${endPosition[$counter]}-${startPosition[$counter]}+1))             xxd -g 1 -s +${startPosition[$counter]} -l $difference $inputFile > $counter.temp             cat *.temp > all.temp              fi              counter=$(($counter+1))         startPosition[$counter]=`expr $((${endPosition[$((counter-1))]}+8388609))`     done          xxd -r all.temp > adjustedImage.zeroed     rm *.temp     exit 0      Thank you.


title: PATH work with relative directories

text: I'm trying to get a program to work that isn't in my distro's package manager. It doesn't provide a makefile or sources, just binaries. If I copy the whole folder to /usr/local and then add that to my PATH in .bashrc, I can execute the program but there are problems. The program requires some local files from its directory, and they are stored as a relative path. The program looks for the files in the directory I'm currently in, not the directory that the program itself is in. Is there any way around this? Thanks.


title: Kernel Panic after Fedora 19 Update

text: After installing updates on Fedora 19 (kernel 10.3.7-200.fc19.x86_64) the DE freezes whenever I log in. Using the virtual consoles doesn't work. One time I even got this kernel panic: http://i.stack.imgur.com/h5q5n.jpg I have other kernels to try (10.3.5 and 10.3.3) and on them I don't get the freezes or the kernelpanics. Can you help me?


title: Finding the offset for ext4 partition

text: I've created an image of my hd with dd, but grub was installed on it, and I'm trying to figure out how to mount the image file, but mount doesn't recognise it as an ext4 partition because of the grub header. I know it's there because when I run file -k disk.img, I get the following:               disk.img: x86 boot sector; GRand Unified Bootloader, stage1 version 0x3, 1st sector stage2 0x3a883d7, code offset 0x48\012- Linux rev 1.0 ext4 filesystem data, UUID=6d1e45d1-8fac-4995-839b-fa5691a898ad (needs journal recovery) (errors) (extents) (large files) DOS executable (COM), boot code      Anyone have any thoughts as to how I could find the beginning of the partition so that I can tell mount (well, losetup really) where the offset is to load the partition?


title: How to zoom into a Java app under KDE4?

text: I have 200 dpi monitor and this Java is just inscrutinable app small. The desktop zoom effect is cool -- but it doesn't seem permanent? I would like to, basically, change every pixel into 2x2 pixels or 3x3 even.


title: Where to install local software that runs before /usr is available?

text: I'm writing a local program to be called by a udev `IMPORT{program}` rule. Normally, I'd install local software in `/usr/local`, but these udev rules are run when block devices appear. So they're running long before `/usr` is necessarily mounted. I believe I'll also have to configure this to be copied to initramfs (which is easily done with `/etc/initramfs-tools/hooks/`). Normally, it seems, things use the same path on initramfs as on the root filesystem. (edit: it appears I don't actually have to add it to initramfs, the events are re-triggered after rootfs is mounted) `/etc` is version controlled, so binaries there are best avoided. I'm thinking my best bet may just be to install this in `/lib/udev`, under a file name starting with `local-` to avoid clashing with any future files from the distro. The also makes the udev rules file prettier (since it won't need to specify full path). This machine is running Debian Squeeze. Is there some standard location for this file? I don't believe FHS or Debian Policy specifies one.


title: Cannot use highest resolution, xrandr does not list mode (Intel GPU, DP to DVI adapter)

text: I have a screen capable of 2560x1440. It is connected to my Intel NUC with a DP to DVI adapter. My graphics card Since updated my Arch Linux system last week (not sure what was updated exactly) I can no longer use the highest resolution. I'm pretty sure I could only use 1080 before then and the screen complained that I used the wrong cable so something was still weird back then but I didn't think about it much. Now I can only use 1680x1050 which is unreadable on my screen and disrupts my work. Here is my lspci, xrandr and xorg log: http://pastebin.com/5aSwQrk1 I find it strange that xrandr lists 2 HDMI ports, I'm not using HDMI at all and have even tried to disable it in BIOS. For some reason "DP1" is also listed as disconnected. DP1 seem to have some relation with HDMI2 as both are listed as "Clones" of each other, I have no idea what that means though. As you can see from the xorg log it even detects the correct modes:               [   184.333] (II) intel(0): Printing DDC gathered Modelines:     [   184.333] (II) intel(0): Modeline "2560x1440"x0.0  241.50  2560 2608 2640 2720  1440 1443 1448 1481 +hsync -vsync (88.8 kHz eP)      I've tried adding that modeline manually to HDMI2, but it failed:               $ xrandr --newmode 2560x1440  241.50  2560 2608 2640 2720  1440 1443 1448 1481 +hsync -vsync     $ xrandr --addmode HDMI2 2560x1440     $ xrandr --output HDMI2 --mode 2560x1440 --verbose     screen 0: 2560x1440 675x379 mm  96.28dpi     crtc 0:    2560x1440  59.95 +0+0 "HDMI2"     xrandr: Configure crtc 0 failed     crtc 0: disable     crtc 1: disable     crtc 2: disable     crtc 3: disable     screen 0: revert     crtc 0: revert     crtc 1: revert     crtc 2: revert     crtc 3: revert      Now I'm completely stuck and need someone with more xrandr and X11 esoteric knowledge to help me. Thank you for your time. EDIT: I just tested all variations of the 2560x1440 mode with different MHz settings through xrandr. Above ~165 MHz I get "xrandr: Configure crtc 0 failed" and "(EE) intel(0): failed to set mode: Invalid argument" in the xorg log. Below ~165 MHz switching to the mode works but my screen will go blank and complain "OUT OF RANGE". It's also worth mentioning that 1920x1080 doesn't work either as xrandr returns "configure crtc 0 failed" for it as well, probably because it's above 165 MHz. Driver issue? I'm going to buy a mDP to DP cable tomorrow and try what happens when I don't use DVI.


title: Rhythmbox error while saving song information: Could not multiplex stream

text: I play a lot of `.ra` or `.rm` files in Rhythmbox. It plays fine but when I try to edit with the property box it says: > Error while saving song information   >  Could not multiplex stream. But it works fine with other file types. My system is Mint 12 (32bit) with Cinnamon desk top, and 2.90.1 Rhythmbox 2.90.1


title: Failed to execute shell script from "network" udev rule to change the MAC-address

text: I am trying to execute a shell script from udev rule, when a network interface is added, as follows:               SUBSYSTEM=="net", ACTION=="add", KERNEL=="eth*", PROGRAM="/usr/local/bin/changemac.sh", NAME="eth0"      The shell script is just changing the MAC address of eth1 using ifconfig command, as follows:               #!/bin/sh     /sbin/ifconfig eth0 hw ether 00:cc:dd:ee:ff:e1     echo "command return status $?" > /root/changemac.log      Above script is working fine from command prompt, but not executing from udev rule. I also try to use RUN instead of PROGRAM in udev rule but no success:               SUBSYSTEM=="net", ACTION=="add", KERNEL=="eth*", RUN="/usr/local/bin/changemac.sh", NAME="eth0"      Same script is executing from my custom module udev rule. I think somebody must know this why it is not executing from network udev rule. :-)


title: BLT2.z installation

text: I'm trying to install BLT2.4z, with Tcl/tk8.4. When I run command `make` I see this:               (cd src; make all) gcc -c -Wall -O6   -I. -I.  -I/Users/scarter/tk8.4.20/unix/include -I/Users/scarter/tcl8.4.20/unix/include bltAlloc.c     error: invalid value '6' in '-O6' make[1]: *** [bltAlloc.o] Error 1      What's going on here?


title: logname not working under X session

text: I would like to find out the name of the user at the end of a sudo-chain. The exact tool for this is `logname` or also `who am i` works as well. My problem is that while over SSH or tty1 (`Ctrl`+`Alt`+`F1`) logname works as it should, when I call it from a X session (lxterminal under LXDE), it says: `logname: no login name` Also, what I believe is connected to this issue, `who -a` doesn't list the user who is logged in for the X session. Can you tell me why is logname/who broken in X session and how can I fix it?


title: Redirect Packets from ppp0 interface to ethernet interface in linux

text: My question is similar to this question, however with some change. I have a PPPoE connection on my Linux Machine (CentOS kernal 2.6.32) as a client, so that when I setup this connection, another virtual tunnel interface comes up, i.e., ppp0 This connection is setup over existing the physical interface eth0. Now what I want is to create another virtual interface (Ethernet type not ppp type) and somehow map it (bridge) to this ppp0 interface, so that if I route the traffic to this virtual interface, it is in turn routed to this ppp0 interface and vice versa. EDIT: Have a look at this scenario:   ![enter image description here](http://i.stack.imgur.com/UjyNV.png)   Now originally what is happenening is that traffic from eth0 (LAN) should be able to exit depending upon routing to ppp0 or eth1 interface. However due to some limitation what i want is having a virtual tap interface and then reroute traffic from this itnerface to ppp0, so that the routing rule will select either eth1 or tap0, while tap0 will inturn use ppp0 interface:   ![enter image description here](http://i.stack.imgur.com/kIyHM.png)   Can you please tell me how I can do this, thanks.


title: What is the difference between the whatis and apropos commands?

text: CentOS 6.3 / RHEL 6.3 Can someone please explain the difference between the `whatis` command and the `apropos` command? I noticed that both appear to be installed by default and I'm not sure what the difference is between them.


title: How to view output for ALL processes simultaneously?

text: I know that you can connect to various background processes to watch their console output, but is there a way to view the output of all processes at once? Likely it would scroll quickly and be hard to read, but is it possible?


title: IPTables "iptables table `filter': Table does not exist (do you need to insmod?)"

text: I'm trying to get iptables working for my embedded Debian system, kernel version 2.6.35.3-571-gcca29a0. I've tried to enable iptables support in the kernel by selecting these options (this is a diff between the new config and the deault config for the board), see pastebin.com/ipxycuGR After booting the board I try to run "iptables -L -n" I get this:               root@ts7600-47aad3:~# iptables -L -n     FATAL: Module ip_tables not found.     iptables v1.4.14: can't initialize iptables table `filter': Table does not exist (do you need to insmod?)     Perhaps iptables or your kernel needs to be upgraded.      My list of modules installed is this:               Module                  Size  Used by     x_tables               11384  0     ppp_deflate             3528  0     ppp_async               6686  1     crc_ccitt               1045  1 ppp_async     ppp_generic            18035  6 ppp_async,ppp_deflate     slhc                    4425  1 ppp_generic     binfmt_misc             6401  1     arcotg_udc             15990  0     ehci_hcd               36559  0     fsl_otg_arc            14084  0     usbcore               117957  2 fsl_otg_arc,ehci_hcd      How do I get iptables working?


title: Upon login, session crashes and returns me to greeter

text: I'm running Elementary Luna Beta 1 and I'm running into some pretty difficult problems. Whenever I try logging in with the greeter (either pantheon-greeter or even lightdm-gtk-greeter), it immediately returns me to the login screen after the screen goes black. I'm not seeing anything significant in `~/.xsession-errors` or in `/var/log/Xorg.0.log`. Where else should I look for potential problems? How can I debug what's going wrong with my session? If I log into a guest session, everything works fine, but I can't log into my own account.


title: wheezy: nis/autofs doesn't work

text: I have a few computers with debian lenny on them. One of them has a nis server: `193.167.1.75` I can automount my home directory when I log in:               >ssh 193.167.1.80 -l myuser     >pwd      /home/nis/myuser      Now, I just installed a debian wheezy on one of them and I can no longer automount home directories (but I still can log in using myuser)               >ssh 193.167.1.80 -l myuser      Could not chdir to home directory /home/nis/myuser: No such file or directory     >pwd      /      What I have done until now:               apt-get install nis nfs-common portmap autofs     echo "+::::::" >>/etc/passwd     echo "+::::::::" >>/etc/shadow     echo "+:::" >>/etc/group     echo "mynisserver" > /etc/defaultdomain     echo "ypserver ##.##.##.75" > /etc/yp.conf     nisdomainname mynisserver     /etc/init.d/nis restart     echo "+auto.master" > /etc/auto.master     rm /etc/auto.home     /etc/init.d/autofs restart      Any Idea why home directories are still not mounted? **EDIT 1:** **Client side (193.167.1.80)**               grep -i automount /var/log/messages     grep -i automount /var/log/syslog      returns nothing (and no new line when logging in)               /etc/init.d/autofs status     [ ok ] automount is running.      nsswitch:               cat /etc/nsswitch.conf           passwd:         compat nis     group:          compat nis     shadow:         compat nis          hosts:          files dns nis     networks:       files          protocols:      db files     services:       db files     ethers:         db files     rpc:            db files          netgroup:       nis      Not sure it has anything to do with it, but just in case:               showmount -a     clnt_create: RPC: Port mapper failure - Unable to receive: errno 111 (Connection refused)      **Server side** (193.167.1.75):               cat /etc/exports     /home/nis 193.167.1.0/24(sync,rw,no_root_squash,no_subtree_check)      **EDIT2:** I tried to manually mount nfs on 193.167.1.80 with root. It worked. Now I need to figure out why autofs don't do it automatically:               mount -t nfs -o rw 193.167.1.75:/home/nis /home/nis