title: Suggested setup for an ultra-lightweight text-based programming environment in linux

text: I am looking for suggestions for a setup for my particular needs. I haven't done much linux since college and want to get back into it as a hobby. I have some not-too-powerful hardware (512 MB ram, single core). I want to do everything via text-based shells and editors, such as vim. My goal is to never touch the mouse. I need the ability to have multiple shells open at once, one running a web server, one running vim, one running my application build pipeline, another one for ad-hoc shell commands such as wget, grepping and untarring, etc. I need to be able to open new shells and switch between shells quickly with the keyboard. But even though I want multiple shells, I do **not** want a graphical desktop environment. I don't ever want to be tempted to use the mouse; part of my purpose is to force myself to learn the command-line way of doing various tasks. I also want to be able to take advantage of my large monitor, running vim with a couple hundred columns dipslayed. Is this possible?


title: Batch conversion of Module files with XMP

text: I have the following script to convert a big bunch of .MOD and .XM files into Wave format:               #!/bin/bash          for f in ./XM.* ./MOD.*         do         xmp $f -d wav -o - | ffmpeg -i - -acodec libmp3lame -ab 320k "$f.mp3"     done      But it doesn't work as expected. The program just hang up. It creates the .wav file but nothing more.(Doesn't write in it) Even the -vvv switch doesn't give any information. The strange thing is: if I prepend "strace", it's working fine. Any ideas/workarounds?


title: How is the inherited file descritor vulnerability dealt with in Unices?

text: Ulrich Drepper describes a vulnerability in programs that have open file descriptors then they `fork()` and `execve()` without lots of very careful locking in place. He also talks about new kernel additions to fix this problem in Linux. How is this dealt with on other systems?


title: Attempted assignment to non-variable?

text: We can use arithmetic operations inside shell script function:               function mess     {        if (( "$1" > 0 )) ; then           total=$1        else           total=100        fi        tail -$total /var/adm/messages | more     } I try to do this arithmetic operations on the function args:               #!/bin/bash     byte="Bytes"     kilo="KB"     mega="MB"     giga="GB"     function bytesToUnites() {     if (( "$1" < 1000 ))      then         echo $1" "$byte     elif (( $1 < 1000000 ))     then         let $1/=1000         echo $1" "$kilo     fi     }          bytesToUnites 28888 But I get this error:               line 12: let: 28888/=1000: attempted assignment to non-variable (error token is "/=1000")     28888 KB How can I fix this?


title: Why are updates pushed to Fedora's updates-testing repos initially invisible?

text: I follow various bugs on Red Hat Bugzilla, and I just received a notification from the Fedora Update System that a new package was available for testing that supposedly fixes a bug I was interested in. I wanted to test it, so I tried to follow the instructions. Unfortunately, although the packages are described as having been "pushed to updates-testing", I see no evidence that they are actually there yet. It seems somewhat silly to publish a command for testing an update that initially _doesn't work_ , but this is apparently what they are doing on a regular basis! I tried a couple of things:   1. Commented out `mirrorlist` and uncommented `base-url` in `/etc/yum.repos.d/fedora-updates-testing.repo` to make it use (what I _believe_ to be) the "master" public download site   2. `yum clean all` but these made no difference to the outcome - still no new packages available, according to yum. Details: It's mesa-libGL (and the other mesa packages) for Fedora 14.


title: What makes a portable mp3 player work well with Linux?

text: I'm in the market for a new portable mp3-player, and will be connecting it mostly to a Linux box, but occasionally to a Windows Vista machine as well. I'm wondering what qualities I should be looking for in a music player that suggest good out of the box Linux support. Having struggled to get my iPod to play nicely with Linux on a consistent basis, I'm hoping that I can find something that offers better native Linux support. I've noticed a couple things in my search thus far:   1. Ogg Vorbis support and "Linux Compatible" are highly correlated   2. Linux Compatible is often qualified with something like "support only for data transfer"  Are these the only sorts of clues I'll be able to follow? I'd appreciate any advice on what to look for, or examples of products that do it right.


title: sh startup files over ssh

text: I have some important commands I need to execute before any sh shell starts. This is required for passing SSH commands in the SSH command (`ssh host somecommand`) and other programs that run commands. In my `.profile` I have this:               ihammerhands@wreckcreations:~> cat .profile     #specific environment and startup programs     export PS1="\u@wreckcreations:\w> "     export PYTHONPATH=~/python/lib/python2.4/site-packages     export PATH=$PATH:~/bin:~/python/bin      However, this fails:               W:\programming\wreckcreations-site\test-hg>ssh name@host echo $PATH     Enter passphrase for key '/home/Owner/.ssh/id_rsa':     /usr/local/bin:/bin:/usr/bin      Notice the missing PATH options What is the proper name for the sh profile? Note: I do not have root access and don't want this applied to other users. Is there another way to do this? * * * EDIT: It appears `/bin/sh` links to `bash`, which isn't surprising. What is surprising is that my profile is still ignored. Any suggestions?


title: What is the difference between shared memory in early unix systems vs modern unix systems?

text: How could processes share memory in early versions of UNIX version modern implementations of shared memory?


title: Looking for ARM- or MIPS-based computer (netbook or similar size) to play with

text: I am bored and want to play with a netbook or other small computer. Can anyone recommend something? Requirements:   1. ARM or MIPS CPU   2. Can run Windows CE 6 and/or Linux (preferably dual-boot)   3. Linux distribution must be full-fledged (for the architecture, i.e. no single-user toy GUI)   4. Costs less than 400 Euros (although a cool machine can cost more)   5. Wireless LAN, any speed   6. USB ports, 1.1 or 2.0   7. SD card reader would be nice but is not necessary   8. Slot for SIM card and built-in 3G would be nice but is not necessary   9. If netbook/laptop should run when lid is closed


title: setcap error on Debian Squeeze: "unable to set CAP_SETFCAP effective capability: Operation not permitted"

