title: Problem in secure copying (scp) filenames with spaces

text: I am trying to copy files using secure copy(scp). I am trying to execute the following command but I get error due to the space in the absolute path of the location of the directory.               scp -r -P 8484 root@172.31.72.103:/media/New Volume/lj /home/pratheep      I am getting the following error:               scp: /media/New: No such file or directory       scp: Volume/lj: No such file or directory      I tried using the same command putting extra back slash like               scp -r -P 8484 root@172.31.72.103:/media/New\ Volume/lj /home/pratheep      but I am still getting the same error. Can somebody tell me how to correct it?


title: "ss" command in iproute package; why query slab table for timewait sockets?

text: Forgive me if this isn't the best forum for this question, but it seems more relevant to the kernel than to the programming itself. I'm writing a script that queries the system for open ports so that we can graph and monitor the statistics. For this, I'm using the "ss" command from the iproute package. If you execute `ss -s|grep estab` you will receive output similar to this:               TCP:   296 (estab 6, closed 238, orphaned 0, synrecv 0, timewait 238/0), ports 0      My question has to do with the timewait variable, which shows the computed sockets in TIME_WAIT state. When I tried to figure out what number was referenced after the slash, it became a whirlwind adventure of searching for source code which ultimately led me to find the following snippet:               printf("TCP:   %d (estab %d, closed %d, orphaned %d, synrecv %d, timewait %d/%d), ports %d\n",            s.tcp_total + slabstat.tcp_syns + s.tcp_tws,            sn.tcp_estab,            s.tcp_total - (s.tcp4_hashed+s.tcp6_hashed-s.tcp_tws),            s.tcp_orphans,            slabstat.tcp_syns,            s.tcp_tws, slabstat.tcp_tws,            slabstat.tcp_ports            );      I must admit, my searching for what "slabstat" was supposed to mean ultimately led to my learning about the slab caches and their reporting interface at /proc/slabinfo. The question: What does the slabtable have to do with TIME_WAIT socket calculations? I'm failing to figure out why this number is reported, as every time I've run the command across every server I've tried it on, the number has always been zero.


title: Where does the -i option in sed store the lines matching a regex?

text: I am trying to release space in my server's hd so I'm matching old dates in a log file with sed and it is decreasing but my root partition is now using 98% percent of it's space instead of 91% it was using before I invoke sed. I did this `sed -i '/^Jan/ d' file.log` and my log file decrease from 6G to 400M. I'm using `find / -size +1G` trying to search a temporal file or something like that but it's not matching new files. **Edit:** I did `echo -n > file.log` to avoid a service crash but it's temporal because the issue remains


title: sort output by column

text: I'd like to take this command `find -maxdepth 1 -type d | while read -r dir; do printf "%s:\t" "$dir"; find "$dir" | wc -l; done` ( from here ). which has an output of basically               ./kennel:       11062     ./shadow:       15449     ./ccc:  9765     ./journeyo:     14200     ./norths:       10710      and sort it by the numbers largest to smallest. but I'm not sure how to make `sort`, or whatever operate on a different column.


title: What is /usr/local/bin? Came across it in an script installation for Applescript but would like to know more

text: Before today, I've used Terminal to a limited extent of moving in and out of directories, changing the dates of files using the `touch` command, but had realised the full extent of Terminal after installing a fun script in Mac and having to `chmod 755` the file to make it executable afterwards. I'd like to know what is /usr/local/bin though. /usr/, I assume is the user of the computer. I'm not sure why /local/ is there though. It obviously stands for the local computer, but since it's on the computer (Or a server), would it really be necessary? Wouldn't /usr/bin be fine? And what is /bin? Why is this area usually used for installing scripts into Terminal?


title: Connect psftp between Unix and Windows server

text: I need to transfer files from Unix to Windows server. After creating a folder in the windows server files need to be copied from Unix to Windows. I am using `psftp` to do this process.So, I am trying to automate this process using shell script but I do not know how to connect Unix and Windows by using `psftp` in the shell script. Please some one guide me on this.


title: Get X to ignore specific mouse?

text: I have a program which needs control of a mouse. I have a specific mouse attached for this, and I would like X to leave it alone. Unfortunately whatever mechanism in X autodetects and configures input devices, it is overriding any settings I make in Xorg.conf. I know this because:   * I have disabled "AutoEnableDevices" in Xorg.conf, and this stops it from interfering with my mouse. Unfortunately this is not a solution as it also stops it from correctly configuring my other mouse and keyboard, as a result buttons on both devices do not work correctly. (I know this is because my manual configuration of these devices in Xorg.conf is wrong, but I don't know how to fix it and can't find any helpful documentation.)   * The second mouse has its own entry in Xorg.conf, along with /input/mice, and both have the driver set to void. Also, when I made a mistake configuring the first mouse it still worked when AutoEnableDevices was set. **How do I stop X using the second mouse?** (I have tried disabling the device using xinput, but it always ends up re- enabled after a minute or so. This may be because I am changing permissions so my program can access it without su privileges, but again I need to do that and would prefer a more stable solution than not touching it in the hope that udev forgets its there...)


title: Command not working in shell script, but works on command line

text: I have a shell script that executes the following command:               bash -c "screen -dmS node /home/nodejs/bridge/bridge.js"      However, the screen is not being started. Typing the command...               screen -dmS node /home/nodejs/bridge/bridge.js      ...in a terminal(logged as the same user that launches the script) the screen starts up properly.


title: Playing mkv files

text: I'm having trouble playing mkv files in Kaffeine, or any other player on openSUSE, which generally doesn't come with this type of codec. I've already installed a mkv codec that I found in the openSUSE repository. Still, the player can't play this format. I tried installing VLC with a built-in codec for mkv, but ended up with lots of problems and decided to back out. What solution could I use to solve this problem?


title: Why was '~' chosen to represent the home directory?

text: I have often wondered why the `~` represents the home directory of a user. Is there a reason behind this, or is it just some infrequently used character?


title: How is /proc/self implemented in Linux?

text: I was tinkering around with the `/proc` filesystem in Linux, and I came across `/proc/self`, which is a symbolic link to the process directory of the current process. I would like to know how it is implemented. One solution would be to change that symlink on _every context switch_ , but that's obviously very expensive as it involves a disk access.


title: How to Create a Unix Executable File

text: Is it possible to create what the Mac Finder specifies as a "Unix Executable File" and run it in Terminal like any other command instead of creating a `.sh` or `.command` file? If so how and where can I learn how to make them? If not, how can I create a `.sh` file that can take options? For example, with the `ls` command you can type `ls -a` to list invisible files as well as visible ones. How can make an executable that will only execute certain code with a `-a` option?


title: Cancel SSH (after using it to browse) without logging out?