text: My python script needs at least the CAP_NET_RAW capability, because it's using a pcap library, but I don't want to use sudo (and in fact sudo causes my script to not work properly, with the script's use of the subprocess module). When I try `sudo setcap cap_net_raw=pie test.py` I get `unable to set CAP_SETFCAP effective capability: Operation not permitted` When I do `sudo getcap /sbin/setcap` I get no output, so I have a feeling that setcap needs the CAP_SETFCAP capability? I've only found out about "capabilities" today, and from a quick search I get the feeling that setcap should work out of the box, so I'm lost. * * * * * * Update: I should have mentioned that this is on a Virtual Private Server.               $ df -T     Filesystem    Type   1K-blocks      Used Available Use% Mounted on     /dev/simfs   simfs    26214400  10373184  15841216  40% /     tmpfs        tmpfs      817152         0    817152   0% /lib/init/rw     tmpfs        tmpfs      817152         0    817152   0% /dev/shm          $ cat /etc/fstab     proc  /proc       proc    defaults    0    0     none  /dev/pts    devpts  rw          0    0


title: What are high memory and low memory on Linux?

text: I'm interested in the difference between Highmem and Lowmem:   1. Why is there such a differentiation?   2. What do we gain by doing so?   3. What features does each have?


title: How do I modify the ci command in vim

text: Just like "ci(" changes everything between parentheses, I want "ci$" to change everything between dollar signs (for editing LaTeX.) Is this possible?


title: How to execute php file as different user securely?

text: I want to confirm that my thoughts are correct as this is about security matter. We have web based application which is using db2 database. db2 runs under the `db2inst1` user. Now we want users of the web application to be able to restore db2 backup images into a database that we call playschool. Using this playschool they "play around" and make no harm to the production database. To do so PHP script `db2restore` needs to be executed via PHP function `exec()`. **Is it secure enough** to make sure that no one can misuse and run db2 commands as PHP user if:   * we add this line to `/etc/sudoers`              php ALL=(db2inst1) NOPASSWD: /opt/eduserver/bin/db2restore        * and then run inside PHP `db2restore` script this command              exec('sudo -u db2inst1 /opt/eduserver/bin/db2restore');      Note   * that not all end users will have access to run db2restore via web interface, only admin group where they 'should' know what they are doing.    * no end user had access to command line of the server.   * db2restore is not accessible via web server


title: Determine if reboot is required to update kernel?

text: I am running a server which runs on CentOS with cPanel (latest version) and I have it set to automatically update using yum. Since it needs to be rebooted in order to update the kernel (and possibly other things), I was wondering if there's any way to figure out if a reboot is required? **EDIT:** The server is a VPS and it's running on OpenVZ. Because of the way OpenVZ works, there's no `/boot/vmlinuz` and `yum list installed kernel` doesn't work either.


title: How can I encrypt a device with loop-aes under Linux?

text: Using Fedora/Ubuntu, how can I do it?


title: Upload file to ftp server using commands in shell script?

text: I want to upload a file from my Linux server to some FTP server. I know we use `put` and `get` commands to upload and download files and the `sftp` command to connect to the FTP server. But I wanted to do all this in one shell script and I have no idea how to connect to FTP using the `sftp` command within some script to upload some file. This is what I know but I don't know how it will work inside one sh script.               sftp -v -oIdentityFile=path user@server     put localPath ftpPath      Can anyone help me?


title: Xen VNC - VGABIOS Rom Missing

text: I've had a Xen server with VNC running successfully for almost a year now. However, recently, when I tried to connect to an HVM domain with VNC, it displays a blank screen. When I looked in the QEMU log, I found this message:               qemu-system-i386: pci_add_option_rom: failed to find romfile "vgabios-cirrus.bin"      The dom0 is Ubuntu 13.10. I'm not certain why this file appears to be missing, as it exists in /usr/share/qemu. I recently upgraded from Ubuntu 12.10 to 13.10 (with 13.04 as an intermediary version). Does anyone know how to fix this issue? **UPDATE:** I think I've solved my issue. After looking all over the internet (I'd already looked for a while before posting this question), I found a message on the Xen mailing list (http://lists.xenproject.org/archives/html/xen-devel/2013-06/msg03008.html). This message says that they fixed an issue when upgrading to Xen 4.3 by adding the line:               device_model_version = ' qemu-xen-traditional'      to the domain's configuration file. I added this to the domain's config file and restarted the domain. Now, my issue appears to be fixed.


title: Error: permission denied on key 'fs.file-nr'

text: # sysctl -w fs.file-nr=131072     error: permission denied on key 'fs.file-nr'      Same issue when I edit /etc/sysctl.conf and try sysctl -p. Any reason why I cannot edit this value? I am on CentOS 6.5


title: Can't install GRUB. Dual Booting Kali Linux with Windows 7. Two different HDDs

text: I'm having trouble installing Kali on a MSI GE70 2OE with a SSD HD and a standard SATA HD. I've installed W7 on the SSD, and then partitioned my SATA in two parts: One 800Gb for W7 and another 200Gb of empty space to install Kali. There's as well 2Gb occupied by a FreeDos installation on my SATA that I've left just in case. When installing Kali my Atheros Killer 2200 netword card is not recognized. Let's put aside this problem and the fact that I can't install a package administrator. Finally I can't install GRUB. When starting the GRUB installation the only SO that finds is FreeDos, that is in my SATA along with Kali. I've tried all possibilities to install GRUB but none works:   * `/dev/sda` -> MBR for SATA disk (I think). It doesn't work.   * `/dev/sda5` -> Partition for Kali. ext4. It doesn't work.   * `/dev/sda6` -> SWAP space, 10Gb. ext4. Doesn't work.   * `/dev/sdb` -> W7 on my SSD, 128Gb. NFTS. Doesn't work. I think I didn't try `sda2` where my FreeDos is, but I guess it wouldn't work anyway. How can I install GRUB under those premises? Ideally I would like to dual boot along with the W7 on the SSD.


title: script does not behave properly when called by acpi and udev events

text: I have the following files in /etc/acpi/events and /etc/udev/rules.d /etc/acpi/events/lidclose               # Pass all events to our one handler script     event=button/lid     action=/etc/acpi/monitors.sh      /etc/udev/rules.d/80-monitor.rules               # change monitor settings when monitor is plugged in or o$     ACTION=="change", SUBSYSTEM=="drm", HOTPLUG=="1", RUN+="/etc/acpi/monitors.sh"      Now, the (executable and owned by root) /etc/acpi/monitors.sh               #!/bin/sh          # default monitor is LVDS1     STATE=internal     INTERNAL=LVDS1     EXTERNAL=HDMI3          # functions to switch from LVDS1 to VGA and vice versa     function internal {         echo "Switching to internal"         xrandr --output $EXTERNAL --off --output $INTERNAL --auto         STATE=internal     }     function external {         echo "Switching to external"         xrandr --output $EXTERNAL --auto --output $INTERNAL --off         STATE=external     }     function both {         echo "Switching to both"         xrandr --output $EXTERNAL --auto --right-of $INTERNAL --output $INTERNAL --auto --primary         STATE=both     }          # functions to check if VGA is connected and in use     function externalConnected {         ! xrandr | grep "^$EXTERNAL" | grep disconnected >/dev/null     }     function lidOpen {         ! cat /proc/acpi/button/lid/LID/state | grep closed >/dev/null     }          # actual script     if ! [ $STATE == "both" ] && externalConnected && lidOpen     then         both     fi          if ! [ $STATE == "external" ] && externalConnected && ! lidOpen     then         external     fi          if ! [ $STATE == "internal" ] && ! externalConnected && lidOpen     then         internal     fi      Now, I tested the script both as root and as my user, and it worked like a charm. I also put some test output via "echo bla > /home/me/test" in it, and when called by udev and acpid it generated the output, so it is executed. The only thing is, that nothing happens with xrandr. What am I missing? How could I log the output of the script to find errors?


title: System fonts not taking effect in linux mint with both mate and cinnamon installed

text: I have linux mint 16 installed on my desktop with both the mate and cinnamon desktop environments. I have noticed that the system font settings are not used as I expect. For example, the "window title font" setting is taken from the system settings that are set within cinnamon (i.e., System Settings > Fonts from the cinnamon UI), and the "monospace font" that is used in the Terminal is taken from the settings that are set in mate, while the monospace font setting in cinnamon is ignored. I checked with a coworker who uses Debian Mint, and all analogous font settings for menus, monospace font, and titles had the expected effects. Can someone explain why my font settings are seemingly split between mate and cinnamon, and how I might resolve the issue so that my system font settings are used rather than ignored?


title: Make vim stop splitting my Git commit messages

text: Vim has this awful annoying habit of splitting my commit messages and automatically line-breaking them, rendering the second line with a red background for some reason. ![enter image description here](http://i.stack.imgur.com/cF0yU.png) How can I make vim _stop_ doing this?


title: the difference between '..' and ".." when I use ssh usr@ip 'pscp ......'

text: My Server machine run Window,and it installed Cygwin. My Client machine run linux. In Clinent machine.I do this:               [sikaiwei@login-1-2 v1.4]$ bash test.sh CHUN~19900405 sikaiwei@192.168.9.102:/ifs2/BC_MG/GROUP/sikaiwei/ssh/v1.4     start     PuTTY Secure Copy client     Release 0.63     Usage: pscp [options] [user@]host:source target        pscp [options] source [source...] [user@]host:target        pscp [options] -ls [user@]host:filespec     Options:      -V        print version information and exit      -pgpfp    print PGP key fingerprints and exit      -p        preserve file attributes      -q        quiet, don't show statistics      -r        copy directories recursively      -v        show verbose messages      -load sessname  Load settings from saved session      -P port   connect to specified port      -l user   connect with specified username      -pw passw login with specified password      -1 -2     force use of particular SSH protocol version      -4 -6     force use of IPv4 or IPv6      -C        enable compression      -i key    private key file for authentication      -noagent  disable use of Pageant      -agent    enable use of Pageant      -batch    disable all interactive prompts      -unsafe   allow server-side wildcards (DANGEROUS)      -sftp     force use of SFTP protocol      -scp      force use of SCP protocol     end      It seems warn me that I use '`pscp`' in my test.sh file worngly! But I don't. And my test.sh is:               #!/bin/bash     sshpass -p 'CHUN~19900405' ssh sikaiwei@172.16.22.53 '     echo start;     touch final_result.txt;     pscp -pw $1  final_result.txt $2;     echo end;     ';      But when I use ".." instead of '..',like               #!/bin/bash     sshpass -p 'CHUN~19900405' ssh sikaiwei@172.16.22.53 "     echo start;     touch final_result.txt;     pscp -pw $1  final_result.txt $2;     echo end;     ";      It don't repost error :               [sikaiwei@login-1-2 v1.4]$ bash test.sh CHUN~19900405 sikaiwei@192.168.9.102:/ifs2/BC_MG/GROUP/sikaiwei/ssh/v1.4     start     end      I must use '..' instead of ".." to use enviorment variable of Server machine.like               [sikaiwei@login-1-2 v1.4]$ sshpass -p 'CHUN~19900405' ssh 172.16.22.53 -l sikaiwei   "getId=$ORANGE;echo $ORANGE;ORANGE=$((ORANGE+1));echo $ORANGE;echo 'getId is '+$getId;"      The $ORANGE is variable of Server machine. So I must use '..',and how to still use $1,$2 to get arguements ?


title: Day of week {0-7} in crontab has 8 options, but we have only 7 days in a week

text: **Day-of-week: Allowed range 0 – 7. Sunday is either 0 or 7.** I found this after Googling, my question is why should both values (0,7) correspond to Sunday?


title: Completely disable the menu when I right click on the desktop (LXDE, Openbox, Ubuntu)

text: I would like to setup an old PC as a thinclient for our VMware View infrastructure. I need to disable the menu that pops up when I right-click on the desktop, along with some other things such as disabling the screen saver. This is what I have done so far:   * Disable LXDE screensaver Delete `@xscreensaver –no-splash` from `/etc/xdg/lxsession/LXDE/autostart`   * Remove right click desktop menu options Right click on desktop and choose `Desktop Preferences` Select the advanced tab and check off `Show menus provided by window managers when desktop is clicked` Edit `/etc/xdg/openbox/menu.xml` and remove everything between `<menu id=”root-menu” label=”Openbox 3”>` and `</menu>`   * Disable the LXPanel Edit `/etc/xdg/lxsession/LXDE/autostart` and comment out `@lxpanel –profile LXDE`. All of this seems to work fine, but when I right-click the desktop I still see this: ![Screenshot of the pop-up menu](http://i.stack.imgur.com/b6CJn.png) How do I kill this?


title: xkb: `ctrl:swapcaps` option messes with the escape key

text: I've been using `setxkbmap -option "ctrl:swapcaps"` to swap the capslock and left control keys, but I just recently noticed that this seems to mess up my escape key. With `xev`, I can see that pressing the escape key sends an event like:               KeymapNotify event, serial 34, synthetic NO, window 0x0,         keys:  2   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0                   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0      After experimenting without "swapcaps" set, I was able to send the same event by pressing control and escape at the same time (`<Ctrl-Esc>`). Why should the escape key be affected by the `ctrl:swapcaps` option and how can I fix it?


title: Why does Emacs make it difficult for me to have two frames open the same buffer?

text: I have 2 frames. I switch the buffer in first frame to buffer A. When I try to switch the buffer in the second frame to buffer A, Emacs brings the first frame forward. What I want is to open buffer A in both frames. Is there a setting that makes Emacs bring the other frame forward when buffer A is already opened in it?


title: Portability of "> /dev/stdout"

text: Occasionally I need to specify a "path-equivalent" of one of the standard IO streams (`stdin`, `stdout`, `stderr`). Since 99% of the time I work with Linux, I just prepend `/dev/` to get `/dev/stdin`, etc., and this " _seems_ to do the right thing". But, for one thing, I've always been uneasy about such a rationale (because, of course, "it seems to work" until it doesn't). Furthermore, I have no good sense for how portable this maneuver is. So I have a few questions:   1. In the context of Linux, is it safe (yes/no) to equate `stdin`, `stdout`, and `stderr` with `/dev/stdin`, `/dev/stdout`, and `/dev/stderr`?   2. More generally, is this equivalence "adequately _portable_ "? (I cringed as I wrote the last question, because I wish I could make it less subjective...) I tried Googling these questions, including terms like POSIX among my search terms, but none of the top hits I got were particularly germane or authoritative.


title: Locked myself out of Amazon EC2 SSH - This service allows sftp connections only

text: Doh. Locked myself out of SSH on an Amazon EC2 box after fiddling with `ForceCommand internal-sftp` in `/etc/ssh/sshd_config` in order to allow `root` log-in via SFTP. SFTP still works fine, but PuTTY dies instantly, e.g: ![PuTTY](https://dl.dropboxusercontent.com/u/233981/ssh_lock_out_username_prompt.PNG) The odd thing here is that SFTP still works fine and permits me to log-in as `root` currently (because of the changes I made) - so I've got a WinSCP window open and I can trawl through whatever I like and edit stuff. When I try to connect from another Linux box using:               ssh -i keyfile.pem ec2-user@hostname.com.au -p [portnumber]      I get the following response:               This service allows sftp connections only.     Connection to [hostname] closed.      I've successfully removed `ForceCommand internal-sftp` from `/etc/ssh/sshd_config` but I'm having trouble running `service ssh restart` remotely. When I do it from `sftp` with the `!` prefix, it says it's worked - but I can tell that it hasn't because the listening port is not changing.


title: Fedora 16: run a binary after automatic login?

text: I want to automatically login as root, and then run an interactive script. I am using Fedora 16.


title: privoxy blocks all traffic on browser configured to use 127.0.0.1:8118 proxy url

text: I'm in the process of distro hopping and in the past configuring privoxy has been a simple task. This time I am using LMDE 201403 (essentially a debian wheezy system). I've installed and started privoxy after editing the config file at /etc/privoxy/config. I added a few debug lines:               debug     1 # Log the destination for each request Privoxy let through. See also debug 1024.     debug  1024 # Actions that are applied to all sites and maybe overruled later on.     debug  4096 # Startup banner and warnings     debug  8192 # Non-fatal errors      I also added a couple of forward rules:               forward                 champ/ .     forward                 192.168.2.*/ .      but I've also tried running privoxy with theses lines commented. Same result. I'm not getting anything useful in the logs except:               2014-07-10 20:05:47.098 7f080a637700 Info: Privoxy version 3.0.21     2014-07-10 20:05:47.098 7f080a637700 Info: Program name: /usr/sbin/privoxy     2014-07-10 20:05:47.098 7f080a637700 Info: Loading filter file: /etc/privoxy/default.filter     2014-07-10 20:05:47.117 7f080a637700 Info: Loading filter file: /etc/privoxy/user.filter     2014-07-10 20:05:47.122 7f080a637700 Info: Loading actions file: /etc/privoxy/match-all.action     2014-07-10 20:05:47.122 7f080a637700 Info: Loading actions file: /etc/privoxy/default.action     2014-07-10 20:05:47.146 7f080a637700 Info: Loading actions file: /etc/privoxy/user.action     2014-07-10 20:05:47.148 7f080a637700 Info: Listening on port 8118 on IP address localhost      In my browser configured to use the proxy url 127.0.0.1:8118 all traffic is blocked. I cannot reach the privoxy configuration page at either http://config.privoxy.org/ or http://p.p/ What other debug codes would help determine what is blocking all traffic? Any ideas what might be causing this blockage? Thanks


title: How to measure network traffic usage?

text: I want to know how much bandwidth my server is using. How much in, how much out. How do I know that? I think there is a software, netstat or something that took care that sort of thing.


title: How can I ignore KDE's power-saving features for certain programs?

text: I want to use KDE Power Saving capabilities on my Desktop computer, such as suspend and screen-off. But, I want these capabilities be enabled only when some programs aren't running; for instance, I want the screen to remain awake while I am playing a movie with `vlc` or `mplayer`. For some other programs such as music players (`clementine`), vms (`vmware`), torrents (`ktorrent`), there's no problem turning the screen off, but it is (obviously) not great if the system goes to sleep. I want to be able to select which programs can suspend KDE's power-saving.


title: Binding additional keyboard shortcuts in bash

text: I like typical GUI shortcuts:   * `Ctrl-Backspace`   * `Ctrl-Del` And other typical shortcuts. Are there any ready `.bashrc` with all this shortcuts available?


title: tar -c Error Messages and Source Files?

text: During a tar archiving operation with `tar -cvf archive.tar source` does the resulting tar archive that reports a `file changed as we read it` error still contain "some version" of the source file that it reported the error on or does it completely abandon archiving that source file and move on?


title: Recover MDADM Raid 5 in LVM with badblocks

text: I'm pretty sure I'm dealing with at stuffed RAID 5 array. Two of the drives were listed as failed in `/proc/mdstat` and `mdadm`details:                  0     0       8       33        0      active sync   /dev/sdc1        1     1       0        0        1      faulty removed         2     2       0        0        2      faulty removed         3     3       8        1        3      active sync   /dev/sda1          md127 : inactive sdd1[0](S) sdb1[3](S) sde1[2](S) sdc1[1](S)           3907039744 blocks      So sdb and sdd are failed. I then ran SMART diagnosis on my drives and confirmed that I've got current pending sectors, about 1000 of them on both of the failed disks. Then running badblocks has confirmed that I do have many badblocks about. Trying to zero these out by hand would be a total nightmare, being in RAID5 which I can assemble but can't start anymore and then in LVM makes it a real pain in the ass. I think following something like this just isn't going to work. I'm open to using MHDD if people have confirmed it to work (suggestions?), it was slow when I was trying it so I aborted and instead started backing up the drives instead. http://hddguru.com/software/2005.10.02-MHDD/mhdd_manual.en.html#scanning Currently doing a ddrescue and moving the data over to other disks, hopefully will be able to make a master copy - possibly zero out stuffed drives, and then `dd` copy back to those drives. Though not knowing much about `ddrescue` I feel I'm just going to be moving my problem about instead of fixing it. http://www.gnu.org/software/ddrescue/manual/ddrescue_manual.html


title: VNC session turns undead over the weekend

text: During the week I have a single VNC session I'm working with throughout the week. However, whenever I come back from the weekend or some vacation, I can no longer connect to that session, getting a "cannot connect to host: Connection refused (10061)". When I ssh to the server and use `vncserver -list`, I **do** see my session there, and it looks very much alive; and I can open additional sessions and connect to them. If I try to `vncserver -kill` the original session, though, I get a               Xvnc process ID $ID already killed      message. What's going on here, and I can I keep my session alive over time? Server is running Redhat 6.


title: How to add gtk2 theme to KDE?

text: I'm trying to find a good GTK theme that I like for certain applications. Trouble is, I don't use Gnome-- I have OpenSUSE 12.2 x64 with KDE 4.9 only. So if I've downloaded a theme tarball, what can I do to make KDE aware of it? Is it a matter of putting it in a certain location?


title: Virtual kernel memory layout: negative values

text: i'm porting drivers for omap3-board to 3.5 kernel. When I start board I see it:               Memory: 256MB = 256MB total     Memory: 253564k/253564k available, 8580k reserved, 3226106074K highmem     Virtual kernel memory layout:         vector  : 0xffff0000 - 0xffff1000   (   4 kB)         fixmap  : 0xc04a78ea - 0xc0573f24   (   0 kB)         vmalloc : 0xc0573f24 - 0xc0573f2c   (5276 MB)         lowmem  : 0xc0573fbc - 0xc0573f30   (-1068285412 MB)         modules : 0xc03d93e4 - 0xc04a7927   (-65536 MB)           .text : 0xffff1000 - 0x00000004   (-1048576 kB)           .init : 0xfffe0000 - 0x00000380   (-796917760 kB)           .data : 0xff000000 - 0x000002e8   (-1073741824 kB)            .bss : 0xd0000000 - 0x00000100   (-1090519040 kB)     SLUB: Genslabs=11, HWalign=64, Order=0--1068023944, MinObjects=-1068023968, CPUs=-1071855052, Nodes=-1071855184      Why are values of memories so big and negative? How can I fix it?


title: mounting dropbox (for exploring the files)

text: I want to simply be able to explore a dropbox filesystem, without much additional load on CPU, memory, storage (i.e., without saving copies of the remote files locally). It seems that the official client consumes much reosurces (and would do unneccessary operations like syncing) -- http://www.lowendtalk.com/discussion/3179/dropbox-memory-usage-on-linux. Can one simply mount it (say, with FUSE, and without copying the files locally) and explore the files with the usual Unix utilities (`ls`, `du`, `cp`)? (I wanted something similar for public.me.com: `wget -r`-like or FUSE.) Dropbox-Uploader (a bash script using dropbox API to access it) could help to access dropbox in a Unix way. But unfortunately it doesn't support recursive downloading of directories (like `wget -r`), that's why I'd rather have a FUSE wrapper on top of it.


title: Update is telling me my package system is broken - the instruction to fix it doesn't work - what to do?

text: I am using Linux Mint 12 and currently have the Mate desktop running. The icon in the upper right showed their were updates. Tried to do it and it said that > The package system is broken > > Check if you are using third party repositories. If so disable them, since > they are a common source of problems. Furthermore run the following command > in a Terminal: apt-get install -f The details are: > The following packages have unmet dependencies: > > mint-artwork-gnome: Depends: gtk2-engines-clearlooks but it is a virtual > package Depends: mint-backgrounds-lisa but it is not installed sudo apt-get install -f gives this output: > Reading package lists... Done Building dependency tree   >  Reading state information... Done > > Correcting dependencies... Done > > The following extra packages will be installed:   >  mint-backgrounds-lisa The following NEW packages will be installed:   >  mint-backgrounds-lisa 0 upgraded, 1 newly installed, 0 to remove and 32 not > upgraded. 4 not fully installed or removed. Need to get 0 B/3,003 kB of > archives. After this operation, 3,265 kB of additional disk space will be > used. Do you want to continue [Y/n]? y (Reading database ... 482703 files > and directories currently installed.) Unpacking mint-backgrounds-lisa (from > .../mint-backgrounds-lisa_1.1_all.deb) ... dpkg: error processing > /var/cache/apt/archives/mint-backgrounds-lisa_1.1_all.deb (--unpack):   >  trying to overwrite '/usr/share/gnome-background-properties/linuxmint- > lisa.xml', which is also in package mint-artwork-kde 2.0.1 dpkg-deb: error: > subprocess paste was killed by signal (Broken pipe) Errors were encountered > while processing:   >  /var/cache/apt/archives/mint-backgrounds-lisa_1.1_all.deb E: Sub-process > /usr/bin/dpkg returned an error code (1) If I try and install the latest version of Chromium by double-clicking the deb file is says: > gdebi-gtk Broken Dependencies > > Your system has broken dependencies. This application cannot continue until > this is fixed. To fix it run 'gksudo synaptic' or 'sudo apt-get install -f' > in a terminal window. If I run 'gksudo synaptic' Synaptic comes up and says: > (as superuser) You have 1 broken package on your system! > > Use the "Broken" filter to locate it. The Broken filter shows: > Synaptic Broken Installed Version Latest Version Description   >  mint-artwork-gnome 2.6.20 2.6.20 Default Artwork for Linux Mint Trying to reinstall the above package gives: An error occurred The following details are provided: > E: /var/cache/apt/archives/mint-backgrounds-lisa_1.1_all.deb: trying to > overwrite '/usr/share/gnome-background-properties/linuxmint-lisa.xml', which > is also in package mint-artwork-kde 2.0.1 One easy solution is probably to not run Mate with Linux Mint (this is my first try), but just wondering if this is fixable.


title: Send a packet over the network even when its target is the local host

text: Under Linux if you send a packet to the address of one of its network interfaces, this packet is routed internally, it is never sent over the network. That's the right thing in 99.99% of the cases. Occasionally, when testing network configurations, it's useful to send a packet over a local link from the machine itself, with the machine itself as the target. How can I do this? At least for a bus-type link such as Ethernet, if not for a point-to-point link. I'm only interested in IP packets (both IPv4 and IPv6).


title: Duplex option when printing to a Windows shared printer

text: I'd like to know, if I send `lp -h 192.168.0.3 -d printer -o duplex txtfile`, supposing it's a Windows shared printer, will it make the txt file be printed in duplex? Or should I first pass it to a local printer with the Destination Printer's PPD, in order to interpret the `-o duplex` command, and have it forward to the Windows Printer?


title: Best way to make encrypted backups while preserving permissions to a windows file system

text: For my home network I wanted to buy a NAS which supports disk encryption and NFS since it is important for me that the backup is encrypted but also that it preserves owner, groups and permissions (therefore NFS). This way I thought I could use something like `rsnapshot` or `rBackup` to backup my data and get multiple snapshots. Unfortunately I didn't find any NAS which supports NFS and encryption at the same time. So I was wondering if there is any possibility to get this using an NAS which without NFS (using for example CIFS instead of NFS). So I am looking for a backup solution which meets the following requirements:   * backup to a NAS in my local network (i.e. I don't want to use a local usb drive)   * it should preserve owner, groups and permissions and symbolic links   * it should be encrypted   * there should be multiple snapshots available like in `rsnapshot` or `rBackup`   * it should be easy to access the files of a snapshot   * it should be not too slow Any ideas how to do this in detail? **Edit:** I just try to sum up the answers so far and want to ask some additional question to clarify some points. It seems to be the most flexible option to use a container, FUSE or otherwise "faked" filesystem which doesn't depend on the target device. In this approach I can use any backup script I like and the encryption is done by the client CPU. The possibilities are:   * EncFS   * Truecrypt   * dmcrypt/luks   * S3QL I am not sure if it is possible to read and write on the NAS via S3QL from two clients simultanously. Is it correct that this is no problem for the other approaches? Concerning the permissions, in any case I have just to make sure to make it work with NFS. For example I could just make my backup script to preserve _numerical_ uid/gid and setup no users on the NAS at all. EncFS seems to be the easiest solution so far. In Truecrypt and dmcrypt/luks I have to choose the containersize in advance which seems to be not so flexible as EncFS or Truecrypt. However are there any significant differences between those solutions concerning read/write performance and stability? Another interesting approach mentioned so far is to use `duplicity` as a backup script which does the encryption via `gpg` by itself.


title: Count rows with specific integer in a column

text: I have 6 columns, each with multiple rows. I want to count the number of rows which have the integer 4 or 5 in the fifth column.               A1 jhfj jdhfjkhd kdkfjjh 5 jhsdjkfh     A2 ujhf jhdfhsd  dsfkks  4 jhsdfjhs     A3 jhfj jdhfjkhd kdkfjjh 5 jhsdjkfh     A4 jhfj jdhfjkhd kdkfjjh 5 jhsdjkfh     A5 ujhf jhdfhsd  dsfkks  4 jhsdfjhs      In the example presented, the result should be three for lines with a 5, and two for lines with a 4.


title: Redirecting/grep'ing an existing shell's STDOUT

text: I run a lot of long running processes (simulations) that print progress to `STDOUT`. I occasionally forget to redirect to `STDOUT` to a file I can `grep`, and it's usually too far along to restart. **QUESTION:** Without stopping the process, is there a way I can hook into another `STDOUT`? These are always running in GNU screen with ZSH on OS X 10.7.3.


title: Credential in PPD file: Is there a way to hide it?

text: We have a copying machine that can be used as a printer. In order to do that, I have to provide a credential in plain in the `Xerox.ppd` file. Problem: Any user on the system can `grep credential /etc/cups/ppd/Xerox.ppd` no matter if CUPS allows him to use that printer. Being more restrictive on the file permissions of that file makes it impossible for users to set options like paper format and duplex/simplex, so that's no option. For example, I want `lpoptions -l` to keep working. Is there a way to overcome this?


title: What module for network card Intel Corporation Device 1521?

text: I'm installing a new server and I'm not able to figure out what module should I load to make its on-board network card work. Calling `lspci` prints:               Ethernet controller: Intel Corporation Device 1521      I tried to google, but I couldn't find **what module should I load?**


title: ssh password-less login doesn't work using proxycommand

text: I have 2 servers. I can connect to server B only using server A. In my `~/.ssh/config` file:               Host serverB       Hostname serverb       User root       ForwardAgent yes       Port 22       ProxyCommand ssh user@serverA nc %h %p      When I login to serverA and type `ssh root@serverB` It connects without asking for password, but when I type `ssh ServerB` on my local machine, it asks for ServerB's password. Why?


title: Pipe command output to input of running/backgrounded command

text: In Bash 4.X It it possible to do something like:               command that expects input &     echo some output | %1      Where %1 represents the first backgrounded command?


title: How can I print a summary of Maildir contents when logging into a shell?

text: I know this is theoretically possible, but I'm trying to avoid reinventing the wheel. I'm using Ubuntu Linux, with Maildir mailbox format. I want to put something in my .login that will parse the ~/Maildir contents and display a summary of my unread email messages. I'm running Ubuntu 13.04 (Raring Ringtail), and I use mutt for my email client, and I'm using Postfix and dovecot for SMTP and MDA/IMAP. Is there something already written that will do this? Or will I need to write something myself using Perl and Mail::Box::Maildir? It seems like this would be a common thing, but for the life of me I can't find a package or utility that will do what I'm looking for.


title: sensors Information about degree of adapter

text: In this Image (output of `sensors`): ![enter image description here](http://i.stack.imgur.com/US1bw.png) On the top, just below radeon-pci-0100, it says `temperature +511 Deg C`, does this really mean 511, will this not blow up my laptop?


title: Uncover sudoer user with root privileges which ran command X?

text: I'm the main sysadmin of a system. In the system there are 3 sudoers users with root's privileges. The system runs a script in background which check the hash of system's utilities to detect possible malicious changes. Today I was alerted that the `ssh` utility's hash changed. There weren't any updates till now, and I think one of sudoers is responsible for this. Is it possible to detect which sudoer changed the `ssh` utility?


title: Monitor what is being sent to /dev/null?

text: Just for fun:   Is there a way to monitor/capture/dump whatever is being written to `/dev/null`? On Debian, or FreeBSD, if it matters, any other OS specific solutions are also welcome.


title: Implementing load balancing on any Linux distro

text: I am thinking of implementing a load balancing solution for personal use. What I want to do, is to maximize data throughput over mobile phone Internet connections. Let me be clear: I have data plan in my mobile phone and my family have their respective data plans in their phones, too. If I can connect up to 4 phones in one (desktop) PC (through USB preferably) then I will achieve (theoretically) a faster Internet connection than any one of the 4 phones can achieve (if I connect them to a PC). That desktop computer will then act as a router for an intranet. If the above has a sound basis (I could be wrong - don't know the technologies involved in great detail), I need a how to to implement that. I have seen that the tool for the job is `ipvs` (right?) but no how to. Distro-wise the job can be done in any distro, but I know that connecting an Android phone with Ubuntu works plug and play. So If I can do it in Ubuntu, it will probably be faster than compiling everything from strach. Is there a relative how to? Is there a distro perhaps that does load balancing, and identifies USB internet connections on the fly?


title: Getting visual feedback of workspace switch in KDE

text: I've just installed KDE on Linux Mint. One feature I miss from cinnamon regarding workspaces is indication on what workspace I've just switched. I'm completely new to KDE but so far I can't find anything like this in default system.


title: Hiding Script Command Output

text: I'm building a shell script to automatically configure a specific computer with the best settings. I would like to hide all output from this script except for echo output. Is it possible?


title: Monitoring filesystem activity

text: Say, I have a program, and I want to monitor its filesystem activity (what files/directories are created/modified/deleted etc.) This program may be capable of spawning further processes, and thus, I would like to get the activity of these spawned processes too. How should I go about doing this?


title: How to go to next screen in screen

text: I have 10 screens running in detached mode. When I do `screen -r pid` I can see the output from one of them. The man page says `ctrl-a + n` will show me the next screen, but when I do it it says: `No other window.` What am I missing?


title: Debian: get package name for installed file

text: I'm connected via SSH to a PC running Linux kernel 3.11.1:               root@alix:~# uname -r     3.11.1      how can I find out which package installed this specific file or kernel version respectively? I tried               root@alix:/boot# dpkg -S vmlinuz-3.11.1      dpkg-query: no path found matching pattern *vmlinuz-3.11.1*      Other installed kernel versions can be found with **dpkg -S** :               root@alix:/boot# dpkg -S vmlinuz-3.2.23     linux-image-3.2.23-ath5kmod: /boot/vmlinuz-3.2.23-ath5kmod      My purpose: I would like to install the corresponding Linux headers for version 3.11.1 to compile a kernel module for it. **apt-cache search linux- headers** lists 15 different header versions but not that one for 3.11.1. Thank you very much.


title: ant command not found when running from the path othe than ant installation directory

text: Actually I have installed Ant in rhel5 environment and set `ANT_HOME` variable in `/etc/profile` which points to `/usr/local/ant/bin` so when I execute command `echo $ANT_HOME` it gives correct path but I get `ant:command not found` when I tried executing it from other directory. I installed it using a tar named `apache-ant-1.7.1-bin.tar.gz` and untared it. I tried the command below `ln -s /usr/local/ant/apache-ant-1.7.1/bin /usr/local/ant/apache-ant-1.7.1/bin/ant ln: creating symbolic link /usr/local/ant/apache-ant-1.7.1/bin/ant' to /usr/local/ant/apache- ant-1.7.1/bin': File exists` but when I run ant it still says command not found


title: Linux project work

text: I am a b.tech 2nd yr. student from Motilal Nehru National Institute of Technology - Allahabad. I am currently doing linux system administration course in this summer. I want to do a project work related to same also, but I don't have any idea regarding the topics on which projects can be done. Can anyone suggest some topics or any link regarding this?


title: ncurses based menus

text: How can I build an ncurses based menu? Are there any other solutions for building "menus" for use on the console? I just need an "inter-operating system" (all non-windows :P) solution. Are there any good solutions to build/create menus in perl?


title: how do I configure stunnel to serve https

text: I'm wondering if anyone has configured https using stunnel without using apache or any web server. I will be using this to replace our hudson build system which currently is running via apache https (winstone is proxyed via apache) which is kind of heavy. I was the one who configured the apache https in our hudson build system but I can't seem to understand as to how to do it the stunnel way. Here's a sample run of stunnel in my CLI:               buggedtech~$ stunnel     Reading configuration from file /usr/local/etc/stunnel/stunnel.conf     Snagged 64 random bytes from /Users/icasimpan/.rnd     Wrote 1024 new random bytes to /Users/icasimpan/.rnd     PRNG seeded successfully     Using DH parameters from /usr/local/etc/stunnel/stunnel.pem     DH initialized with 512 bit key     ECDH initialized     Certificate: /usr/local/etc/stunnel/stunnel.pem     Certificate loaded     Key file: /usr/local/etc/stunnel/stunnel.pem     Private key loaded     SSL context initialized for service https     Configuration successful     Clients allowed=125     FD=8 in non-blocking mode     FD=9 in non-blocking mode     FD=10 in non-blocking mode     Option SO_REUSEADDR set on accept socket     Error binding https to ::1:443     bind: Permission denied (13)      Thanks in advance, Ismael Casimpan :)


title: How do I learn what I can do with /proc and /sys

text: I'd like to know more about the advanced uses of the `/proc` and `/sys` virtual filesystems, but I don't know where to begin. Can anyone suggest any good sources to learn from? Also, since I think sys has regular additions, what's the best way to keep my knowledge current when a new kernel is released.


title: How to parse ISO8601 dates with linux date command

text: I'm trying to use the date command to generate a file timestamp that the date command itself can interpret. However, the date command does not seem to like its own output, and I am not sure how to work around this. Case in point:               sh-4.2$ date     Fri Jan  3 14:22:19 PST 2014     sh-4.2$ date +%Y%m%dT%H%M     20140103T1422     sh-4.2$ date -d "20140103T1422"     Thu Jan  2 23:22:00 PST 2014      date appears to be interpreting the string with an offset of 15 hours. Are there any known workarounds for this? Edit: this is not an issue of display:               sh-4.2$ date +%s     1388791096     sh-4.2$ date +%Y%m%dT%H%M     20140103T1518     sh-4.2$ date -d 20140103T1518 +%s     1388737080     sh-4.2$ python     Python 3.3.3 (default, Nov 26 2013, 13:33:18)      [GCC 4.8.2] on linux     Type "help", "copyright", "credits" or "license" for more information.     >>> 1388737080 - 1388791096     -54016     >>> 54016/3600     15.004444444444445     >>>       It's still off by 15 hours when displayed as a unix timestamp. ### EDIT #1 Maybe I should pose this question a little differently. Say I have a list of ISO8601 basic timestamps of the form:   * YYYYMMDDThhmm   * YYYYMMDDThhmmss What is the simplest way to convert them to the corresponding Unix timestamps? For example:               - 20140103T1422   = 1388787720     - 20140103T142233 = 1388787753


title: Unable to write to hdd formatted in anything other ext2,3,4

text: I am unable to write to my HDD mounted on Ubuntu server 12.04 that are formatted to NTFS or FAT32. However when I format to EXT and Mount as auto its able to write. I tried chmod and chown but the permission stay the same.


title: "Kernel panic - not syncing" after building Centos-6/elrepo 3.10.19 kernel from source

text: I need to rebuild the Centos-6 / elrepo 3.10.19 kernel from source. Background: the GVision touch screen drivers are incompatible with kernels > 3.8 and require source code patches to add code to avoid conflicts with their touchscreen drivers. My first step is to build an unmodified driver from source that works before I try to apply the GVision patches. When I build the kernel as noted below, the kernel fails to boot properly with (hand typed!):               Kernel panic - not syncing: Attempted to kill init! exitcode=0x000000100     <some register dumps>     dump_stack     panic     remote_function+0x38/0x40     find_new_reaper_0x512/0x160     forget_original_parent+0x34/0x250     perf_cgroup_switch+0x160/0x160     exit_notify+0x16/0x120     do_exit+0x1b4/0x400     do_group_exit_0x3e/0xb0     SyS_exit_group_0x3e/0xb0     sysenter_do_call+0x12/0x28     drm_kms_helper: panic occurred, swithcing back to text console      Here how I built the kernel guided by https://fedoraproject.org/wiki/BuildingUpstreamKernel               Get config file elrepo used:     - First, get the config files that were used to build the elrepo kernel     - - wget http://elrepo.org/linux/kernel/el6/SRPMS/kernel-t-3.10.19-1.el6.elrepo.nosrc.rpm     - - rpm -i kernel-lt-3.10.19-1.el6.elrepo.nosrc.rpm     The key thing that you want from here is rpmbuild/SOURCES/config-3.10.19-i686     Next, get the kernel source     - wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.10.19.tar.xz     Change perms on /usr/src/kernels     - chmod o+w /usr/src/kernels          Then, as non-root     - cd /usr/src/kernels     - tar xJf ~/linux-3-10-19.tar.xz     - cd linux-3-10-19     - copy the config file from the rpmbuild/SOURCES/config-3.10.19-i686 to ./.config     - edit the Makefile to make a unique kernel name with an extesion in the variable "EXTRAVERSION"     - make bzImage && make modules          As root     - make modules_install     - make install      This all completes cleanly In /boot, the original and newly build vmlinuz and System.map are the same file size (but different md5sum) and the newly built initramfs is much smaller.               drwxr-xr-x 3 root root     1024 Nov 11 18:23 boot     -rw-r--r-- 1 root root   142933 Nov 12 23:22 config-3.10.19-1.el6.elrepo.i686     drwxr-xr-x 3 root root     1024 Aug  5  2011 efi     drwxr-xr-x 2 root root     1024 Nov 14 20:07 grub     -rw-r--r-- 1 root root 16589977 Nov 14 14:16 initramfs-3.10.19-1.el6.elrepo.i686.img     -rw-r--r-- 1 root root  4645843 Nov 14 20:07 initramfs-3.10.19-MDV1.img     drwx------ 2 root root    12288 Aug  5  2011 lost+found     -rw-r--r-- 1 root root   254858 Nov 12 23:23 symvers-3.10.19-1.el6.elrepo.i686.gz     lrwxrwxrwx 1 root root       29 Nov 14 20:06 System.map -> /boot/System.map-3.10.19-MDV1     -rw-r--r-- 1 root root  2342208 Nov 12 23:22 System.map-3.10.19-1.el6.elrepo.i686     -rw-r--r-- 1 root root  2342208 Nov 14 20:06 System.map-3.10.19-MDV1     lrwxrwxrwx 1 root root       26 Nov 14 20:06 vmlinuz -> /boot/vmlinuz-3.10.19-MDV1     -rwxr-xr-x 1 root root  4868224 Nov 12 23:22 vmlinuz-3.10.19-1.el6.elrepo.i686     -rw-r--r-- 1 root root  4868224 Nov 14 20:06 vmlinuz-3.10.19-MDV1      What step am I missing? ==== Solved ==== The key problem here was the initramfs that I generated was missing lots of material that was in the original elrepo distributed initramfs. As @terdon pointed out something is missing in there that is obviously essential to a successful boot. I don't know why the initramfs created by "make install" didn't work -- I didn't dig into that. To recreate the initramfs:               cd /boot     dracut -f initramfs-3.10.19.el6.elrepo.i686-MDV1.img 3.10.19.el6.elrepo.i686-MDV1      With the new initramfs, this kernel boots cleanly. While digging into this I found that the config file in /boot was exactly the same as I had pulled from the elrepo archive so the wget for the elrepo config file can be eliminated. With a clean process to build from source, I was able to apply the source code patches to make the GVision touch screen work. The GVision instructions are a bit confusing, and in some places incorrect, and I've provided feedback to the vendor to update their documentation.


title: gphoto2 hook scripts - a guide?

text: I posted this on raspberrypi.stackexchange but was directed here. I'm new to Linux / Unix, and I'm trying to get a tether / display script going with `gphoto2`.               gphoto2 --capture-tethered --hook-script=myhookscript.sh \         --filename="/home/media/usbpendrive/image-%Y%m%d-%H%M%S.jpg" \         --force-overwrite      This is supposed to download the image to my USB pen drive and then look for new commands in the hookscript. The next stage would be to use `qiv` or similar image viewer to look for the last capture in the folder, then display it full screen. I would like someone to explain in simple terms how to make this hook script.


title: Kali Linux + WIndows 8 - Cleared my master boot record, can't access Win 8

text: I'm not a linux power user by any measure and managed to screw up my MBR. Currently I have access to Kali linux, and GRUB is working fine (Kali installed without problems.) While installing Kali it mentioned that it couldn't find any other operating systems on the HDD and recommended that I overwrite the MBR. I thought that was kind of strange but figured I could restore the MBR without too much trouble. I cannot see any indication that Windows is installed on any of the partitions that I can see in Kali linux (though I'm pretty sure it should be on sda1, but that says "Linux"). It probably has something to do with the way I set up the disks during the Kali setup - I said "do not mount" for the Windows partition. Checking the GRUB command line I was able to discover `(hd0,msdos1)` contains a `lost+found` folder, but that's it. From my understanding of GRUB + Linux disk numbering, that corresponds to `sda1` - so where are my files? I don't know what other information I can provide to be of more use, but could really appreciate some help. Edit: `sudo fdisk -l` output               Disk /dev/sda: 500.1 GB, 500107862016 bytes     255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0x00071d9a             Device Boot      Start         End      Blocks   Id  System     /dev/sda1   *        2048   945407999   472702976   83  Linux     /dev/sda2       945410046   976771071    15680513    5  Extended     Partition 2 does not start on physical sector boundary.     /dev/sda5       945410048   972949109    13769531   83  Linux     /dev/sda6       972949504   976771071     1910784   82  Linux swap / Solaris


title: Find files with same name but different content?

text: I want to generate a list of files that have:   * Same name   * Different content in a directory (including all children directories and content). How to do? Bash, perl, anything is fine. So, two files with the same name and same content should not show up.


title: Wireless troubles with Netgear WNA1100

text: I have a Netgear WNA1100 Wireless Adapter that I bought a few weeks ago, so its fairly new. Last night it was working perfectly. I turned my computer off for the night, came back in the morning, and found that I had no wireless. The desktop that its being used on is running is Fedora 15 x32 and my laptop where I did testing on runs Fedora 15 x64 `dmesg` output               [63046.973098] usb 2-1.2: new high speed USB device number 12 using ehci_hcd     [63047.079092] usb 2-1.2: New USB device found, idVendor=0846, idProduct=9030     [63047.079103] usb 2-1.2: New USB device strings: Mfr=16, Product=32, SerialNumber=48     [63047.079109] usb 2-1.2: Product: WNA1100     [63047.079114] usb 2-1.2: Manufacturer: NETGEAR WNA     [63047.079118] usb 2-1.2: SerialNumber: 12345     [63047.385150] usb 2-1.2: ath9k_htc: Transferred FW: htc_9271.fw, size: 51272     [63047.619805] ath9k_htc 2-1.2:1.0: ath9k_htc: HTC initialized with 33 credits     [63047.811373] ath9k_htc 2-1.2:1.0: ath9k_htc: FW Version: 1.0     [63047.811382] ath9k_htc 2-1.2:1.0: ath9k_htc: Please upgrade to FW version 1.3     [63047.812138] Failed to initialize the device     [63047.821250] ath9k_htc: probe of 2-1.2:1.0 failed with error -22      Ok, that's not good but isn't helpful as Google can't seem to find anything on error -22. So I bring up a Windows XP VM in Virtualbox, install the Netgear software, and get a Code 10 error in the driver manager. Possible causes as listed on their website for this error   * IRQ conflict   * Adapter not plugged in properly   * Wrong/Incorrect driver installed Well I'm sure its plugged in properly (wasn't touched on my desktop) and I'm sure I have the right driver, which leaves the IRQ conflict, which makes absoltely no sense. As a side note when testing in Virtualbox I got a big wall of errors in dmesg. They are all pretty much               [62656.644660] WARNING: at net/ipv4/route.c:1677 ip_rt_bug+0x5c/0x62()     [62656.644667] Hardware name: 4298CTO     [62656.644671] Modules linked in: ath9k_htc ath9k_common ath9k_hw ath tcp_lp fuse vboxpci vboxnetadp vboxnetflt vboxdrv 8021q garp stp llc cpufreq_ondemand acpi_cpufreq freq_table mperf rfcomm bnep coretemp snd_hda_codec_hdmi snd_hda_codec_conexant arc4 snd_hda_intel snd_hda_codec snd_hwdep snd_seq snd_seq_device snd_pcm btusb bluetooth thinkpad_acpi snd_timer snd iwlagn mac80211 cfg80211 soundcore iTCO_wdt snd_page_alloc rfkill iTCO_vendor_support i2c_i801 microcode joydev wacom e1000e sdhci_pci sdhci mmc_core wmi uas usb_storage i915 drm_kms_helper drm i2c_algo_bit i2c_core video [last unloaded: scsi_wait_scan]     [62656.644807] Pid: 18137, comm: VirtualBox Tainted: G        W   2.6.40-4.fc15.x86_64 #1     [62656.644814] Call Trace:     [62656.644832]  [<ffffffff81054c8e>] warn_slowpath_common+0x83/0x9b     [62656.644845]  [<ffffffff81054cc0>] warn_slowpath_null+0x1a/0x1c     [62656.644856]  [<ffffffff81400f9f>] ip_rt_bug+0x5c/0x62     [62656.644867]  [<ffffffff81407c0b>] dst_output+0x14/0x16     [62656.644877]  [<ffffffff8140946b>] ip_local_out+0x20/0x25     [62656.644885]  [<ffffffff8140a307>] ip_send_skb+0x19/0x58     [62656.644899]  [<ffffffff81425b6c>] udp_send_skb+0x239/0x29b     [62656.644911]  [<ffffffff81427093>] udp_sendmsg+0x559/0x78c     [62656.644924]  [<ffffffff811f4e3a>] ? avc_has_perm_flags+0x61/0x7a     [62656.644937]  [<ffffffff81407d7e>] ? ip_select_ident+0x3d/0x3d     [62656.644950]  [<ffffffff8142d93e>] inet_sendmsg+0x66/0x6f     [62656.644961]  [<ffffffff813c975d>] sock_sendmsg+0xe6/0x109     [62656.644974]  [<ffffffff8105a6e4>] ? _local_bh_enable_ip+0x25/0x8e     [62656.644985]  [<ffffffff8140be11>] ? do_ip_setsockopt+0xaa1/0xada     [62656.645005]  [<ffffffff81041325>] ? should_resched+0xe/0x2d     [62656.645018]  [<ffffffff813c7fee>] ? might_fault+0x21/0x23     [62656.645029]  [<ffffffff813c801f>] ? copy_from_user+0x2f/0x31     [62656.645039]  [<ffffffff813cb253>] sys_sendto+0x12f/0x171     [62656.645049]  [<ffffffff8140bf1b>] ? ip_setsockopt+0x2d/0x8d     [62656.645061]  [<ffffffff8112f5e8>] ? path_put+0x20/0x24     [62656.645073]  [<ffffffff810a0c7c>] ? audit_syscall_entry+0x145/0x171     [62656.645086]  [<ffffffff814bd7c2>] system_call_fastpath+0x16/0x1b     [62656.645094] ---[ end trace af0b7ceb6aa2690a ]---     [62657.392996] ip_rt_bug: 192.168.5.12 -> 255.255.255.255, ?      What could possibly be the problem? This was working just fine last night. I've tried every usb port on two different computers, all with the same message. How can something just die over night


title: How does /dev/fd relate to /proc/self/fd/?

text: $ ls -l /dev/stdin /dev/fd/0     lrwx------ 1 tim tim 64 2011-08-07 09:53 /dev/fd/0 -> /dev/pts/2     lrwxrwxrwx 1 root root 15 2011-08-06 08:14 /dev/stdin -> /proc/self/fd/0     $ ls -l /dev/pts/2 /proc/self/fd/0     crw--w---- 1 tim tty  136, 2 2011-08-07 09:54 /dev/pts/2     lrwx------ 1 tim tim     64 2011-08-07 09:54 /proc/self/fd/0 -> /dev/pts/2        1. What differences and relations are between /dev/fd/ and /proc/self/fd/? Do the two `fd`'s mean `both floppy disk`, both `file descriptor`, or one for each?   2. What are /proc/self and /proc usually for?


title: file descriptor vs. file name

text: I was wondering what differences and relations are between file descriptors and file names. Are they all used to access files? If yes, in the same way? For example, `/dev/fd/0`, `/dev/stdin`, and `/proc/self/fd/0` are all links to `/dev/pts/2`. Are these four file descriptors, or file names?


title: Show running processes with file name(s)?

text: I am using putty to connect my linux server which my sites are in. I can run               # ps aux | less      to show running processes. But I want to display which files running these processes ? I have also tried               # ps aux | grep <pid>      But getting this error. ![enter image description here](http://i.stack.imgur.com/2qsug.jpg) What is the correct way to do it ?


title: Diff several files, true if all not equal

text: I have a number of files, I want to check that all those files have the same content. What command line could I use to check that? Usage could be something like:               $ diffseveral file1 file2 file3 file4      Result:               All files equals      OR               Files are not all equals


title: How to make tar globbing work with the 'change directory' option

text: I have the followin directory structure:               base/        files/        archives/        scripts/      I want a script to run from `scripts/`, compress files that match `results.*.log` in `files/` into a gzipped tar archive in `archives/`. I'm trying the following command:               tar czfC ../archives/archive.tar.gz ../files results.*.log      But I get               tar: results.*.log: Cannot stat: No such file or directory     tar: Exiting with failure status due to previous errors      While               tar czfC ../archives/archive.tar.gz ../files results.a.log      works as expected. Also               tar czf ../archives/archive.tar.gz ../files/results.*.log      works the way I would like, except it adds the prefix `files/` to the file and also emits a warning:               tar: Removing leading `../' from member names      So my conclusion is that `tar` globbing doesn't work properly when using the `-C` option. Any advice on how I make this work in a simple manner?


title: How to set up keyboard shortuts with custom modifiers (like Mod3) in Cinnamon?

text: I'm trying to migrate from Mate into Cinnamon. In Mate, it was possible to assign custom modifiers to _Switch to workspace on the left of the current workspace_. In Cinnamon keyboard configuration applet, the "Mod3" modifier is ignored. Is there any "backdoor" or command-line way for assigning keyboard assignments for switching workspaces that bypass the configuration applet? Unfortunately I can't find these shortcuts with dconf-tool nor with gconf- editor. There is also similar question on AskUbuntu: How to change key bindings for switching workspaces in gnome3?


title: Force directory to always be in cache

text: I've been testing out different methods to improve the time it takes to compile my entire c++ project. Currently it takes ~5 minutes. I experimented with distcc, ccache, and others. Recently, I discovered that if I copy my entire project onto a RAM-drive, and then compile from there, it cuts the compile time down to 30% of its original-- just 1.5 minutes. Obviously, working from the RAM drive isn't practical. So, does anyone know of a way I can **force the OS to always keep a certain directory cached**? I still want the directory to get synced back to disk like normal, but I always want a copy of the data in memory as well. Is this possible? **EDIT:** As a possible solution, we just thought of launching a daemon that runs `rsync` every 10 seconds or so to sync the disk drive with a RAM drive. Then we run the compilation from the RAM drive. The `rsync` is blazing fast, but would this really work? Surely the OS could do better....


title: Cron with a 12-hour issue?

text: I have a cron job that's managed through plesk. I'm being told that it's being executed twice in a day, once at 5AM and once at 5PM, based on the email that's being received. Here's the cron line:               0   4   *   *   *   wget http://website.com/script.php      So obviously there's a daylight-savings issue; that's not a problem. But why is it running twice? I thought that the hour specifier was a 24-hour denomination. But it seems to be running at both 4am and 4pm server time. Please note that I'm managing the cron job though a Plesk web admin panel. I did some googling, but I couldn't find anything about Plesk cron bugs or issues. What is going on here?


title: How do I zip/unzip on the unix command line?

text: How can I create and extract zip archives from the command line?


title: Copy keyboard shortcuts between profiles on kali linux

text: I've just spent a while customizing a new install of kali Linux, however, I realise I've just set everything up on the root user account and not on the user account I created. As a result, I don't have my keyboard shortcuts, background, startup scripts, etc., in the user profile. I tried running the following commands to copy the profile and set the permissions:               cp -r /root /home/user     chown -R user /home/user      Unfortunately it didn't work and none of the settings seem to have been applied to the user profile. Am I missing something or is there an easier way to migrate the settings of a profile to a new user?


title: Tar ignore or fix checksum

text: I have a archive backup.tar that was created with a nonstandard program a long time ago. I no longer have access to the original program. The archive is Not compressed (gzip). When trying to extract the archive files, I receive an `Unexpected EOF` error. It's complicated, but I have reason to suspect that the only problem is with the the checksum. I want to extract it and get the files out. Is there a way (perhaps using cpio or pax), to ignore or fix the tar checksum, and extract the files?


title: crontab's @reboot only works for root?

text: `man 5 crontab` is pretty clear on how to use crontab to run a script on boot:                  These special time specification "nicknames" are supported, which replace the 5 initial time and date        fields, and are prefixed by the `@` character:        @reboot    :    Run once after reboot.      So I happily added a single line to my crontab (under my user account, not root):               @reboot     /home/me/myscript.sh      But for some reason, myscript.sh wouldn't run on machine reboot. (it runs fine if I invoke it from the command line, so it's not a permissions problem) What am I missing? * * * Update to answer @Anthon's questions:   1. Oracle-linux version: 5.8 (uname: 2.6.32-300.39.2.el5uek #1 SMP)   2. Cron version: vixie-cron-4.1-81.el5.x86_64   3. Yes, `/home` **is** a mounted partition. Looks like this is the problem. How do I workaround this?   4. Currently, `myscript.sh` only echos a text message to a file in `/home/me`.


title: X11 forwarding not working from putty and XMing to centos 6.4

text: I have centos 6.4 running on VirtualBox. I can connect to it via putty just fine. However X11 forwarding is not working. I Have Xming 6.9.0.31 running and putty 0.62 is setup for X11 forwarding: ![Putty and Xming](http://i.imgur.com/eFPYDIG.png) However, when I connect DISPLAY is not set:               [jdearing@njlt0151 ~]$ echo $DISPLAY          [jdearing@njlt0151 ~]$      And launching terminator fails               [jdearing@njlt0151 ~]$ terminator     Traceback (most recent call last):       File "/usr/bin/terminator", line 30, in <module>         import gtk, pango, gobject       File "/usr/lib64/python2.6/site-packages/gtk-2.0/gtk/__init__.py", line 64, in <module>         _init()       File "/usr/lib64/python2.6/site-packages/gtk-2.0/gtk/__init__.py", line 52, in _init         _gtk.init_check()     RuntimeError: could not open display     [jdearing@njlt0151 ~]$      What am I doing wrong?


title: How can I make window borders transparent in Gnome?

text: I want to create a GTK+ 3.0 theme (for Gnome 3.6+) that features transparent window borders. Is this possible? If so, how can I do it?


I got an old PC running as router which has 3 NIC and 1 wifi PCI card TP-Link L-WN751ND. This box runs Debian Wheezy, hostapd, dhcpd etc. The problem is that AP randomly gets unreachable for the clients while hostapd is running and its interface is up. In fact, this router had been working in 6 day w/o any problems since I set it up until the yesterday. I cannot figure out what is the reason why hostapd goes unusable. **What interfaces I have exactly**               eth0 is down (3Com)     eth1 gets IP from ISP DHCP (Realtek)     eth2 takes IP for my LAN over DHCPD     ppp0 - it's an ISP VPN over PPTP      **Configuration**               $ cat /etc/debian_version     wheezy/sid          $ uname -r     3.2.0-2-686-pae          $ dpkg -l | grep linux-image     ii  linux-image-2.6-686                  3.2+44 Linux for modern PCs (dummy package)     ii  linux-image-3.2.0-2-686-pae          3.2.17-1 Linux 3.2 for modern PCs     ii  linux-image-686-pae                  3.2+44 Linux for modern PCs (meta-package)          $ hostapd -v     hostapd v1.0     User space daemon for IEEE 802.11 AP management,     IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator     Copyright (c) 2002-2010, Jouni Malinen <j@w1.fi> and contributors          $ lspci     00:00.0 Host bridge: Intel Corporation 82810E DC-133 (GMCH) Graphics Memory Controller Hub (rev 03)     00:01.0 VGA compatible controller: Intel Corporation 82810E DC-133 (CGC) Chipset Graphics Controller (rev 03)     00:1e.0 PCI bridge: Intel Corporation 82801AA PCI Bridge (rev 02) 00:1f.0 ISA bridge: Intel Corporation 82801AA ISA Bridge (LPC) (rev 02)     00:1f.1 IDE interface: Intel Corporation 82801AA IDE Controller (rev 02)     00:1f.2 USB controller: Intel Corporation 82801AA USB Controller (rev 02)     00:1f.3 SMBus: Intel Corporation 82801AA SMBus Controller (rev 02)     01:07.0 Multimedia audio controller: Ensoniq ES1371 [AudioPCI-97] (rev 06)     01:08.0 Network controller: Atheros Communications Inc. AR9227 Wireless Network Adapter (rev 01)     01:09.0 Ethernet controller: Sundance Technology Inc / IC Plus Corp IC Plus IP100A Integrated 10/100 Ethernet MAC + PHY (rev 31)     01:0a.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)     01:0b.0 Ethernet controller: 3Com Corporation 3c905 100BaseTX [Boomerang]          $ ifconfig         eth1      Link encap:Ethernet  HWaddr 00:60:97:d8:dd:ea                  inet addr:192.168.120.184  Bcast:192.168.120.255  Mask:255.255.255.0                  inet6 addr: fe80::260:97ff:fed8:ddea/64 Scope:Link                  UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1                  RX packets:431713 errors:74 dropped:682 overruns:59 frame:0                  TX packets:171981 errors:0 dropped:0 overruns:0 carrier:0                  collisions:0 txqueuelen:1000                  RX bytes:283031893 (269.9 MiB)  TX bytes:21389936 (20.3 MiB)                  Interrupt:10 Base address:0xd800               eth2      Link encap:Ethernet  HWaddr 14:da:e9:a7:21:33                  inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0                  inet6 addr: fe80::16da:e9ff:fea7:2133/64 Scope:Link                  UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1                  RX packets:276872 errors:0 dropped:0 overruns:0 frame:0                  TX packets:338010 errors:1 dropped:30 overruns:0 carrier:0                  collisions:0 txqueuelen:1000                  RX bytes:23357782 (22.2 MiB)  TX bytes:278728804 (265.8 MiB)                  Interrupt:11 Base address:0xdc00               lo        Link encap:Local Loopback                  inet addr:127.0.0.1  Mask:255.0.0.0                  inet6 addr: ::1/128 Scope:Host                  UP LOOPBACK RUNNING  MTU:16436  Metric:1                  RX packets:4 errors:0 dropped:0 overruns:0 frame:0                  TX packets:4 errors:0 dropped:0 overruns:0 carrier:0                  collisions:0 txqueuelen:0                  RX bytes:436 (436.0 B)  TX bytes:436 (436.0 B)               mon.wlan0 Link encap:UNSPEC  HWaddr         B0-48-7A-E3-AE-0F-00-00-00-00-00-00-00-00-00-00                  UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1                  RX packets:0 errors:0 dropped:0 overruns:0 frame:0                  TX packets:0 errors:0 dropped:0 overruns:0 carrier:0                  collisions:0 txqueuelen:1000                  RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)               ppp0      Link encap:Point-to-Point Protocol                  inet addr:80.242.96.16  P-t-P:195.66.139.23  Mask:255.255.255.255                  UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1400  Metric:1                  RX packets:225471 errors:0 dropped:0 overruns:0 frame:0                  TX packets:142471 errors:0 dropped:0 overruns:0 carrier:0                  collisions:0 txqueuelen:3                  RX bytes:252918981 (241.2 MiB)  TX bytes:11957326 (11.4 MiB)               wlan0     Link encap:Ethernet  HWaddr b0:48:7a:e3:ae:0f                  inet addr:192.168.2.1  Bcast:192.168.2.255  Mask:255.255.255.0                  inet6 addr: fe80::b248:7aff:fee3:ae0f/64 Scope:Link                  UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1                  RX packets:252 errors:0 dropped:0 overruns:0 frame:0                  TX packets:420 errors:0 dropped:0 overruns:0 carrier:0                  collisions:0 txqueuelen:1000                  RX bytes:31491 (30.7 KiB)  TX bytes:240068 (234.4 KiB)                    $ iwconfig                 wlan0     IEEE 802.11bgn  Mode:Master  Frequency:2.437 GHz  Tx-Power=13 dBm                      Retry  long limit:7   RTS thr:off   Fragment thr:off                      Power Management:on               mon.wlan0  IEEE 802.11bgn  Mode:Monitor  Tx-Power=13 dBm                      Retry  long limit:7   RTS thr:off   Fragment thr:off                      Power Management:on      **The content of my system logs** This part of /var/log/messages has caught my attention:               May 26 03:19:01 debian kernel: [10947.008116] ------------[ cut here ]------------     May 26 03:19:01 debian kernel: [10947.008167] WARNING: at /build/buildd-linux-2.6_3.2.17-1-i386-rPdRhH/linux-2.6-3.2.17/debian/build/source_i386_none/net/sched/sch_generic.c:255 dev_watchdog+0xb1/0x104()     May 26 03:19:01 debian kernel: [10947.008181] Hardware name:     May 26 03:19:01 debian kernel: [10947.008190] NETDEV WATCHDOG: eth2 (sundance): transmit queue 0 timed out     May 26 03:19:01 debian kernel: [10947.008199] Modules linked in: cryptd aes_i586 aes_generic ppp_async crc_ccitt ppp_generic slhc ipt_MASQUERADE xt_TCPMSS xt_limit xt_pkttype ipt_REJECT xt_tcpudp xt_state ipt_LOG iptable_mangle iptable_nat iptable_filter nf_conntrack_irc nf_nat_ftp nf_conntrack_ftp nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_conntrack ip_tables x_tables 8021q garp stp loop arc4 ath9k ath9k_common ath9k_hw snd_ens1371 ath snd_ac97_codec mac80211     snd_rawmidi snd_seq_device cfg80211 snd_pcm evdev snd_page_alloc snd_timer fkill snd soundcore ac97_bus pcspkr serio_raw i2c_i801 gameport i2c_core iTCO_wdt iTCO_vendor_support rng_core shpchp parport_pc parport processor button thermal_sys ext4 crc16 jbd2 mbcache dm_mod sr_mod sd_mod cdrom crc_t10dif ata_generic ata_piix libata 8139too uhci_hcd ehci_hcd scsi_mod usbcore sb_common 3c59x 8139cp floppy sundance mii [last unloaded: scsi_wait_scan]     May 26 03:19:01 debian kernel: [10947.008476] Pid: 1705, comm: rs:main Q:Reg Not tainted 3.2.0-2-686-pae #1     May 26 03:19:01 debian kernel: [10947.008486] Call Trace: May 26 03:19:01 debian kernel: [10947.008513]  [<c103845c>] ? warn_slowpath_common+0x68/0x79     May 26 03:19:01 debian kernel: [10947.008528]  [<c1231444>] ?     dev_watchdog+0xb1/0x104     May 26 03:19:01 debian kernel: [10947.008545]  [<c10384d5>] ?     warn_slowpath_fmt+0x29/0x2d     May 26 03:19:01 debian kernel: [10947.008560]  [<c1231444>] ?     dev_watchdog+0xb1/0x104     May 26 03:19:01 debian kernel: [10947.008613]  [<c103ce5d>] ?     local_bh_enable+0x2/0x2     May 26 03:19:01 debian kernel: [10947.008641]  [<c1042010>] ?     run_timer_softirq+0x150/0x1f3     May 26 03:19:01 debian kernel: [10947.008656]  [<c1231393>] ?     netif_tx_unlock+0x3a/0x3a     May 26 03:19:01 debian kernel: [10947.008672]  [<c103ce5d>] ?     local_bh_enable+0x2/0x2     May 26 03:19:01 debian kernel: [10947.008687]  [<c103cef1>] ?     __do_softirq+0x94/0x12f     May 26 03:19:01 debian kernel: [10947.008702]  [<c103ce5d>] ?     local_bh_enable+0x2/0x2     May 26 03:19:01 debian kernel: [10947.008710]  <IRQ>  [<c103d0e2>] ?     irq_exit+0x32/0x80     May 26 03:19:01 debian kernel: [10947.008762]  [<c100cd7a>] ? o_IRQ+0x65/0x76     May 26 03:19:01 debian kernel: [10947.008787]  [<c12c5bf0>] ?     common_interrupt+0x30/0x38     May 26 03:19:01 debian kernel: [10947.008825]  [<c10f1dc1>] ?     __fsnotify_parent+0x80/0x87     May 26 03:19:01 debian kernel: [10947.008844]  [<c10cb955>] ?     wait_on_retry_sync_kiocb+0x3c/0x3c     May 26 03:19:01 debian kernel: [10947.008858]  [<c10cb955>] ?     wait_on_retry_sync_kiocb+0x3c/0x3c     May 26 03:19:01 debian kernel: [10947.008872]  [<c10cb901>] ?     fsnotify_modify+0x37/0x4f     May 26 03:19:01 debian kernel: [10947.008887]  [<c10cc1c8>] ?     vfs_write+0xa4/0xd4     May 26 03:19:01 debian kernel: [10947.008901]  [<c10cc367>] ?     sys_write+0x3d/0x61     May 26 03:19:01 debian kernel: [10947.008916]  [<c12c565f>] ?     sysenter_do_call+0x12/0x28     May 26 03:19:01 debian kernel: [10947.008927] ---[ end trace d751668d50ee9171 ]---     May 26 03:19:01 debian kernel: [10947.008943] eth2: Transmit timed out, TxStatus 00 TxFrameId bc, resetting...      The /var/log/syslog gets piled with messages like these:               May 26 16:37:35 debian kernel: [58861.160666] ath: Could not stop RX, we could be confusing the DMA engine when we start RX up     May 26 16:37:36 debian kernel: [58861.514885] ath: DMA failed to stop in 10 ms AR_CR=0x00000024 AR_DIAG_SW=0x42000020 DMADBG_7=0x00008040     May 26 16:37:36 debian kernel: [58861.514987] ath: Could not stop RX, we could be confusing the DMA engine when we start RX up     May 26 16:37:36 debian kernel: [58861.869302] ath: DMA failed to stop in 10 ms AR_CR=0x00000024 AR_DIAG_SW=0x42000020 DMADBG_7=0x00008040     May 26 16:37:36 debian kernel: [58861.869398] ath: Could not stop RX, we could be confusing the DMA engine when we start RX up     May 26 16:37:37 debian kernel: [58862.223665] ath: DMA failed to stop in 10 ms AR_CR=0x00000024 AR_DIAG_SW=0x42000020 DMADBG_7=0x00008040     May 26 16:37:37 debian kernel: [58862.223769] ath: Could not stop RX, we could be confusing the DMA engine when we start RX up     May 26 16:37:37 debian kernel: [58862.578063] ath: DMA failed to stop in 10 ms AR_CR=0x00000024 AR_DIAG_SW=0x42000020 DMADBG_7=0x00006040     May 26 16:37:37 debian kernel: [58862.578163] ath: Could not stop RX, we could be confusing the DMA engine when we start RX up      I'm confusing what causes this problem and tend to blame a bug in ath9k module so I've been googling it by subject from my syslog and found out that it's an old commonly known bug. Workaround suggested by google is to turn off a wifi card's power management system:               # iwconfig wlan power off      I've tried it out and this not works for me.


title: LFS can't cd to lfs/source - permission denied

text: I'm trying to build a LFS using version 7.1. I've followed all of the steps up to 5.3 and now I'm stuck because I can't change to $LFS/sources - I get the message:               bash: cd: /mnt/lfs/sources: Permission denied      I'm logged in, in a new terminal, as lfs. The directory permissions (as seen from /mnt/lfs by root) are:               drwx------ 6 leo  leo   4096 May 26 18:02 .     drwxr-xr-x 3 root root  4096 May 21 20:43 ..     drwx------ 2 root root 16384 May 21 20:24 lost+found     drwxr-xr-x 2 leo  leo   4096 May 26 18:00 patches     drwxrwxrwt 2 lfs  root  4096 May 26 17:53 sources     drwxr-xr-x 2 lfs  root  4096 May 26 18:02 tools      The mount spec for the partition is:               /dev/sdb3 on /mnt/lfs type ext3 (rw)      I'm far from new to UNIX and LINUX and this is really annoying me. I know it's something blindingly obvious but I just can't see it. I have restarted the machine, sourced the lfs profile (source ~/.bash_profile) but just can't seem to find the one thing I'm missing. The host system is Debian if that helps.


title: Cancel zsh tab completion

text: Is there a way to cancel a completion once it has been started? I sometimes foolishly press tab to autocomplete make targets (only from sheer indolence) and then end up having to wait for a longer time than if I had just typed the whole of "install" or "check" out myself. I didn't see anything of note in the zshzle man page, but maybe I missed something? Do any other shells have this capability? **EDIT** : Trivial answer. So instead: is there a way for zsh to estimate that tab completion would take a relatively long time to execute and instead ask whether the user would like this to be done?


title: How can I check if mysql is installed using a bash script?

text: I need to check if mysql is installed from within a bash script. What would be an efficient way of doing that? I thought I could do this:               if [ ! -f `which mysql` ] ; then         echo "foo"      fi      But I think I might be confused about something. What would be a better solution? It should be portable and work on both `Ubuntu` and `OSX`.


title: Setting grub loader as default loader

text: I have Windows 7 on my system, and recently I have installed Fedora 16 in a different partition. To have it dual boot, I have used EasyBCD 2.1.2 and I made an entry for Fedora. When I boot my system, it displays Windows 7 and Fedora 16. But the main problem is that when I click on Fedora 16, its doesn't boot directly. Instead it redirects me to Fedora's loader in which I have the option of loading Windows and Fedora. It is kind of irritating. So I want to set grub as my default or main bootloader from where I can load both OS. And I want to remove EasyBCD 2.1.2. How can I set grub loader as my default loader? **Edit**               grub2-bin2h            grub2-install          grub2-mkconfig         grub2-mkimage          grub2-mkpasswd-pbkdf2  grub2-probe            grub2-set-default     grub2-editenv          grub2-kbdcomp          grub2-mkdevicemap      grub2-mklayout         grub2-mkrelpath        grub2-reboot           grub2-setup     grub2-fstest           grub2-menulst2cfg      grub2-mkfont           grub2-mknetdir         grub2-mkrescue         grub2-script-check     grubby


title: How to recover from a corrupt xdebug session?

text: Sometimes my local computer crashes when I'm in the middle of a `xdebug` session. When I reconnect to my remote server with a reverse shell I get this warning:               Warning: remote port forwarding failed for listen port 9000?      How can I recover instantly from my `xdebug` session after a crash from my local computer?


title: sending emails with heirloom, even when Postfix is not running locally

text: Normally, I can send email from commandline, such as               echo hello | mail -s "subject" user@example.com      I have noticed that even when Postfix is not running on my machine, I can still "send" emails. Actually they are being queued in `/var/spool/postfix/maildrop`. But once Postfix is started again, these emails will be sent out. Can somebody please explain how this works? Who copies the emails into `/var/spool/postfix/maildrop`, is it the email client (`heirloom` in my case) ? Does it mean, I have a guarantee all emails will be always delivered, regardless whether Postfix is running or not?


title: Can GRUB font size be customised?

text: I would like to reduce the size of the font of GRUB boot loader. Is it possible and so how?


title: What purpose does the colon builtin serve?

text: I've hacked on a lot of shell scripts, and sometimes the simplest things baffle me. Today I ran across a script that made extensive use of the `:` (colon) bash builtin. The documenation seems simple enough: > >     : (a colon)   >          : [arguments]   >   > > Do nothing beyond expanding arguments and performing redirections. The > return status is zero. However I have only previously seen this used in demonstrations of shell expansion. The use case in the script I ran across made extensive use of this structure:               if [ -f ${file} ]; then         grep some_string ${file} >> otherfile || :         grep other_string ${file} >> otherfile || :     fi      There were actually hundreds of greps, but they are just more of the same. No other input/output redirects are presentother than the simple structure above. No return values are checked later in the script. I am reading this as a useless contstruct that says "or do nothing". What purpose could ending these greps with "or do nothing" serve? In what case would this construct cause a different outcome than simply leaving off the `|| :` from all instances?


title: Slow boot on Fedora 16: why and how to improve?

text: I recently installed Fedora 16 on a Dell VOSTRO 1510. I am quite happy with it, but I am concerned with the slow boot load time. I measured from launching the OS with GRUB till GDM, a boot load time of `1:01.42`, which I experience as _slow_ (that's subjective, my bad: I have not measured other boot times in prior Ubuntu installations, but I remember it to be half that time). Pressing `F2` during boot prints out various details. I notice the boot load is taking much time in the following phase:               Started LSB: Starts and stops login ISCSI daemon.     Starting LSB: Starts and stops login and scanning of ISCSI devices.      What is LSB, ISCSI? Is one minute indeed a long boot time? Can I somehow improve the boot load time? Here is my bootchart for more details: ![Bootchart](http://i.stack.imgur.com/bvkbu.png) **Edit:** thanks to some more documentation suggested by @vasquez, I have been able to remove some services and reduce boot time using `systemd-analyze` and `systemctl`. There are still more services however, which I may need to remove,see below. But how to know what services is doing what and gauge whether I need it or not?                13067ms udev-settle.service       4622ms fedora-loadmodules.service       3539ms systemd-vconsole-setup.service       2913ms remount-rootfs.service       2620ms media.mount       2603ms sys-kernel-debug.mount       2595ms dev-hugepages.mount       2587ms sys-kernel-security.mount       2577ms dev-mqueue.mount       2025ms udev-trigger.service       1951ms fedora-readonly.service       1763ms netfs.service       1619ms mdmonitor-takeover.service       1598ms fcoe.service       1570ms udev.service       1267ms systemd-remount-api-vfs.service       1214ms fedora-storage-init.service       1018ms sys-kernel-config.mount        950ms plymouth-start.service        833ms systemd-sysctl.service        440ms NetworkManager.service        391ms avahi-daemon.service        324ms rsyslog.service        268ms systemd-logind.service        262ms console-kit-log-system-start.service        249ms fedora-storage-init-late.service        231ms livesys.service        228ms ip6tables.service        224ms iptables.service        206ms auditd.service        193ms sshd-keygen.service        184ms systemd-readahead-replay.service        183ms systemd-tmpfiles-setup.service        175ms irqbalance.service        173ms systemd-readahead-collect.service        167ms boot.mount        145ms abrt-vmcore.service        138ms mcelog.service        136ms dbus.service        122ms abrt-ccpp.service         90ms lvm2-monitor.service         52ms fedora-wait-storage.service         51ms sandbox.service         44ms console-kit-daemon.service         30ms livesys-late.service         22ms home.mount         11ms systemd-user-sessions.service          9ms accounts-daemon.service          5ms rtkit-daemon.service          0ms sys-fs-fuse-connections.mount      **Edit** : After removing the following services:   * sendmail.service   * sm-client.service   * iscsi.service   * udev-settle.service   * fedora-wait-storage.service Boot went from 1m 1.5s to about 26s (hurray) see plots: **Before** ![Before](http://i.stack.imgur.com/Rzmef.png) **After** ![After](http://i.stack.imgur.com/JYC6M.png) Now the `fedora-storage-init.service` is taking the most time and removing it only replaces it by `fedora-storage-init-late.service`. What is this service exactly doing and how it can be sped up is yet a mystery.


title: Have working headphone controller under Linux?

text: I have headphones with a controller (+/- volume, play/pause). They work when using an iPad. My question is if it's possible to make it work under Fedora 16 (using GNOME 3)? I assume some drivers are needed for this, but would this be headphone specific (I'm a newcomer to this world so I'm not completely sure about this)?


title: How to find whether a software (which may `not` be in the PATH) is pre-installed or not?

text: anisha@linux-dopx:~> which qmake     which: no qmake in (/opt/qtcreator-2.0.92/bin/:/opt/qtsdk-2010.05/qt/bin/:/opt/qtcreator-2.0.92/bin/:/opt/qtsdk-2010.05/qt/bin/:/usr/lib64/mpi/gcc/openmpi/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/usr/lib/mit/bin:/usr/lib/mit/sbin)          anisha@linux-dopx:~> locate qmake     anisha@linux-dopx:~>       Is there any other way by which I can confirm whether a software is installed or not, considering the clause that it is currently not in the PATH?


title: using here script I/O redirection with su command

text: here is my script. I want to login with another user and do `ls -lih`:               #!/bin/bash          su - testuser <<- _EOF_         123456 #password         _EOF_          ls -lih      here is the output when i ran script:               ./script.sh     -bash: line 1: 123456: command not found     total 127M      262210 drwxr-xr-x.  9 mazimi mazimi 156K Feb 14 19:05 Desktop      262211 drwxr-xr-x.  2 mazimi mazimi  36K Feb 14 18:26 Downloads      278106 -rw-r--r--   1 mazimi mazimi  64K Feb 14 22:30 ems.cfg      ... # list of files      It does `ls -lih` in my home directory not `testuser`? How should I fix it?


title: ulimit PICKLE: "Operation not permitted" and "Command not found"

text: I'm trying to increase the maximum number of open files for the current user               > ulimit -n     1024      I attempt to increase and fail as follows               > ulimit -n 4096     bash: ulimit: open files: cannot modify limit: Operation not permitted      So I do the natural thing and try to run with temp permission, but fail               > sudo ulimit -n 4096     sudo: ulimit: command not found      **Questions**   1. How to increase ulimit?   2. Why is this happening? _Using Fedora 14_


title: Arch modules not loading on start?

text: I keep getting errors on startup in Arch relating to my `rc.conf`:               failed to load module "wl"     failed to load module "lib80211"       etc. It lists all the modules in my `/etc/rc.conf` This is my full `rc.conf`:               #     # /etc/rc.conf - configuration file for initscripts     #          DAEMONS=(syslog-ng dbus networkmanager crond .. etc. ..)     MODULES=(... wl... lib80211... nvidia-bl... openntpd... slim... acpid... pommed)          # Storage     #     # USEDMRAID="no"     # USELVM="no"          # Network     #     # interface=     # address=     # netmask=     # gateway=          HARDWARECLOCK="UTC-5"     TIMEZONE="US/Central"      I notcied this when `pommed` failed to start in X when I added `sudo pommed &` in my `xinitrc`. Is the config file formated properly?


title: Run job at boot and on a schedule from same crontab

text: I have a process that I need to run on boot and periodically. I've created a file for it in `/etc/cron.d/`. Is there a way for me to specify that I want `@reboot 0,30 * * * *`?


title: Mount USB drive (FAT32) so all users can write to it

text: I have a USB FAT32 drive that is on /dev/sda2. I've mounted it as /media/bigdrive however, I get permission denied whenever I try to touch a file there as a non root user. When I run `mount` I can see this line:               /dev/sda2 on /media/bigdrive type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=cp437,iocharset=ascii,shortname=mixed,errors=remount-ro)      My /etc/fstab has this line:               /dev/sda2       /media/bigdrive vfat    rw,user,exec,umask=000  0       0      I've tried running `sudo chmod 777 /media/bigdrive` and `sudo chmod 777 -R /media/bigdrive` Neither one changes anything. Is there anything I'm missing? This is on a rasberry pi running raspbian BTW.


title: How can I manually decrypt the hard drive?

text: I've just switched to Ubuntu 12.04 one year ago and moved all my photos, documents, etc to the 1TB main hard drive that has been encrypted during the installation process - not LVM but only the home folder. I didn't record any key or passphrase when prompted... However, it only required the password to login in the system and have access to the files. It happened that after one month of holiday I've forgotten my password so I've googled and found a way to change it: from the recovery mode, I've selected the root shell and at the prompt I entered:               mount -rw -o remount /     passwd <username>     init 2      Desperately I've tried lots of passwords.. and after a while I've found the initial password written down. I've set this password back again and now the system doesn't want to start up Ubuntu - it only loops in between the login screen - it doesn't say "Invalid password" - and a black screen and then back to the login screen. So the system cannot decrypt the hard drive. Could it be that the "init 2" has deleted some sort of info? Looks like something has been altered by these password changes... What could be done to recover my data? I know that Kali linux has an utility to decrypt WiFi by "listening" it. Could I use a similar program to find the passphrase?


title: What is the difference between curl and wget?

text: I am keen to know the difference between `curl` and `wget`. Both are used to get files and documents but what the key difference between them. Why are there two different programs?


title: Why is the root directory on a web server put by default in "/var/www"?

text: Tuxfiles says the following about the Linux directory structure: > `/var`: > > This directory contains variable data that changes constantly when the > system is running. FHS on `/var` says the following: > `/var` contains variable data files. This includes spool directories and > files, administrative and logging data, and transient and temporary files. They then go on to say that things like logs, mail and the spooler are put in that folder. ~~Traditionally~~ A stock installation of Apache or Nginx on Ubuntu Linux will place the directory at `/var/www/`. It doesn't seem to me like the ideal place to put a directory with files or otherwise content that is supposed to be almost permanent. Why is it so often put into `/var`? More subjectively, is this where it should ideally go, according to the directory structure?