text: I'm afraid I'm not an expert on Unix and its command line (I'm using a Mac), so do bear with me (possibly an extremely stupid or basic question). I've used the command `ssh -D 8080 -f -C -q -N user@IP` to SSH into a VPS and set it to browse in the SOCKS proxy settings in System Preferences (on my Mac). How do I cancel the SSH session (and browse normally) without having to log out? Edit: I know `Ctrl`+`C` 'cancels' certain commands that are running, but once I do the `ssh -D` it immediately logs out of the VPS. Also, unrelated question: Does logging out cancel the SSH 'binding' on the port?


title: where is `/var/www` in arch

text: I install Apache web server in arch Linux, my Apache work(when i type localhost in my browser see this:               Apache/2.2.25 (Unix) mod_ssl/2.2.25 OpenSSL/1.0.1e DAV/2 PHP/5.5.7 Server at localhost Port 80      i don't have `/var/www` folder, I created this but when I create a simple file like `index.html` i have 404 error. how i can fix this error?


title: Apache2 does not run on IPv4 tcp port

text: Can you help me please. I need run Apache2 on my Debian 7 server. But it run only on tcpv6 port, not on tcpv4 port. I installed it with apt-get install. I read some tips for this problem, but it does not help me. And if I go to localhost or 127.0.0.1 or my server IPv4 address it does not display any website. My `/etc/apache2/ports.conf`:               # If you just change the port or add more ports here, you will likely also     # have to change the VirtualHost statement in     # /etc/apache2/sites-enabled/000-default     # This is also true if you have upgraded from before 2.2.9-3 (i.e. from     # Debian etch). See /usr/share/doc/apache2.2-common/NEWS.Debian.gz and     # README.Debian.gz          NameVirtualHost *:80     Listen 80          <IfModule mod_ssl.c>      # If you add NameVirtualHost *:443 here, you will also have to change      # the VirtualHost statement in /etc/apache2/sites-available/default-ssl      # to <VirtualHost *:443>      # Server Name Indication for SSL named virtual hosts is currently not      # supported by MSIE on Windows XP.      Listen 443     </IfModule>          <IfModule mod_gnutls.c>      Listen 443     </IfModule>      `netstat -plntu`:               tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      3558/sshd            tcp        0      0 0.0.0.0:3466            0.0.0.0:*               LISTEN      2820/mysqld          tcp6       0      0 :::80                   :::*                    LISTEN      2097/apache2         tcp6       0      0 :::22                   :::*                    LISTEN      3558/sshd


title: Installed library packages cannot be found on OpenWRT

text: I have been compiling / installing custom packages for OpenWRT. I kept running into problems when I was compiling getting errors like:               Package x is missing dependencies for the following libraries:     libc.so.6      I solved this by adding the line `libc.so.6` to a `libc.provides` file. Now I am running into this error: ![OpenWRT Screenshot](http://i.stack.imgur.com/jULUa.png) Even though the packages are installed (in the list of installed packages and in the `bin` folder), they don't get run when I type them in. Somebody suggested that it may be because a linked library is missing. If anybody has any idea, I would appreciate any comments! **Update** In another install where `amld` **is working** , and `amldmonitor` **is not**               root@OpenWrt:~# file /bin/amld     /bin/amld: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), corrupted section header size     root@OpenWrt:~# file /bin/amldmonitor     /bin/amldmonitor: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.24, dynamically linked (uses shared libs), corrupted section header size      Question on r/openwrt


title: Two questions about building packages from source on Manjaro

text: I recently asked this question which was closed for being unclear. I'll ask clear questions now, and I hope to get clear short answers, not a link to Arch Wiki. I'm on Manjaro Openbox, no Internet, Yaourt isn't installed by default, I need to build packages from source, and not any package, lets be clear, I want to build this package. I have two questions.   * Is Abs installed by default on Manjaro or do I need to install it before building? * * *   * Makepkg: gives permission denied   * Sudo Makepkg: using sudo is a bad idea, use --asroot instead   * Makepkg --asroot: gives permission denied   * pacman -U broadcom-wl-5.100.138.tar.bz2 gives error or the file maybe damaged or something, can't remember, i tried it again and again with different packages and didn't work. * * * So how do you build that particular package on an Arch/Manjaro system? I want a short answer, Majaro forum users gave me every single page of ArchWiki to read, I don't want to see ArchWiki anymore please, if I was willing to waste a day building packages, I would have gone for Arch, not Manjaro, I think any Manjaro user would have done the same. * * * **Edit** I need fakeroot to install packages, I can't install base-devel using pacman, no Internet, how to install it from source?


title: Dir diff and removal

text: Is there a simple way to (recursively) remove all files from a directory A that are identical (same name and same hash) to files in directory B while preserving the structure? e.g. A/file1 gets removed if B/file1 exists; but A/file1 gets not removed although B/d/file1 exists


title: gpg-agent fail: undefined symbol gpg_err_set_errno

text: We started to get some odd issues yesterday; possible due to a yum install gone bad? One of the issues, PS -ef hanging indefinately (actually an ps command that looks at other user state) was fixed with a reboot. However we still have two issuse. When trying to run vncserver I get an error that:               Gtk-Message: Failed to load modle "canberra-gtk-module": libcanberra-gtk-module.so: cannot open shared object.      This error is valid; because the libcanberra-gtk-module does not exist anywhere on our system. I would just remove the module from the list to load, as I think it's non-mandatory, but I don't know what is causing vncserver to try to load it. The more important error though is GPG-agent. We get the error a few places, but it boils down to the fact that when I try to run gpg-agent I get the error:                ImportError: /usr/local/lib/libgcrypt.so.11: undefined symbole: gog-err-set_errno      none of the files listed on the gpg-agent man page even seem to exist. We tried re-installing libgpg-error package which didn't fix anything. Any idea what would cause this, or how to debug it? Thanks.


title: Opening TTY or using IBus freezes Linux?

text: For some reason, whenever I open a TTY, if I switch back to X11, it will be completely frozen except for the cursor. The exact same thing also happens whenever I use IBus to switch to ibus-mozc for Japanese input, or try to open the IBus settings application. Linux 3.11-2 under Crunchbang (Debian) upgraded to Testing. IBus 1.5.3-7 ibus-mozc 1.11.1522.102-2 EDIT: I uninstalled IBus and now the TTY works fine, so presumably it was an IBus problem. I still don't know why IBus was causing that problem though.


title: Driver install, kernel source not found

text: I am trying to install a NVidia Cuda driver on a Amazon EC2. GPU instance (Amazon Linux AMI (HVM) 2013.09.2 - ami-e9a18d80) following the instructions laid out in a blog. It worked for the last two weeks, but today it fails. The instructions state               sudo yum -y groupinstall "Development Tools"     sudo yum -y install git libcurl-devel python-devel screen rsync yasm numpy openssl-devel     wget http://developer.download.nvidia.com/compute/cuda/5_5/rel/installers/cuda_5.5.22_linux_64.run     sudo sh cuda_5.5.22_linux_64.run      error is > Installing the NVIDIA display driver... The driver installation is unable to > locate the kernel source. Please make sure that the kernel source packages > are installed and set up correctly. If you know that the kernel source > packages are installed and set up correctly, you may pass the location of > the kernel source with the '--kernel-source-path' flag. There is a comment on the instructional on how to possibly fix but I do not understand the commands, I cant seem to navigate to the paths specified. If someone could explain it like I am 5 for me I think it would be helpful. > For people having trouble with installing CUDA (fails with some complaint > about the kernel source), here's the fix I found… The kernel source in > /usr/src/kernels wasn't the same version as the kernel I was running (which > you can find with `uname -r`). I went into /boot/grub/menu.lst and made sure > that the only enabled kernel version was the one I had the source for.


title: How to use a “hardware key” to control Linux networking

text: Sometimes I have trouble controlling myself while in front of the computer and I tend to procrastinate a lot doing Internet surfing. Fortunately I do not need Internet for most of my work. So I would like to have a way to completely disable networking on Linux. To enable it again I would need a USB stick which would act as a key. Do you have any advice how one could go about implementing such a scheme? Ideally the enabling/disabling of networking should be as quick and automatic as possible. Also I would like a solution which, once implemented, is easy to set up on different machines. EDIT: I have a similar set-up for my laptop, but it is not as automatic as I like. I simply delete all the wireless drivers and keep a copy of them on a USB stick. But this solution is not easily portable. So I am looking for ideas how to improve it.


title: Arch Linux, Openbox and Desktop

text: I' m installing Arch with OpenBox, I' ve done everything but when I type               openbox-session      I have this error               Failed to open the display from the DISPLAY environment variable.      What's the problem?


title: How to turn on Keyboard Autorepeat permanently on VMware instances of CentOS 6?

text: In my lab we have about 40-50 machines, all cloned with the same image of CentOS 6. For some reason the keyboard auto repeat function decides to randomly turn itself off. Typically we just have students type `xset r on` which will turn it on. However, all throughout the day and random intervals it turns itself off again. There seems to be nothing in common with the times it does it, or the actions that were being performed on the system at the time it turned off. Recently it will even remain off even after typing `xset r on` multiple times in a row as both root and a normal user. It's highly annoying and I can't seem for the life of me to figure out how to permanently turn this on. My only real solution I've thought of was to create a `cron` job that turns it on every minute or so, however this only seemed to work temporarily. Hours after it starts running it just turns off again and the script seems to be rendered null and void. I've tried adding it to start up scripts, bash_profile, xinit scripts etc. But it will not stay on. What may be causing this and how can I permanently fix it? I have found others with similar issues that seem to believe it has something to do with VMware's mouse and keyboard driver that allows seamless integration of desktops. Which could be the case since we do run VMware Workstation on the machines. But sometimes it will happen even if a Virtual Machine isn't running even after a fresh reboot. **UPDATE #1:** I found a few potential fixes when searching around. None of which have actually fixed the problem. Here is what I tried: **Potential Fix #1 (Unsuccessful)** Source: VMware update: Keyboard repeat problem solved Added: `divider=1- clocksource=acpi_pm` to `/etc/grub.conf` This didn't work, nor do I understand why it would work. But was worth a shot. Also this fix is for the Guest OS. My problem isn't related to the Guest, it's a problem with the Host which carries over to Guest OS's to include Windows and Linux VM's. **Potential Fix #2 (Unsuccessful)** Source: VMware and the fubar keyboard effect This user had a different problem with the keyboard keys remapping randomly. However, I thought I'd try his fix to see if it would fix mine. It was not successful. Add: `xkeymap.nokeycodeMap = true` to `/etc/vmware/config` (if it doesn't exist create it) http://sgros.blogspot.com/2012/01/keyboard-autorepeat.html **UPDATE #2** So I ran a search to see what files and processes have a handle on XChangeKeyboardControl since that is the function which controls the keyboard auto repeat toggle. Here is the command I ran and my results:               PATH=$PATH:$HOME/bin:/usr/lib:/usr/lib64:/usr/share:/usr/include:/usr/libexec          IFS=:; find $PATH -type f -exec grep -lw XChangeKeyboardControl {} +        My results were:               /usr/lib/vmware/bin/vmware-remotemks     " "                /vmware-vmx-debug       " "                /vmware-vmx       " "                /vmware-vmx-stats       /usr/lib64/libX11.so.6.3.0       " "       /gnome-settings-daemon-2.0/libkeyboard.so       " "       /libxklavier.so.15.0.0       /usr/share/vm/io/L-master/linuxop-cl1.vmdk       /usr/include/X11/Xlib.h      I also ran the same command searching for `"XAutoRepeatOff"` and found this string in `/usr/bin/expresskeys` which is some sort of program that enables the use of PDA's and tablets style stylus's with the system. But its not running and isn't loaded at startup. **UPDATE#3** Note I verified I am using VMware Workstation 9.0. So all answers I've found that simply suggested upgrading to 8.0+ shouldn't really work. Still no resolution to this problem.


title: where is browser.js file in firefox in rhel?

text: i want to modify the browser configuration and i was unable to find "browser" java script file in installation directory i.e. /.Mozilla/Firefox/default/profile/. please provide me the link for browser.js


title: How to get a list of images in a a prticular folder?

text: My folder contains 5 -6 images, I want to display a list of the names of all images only. However the folder contains two text files.


title: allowing users to access certain ports on server

text: I have an RHEL 6 system which has 20 users. I have 20 ports on which separate versions of a service is running. I want user a to access port a, but not other ports. Is there a way to do this? (possibly by modifying iptables)?


title: How do I diagnose why Ubuntu is freezing?

text: I am running Ubuntu 12.04 LTS 64bit Desktop as a server at home. I run a Teamspeak server, and some php scripts every minute. After 12 to 168 hours (1 week) of being online, the server will freeze. What displays on the monitor is the login screen background, but is completely unresponsive. I cannot access the server through Putty either. The only way to fix it is to hold the power button down to turn off, and then turn it back on. How would I go about diagnosing such an issue? I am very new to linux and have only been running this "server" for around 6 months.


title: How to parallelize the for loop while scp the files?

text: I am running my below shell script from `machineA` which is copying the files `machineB` and `machineC` into `machineA`. If the files are not there in `machineB`, then it should be there in `machineC`. The below shell script will copy the files into `TEST1` and `TEST2` directory in `machineA`..               #!/bin/bash     set -e          readonly TEST1=/data01/test1     readonly TEST2=/data02/test2     readonly SERVER_LOCATION=(machineB machineC)     readonly FILE_LOCATION=/data/snapshot          dir1=$(ssh -o "StrictHostKeyChecking no" david@${SERVER_LOCATION[0]} ls -dt1 "$FILE_LOCATION"/[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9] | head -n1)     dir2=$(ssh -o "StrictHostKeyChecking no" david@${SERVER_LOCATION[1]} ls -dt1 "$FILE_LOCATION"/[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9] | head -n1)          echo $dir1     echo $dir2          if [ "$dir1" = "$dir2" ]     then         rm -rf $TEST1/*         rm -rf $TEST2/*         for el in $test1_partition         do             scp david@${SERVER_LOCATION[0]}:$dir1/pp_monthly_9800_"$el"_200003_5.data $TEST1/. || scp david@${SERVER_LOCATION[1]}:$dir2/pp_monthly_9800_"$el"_200003_5.data $TEST1/.         done         for sl in $test2_partition         do                 scp david@${SERVER_LOCATION[0]}:$dir1/pp_monthly_9800_"$sl"_200003_5.data $TEST2/. || scp david@${SERVER_LOCATION[1]}:$dir2/pp_monthly_9800_"$sl"_200003_5.data $TEST2/.         done     fi      Is there a way to run process parallelly in the loop of a bash script Currently it copies the file from `machineB` and `machineC` into `machineA` `TEST1` directory first, and if it is done, then only it will go and copy the files from `machineB` and `machineC` into `machineA` `TEST2` directory.. Is there any way I transfer the files both in `TEST1` and `TEST2` directory simultaneously? I am running Ubuntu 12.04


title: sed regex issue

text: I'm trying to replace a string in a file:               $RELEASE     = '1234';      The whitespace between RELEASE and the = symbol could be either spaces OR tabs. The quotes around the version number could be either single or double. I currently am assuming spaces and single quotes at the moment just to try to get it working:               sed 's/$RELEASE[[:space:]]*\=[[:space:]]*'\''[0-9]*'\'';/$RELEASE = '\''1234'\'';/g' config.ini > config.ini      So after a lot of work, this works. But only if the string is spaces (as apposed to tabs) and single quotes as apposed to doubles. Here is what I have so far for trying to tackle the tabs...:               sed 's/$RELEASE([[:space:]]|\t)*\=([[:space:]]|\t)*'\''[0-9]*'\'';/$RELEASE = '\''1234'\'';/g' config.ini > config.ini      I've just read that /t isn't supported in most sed regular expressions... Is this true? Is there a [[:tab:]] type replacement? (I did try that) Any help would be appreciated.


How do you view a sql.gz file as plain text SQL from the command line? I want to read the SQL statements stored in a `.sql.gz` file, from the command line on the server. I've tried `tar -xzvf`, but get `tar: This does not look like a tar archive`. `cat` returns garbage because it's compressed.


title: Play Video files in fedora

text: I installed a Fedora 18 and added rpm-fusion repositories for fedora18 and also installed all gstreamer codec such as good,ugly,bad, but i can not play videos with `.mkv` , `.mp4`, `.wmv` , extensions yet. it shows this error when I play a video file: ![enter image description here](http://i.stack.imgur.com/LhN91.png) ofcourse i should say that `.webm` and `.flv` videos play very well and I dont want to use **VLC**!


title: Copy/Mirror traffic to WAN interfaces without “iptables tee” support

text: I want to copy every outgoing packet to other WAN interfaces but my `iptables` (v1.2.7) doesn't have TEE target support. I wonder if there is another way (maybe using `iproute2` or `ebtables`) to copy every outgoing packet to an selected interface. I prefer another way than getting xtables-addons because I'm working with a embedded device (an UClinux distribution) and I would prefer avoid new versions of `iptables` (I don't know if the syntax remains the same among versions), cross-compiling problems or changing Makefiles.


title: How do I build a read-only Linux system that only writes to the RAM?

text: This is my current partition structure:               Filesystem            1K-blocks      Used Available Use% Mounted on     tmpfs                   127428         0    127428   0% /lib/init/rw     udev                    122976        96    122880   1% /dev     tmpfs                   127428         0    127428   0% /dev/shm     rootfs                  127428     11008    116420   9% /     /dev/sda1              1827534    933144    800029  54% /ro     rootfs.tmpfs            127428     11008    116420   9% /rw     rootfs.aufs             127428     11008    116420   9% /      I want to set up another system exactly like that, or at least close. The other disk looks like this, as shown by `df`:               Filesystem           1K-blocks      Used Available Use% Mounted on     /dev/hda3               678551    594050     84501  88% /     tmpfs                   124004         0    124004   0% /lib/init/rw     udev                     10240       520      9720   6% /dev     tmpfs                   124004         4    124000   1% /dev/shm     /dev/hda1                19515     15940      3575  82% /boot     /dev/hda2               253807      7002    246805   3% /var/log_compressed     tmpfs                   124004         0    124004   0% /tmp     tmpfs                   124004      3552    120452   3% /var/log     tmpfs                   124004         0    124004   0% /var/tmp     tmpfs                   124004        20    123984   1% /var/run     tmpfs                   124004         0    124004   0% /var/lock     tmpfs                   124004         0    124004   0% /var/spool      I read a lot, but I don't know how to set this up using unoinfs or initramfs. I will really appreciate help and explain I did read a lot and but I don't get how to do it by unoinfs or initramfs .


title: How do I diagnose a font rendering problem?

text: I recently updated my Fedora Rawhide system, and after doing so, fonts in Firefox (now 31) are ugly. But... not all of them. I traced it down to some fonts being rendered as "Helvetica" (the element inspector in Firefox tells me so), and this being rendered with no anti-aliasing. I don't think there is an open-source Helvetica, so something is being substituted. How can I:   1. figure out what font is actually being used,   2. discover why it isn't rendered nicely, and   3. fix the problem?


title: Why are directories created with permissions 2070 and files with 060 in a directory with setgid bit?

text: I have the following directory:               $ ll -d neptune     drwxrws---+ 5 beamin psych 4096 Mar  7 16:18 neptune          $ getfacl neptune     # file: neptune     # owner: beamin     # group: psych     # flags: -s-     user::rwx     group::r-x     group:sysadmins:rwx     group:psych:rwx     mask::rwx     other::---     default:user::---     default:group::r-x     default:group:sysadmins:rwx     default:group:psych:rwx     default:mask::rwx     default:other::---      I am logged in as `beamin`:               $ id beamin     uid=1000(beamin) gid=1000(beamin) groups=1000(beamin),2000(sysadmins)          $ umask     0002      However, when I create a directory or file, this is what I get:               $ cd neptune          $ mkdir dir          $ touch file          $ ll     total 8     d---rws---+ 2 beamin psych 4096 Mar  7 16:25 dir     ----rw----+ 1 beamin psych    0 Mar  7 16:25 file      Why is this?


title: Where do I find versions of Turnkey Linux made to run on 32-bit VirtualBox?

text: What I found on the main site turnkeylinux.org/core is the file turnkey- core-12.1-squeeze-amd64-vmdk.zip which I suppose is for 64-bit OSes (corrections accepted..).


title: How is built the initrd of a fresh install [RHEL55]

text: I'm trying to understand how is built the `initrd.img` file during an install process, I mean the one that will be boot up right after a fresh install. I updated the `initrd.img` file with new version of some drivers, I now need to update the "runtime" img (e.g : `initrd-2.6.9-89.ELhugemem.img`) file because the driver were loaded during the PXE boot but not after the install process. **Let me refine my question to:** Where should I put new modules (drivers) in order to make them available after the install process, given that I have a KS (Kickstart) infrastructure that does pre and post install steps? **My own answer (may not be the best) :** Looks like the initrd to be deployed after installation is nowhere, it looks like it is built using mkinitrd (but I am not sure), so I used our post-install scripts to handle the driver update process.


title: unrar for centos 5.7 needs unrar-4.20-2.mga3.nonfree.x86_64.rpm which causes an error

text: I'm trying to install unrar package for my cpanel. as some people suggested that I need this package `unrar-4.20-2.mga3.nonfree.x86_64.rpm` . So when I run `rpm -ivh unrar-4.20-2.mga3.nonfree.x86_64.rpm` I get this error:                   [root /]# rpm -ivh unrar-4.20-2.mga3.nonfree.x86_64.rpm     warning: unrar-4.20-2.mga3.nonfree.x86_64.rpm: Header V3 RSA/SHA1 signature: NOKEY, key ID 80420f66     error: Failed dependencies:         libc.so.6(GLIBC_2.14)(64bit) is needed by unrar-4.20-2.mga3.nonfree.x86_64         libc.so.6(GLIBC_2.7)(64bit) is needed by unrar-4.20-2.mga3.nonfree.x86_64         rpmlib(PayloadIsXz) <= 5.2-1 is needed by unrar-4.20-2.mga3.nonfree.x86_64     [root /]#      I saw posts suggesting to install `EPEL` and still the problem exists. I didn't see a relevant for installing the `EPEL` but still I tried and nothing worked. Any suggestions will be much appreciated. **Note:** I have `Centos 5.7`


title: How do I re-encode a mixed encoded text file

text: I've got a log file that is ASCII, except for a few UTF-8 characters (which I can fix for a future version). For the moment, I need to figure out how to get this file to a viewable/searchable/editable state by gedit/less etc. `enca -L none file` returns `7bit ASCII characters Surrounded by/intermixed with non-text data`. `enconv -L none -X ASCII file` and `enconv -L none -X UTF-8 file` "succeed" but do not actually change anything. How do I go about fixing this file? ## Update (after some answers): Actually, as stated below (upvotes to all :)), ASCII + UTF-8 is UTF-8. What I have is               0003bbc0  28 4c 6f 61 64 65 72 29  20 50 61 74 69 65 6e 74  |(Loader) Patient|     0003bbd0  20 00 5a 00 5a 00 5a 00  38 00 31 00 30 00 34 00  | .Z.Z.Z.8.1.0.4.|     0003bbe0  20 6e 6f 74 20 66 6f 75  6e 64 20 69 6e 20 64 61  | not found in da|     0003bbf0  74 61 62 61 73 65 0d 0a  32 36 20 53 65 70 20 32  |tabase..26 Sep 2|      I believe it will be a will be ~~a cp1252-type encoding~~. _Actually, I don't know what it is the cp1252 will be a 1-byte for ASCII won't it?_ _Incidentally, the fact that linux barfs on this helped me figure out that an input file (where the id's came from) was encoded badly..._


title: How to achieve the effect of chroot in userspace in Linux (without being root)?

text: The goal is to install and run programs in a displaced (relocated) distro (whose / must not coincide with the global /) inside a host Linux system. The programs are not adapted for using a different / . fakechroot is not a complete solution because it employs library-substitution instead of acting on the level of system calls (so not good for statically linked binaries).


title: An obscure autotools error with Epson iscan project

text: I'm seeing the following error when attempting to build iscan using the master branch on Debian wheezy. This project provides support for Epson scanners, in cases when SANE doesn't. This project appears to be an unofficial fork of the Epson project - I'm not clear about the details. I start with:               faheem@orwell:/usr/local/src/iscan/iscan$ git remote -v     origin  https://github.com/hean01/iscan (fetch)     origin  https://github.com/hean01/iscan (push)     faheem@orwell:/usr/local/src/iscan/iscan$ git branch      * (detached from origin/master)       iscan-2.29.1-5     faheem@orwell:/usr/local/src/iscan/iscan$ git status     # HEAD detached at origin/master     nothing to commit, working directory clean     faheem@orwell:/usr/local/src/iscan/iscan$ debuild -uc -us     This package has a Debian revision number but there does not seem to be     an appropriate original tar file or .orig directory in the parent directory;     (expected one of iscan_2.29.3.orig.tar.gz, iscan_2.29.3.orig.tar.bz2,     iscan_2.29.3.orig.tar.lzma,  iscan_2.29.3.orig.tar.xz or iscan.orig)     continue anyway? (y/n)     The error is          make[1]: Entering directory `/usr/local/src/iscan/iscan'     cd . && /bin/bash /usr/local/src/iscan/iscan/missing --run aclocal-1.10 -I m4     configure.ac:273: error: unknown libltdl build type: _LTDL_TYPE     /usr/share/aclocal/ltdl.m4:226: LTDL_INIT is expanded from...     /usr/share/aclocal/ltdl.m4:352: AC_LIB_LTDL is expanded from...     configure.ac:273: the top level     autom4te: /usr/bin/m4 failed with exit status: 1     aclocal-1.10: autom4te failed with exit status: 1     make[1]: *** [aclocal.m4] Error 1     make[1]: Leaving directory `/usr/local/src/iscan/iscan'      Suggestions for fixing or even a confirmation this can be reproduced would be helpful. I've also opened an issue for the iscan GitHub project. Googling "configure.ac:273: error: unknown libltdl build type: _LTDL_TYPE" brings up http://help.lockergnome.com/linux/Beating-libtool-submission-- ftopict507073.html but the suggested               autoreconf -fiv      does not work. I might try one of the autotools mailing list, but at this point, I don't even know which one to post to. Should it be autoconf, automake, or libtool, or something else? Pointers appreciated.


title: Centos 'Login incorrect' problem

text: When I type my username and password into the login field, I receive the following error: > Login incorrect How can I solve this problem? I am using CentOS.


title: A hidden process, what it is?

text: [root@datacenteronline ~]# ssh root@192.168.1.172     Last login: Wed Apr 17 09:55:45 2013 from 192.168.1.187     [root@localhost ~]# ls /proc/ | grep 2266     [root@localhost ~]# cd /proc/2266     [root@localhost 2266]# ls     attr             cpuset   limits      net            root       statm     autogroup        cwd      loginuid    numa_maps      sched      status     auxv             environ  maps        oom_adj        schedstat  syscall     cgroup           exe      mem         oom_score      sessionid  task     clear_refs       fd       mountinfo   oom_score_adj  smaps      wchan     cmdline          fdinfo   mounts      pagemap        stack     coredump_filter  io       mountstats  personality    stat     [root@localhost 2266]# ls -al /proc/2266     total 0     dr-xr-xr-x   7 apache apache 0 Apr 17 09:45 .     dr-xr-xr-x 266 root   root   0 Apr 17 09:11 ..     dr-xr-xr-x   2 apache apache 0 Apr 17 09:45 attr     -rw-r--r--   1 root   root   0 Apr 17 09:45 autogroup     -r--------   1 root   root   0 Apr 17 09:45 auxv     -r--r--r--   1 root   root   0 Apr 17 09:45 cgroup     --w-------   1 root   root   0 Apr 17 09:45 clear_refs     -r--r--r--   1 root   root   0 Apr 17 09:45 cmdline     -rw-r--r--   1 root   root   0 Apr 17 09:45 coredump_filter     -r--r--r--   1 root   root   0 Apr 17 09:45 cpuset     lrwxrwxrwx   1 root   root   0 Apr 17 09:45 cwd -> /     -r--------   1 root   root   0 Apr 17 09:45 environ     lrwxrwxrwx   1 root   root   0 Apr 17 09:45 exe -> /usr/local/apache2/bin/httpd     dr-x------   2 root   root   0 Apr 17 09:45 fd     dr-x------   2 root   root   0 Apr 17 09:45 fdinfo     -r--------   1 root   root   0 Apr 17 09:45 io     -rw-------   1 root   root   0 Apr 17 09:45 limits     -rw-r--r--   1 root   root   0 Apr 17 09:45 loginuid     -r--r--r--   1 root   root   0 Apr 17 09:45 maps     -rw-------   1 root   root   0 Apr 17 09:45 mem     -r--r--r--   1 root   root   0 Apr 17 09:45 mountinfo     -r--r--r--   1 root   root   0 Apr 17 09:45 mounts     -r--------   1 root   root   0 Apr 17 09:45 mountstats     dr-xr-xr-x   6 apache apache 0 Apr 17 09:45 net     -r--r--r--   1 root   root   0 Apr 17 09:45 numa_maps     -rw-r--r--   1 root   root   0 Apr 17 09:45 oom_adj     -r--r--r--   1 root   root   0 Apr 17 09:45 oom_score     -rw-r--r--   1 root   root   0 Apr 17 09:45 oom_score_adj     -r--r--r--   1 root   root   0 Apr 17 09:45 pagemap     -r--r--r--   1 root   root   0 Apr 17 09:45 personality     lrwxrwxrwx   1 root   root   0 Apr 17 09:45 root -> /     -rw-r--r--   1 root   root   0 Apr 17 09:45 sched     -r--r--r--   1 root   root   0 Apr 17 09:45 schedstat     -r--r--r--   1 root   root   0 Apr 17 09:45 sessionid     -r--r--r--   1 root   root   0 Apr 17 09:45 smaps     -r--r--r--   1 root   root   0 Apr 17 09:45 stack     -r--r--r--   1 root   root   0 Apr 17 09:45 stat     -r--r--r--   1 root   root   0 Apr 17 09:45 statm     -r--r--r--   1 root   root   0 Apr 17 09:45 status     -r--r--r--   1 root   root   0 Apr 17 09:45 syscall     dr-xr-xr-x  29 apache apache 0 Apr 17 09:45 task     -r--r--r--   1 root   root   0 Apr 17 09:45 wchan      Cound anyone tell me what it is?


title: Virtual TTY jumps to the next on launching from the Openbox menu

text: When I launch a terminal from my Openbox menu my virtual terminal TTY jumps to the next `Ctrl``Alt``F12` slot. It seems that this problem appeared after I wanted some more than 7 TTYs and added some to `/etc/inittab`. I don't even know how to formulate a Google search. Every time I launch a terminal from OpenBox I need to press `Ctrl``Alt``F11` - to return back from the terminal I've jumped to. Here is my /etc/inittab: http://bpaste.net/show/91971/ /var/log/Xorg.0.log: http://bpaste.net/show/153905/ And after a year, as I understand nobody could help at any forum or #gentoo IRC (the question was opened 10 times at different time ..or so) Yes, the system could live, though it's somehow annoying. **/update:** The problem worsened from just jumping through TTY's to desktop not reacting on a mouse second time after the first successful launch of lxterminal/xfce-terminal ....etc.. etc... dozens of them (including xterm) * * * I'm adding my configs               cat /proc/cmdline     root=/dev/sda2      /etc/X11/xorg.conf:               Section "Device"             ### Available Driver options are:-             ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",             ### <string>: "String", <freq>: "<f> Hz/kHz/MHz",             ### <percent>: "<f>%"             ### [arg]: arg optional             #Option     "SWcursor"              # [<bool>]             #Option     "HWcursor"              # [<bool>]             #Option     "NoAccel"               # [<bool>]             #Option     "ShadowFB"              # [<bool>]             #Option     "VideoKey"              # <i>             #Option     "WrappedFB"             # [<bool>]             #Option     "GLXVBlank"             # [<bool>]             #Option     "ZaphodHeads"           # <str>             #Option     "PageFlip"              # [<bool>]             #Option     "SwapLimit"             # <i>         Identifier  "Card0"         Driver      "nouveau"         BusID       "PCI:2:0:0"     EndSection


title: Bash script doesn't TEE output to subdirectory

text: I've got a script that runs a number of curl commands by reading an input file line by line (each line has different curl parameters). I'm trying to tee the stnd out and stnd error of the curl command to a log file as well as display them to the terminal. Simple, right? But for some reason tee will not save the output to the subdirectory where I want the log file. It will create the log file if I specify the directory the script is running in. Below is the relevant code:               if [[ -f $1 ]]     then       echo "Running requests from $1"       bname=`basename ${1} | awk -F\. '{print $1}'`       mkdir ./output/${bname}       echo "Will write output to ./output/${bname}"     while read line         do         let j=j+1         post_data=`perl -MURI::Escape -e 'print uri_escape($ARGV[0]);' "${line}"`          echo $line > ./output/${bname}/${bname}_${j}_request         curl -v -b cookie ${SvrProperties} -d "xmlrequest=$post_data" -o ./output/${bname}/${2}_${j}_response.xml 2>&1 | tee /output/${bname}/${2}_${j}_Run.log &       done < ${1}     elif [[ -d $1 ]]     then       for file in `ls $1`       do         echo "Running requests from $1/${file}"         bname=`basename ${file} | awk -F\. '{print $1}'`         mkdir ./output/${bname}         echo "Will write output to ./output/${bname}"         while read line           do           let i=i+1           post_data=`perl -MURI::Escape -e 'print uri_escape($ARGV[0]);' "${line}"`            echo $line > ./output/${bname}/${bname}_${i}_request           curl -v -b cookie ${SvrProperties} -d "xmlrequest=$post_data" -o ./output/${bname}/${2}_${i}_response.xml 2>&1 | tee /output/${bname}/${2}_${i}_Run.log &         done < ${1}/${file}       done     else       echo "Invalid input, neither file nor directory!  Exiting..."       exit     fi      Note: The line where I echo the request to the subdirectory as well as saving the output of the curl request all work. It's only the tee command that doesn't work. The log files will be created if I write something like this:               curl -v -b cookie ${SvrProperties} -d "xmlrequest=$post_data" -o ./output/${bname}/${2}_${j}_response.xml 2>&1 | tee ${2}_${j}_Run.log &       But then it's not in the location that I want.


title: History-search in zsh working only for commands?

text: Say I have the following entries in my command history:               less documents/doc1.txt     less documents/doc2.txt     less files/file1.txt     less files/file2.txt     ls     pwd      and that I have the following keyboard binding enabled:               bindkey '^P' history-search-backward      I have noticed that if I then type:               less documents     ^P      ZLE brings `less files/files2.txt` as the first option, rather than: `less documents/doc2.txt` Why is that? Is there a way to make `history-search` fix **everything on the left of my cursor** and iterate through the history with it?


title: What is the difference between /proc/self/stack and output from pstack?

text: I have been looking through the documentation for /proc and the "stack" object being a new'ish object in proc, I have also looked through the kernel commit to create it -- however the documentation does not detail exactly what is in the /proc/self/stack file -- and since I intuitively expected it to be the actual stack of the process -- however the old `pstack` tool gives a different (and more believable) output. So as an example of the stack for bash               $ cat /proc/self/stack      [<ffffffff8106f955>] do_wait+0x1c5/0x250     [<ffffffff8106fa83>] sys_wait4+0xa3/0x100     [<ffffffff81013172>] system_call_fastpath+0x16/0x1b     [<ffffffffffffffff>] 0xffffffffffffffff      and, using pstack               $ pstack $$     #0  0x00000038cfaa664e in waitpid () from /lib64/libc.so.6     #1  0x000000000043ed42 in ?? ()     #2  0x000000000043ffbf in wait_for ()     #3  0x0000000000430bc9 in execute_command_internal ()     #4  0x0000000000430dbe in execute_command ()     #5  0x000000000041d526 in reader_loop ()     #6  0x000000000041ccde in main ()      The addresses are different, and obviously the symbols are not at all the same.... Does anybody have an explanation for the difference and/or a document which describes what is actually shown in /proc-stack?


title: Run service after logging in on an X session

text: I am using Ubuntu 12.04. I want to automatically start a service after login with LightDM. This service is not meant to start on boot, but after X is initialized.


title: xdotool random/more natural delay?

text: For automated testing of some applications, I would like to emulate the users behaviour. I know I can user the `xdotool type --delay` option, but I would like a more natural delay. The easiest thing would be to add a random delay, but more advanced methods are also appreciated. Is there such a option / utility?


title: How to keep a line from being remembered in the history?

text: This is for a single line, not a command. I found the way to make it always prevent history for a single command. Thanks. EDIT: Sorry for the poor wording. Single line - For example, if I type, `git push production`, I might not want to accidentally execute this single line in the future, because it should only be run occasionally, and it has serious ramifications. Command - In this example, the command is `git`. I would want the history to remember `git push; git push staging` Single command - meant command as well. Is this clearer now? Thanks.


title: Simultaneously move long list files to new location

text: I'm using a wonderful program called ExifTool to recursively rename a large batch of files. Here is example usage:               $ exiftool -r -ext JPG '-FileName<CreateDate' -d %Y%m%d_%H%M%S.jpg .     Error: './folder1/110310_135433.jpg' already exists - ./folder1/source.jpg     Warning: No writable tags found - ./folder2/110404_095111.jpg        68 directories scanned      1650 image files updated         5 image files unchanged         2 files weren't updated due to errors      When processing very large batches of images, the number of files not updated due to errors is often in the hundreds, therefore moving each file individually with `mv` is out of the question. I'd like to simultaneously move the files with errors/warnings to a separate directory for further processing. I need to extract the paths of the problem files from the terminal output and move them together, but I'm not sure how to achieve this. How would I go about this? For what it's worth, I am using Ubuntu 11.10.


title: Where do I download Vine Linux for PowerPC?

text: Where do I download the latest version of Vine Linux for PowerPC? I cannot find the link for PowerPC download on their website.


title: getrusage system call: what is "maximum resident set size"

text: `man getrusage 2` says               ru_maxrss (since Linux 2.6.32)                   This is the maximum resident set size used (in kilobytes). For RUSAGE_CHILDREN, this is the resident set size of the largest                   child, not the maximum resident set size of the process tree.      So what does this number mean exactly?


title: Terminal does not source .zshrc with custom colors for ls and cd command

text: I customized the directory and file colors for `ls` and `cd` + `TAB`. Here is my configuration. * * * **My configuration** My system environment.               Ubuntu 10.10     zsh 4.3.10 (x86_64-unknown-linux-gnu)     oh-my-zsh // http://git://github.com/robbyrussell/oh-my-zsh.git     Terminal      My .zshrc in $HOME.               // .zshrc     echo "Sourcing $0."     ZSH=$HOME/.oh-my-zsh     ZSH_THEME="josh"     source $ZSH/oh-my-zsh.sh      A custom zsh script in ~/.oh-my-zsh/custom/completion.zsh               // completion.zsh     echo "Sourcing $0."     # Same completion colors when using cd as with ls.     zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}     zstyle ':completion:*:*:*:*:*' menu yes select      A custom zsh script in ~/.oh-my-zsh/custom/theme-and-appearance.zsh               // theme-and-appearance.zsh     echo "Sourcing $0."     export LS_COLORS='di=1;34:ln=35:so=32:pi=0;33:ex=32:bd=34;46:cd=34;43:su=0;41:sg=0;46:tw=1;34:ow=1;34:'      * * * **The problem description.** When I open the Terminal for the first time 3 files are sourced. Notice, that `.zshrc` does appear but **not** with its path nor file name.               Sourcing zsh.     Sourcing /home/john/.oh-my-zsh/custom/completion.zsh.     Sourcing /home/john/.oh-my-zsh/custom/theme-and-appearance.zsh.      Using the `ls` command the directory listing looks as expected. Though, when I use the `cd` command and `TAB` for autocompletion directory colors are not the same as with `ls`. Then I source the configuration once again. Notice, this time `.zshrc` does appear with its full path and file name. I am not sure whether this contributes to the problem explained here.               $ . ~/.zshrc      Sourcing /home/john/.zshrc.     Sourcing /home/john/.oh-my-zsh/custom/completion.zsh.     Sourcing /home/john/.oh-my-zsh/custom/theme-and-appearance.zsh.      Now both `ls` and `cd` + `TAB` use the same colors. * * * **Question** How do I have to change my configuration that the customization is loaded as soon as I open the Terminal application?


title: Which 2-letter POSIX command is different from all the others?

text: I was interviewed for an internship and I got the same question as this one: http://www.glassdoor.com/Interview/Which-2-letter-POSIX-command-is-different- from-all-the-others-QTN_498236.htm The answer is right, it is cd (as the interviewer told me so). I am very confused at this one. Why cd is different? I told the interviewer that it is different because it might not be implemented by the "shell", but I did not know what I was talking about at that time.


title: root permission denied on /proc/1/exe

text: I just performed a fresh ubuntu install and i am seeing the following in lsof:               userA@az1:~$ lsof     COMMAND    PID  TID       USER   FD      TYPE DEVICE SIZE/OFF     NODE NAME     init         1            root  cwd   unknown                          /proc/1/cwd  (readlink: Permission denied)     init         1            root  rtd   unknown                          /proc/1/root (readlink: Permission denied)     init         1            root  txt   unknown                          /proc/1/exe (readlink: Permission denied)     init         1            root NOFD                                    /proc/1/fd (opendir: Permission denied)     kthreadd     2            root  cwd   unknown                          /proc/2/cwd (readlink: Permission denied)     kthreadd     2            root  rtd   unknown                          /proc/2/root (readlink: Permission denied)     kthreadd     2            root  txt   unknown                          /proc/2/exe (readlink: Permission denied)     kthreadd     2            root NOFD                                    /proc/2/fd (opendir: Permission denied)      Is this normal? If not how do I fix it? Trying to search for this particular error has lead me nowhere. I am concerned that something is wrong because root is getting `Permission denied` errors. ls -la result for the proc folder: `dr-xr-xr-x 145 root root 0 Jan 13 17:33 proc` ls -la results for contents are: `dr-xr-xr-x 9 root root 0 Jan 13 17:34 1` and for the contents of process 1.               sudo ls -la /proc/1/     total 0     dr-xr-xr-x   9 root root 0 Jan 13 17:34 .     dr-xr-xr-x 145 root root 0 Jan 13 17:33 ..     dr-xr-xr-x   2 root root 0 Jan 13 17:42 attr     -rw-r--r--   1 root root 0 Jan 13 17:42 autogroup     -r--------   1 root root 0 Jan 13 17:42 auxv     -r--r--r--   1 root root 0 Jan 13 17:34 cgroup     --w-------   1 root root 0 Jan 13 17:42 clear_refs     -r--r--r--   1 root root 0 Jan 13 17:34 cmdline     -rw-r--r--   1 root root 0 Jan 13 17:42 comm     -rw-r--r--   1 root root 0 Jan 13 17:42 coredump_filter     -r--r--r--   1 root root 0 Jan 13 17:42 cpuset     lrwxrwxrwx   1 root root 0 Jan 13 17:35 cwd     -r--------   1 root root 0 Jan 13 17:35 environ     lrwxrwxrwx   1 root root 0 Jan 13 17:34 exe     dr-x------   2 root root 0 Jan 13 17:35 fd     dr-x------   2 root root 0 Jan 13 17:42 fdinfo     -r--------   1 root root 0 Jan 13 17:42 io     -r--r--r--   1 root root 0 Jan 13 17:42 latency     -r--r--r--   1 root root 0 Jan 13 17:35 limits     -rw-r--r--   1 root root 0 Jan 13 17:42 loginuid     dr-x------   2 root root 0 Jan 13 17:42 map_files     -r--r--r--   1 root root 0 Jan 13 17:35 maps     -rw-------   1 root root 0 Jan 13 17:42 mem     -r--r--r--   1 root root 0 Jan 13 17:42 mountinfo     -r--r--r--   1 root root 0 Jan 13 17:42 mounts     -r--------   1 root root 0 Jan 13 17:42 mountstats     dr-xr-xr-x   5 root root 0 Jan 13 17:42 net     dr-x--x--x   2 root root 0 Jan 13 17:42 ns     -r--r--r--   1 root root 0 Jan 13 17:42 numa_maps     -rw-r--r--   1 root root 0 Jan 13 17:42 oom_adj     -r--r--r--   1 root root 0 Jan 13 17:42 oom_score     -rw-r--r--   1 root root 0 Jan 13 17:42 oom_score_adj     -r--r--r--   1 root root 0 Jan 13 17:42 pagemap     -r--r--r--   1 root root 0 Jan 13 17:42 personality     lrwxrwxrwx   1 root root 0 Jan 13 17:35 root     -rw-r--r--   1 root root 0 Jan 13 17:42 sched     -r--r--r--   1 root root 0 Jan 13 17:42 schedstat     -r--r--r--   1 root root 0 Jan 13 17:42 sessionid     -r--r--r--   1 root root 0 Jan 13 17:42 smaps     -r--r--r--   1 root root 0 Jan 13 17:42 stack     -r--r--r--   1 root root 0 Jan 13 17:35 stat     -r--r--r--   1 root root 0 Jan 13 17:42 statm     -r--r--r--   1 root root 0 Jan 13 17:35 status     -r--r--r--   1 root root 0 Jan 13 17:42 syscall     dr-xr-xr-x   3 root root 0 Jan 13 17:35 task     -r--r--r--   1 root root 0 Jan 13 17:42 timers     -r--r--r--   1 root root 0 Jan 13 17:42 wchan


title: Print line numbers of files I am searching through

text: I am looking for a way to print the line number of files my script is going through. I have found `$LINENO` but when I do `echo 'Found foo in file' $(basename $foo) 'on line' $LINENO >> foo.csv` It prints the results "Found foo in file Foo on line 97 in the `.csv` file. I would like it to print the line in the file it is looking at and not the line the script it is on. How can I echo the line number in the files?


title: Simplified navigation in terminal

text: I know IDEs are the wave of the future, but I always find myself coding in `vim` in a Linux terminal. Old dog. New tricks. Anyway, navigation becomes challenging when dealing with long package names. For instance, in my terminals I can see my current path as part of the prompt. Sometimes I am here:               /foo/bar/src/com/example/yomama/      and I want to get to:               /foo/bar      I have some nifty aliases:               alias 1down="cd .."     alias 2down="cd ..;cd .."     alias 3down="cd ..;cd ..;cd .."     alias 4down="cd ..;cd ..;cd ..;cd .."     alias 5down="cd ..;cd ..;cd ..;cd ..;cd .."      So if I type `4down`, bam! I am at `/foo/bar`. The thought just occurred to me that since I know my current working directory is:               /foo/bar/src/com/example/yomama/      I can also just go 2 up from / to get to /foo/bar. So it would be cool to also implement a 2up function, since it is easier to count how many to go up. Before I start to write out a shell script for this, I am wondering if there are any shell tools that would lend a more elegant solution. Extra points if someone knows of one-liner that can implement `Nup`. PS: I already have               alias bar = "cd /foo/bar"      I am looking for a more generic solution here. PPS: I have always thought that it would be really cool to have a clickable `$PWD` in the prompt. So I could just click on `bar`, and `cd` to `/foo/bar`. But maybe I should just move to a graphical IDE and shut up already ;-) EDIT: There is some confusion on what my definition of Nup is. Nup should take you to the Nth path location in your PWD from root. So, if you are currently in /a/b/c/d/e/f/g/h/i, 4up will take you to /a/b/c/d. Similarly 5down will get you /a/b/c/d. Basically, you can navigate the path without having to laboriously 'cd ..' a bunch of times, or specifying 'cd /a/b/c/d'.


title: Nmap -sn: scan or no scan?

text: The `nmap` man page has this to say about the `-sn` parameter:               -sn (No port scan) .         This option tells Nmap not to do a port scan after host         discovery, and only print out the available hosts that         responded to the scan.      The first half of the sentence mentions that there is no scan, but the second half says that there is a scan. Is there a different type of scan than a port scan that the second half is referring to? A host-discovery scan perhaps (guessing from the little that I know about `nmap`)?


title: What does the following script do?

text: This was a question on my study guide, and I believe that the script is pinging the ip addresses, so the 2nd choice. Can somebody confirm this for me? The 5th column of NMAP output below is the IP address. Armed with that information, what does the script below do?               nmap -n -p80 -sS -PN --open 192.168.1.0/24 | grep "Nmap scan report" | awk '{print $5}' | while read IP; do ping -c 1 $IP && echo "I can ping $IP" ; done      Select one:   * It will resolve the network names of the hosts running web servers   * It will ping all of the IP addresses between 192.168.1.0 and 192.168.1.255   * It will search the network for Telnet servers   * It will see if ICMP ECHO REPLY is returned from all hosts running web servers in the 192.168.1.1-255 range   * It will connect to every web page on the network and download the banner


title: Can't mount filesystem by offset

text: I'm having trouble trying to mount a filesystem. Basically, if I mount `/dev/sdc1`, it works perfectly. But if I mount `/dev/sdc` with a byte offset, it fails. The filesystem is HFS+ (formatted using an actual iMac).               root# fdisk -l /dev/sdc          Disk /dev/sdc: 320.1 GB, 320072932864 bytes     255 heads, 63 sectors/track, 38913 cylinders, total 625142447 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x00000000             Device Boot      Start         End      Blocks   Id  System     /dev/sdc1              63      128519       64228+  af  HFS / HFS+     root# mount /dev/sdc1 /mnt     root# echo $?     0     root# umount /mnt     root# mount --ro -o offset=32256,sizelimit=6576994 /dev/sdc /mnt     mount: wrong fs type, bad option, bad superblock on /dev/loop20,            missing codepage or helper program, or other error            In some cases useful info is found in syslog - try            dmesg | tail or so     root# dmesg | tail     [164258.208493] hfs: unable to find HFS+ superblock     [164398.983651] hfs: invalid secondary volume header     [164398.983654] hfs: unable to find HFS+ superblock     [164404.235785] hfs: invalid secondary volume header     [164404.235787] hfs: unable to find HFS+ superblock     [164407.461400] hfs: invalid secondary volume header     [164407.461404] hfs: unable to find HFS+ superblock      What the heck am I doing wrong here? P.S. The offsets seem to match the output from `fdisk`, so that's not the problem. **EDIT** Added `fdisk` output.


title: Sharing a local directory between local users with full permissions

text: How do you share a directory               /home/shared      between two users "eris" and "discordia" such that both can access the directory in their respective home directory, e.g.               /home/eris/shared      and               /home/discordia/shared      and both have full recursive read and write permission on the respective directory? The directories should lie on the same filesystem.   * I tried using bind mounts and ACLs but these do not work well when moving (and copying?) files into the shared directory, in which case the default ACL will not be applied and the files will keep their original permissions instead,   * The same holds for using the setguid flag,   * bindfs with the "mirror" option does what I am looking for, but at the cost of dramatically poor performance, as shown by Guy Paddock.   * setting the global umask to 002 is not an option,   * neither is using vfat.


title: Tab-completion within for loops not working

text: I'm either going crazy or about to ask a stupidly basic question. I appreciate your patience either way. Tab completion for executable command is not working within interactive for loops in bash. I could have sworn it used to work, but I'm open to the idea that it's never worked and I'm going crazy. It works fine at the regular command line, not within loops. I keep finding myself ^Cing out of writing a loop to tab-complete the name so I can copy and paste it (the command names I'm actually not as trivial as 'whatis' I used in the example below). Example:               $ which whatis     /usr/bin/whatis     $ wh<TAB>(BEEP)<TAB>     whatis    whereis   while     who     wheel     which     whiptail  whoami     $ what<TAB>is     usage: whatis keyword ...     $ for i in foo bar ray     > do     > what<TAB>(BEEP)<TAB>(BEEP)      Environment is as follows:               $ bash --version     GNU bash, version 4.1.2(1)-release (x86_64-redhat-linux-gnu)


title: Recover cron jobs accidently removed with crontab -r

text: I entered `crontab -r` instead of `crontab -e` and all my `cron` jobs have been removed. What is the best way (or is there one) to recover those jobs?


title: UDP multicasting broken after kernel update

text: I've got an embedded system which is running a stripped down Gentoo userland with a manually build kernel. The system acquires data from a PCI card and sends it out to an UDP multicast group. All worked well with an old kernel (2.6.11). Now I updated to a slightly younger kernel (2.6.15) to fix a different problem where the board would hang during reboot. This fixed the hang at reboot but now sending data to the UDP multicast group fails. My calls to sendto under 2.6.15 give error ENOTCONN. However, the link is up and I can send data over TCP over the link without problems. My program was not changed, in fact I didn't even recompile it. Calling ifconfig eth0 under both kernels gives the same output. Any ideas what I could have configured wrongly while building the 2.6.15 kernel? Or was there a bug or an API change in 2.6.15? I can not update to anything younger than 2.6.15 as this is the latest kernel supported by the crappy driver for the PCI card in the system.


title: Unable to detect wireless networks in Fedora

text: I've been using Fedora 13 for around six months, but only with a wired connection in my room. I took my laptop to a college library that has Wifi, but when I turn my system on it doesn't detect any wireless networks at all. What could be the problem? How do I fix it?


title: Can't get the '-o remount' option on an NFS share to work in Slackware 13.1

text: I've had `rsnapshot` working under Slackware 13.0 for a few months. In my `/etc/rsnapshot_<interval>` scripts I first have it run is `mount -o remount,rw` then the very last thing it does is a `mount -o remount,ro`. The reason behind this is to protect my backups from accidental deletion by making them read-only whenever they are not actively being created. When I upgraded to 13.1 this `-o remount` functionality seems to have either disappeared or broken:               # mount -t nfs     192.168.1.5:/slackware on /slackware type nfs (rw,addr=192.168.1.5)     # mount -o remount,ro /slackware     mount.nfs: an incorrect mount option was specified      Does anybody have a proposed solution to remedy this?


title: How to mount a disk on key on Red-Hat 6 (Beta) after ejecting it

text: I have a Cruzer disk on key which was recognized automatically by my RedHat6-beta OS. I removed it always using the GUI option "Safely remove", but one time by mistake I selected "Eject" and from then it is not recognized. I tried to mount it according to some Google's results, including editing the fstab file - no success. Does someone have an idea how to solve that? Thank you all in advance.


title: easy-to-use image-editing FLOSS

text: I'm looking for recommendations for something easy to use that will allow me to edit my images. I fiddled with Inkspace and GIMP and found them not so intuitive (I don't want to have to read a manual to know how to **draw a border** around some part of the image).


title: Why do my SATA devices show up under /proc/scsi/scsi?

text: I have 3 SATA devices on my system. They show up under `/proc/scsi/scsi`, although these are not SCSI devices. Why do my SATA devices show up under the SCSI directory?               $ cat /proc/scsi/scsi      Attached devices:     Host: scsi0 Channel: 00 Id: 00 Lun: 00       Vendor: ATA      Model: WDC WD2500AAJS-6 Rev: 01.0       Type:   Direct-Access                    ANSI  SCSI revision: 05     Host: scsi1 Channel: 00 Id: 00 Lun: 00       Vendor: TSSTcorp Model: CDDVDW TS-H653Z  Rev: 4303       Type:   CD-ROM                           ANSI  SCSI revision: 05     Host: scsi4 Channel: 00 Id: 00 Lun: 00       Vendor: ATA      Model: ST3320620AS      Rev: 3.AA       Type:   Direct-Access                    ANSI  SCSI revision: 05


title: Scrollability of text when using tmux?

text: Scrollability of text in some terminals:                      | tty | xterm | urxvt | guake | terminator     screen |  Y  |   Y   |   Y   |   Y   |     Y     tmux   |  N  |   N   |   Y   |   N   |     N      I notice in this answer that scrolling doesn't work when using tmux. But I can scroll in urxvt. How can I have that behaviour in other terminals?


title: Unable to login as normal user on CentOS

text: My normal user account isn't working correctly in CentOS, but logging in as root works fine. What should I do to debug/fix the problem?


title: Which is the default/prefered compiler in F18?

text: I am having trouble trouble finding an installed by default compiler on Fedora18. _Where is it?_ If strangely no compiler is included in the core distribution, is there a preferred compiler for casual users, needing to compile a package from source?


title: What do I need to setup a linux box as a proxy to access the network?

text: At the minute I have all my machines connect directly to my isp-supplied broadband router. I want to make sure my machines are behaving correctly so I wish to test this by sniffing the traffic of each. How do I set up a linux box I have that has 2 network adapters, one ethernet one wireless, to act as (invisible) proxy to the network for another box connected to it via the ethernet port? So in effect I want my proxy box to look after the DNS, HTTP and whatever ethernet multicast requests are normally serviced by the router. I have wireshark setup on my proxy box to sniff the traffic that comes through it's ethernet adapter, so I just need to know what I need to do to set it up as a fully-functioning proxy. The would-be proxy is Debian based.


title: wpa_supplicant issue

text: We are using `wpa_supplicant` utility v2.2 for Wlan. Below is the configuration for the router:               Mode: WEP     Password: 12345678          Mode: WPA     Password: 1122334455      The router's current mode is WEP and we are trying to connect to a router with password of WPA which is `1122334455`. Doing so, `wpa_supplicant` gives signal `CTRL-EVENT_CONNECTED`. As we are just waiting for that event, our GUI application shows it is connected though we are passing the wrong password. Is there any solution for this issue?


title: Under what circumstances does gunzip & tar xf work but tar xzf fail?

text: To illustrate the point: I have downloaded the LEDA library from the company's website. Using tar -xzf on it fails:               $ tar -xzf LEDA-6.3-free-fedora-core-8-64-g++-4.1.2-mt.tar.gz      tar: This does not look like a tar archive     tar: Skipping to next header     tar: Exiting with failure status due to previous errors      However, gunzip followed by tar -xf works just fine:               $ gunzip LEDA-6.3-free-fedora-core-8-64-g++-4.1.2-mt.tar.gz     $ tar -xf LEDA-6.3-free-fedora-core-8-64-g++-4.1.2-mt.tar     # no error      Can anyone tell me why this could be?- I'd want the standard `tar` command to work all the time.


title: sed's c command outputs current line no matter what

text: Here's what I do:               $ echo '1     2     3' | sed -n '         x         c\     test         x     '     test     test     test      Is it expected behavior? I'm running `gnu sed 4.2.1`.


title: Where to store media files on a shared linux server

text: I want to start using our home server as a media server for movies and shows, the question is where is the most appropriate place to store them? The most appropriate places seems to be:   * /var   * My user directory   * Create a new user specifically for media and store stuff there Ideas or suggestions?


title: Choosing distro for old PC, any compatibility issue to look out for?

text: So I need to install an OS on a quite old PC. 1.6GHz CPU, 512 RAM. I had no idea about this earlier today, so I tried to install ElementaryOS (12.04 Ubuntu derivative). GUI was useless, so I switched to console to at least find out system specs. However, one thing I noticed about GUI is that bottom dock-menu and top-bar are fine, but the main area of desktop split into two identical parts. Each half was displaying the same thing but the picture became extremely narrow. Also, desktop background picture was in some very strange colors, a lot of green and red. Like as if we only had 3 bits for each of RGB components. I have never seen anything like this before. However, I realised that I should find a lightweight distro for this PC. I would also like a bit more MSWindows- like interface (I am not going to use this computer, and the people there are more used to Windows. I liked the view of Lubuntu screenshots. Seems very simple and the system requirements are low. However, has anyone encountered a graphical bug like this before? Could it be that it happens again? This splitting image makes the system unusable. ### Some system specs photos ![sudo lshw -short](http://i.stack.imgur.com/dCGe6.jpg) ![sudo lshw : CPU](http://i.stack.imgur.com/9zTV5.jpg) ![sudo lshw : VGA controller](http://i.stack.imgur.com/Zd9Wz.jpg)


title: Graphics on boot like the backtrack linux or the Gentoo live DVD after you press alt+F1 on boot

text: Would like to find a good tutorial on how to make a boot splash similar to the one on backtrack {3,4,5}. It has all of the terminal text that you would see on a normal boot up but it has a nice border. Another example is the gentoo live DVD, a picturesque title bar that has the Gentoo logo on it. It seems to me that it is able to put the graphics into the virtual console. I would like to find a way to make programs take advantage of this and make my boot up screen look cooler as well. I'm running gentoo X86_64 with GCC -v gcc version 4.6.3 (Gentoo 4.6.3 p1.6, pie-0.5.2)


title: Building binutils - lfs - error while 'make'

text: I'm going to build my own Linux from scratch, but I've got an error while running 'make' for binutils in chapter 5 I get some errors. The output of 'make' is here: http://pastebin.com/8aVz6jfd There is output of version-check.sh               enedil@linux-from-scratch:~$ bash version-check.sh      bash, version 4.2.45(1)-release     /bin/sh -> /bin/dash     Binutils: (GNU Binutils for Ubuntu) 2.23.2     bison (GNU Bison) 2.5     /usr/bin/yacc -> /usr/bin/bison.yacc     bzip2,  Version 1.0.6, 6-Sept-2010.     Coreutils:  8.20     diff (GNU diffutils) 3.2     find (GNU findutils) 4.4.2     gawk: not an option: --version     /usr/bin/awk -> /usr/bin/mawk     gcc (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3     (Ubuntu EGLIBC 2.17-0ubuntu5) 2.17     grep (GNU grep) 2.14     gzip 1.5     Linux version 3.8.0-31-generic (buildd@panlong) (gcc version 4.7.3 (Ubuntu/Linaro 4.7.3-1ubuntu1) ) #46-Ubuntu SMP Tue Sep 10 20:03:44 UTC 2013     m4 (GNU M4) 1.4.16     GNU Make 3.81     patch 2.6.1     Perl version='5.14.2';     GNU sed version 4.2.1     tar (GNU tar) 1.26     s: line 33: makeinfo: command not found     Texinfo:      xz (XZ Utils) 5.1.0alpha     gcc compilation OK      My distro is Ubuntu 13.04.


title: AltGr key combinations through Qtnx

text: I started using Qtnx, and it works great. I have a problem accessing some keyboard characters though. I am using a french keyboard (azerty-like), and every character is mapped correctly with qtnx, except for some `AltGr` keys, which are needed for characters such as `#{[|`\^@]}`, which are in the top row (along with all the digits). I need to be able to write these characters! Both computers (the one running Qtnx, and the one being remotely accessed) use Ubuntu 10.04. Apart from switching to a US keyboard layout, is there another solution?


title: How to find multiple strings in files?

text: I use the following command to find files with a given string:               find /var/www/http -type f | xargs grep -iR "STRING1"      But how can I find files which include "STRING1" OR "STRING2" OR "STRING3"? This code doesn't work:               find /var/www/http -type f | xargs grep -iR "STRING1" | xargs grep -iR "STRING2"


title: Replace variable read from a text file (so they can be interpreted)

text: I tried several stuff with not luck so maybe one of you experts can help me (I hope!). I want to store in a text file some select statement that contain variables like a date:               $ cat res.txt     select field1, field2 from log and log_time~'"${TODAY}"*'      I want to use a script that will parse this file and for each statement, execute it. Of course, `${TODAY}` will be replaced with a variable. Unfortunately, the `${TODAY}` is never replaced by a date when I read the file... Is there a way to achieve this? UPDATE: Let say that I want to iterate through a file that containts some sql statements, and I want to execute them using psql (postgres) Here is the file:               $cat sql.res     select path from log where log_host='toto' and log_time~'"${TODAY}"*' and log_msg='POLICY MISSING' and entry_status!='ACK' and path~'^/logs-${cli}/"${THREE_MONTHS_AGO}"_[0-9][0-9][0-9][0-9][0-9][0-9](_[0-9]{1,2}\.|\.)log(ptr|initial_ptr|account_ptr)?\.bz2$';      Now in a bash script, I want to:               $cat script.sh     TODAY=$(date "+%Y-%m-%d")     THREE_MONTHS_AGO=$(date -d "$TODAY -91 days" "+%Y-%m-%d")     THREE_MONTHS_AGO_2=$(date -d "$TODAY -92 days" "+%Y-%m-%d")     ONE_MONTH_AGO=$(date -d "$TODAY -36 days" "+%Y-%m-%d")     ONE_MONTH_AGO_2=$(date -d "$TODAY -37 days" "+%Y-%m-%d")     YESTERDAY=$(date -d "$TODAY -1 day" "+%Y-%m-%d")     while read item; do         psql -P pager=off -t -c "$item" log | sed -e 's|^ *||' -e '/^$/d' > result.txt     done < sql.res      Unfortunately, the variables are not used in the script. So I have tried eval. I have like this:               $while read item; do         c=$(echo $item | sed "s:':@:g" | sed "s:|:EE:g" | sed "s:(:AA:g" | sed "s:):BB:g" | sed 's:]{:TT:g' | sed 's|\.|OO|g')         b=$(eval echo ${c} 2>&1)         d=$(echo $b | sed "s:@:':g" | sed "s:EE:|:g" | sed "s:AA:(:g" | sed "s:BB:):g" | sed 's:TT:]{:g' | sed 's:OO:\\\.:g' )         echo  "-> $b"     done < sql.res      But I have some issues with               \.      I am unable to replace this by something and then revert it. that's where I am now. If someone could help me at this point it will be very appriated


title: KDE becomes slow

text: I experience problems with KDE 4.11.1 on Arch Linux. It suddenly becomes laggy and unresponsive and just as suddenly returns to the normal state after some time. Normal CPU load (KSysGuard): ![Normal CPU Load](http://i.stack.imgur.com/UQmLh.png) Current CPU Load: ![Current CPU Load](http://i.stack.imgur.com/2GUrn.png) There are no suspicious processes in the Process Table tab and even if I kill all processes not related to KDE or System, the situation does not change. CPU Load is shared between processes in the usual proportion: most of CPU is consumed by the application I interact. How can I find the cause of this abnormal CPU consumption?


title: tar '-u' operation

text: When adding an updated version of a file to a tar file using '-u', and looking at the tar file with '-t', I notice that a newer version gets added to the end (the tar file also increases in size); both showing with the same name, and no other info. This process can be repeated. After un-taring it with '-x', the correct, newest version is produced (I assume tar actually un-tars all, but newer versions keep over-writing older ones). As the older versions are apparently kept, is it possible to (1) get more info (e.g., date created or archived) on the versions kept when using '-t', (2) selectively delete certain older versions (--delete removes all), and (3) un-tar a specific older version as opposed to using '-x' only which gives the newest (for which one would need to first understand (1), obviously)? I am working under Ubuntu 12.04, in case this depends on distro/version.


title: Writing a suspend-aware program in linux

text: Programs that depend on physical time, such as jackd and its clients, do not play well with software suspend of a laptop in linux. I would like to fix a client that starts issuing plenty of "timing errors" by letting it disconnect before software suspend and reconnect on resume. Can this be done from the client, without the need for system configuration? I know I could kill the program by editing system scripts, but is there an interface in linux to wait for suspend events directly, and without root permissions? Are you aware of programs that depend on physical time but handle suspend correctly?


title: ProxyPass with Gollum wiki

text: I'm trying to run Gollum, a wiki that uses git, on a Debian server for personal use. Launching it without any command line options makes it listen to to `http://localhost:4567`, which I can access just fine, even from PCs on the same LAN (with the right IP). However, I want to access it through `http://x.x.x.x/gollum`, so I added these lines to `apache2.conf`:               ProxyPass /gollum/ http://localhost:4567/     ProxyPassReverse http://localhost:4567 /gollum/      Accessing `http://x.x.x.x/gollum/home` (/home is the main page of the app) works, but it'll only show the html of the page, without css, javascript, images, or even the links working. The `error.log` file is full of errors like these, just to give an example:               File does not exist: /usr/share/javascript/editor, referer: http://192.168.1.68/gollum/home     File does not exist: /usr/share/javascript/gollum.js, referer: http://192.168.1.68/gollum/home      In the html of the page, if I inspect it with Firefox, the links for the items above are all written, for example, like this: `src="/javascript/gollum.js"`. If I write the url of the files directly, `http://localhost/javascript/gollum/gollum.js`, the right file will load. So, how can I make the site work from `http://localhost/gollum/`? Am I doing the redirection wrong or can this be because gollum doesn't support being deployed this way?


title: Where are my emails stored on CentOS 5.6

text: I have a CentOS 5.6 VM installation and currently have a handful of emails that I would like to get access to. When I run `mail` as root, I get:               [root@dev mail]# mail     Mail version 8.1 6/6/93.  Type ? for help.     "/var/spool/mail/root": 11 messages 11 unread     >U  1 logwatch@www.crmpicco.d  Mon Feb 17 10:06  44/1625  "Logwatch for dev.localdomain (Linux)"      Where is that file stored? I would like to send it on to someone for review. I can't see it in `/var/spool/mail/`.


title: awk - get input from both file and STDIN?

text: Is it possible to get input from both file and the terminal? I wish to ask the user something in the `END` portion of the awk script. That input should be typed in by the user and not read from the file which had the data to be processed.               END {       getline choice       if(choice == "Y")         print "OK"     }      But choice is read off the input file.


title: How can I crop a 1920x1200 monitor to 1920x1080?

text: I have just purchased a 1920x1200 monitor, and have some situations where I want to force the output to the more common 1920x1080. However, I don't want to distort the output, and would prefer a "cropping" black bar at the bottom. Some have suggested using `xrandr` `fb` and `transform` in the general case, but I cannot understand how `transform` works. Is this approach suitable for my case, and if so, what command would I use? ==EDIT== From `man xrandr`                  --transform a,b,c,d,e,f,g,h,i               Specifies a transformation matrix to apply on the  output.  Automati‐               cally  a  bilinear  filter is selected.  The mathematical form corre‐               sponds to:                      a b c                      d e f                      g h i               The transformation is based on homogeneous  coordinates.  The  matrix               multiplied  by  the  coordinate vector of a pixel of the output gives               the transformed coordinate vector of a pixel in the  graphic  buffer.               More precisely, the vector (x y) of the output pixel is extended to 3               values (x y w), with 1 as the w coordinate and multiplied against the               matrix. The final device coordinates of the pixel are then calculated               with the so-called homogenic division by the  transformed  w  coordi‐               nate.   In  other words, the device coordinates (x' y') of the trans‐               formed pixel are:                      x' = (ax + by + c) / w'   and                      y' = (dx + ey + f) / w'   ,                      with  w' = (gx + hy + i)  .               Typically, a and e corresponds to the scaling on the X and Y axes,  c               and  f  corresponds to the translation on those axes, and g, h, and i               are respectively 0, 0 and 1. The matrix can also be used  to  express               more  complex  transformations  such as keystone correction, or rota‐               tion.  For a rotation of an angle T, this formula can be used:                      cos T  -sin T   0                      sin T   cos T   0                       0       0      1               As a special argument, instead of passing a matrix, one can pass  the               string none, in which case the default values are used (a unit matrix               without filter).


title: How to upgrade to “Mono v3” on openSuse 12.2

text: I have mono 2.10.9 installed on a VM with openSuse version 12.2. I'm trying to find a distribution for the latest v3 Release of Mono which I can use to upgrade the version of mono that I have installed. I cannot find any distribution of Mono 3 for openSuse and I'm wondering how to go about upgrading to Mono 3 (if it's possible). Please note I come from mainly a Windows background and while I have used Unix in the past (SCO Unix), the Unix world has changed a lot since I last was involved with it. I'm sure I can get mono to build on openSuse, but it's the number of other dependencies that are required, their versions etc; and I'm just not comfortable enough with the environment yet to get a grip on it all. I hope that someone out there can point in the right direction.


title: Printing maps/cartoons/text saved as a picture/etc

text: What is the best way to print maps/cartoons/text saved as a picture/etc., so pictures that are not photos? The standard routines seem to blur and soften the printed picture, which is probably reasonable for photos, but gives horrible results for pictures that have very sharp features.


title: How do I find corrupted archive files?

text: I have a lot of zip files. Some are not downloaded correctly and are corrupted. I want to remove them. Is there a way to find the corrupted archives in bash?


title: ssh fails silently

text: I have noticed that when I execute a command via `ssh`:               ssh myserver.mydomain.com "w"      and the command fails, `ssh` does not print any error. Lets say, I have misspelled the hostname of my server and `myserver.mydomain.com` does not exist. I would have expected, `ssh` to report something about `unable to connect to server`. But this is not what happens. Instead, `ssh` just prints nothing. Now, I know that I can get the return code of the last command with `$?`. But this is not enough. I am using this in a script and I would appreciate if `ssh` would be more specific. In `man ssh` there is option `-v`, which however is for debugging and prints way too much info. Is there any way to make `ssh` print the reason for not succeeding?


title: make ASUS PCE-N15 driver errors on SteamOS

text: I am trying to install drivers for my wireless network card, thankfully the card does have up-to-date drivers which are suppose to be compatible with Debian (I am running SteamOS which is based on Debian I understand), I got them from here: http://www.asus.com/Networking/PCEN15/HelpDesk_Download/. The readme contained therein says I should:               1. Change to Super User        sudo su     2. Compile driver from the source code         make     3. Install the driver to the kernel        make install        reboot      When I run 'make' I get the output: > make -C /lib/modules/3.10-3-amd64/build M=/home/desktop/Downloads/Linux > modules make[1]: Entering directory `/usr/src/linux-headers-3.10-3-amd64' CC > [M] /home/desktop/Downloads/Linux/base.o > /home/desktop/Downloads/Linux/base.c: In function ���_rtl_init_mac80211���: > /home/desktop/Downloads/Linux/base.c:319:6: error: > ���IEEE80211_HW_BEACON_FILTER��� undeclared (first use in this function) > /home/desktop/Downloads/Linux/base.c:319:6: note: each undeclared identifier > is reported only once for each function it appears in > /home/desktop/Downloads/Linux/base.c: In function ���rtl_action_proc���: > /home/desktop/Downloads/Linux/base.c:858:32: error: ���struct > ieee80211_conf��� has no member named ���channel��� > /home/desktop/Downloads/Linux/base.c:859:32: error: ���struct > ieee80211_conf��� has no member named ���channel��� > /home/desktop/Downloads/Linux/base.c:861:25: error: > ���RX_FLAG_MACTIME_MPDU��� undeclared (first use in this function) > /home/desktop/Downloads/Linux/base.c: In function > ���rtl_send_smps_action���: /home/desktop/Downloads/Linux/base.c:1414:16: > error: ���struct <anonymous>��� has no member named ���sta��� > /home/desktop/Downloads/Linux/base.c:1415:24: error: ���struct > ieee80211_conf��� has no member named ���channel��� make[4]: *** > [/home/desktop/Downloads/Linux/base.o] Error 1 make[3]: *** > [_module_/home/desktop/Downloads/Linux] Error 2 make[2]: *** [sub-make] > Error 2 make[1]: *** [all] Error 2 make[1]: Leaving > directory`/usr/src/linux-headers-3.10-3-amd64' make: _*_ [all] Error 2 I am not sure what is going wrong and how to fix it...


title: Visitors cannot reach my local apache server

text: I have a machine running the client of noip to provide dynamic DNS. This machine is in a network where I put its ip on the DMZ because I want visitors acessing its services. I am succesfull on access it inside my network both by the local address network and by the external IP of the network and by the name I have registered on no-ip. Though people outside my network are finding impossible to connect to my machine. I could confirm the access impossibility because if I try to access the address through a web proxy, the output is libcurl couldn't connect, timeout. Until the last week I had a colleague of mine that was accessing the service normally. But since then nothing was done and the service it is unavailable for him. Ps: If you know a better local to ask my question or a suggestion where I could post my question or for who I could do that, feel free to give it. Any help is welcome. Thanks beforehand


title: Passwordless ssh login not with disabled direct console root login

text: We have the centralized server which has passwordless SSH configured to access other Linux servers within our environment. The issue we are facing is that when we disable root direct console access on Linux servers then passwordless SSH doesn't work. It asks for the password. Is there any workaround for this so our passwordless SSH works with the disabled direct console root login. The following file is where I am adding the no option. /etc/ssh/sshd_config:               PermitRootLogin no


title: Execute in Place an encrypted ram drive

text: I have found a few old posts claiming that `tmpfs` can execute in place. Is this true? If so, how? If not, is there a ram drive alternative? Can this be done with a ram drive that is encrypted? If so, how?


title: Bash copy all files that don't match the given extensions

text: When I import pictures from my camera in Shotwell, it also imports the video clips. This is somewhat annoying, as I would like to store my videos in another folder. I've tried to write a bash command to do this, but have not had success. I need a command that meets the following requirements:   * Locate all files in a directory structure that do not have an extension of .jpg, .png, .gif, or .xcf (case insensitive).   * Move all of these files into a target directory, regardless of whether the file names or directory paths contain spaces or special characters. Any help would be appreciated! EDIT: I'm using the default shell in Ubuntu, meaning that some commands are aliased, etc. EDIT 2: I've attempted this myself (not the copy part, just the listing of files part). I turned on extglob and ran the following command:               $ ls -R /path | awk '       /:$/&&f{s=$0;f=0}       /:$/&&!f{sub(/:$/,"");s=$0;f=1;next}       NF&&f{ print s"/"$0 }'      This lists everything. I tried using grep on the end of it, but haven't the foggiest idea of how to get it to not match a pattern I give it. The extglob switch didn't help much with grep, even though it does help with other commands.


title: How to start x server on another display?

text: I want to connect external monitor to my laptop but I can't manage it properly. My setup is: Arch Linux x64 (xfce) on Dell l702x with Bumblebee and HDMI -> DVI adapter monitor. I want to have that just as regular dual display, with common mouse pointer and ability to move windows between both screens. Since HDMI port in my laptop is connected to Nvidia card, I've followed that help file: https://github.com/Bumblebee-Project/Bumblebee/wiki/Multi-monitor- setup but to no avail. I've found way to get something on second screen (so it's definitely working) - I simply need to do `echo DISPLAY=:8.0` (that's default virtual port) and since then everything will be started on the external screen BUT not X server, which always starts on my laptop main screen despite of any configuration changes. I can share cursor thanks to `synergy` (that works fine) but I can't resize anything on external screen, nor move windows, alt+tab also doesn't work. All answers I've found are about starting another X server on external display so how that can be done? Unfortunately `DISPLAY=:8.0 startx` (or `primusrun startx` or `optirun`) just ignores display, it starts on my laptop screen. I've tested a lot of `xorg.conf` options (all of them are being unfortunately ignored), one big difference I found is that `xrandr` shows always only one display, i.e.:               $ DISPLAY=:0.0 xrandr     Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 32767 x 32767     LVDS1 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 382mm x 215mm        1920x1080     60.01*+  40.01          1400x1050     59.98          1280x1024     60.02          1280x960      60.00          1024x768      60.00          800x600       60.32    56.25          640x480       59.94       VGA1 disconnected (normal left inverted right x axis y axis)     HDMI1 disconnected (normal left inverted right x axis y axis)     DP1 disconnected (normal left inverted right x axis y axis)     VIRTUAL1 disconnected (normal left inverted right x axis y axis)      and               $ DISPLAY=:8.0 xrandr     Screen 0: minimum 8 x 8, current 1920 x 1200, maximum 16384 x 16384     HDMI-0 connected primary 1920x1200+0+0 (normal left inverted right x axis y axis) 518mm x 324mm        1920x1200     59.95*+        1920x1080     60.00          1680x1050     59.95          1600x1200     60.00          1280x1024     60.02          1280x960      60.00          1024x768      60.00          800x600       60.32          640x480       59.94        So basically how can I start X server on external display? Ideally that would work on both screens like any regular setup, but even that would be better than current state.


title: Make XServer ignore the mouseclick that woke up monitor from sleep

text: I have a ARM-Box with a touchscreen, running a Debian variant. Every time I tap the touchscreen, the monitor turns on, but the now visible application receives a mouse click. Can I tell the XServer to drop the click that reactivated the monitor, or is this expected behavior and cannot be turned off? Additional Information: The display is also woken up by a PIR-Sensor that executes the following commands (via GPIO and Python):               xset dpms force on     xset +dpms     xset dpms 30 30 30


title: How to make local mirror of a website with a confirmation popup?

text: I need to get a local copy of a website which requires confirming one's age before displaying content. No complex forms, just a checkbox and a button, "yes, I'm adult". I tried to use `wget` but with no success, it only downloads this initial screen and nothing more. Httrack failed, too. I believe the confirmation info is stored in a cookie file, and I think I found out which one it is. So I copied it using the cookie.txt export chromium extension, then saved it to .txt and tried `wget` once again with `\--load- cookies` option, but it still doesn't work. How do I download website such as this one? Am I misusing `wget` or maybe there's a better way to do this? **EDIT:** OK, DownThemAll seems to do the work. Finally, I succeeded with `wget` as well, using               wget -mpkrl 0 http://example.com      maybe `-rl 0` was what I was missing previously. After investigating the page source I found that there's no reloading/redirecting involved, subpages are downloaded correctly and the confirmation screen is just an `iframe` on top of the page, so I can get rid of it with some simple script. _(In this particular case messing with cookies eventually was not necessary, so I'm not posting this as an answer.)_


title: SUDO: Username condition in sudoers file

text: I'm trying to allow my user (via `sudo`, launched in a script) to copy a file from their home to a web directory. Command would be:               sudo cp /home/$LOGNAME/file_source /var/www/$LOGNAME_file_dest      So i added the following line in my sudoers file:               %users ALL=(ALL)NOPASSWD:/bin/cp /home/$LOGNAME/file_source /var/www/$LOGNAME_file_dest      This doesn't quite works, because `sudo` asks me for a password and it should not. I guess this is a problem with the `$LOGNAME` variable that is not interpreted in sudoer file or somehthing like that. I almost forgot to mention that I'm a control freak, this has to be a very strict condition, no `*` or anything else tolerated. Has anyone a solution to such a problem or should I go the painful way and allow 1 by 1 user to `cp` his file to the `/var/www` directory?


title: Auto-login using nodm and ecrpytfs on the home folder

text: I am trying to secure a Linux system to prevent offline access to the home directory (i.e. someone takes the HDD and mounts it on their system), which I've done with `ecryptfs`. I use `nodm` which boots my system into a xsession running an application from that home directory. However, now that I've added `ecryptfs` my xsession doesn't launch... I have to go to a TTY and login first. The question is, why can't I use ecrpytfs on my home directory, and have something like nodm (or another autologin) decrypt the home directory and run the application on bootup?