title: When gnu parallel exit，my program also fail

text: I use gnu parallel to run a bash function. The function just contains the bash script to restart my program. At first, the restart is ok, but when the gnu parallel script exits， my program also fails. Why?               #!/bin/bash          function_A () {             local module=$1             set -x             cd /dir/${module}/;sh stop_${module}.sh;sh start_${module}.sh;sleep 10     }     export -f function_A          parallel --tag --onall --env function_A -S my_host function_A ::: my_program      * * * ## ps command info: root 12967 0.0 0.0 65960 1152 pts/1 Ss+ 16:30 0:00 bash -c echo $SHELL | egrep "/t?csh" > /dev/null && echo CSH/TCSH DO NOT SUPPORT newlines IN VARIABLES/FUNCTIONS && exec false;? eval `echo $SHELL | grep "/t\\{0,1\\}csh" > /dev/null && echo setenv PARALLEL_SEQ 1\; setenv PARALLEL_PID 6431 || echo PARALLEL_SEQ=1\;export PARALLEL_SEQ\; PARALLEL_PID=6431\;export PARALLEL_PID` ; tty >/dev/null && stty isig -onlcr -echo;echo $SHELL | grep "/t{0,1}csh" > /dev/null && setenv function_A ()\ {\ \ local\ module=\$1\;"?"\ set\ -x\;"?"\ cd\ /dir/\${module}/\;"?"\ sh\ test.sh\;"?"\ sleep\ 10"?"} || export function_A=()\ {\ \ local\ module=\$1\;"?"\ set\ -x\;"?"\ cd\ /dir/\${module}/\;"?"\ sh\ test.sh\;"?"\ sleep\ 10"?"} && eval function_A"$function_A";function_A my_program


title: Graphical login without a keyboard

text: Is there an XDM variant (kdm, gdm etc.) that allows graphical login without a physical keyboard? I have a tablet computer (like iPad, but Intel i5) running KDE and would prefer that users have to login to use it. However, the virtual keyboard is not available in the xdm screens I have seen. I could plug in keyboard, but that is kludgy; I'd prefer to do something more like Android's gesture login. Do you know of any options?


title: mount: wrong fs type, bad option, bad superblock on /dev/sdb on CentOS 6.0

text: Somehow my partition on /dev/sdb has gotten all buggered up. This hard drive contains a lot of data that I need to recover and haven't been able to backup yet. When I attempt to mount it:               # mount -t ext4 /dev/sdb /world     mount: wrong fs type, bad option, bad superblock on /dev/sdb,            missing codepage or helper program, or other error            In some cases useful info is found in syslog - try            dmesg | tail  or so      Also when I run `fdisk` to try see what partitions are on the hard drive:               Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes     255 heads, 63 sectors/track, 121601 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x25467742             Device Boot      Start         End      Blocks   Id  System     /dev/sdb3   *           1           1           0    0  Empty     Partition 3 does not end on cylinder boundary.      I have attempted to use TestDisk to try to recover my lost partition but both quick and deep scans find no partitions present. I am able to look at the used space and all of my data is still intact on the hard drive itself, it just seems my partition is complete gone. Is there any way I can recover this data? Any tools or details that I am missing?


title: Is there a folder accessible to all process and users at all times?

text: I have a script that gathers debugging info from the running environment and I need to figure out were I can save that info. It may be called anytime:   * at boot   * when the system is running   * at shutdown, etc...    * and by any user or process / service. I need a folder that is accessible at all time to EVERYTHING. Does that exist already? If not how can I make it happen?   Since this is for debugging purposes I don't care about security, it'll all be removed before hitting prod.


title: How to resize application windows in an arbitrary direction (not vertical and not horizontal)

text: One of the most annoying things for me in using Linux, is resizing an open window, such as a terminal window. I'd like to resize the terminal window (make it larger or smaller). But when I put the mouse at the lower right corner to grab the corner point, it is trial and error to get the mouse to become at an angle so I can resize the terminal in an arbitrary direction this way:                        \               \                \ |               ___|      It insists that I resize it either like this               ---->        or like this                 |       |       V      Sometimes it takes 5 seconds of trial error moving of the mouse around the corner of the window and error in order for the mouse to show at an angle instead of up or sideways so that the window can be resize in direction other than vertical or horizontal only. I am using standard terminal emulation that appears in the menu->system->terminal. I think this is has to do with the desktop type. I am using Linux mint 14, with xfce distribution. Is there a way to disable the horizontal and vertical resizing, and just keep the angle resizing? As I can use that for both and it is much more flexible. Now I have to first resize vertically, then resize horizontally to enlarge the window which is very silly. This actually affects all windows, not just the terminal. For example, when I open firefox, and want to resize it, same problem happens. That is why I think it is a window manager configuration issue, and not the gnome-terminal itself. In other words, I want it to work just like on windows, where I grab the corner of any window, and I can resize at an arbitrary direction always. Surely one can do this in Linux.


title: Move matched line above a different matched line using sed

text: I have something like               dsadjakldjska     safdsfdsfsf     fdsfsf**STGN**fdsfsd     fdsfkjldsf     fdsff     fdsfs**IRV**fdsfs      and I want to get               dsadjakldjska     safdsfdsfsf     fdsfkjldsf     fdsff     fdsfsf**STGN**fdsfsd     fdsfs**IRV**fdsfs      but only for an interval of lines (say line 40000 till end of file) (moving the line containing STGN right above the next IRV underneath it) Any idea how I can do this, or whether there's a better alternative for this than sed?


title: Samson Meteor Mic under Linux/ALSA

text: Has anybody gotten a Samson Meteor Mic working under Linux/ALSA? I tried to google it but I found no mention of Samson Meteor under Linux at all. Kernel/ALSA/Audacity see the device. Unfortunately I was unable to record anything. `arecord` refuses to work and Audacity freezes completely when I press the record button. `arecord -l` gives me:               **** List of CAPTURE Hardware Devices ****     ...     card 1: Mic [Samson Meteor Mic], device 0: USB Audio [USB Audio]       Subdevices: 1/1       Subdevice #0: subdevice #0      `arecord -L` gives me:               ...     default:CARD=Mic         Samson Meteor Mic, USB Audio         Default Audio Device     front:CARD=Mic,DEV=0         Samson Meteor Mic, USB Audio         Front speakers     surround40:CARD=Mic,DEV=0         Samson Meteor Mic, USB Audio         4.0 Surround output to Front and Rear speakers     surround41:CARD=Mic,DEV=0         Samson Meteor Mic, USB Audio         4.1 Surround output to Front, Rear and Subwoofer speakers     surround50:CARD=Mic,DEV=0         Samson Meteor Mic, USB Audio         5.0 Surround output to Front, Center and Rear speakers     surround51:CARD=Mic,DEV=0         Samson Meteor Mic, USB Audio         5.1 Surround output to Front, Center, Rear and Subwoofer speakers     surround71:CARD=Mic,DEV=0         Samson Meteor Mic, USB Audio         7.1 Surround output to Front, Center, Side, Rear and Woofer speakers     iec958:CARD=Mic,DEV=0         Samson Meteor Mic, USB Audio         IEC958 (S/PDIF) Digital Audio Output      But, e.g. `arecord -f cd -D default:CARD=Mic` returns only error messages:               ALSA lib pcm_direct.c:1052:(snd1_pcm_direct_initialize_slave) unable to start PCM stream     ALSA lib pcm_dsnoop.c:604:(snd_pcm_dsnoop_open) unable to initialize slave     arecord: main:654: audio open error: Broken pipe      and in `dmesg` I find this:               ...     [ 1750.460164] ehci_hcd 0000:00:1d.0: iso resched full ffff8801b3e02500 (now 128 max 8320)     [ 1750.460168] cannot submit datapipe for urb 0, error -28: not enough bandwidth      Additionally, full `dmesg` output when connecting the device:               [ 2030.857802] hub 2-1:1.0: state 7 ports 8 chg 0000 evt 0040     [ 2030.858084] hub 2-1:1.0: port 6, status 0101, change 0001, 12 Mb/s     [ 2030.961848] hub 2-1:1.0: debounce: port 6: total 100ms stable 100ms status 0x101     [ 2030.972865] hub 2-1:1.0: port 6 not reset yet, waiting 10ms     [ 2031.034704] usb 2-1.6: new full speed USB device using ehci_hcd and address 9     [ 2031.045748] hub 2-1:1.0: port 6 not reset yet, waiting 10ms     [ 2031.119403] usb 2-1.6: ep0 maxpacket = 16     [ 2031.120233] usb 2-1.6: skipped 10 descriptors after interface     [ 2031.120236] usb 2-1.6: skipped 2 descriptors after interface     [ 2031.120238] usb 2-1.6: skipped 1 descriptor after endpoint     [ 2031.120240] usb 2-1.6: skipped 2 descriptors after interface     [ 2031.120242] usb 2-1.6: skipped 1 descriptor after endpoint     [ 2031.120243] usb 2-1.6: skipped 1 descriptor after interface     [ 2031.120443] usb 2-1.6: default language 0x0409     [ 2031.122480] usb 2-1.6: udev 9, busnum 2, minor = 136     [ 2031.122482] usb 2-1.6: New USB device found, idVendor=17a0, idProduct=0310     [ 2031.122485] usb 2-1.6: New USB device strings: Mfr=1, Product=2, SerialNumber=0     [ 2031.122486] usb 2-1.6: Product: Samson Meteor Mic     [ 2031.122488] usb 2-1.6: Manufacturer: Samson Technologies     [ 2031.122563] usb 2-1.6: usb_probe_device     [ 2031.122566] usb 2-1.6: configuration #1 chosen from 1 choice     [ 2031.122693] usb 2-1.6: adding 2-1.6:1.0 (config #1, interface 0)     [ 2031.122735] snd-usb-audio 2-1.6:1.0: usb_probe_interface     [ 2031.122739] snd-usb-audio 2-1.6:1.0: usb_probe_interface - got id     [ 2031.139846] usb 2-1.6: adding 2-1.6:1.1 (config #1, interface 1)     [ 2031.139870] usb 2-1.6: adding 2-1.6:1.2 (config #1, interface 2)     [ 2031.139890] usb 2-1.6: adding 2-1.6:1.3 (config #1, interface 3)     [ 2031.139916] usbhid 2-1.6:1.3: usb_probe_interface     [ 2031.139917] usbhid 2-1.6:1.3: usb_probe_interface - got id     [ 2031.140837] input: Samson Technologies Samson Meteor Mic as /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.6/2-1.6:1.3/input/input12     [ 2031.140856] usb 2-1.6: link qh2-0601/ffff88016d9c4300 start 1 [1/2 us]     [ 2031.140890] usbhid 2-1.6:1.3: looking for a minor, starting at 96     [ 2031.140948] generic-usb 0003:17A0:0310.000A: input,hiddev0,hidraw2: USB HID v1.00 Device [Samson Technologies Samson Meteor Mic] on usb-0000:00:1d.0-1.6/input3     [ 2031.140961] drivers/usb/core/inode.c: creating file '009'      Thanks for any help.


title: What is rsh.rlogin and How to remove rsh.rlogin

text: I never heard of this word rsh and also received a check list from Security pro that we have to disable rsh. Can someone please tell me what is this rsh and how to disable it. Base OS : RHEL 5.5 and 5.6


title: How to get Wine to work with SELinux?

text: I want to run a `.msi` file on Fedora 17. After installing Wine Windows Program Loader on my Linux machine, it failed to run the file. A check on `/var/log/messages` shows the following line: > Jan 11 17:32:26 some kernel: [15554.188474] type=1400 > audit(1357983146.108:13): avc: denied { mmap_zero } for pid=4779 comm="wine- > preloader" scontext=unconfined_u:unconfined_r:wine_t:s0-s0:c0.c1023 > tcontext=unconfined_u:unconfined_r:wine_t:s0-s0:c0.c1023 tclass=memprotect An online forum has a suggestion to toggle a switch with:               setsebool -P mmap_low_allowed 1      I did that but it gave me an error: > libsepol.scope_copy_callback: entropyd: Duplicate declaration in module: > type/attribute entropyd_var_run_t (No such file or directory). > libsemanage.semanage_link_sandbox: Link packages failed (No such file or > directory). Could not change policy booleans Next, I try setting SELinux to permissive mode with:               setenforce 0      After checking that SELinux is on permissive mode, I tried to run the file again, but to no avail. What could be causing this problem? And how do I solve it?


title: Can I run several TKL appliances on one server box (eg, HP Microserver)?

text: I'm interested in by Ubuntu-based TurnKey Linux (TKL)'s many (apparently) ready-to-use, FOSS appliances. Is it possible to create one server box (without virtualization) that runs more than one TKL appliance?


title: Can you switch between windows within an application in Openbox?

text: Is it possible to set up a keybinding in Openbox for switching between open windows within an application? Just like you can in gnome 3 with alt + [key above Tab] .


title: How to create QtCurve theme KDE

text: I want to make my gtk2 theme for KDE.   Is there a good instructions/tutorials/tools for creating a QtCurve theme. Can Images be used as elements (buttons, badgrounds, handles, scrollbars...)


title: Update phpmyadmin manually when installed as an package

text: Is it possible to manually update phpMyAdmin when I installed it as a package?   The current version in Ubuntus package list is 3.4.5deb1 but I want to upgrade to 3.4.8


title: Write all tmux scrollback to a file

text: How can I write all the scrollback in a tmux session to a file? `capture-panel` can grab the current screen, but not the entire scrollback.


title: scheduling background tasks in succession

text: I've got three SAS programs to run in the background over a weekend. The three programs output information into files of the same names, so I'll need to remove these output files after the first program finishes and before the second program starts, as well as after the second program finishes and before the third program starts. Obviously the simplest way to get around this issue is to alter each of the programs in such a way that the output filenames are different, but that wouldn't help me learn how to use Unix. So this is what I've got so far:               # Begin by running the first SAS program in the background.     sas program1.sas & | at 5:00 PM JAN 11          # I'd like to wait until the first program finishes to remove     # the output files and run the second program.     wait ???     rm file1.sas7bdat file2.sas7bdat file3.sas7bdat file4.sas7bdat file5.sas7bdat     sas program2.sas & | at 5:00 PM JAN 12          # And now I repeat.     wait ???     rm file1.sas7bdat file2.sas7bdat file3.sas7bdat file4.sas7bdat file5.sas7bdat     sas program3.sas & | at 5:00 PM JAN 13      I set each program to run at the same time on consecutive days for two reasons: (1) I know the previous program will finish within 24 hours, and (2) I am assuming the load on the server will be similar at the same time on consecutive days. Ideally I could somehow grab the process ID for the first program and pass it to the first `wait` command, and similarly for the second program and `wait` command. Any ideas? **EDIT** I am more interested in a general solution for determining a process ID and passing it to the `wait` command than this specific situation.


title: Refreshing less on the fly

text: I'm writing a script in which I pass the output of a function to `less`, wait for some time, and then kill `less`. All of this done inside a loop. This makes it look like `less` is updated on the fly. This is my script:               #!/usr/bin/env bash          for i in {0..5}; do         echo $i | less -c &         pid=$!         sleep 2         kill $pid &>/dev/null     done      This works as expected, but the terminal kind of becomes unresponsive (keystrokes are not visible for instance) after this. What am I doing wrong? **EDIT:** Okay, I think the way I asked the question was confusing. I'm trying to write a script which scrapes lyrics off a website according to the current song in music player. The way I want to do this, I'll keep this script running in a screen session, and I want it to auto-update every 30s or so. The finall script would look something like:               function get_lyrics()     {         # function which gets the lyrics based on current song     }          while true; do         song=$(get_lyrics)         echo "$song" | less -c &         pid=$!         sleep 30         kill $pid &>/dev/null     done


title: How to install iftop?

text: I tried:               root@host [/home]# yum install iftop     Loaded plugins: fastestmirror, security     Loading mirror speeds from cached hostfile      * base: centos.mirrors.tds.net      * extras: yum.singlehop.com      * updates: mirror.wiredtree.com     Setting up Install Process     No package iftop available.     Error: Nothing to do      So how to do it? What should I do to be able to do so?


title: Replacing the values in one file with the values in another file in bash

text: I am having a csv file naming `List.csv` in following format:               Location,IP Address,Host Name,Domain,Domain Name, User Name,Manufacturer,Model,System Type, Serial Number, Operating System,RAM (GB),Processor Type,Processor Frequency     H1,xx.xx.xx.xx,PC1,domain.com,DOMAIN,User1,LENOVO,4089AZ8,X86-based PC,L90RA96,Microsoft Windows 7 Professional ,2,Pentium(R) Dual-Core CPU E5800,3.20GHz     H3,xx.xx.xx.xx,PC2,domain.com,DOMAIN,User2,LENOVO,4089AZ8,X86-based PC,L906W3P,Microsoft Windows 7 Professional ,2,Pentium(R) Dual-Core CPU E5800,3.20GHz     H2,xx.xx.xx.xx,PC3,domain.com,DOMAIN,User3,LENOVO,4089A76,X86-based PC,L929410,Microsoft Windows 7 Professional ,2,Pentium(R) Dual-Core CPU E5400,2.70GHz     H2,xx.xx.xx.xx,PC4,domain.com,DOMAIN,User4,Hewlett-Packard,Z800,x64-based PC,SGH007QT16,Microsoft Windows 7 Professional ,12,Intel(R) Xeon(R) CPU W5590,3.33GHz      If you look at the `MODEL` column, it is bearing some values which do not interpret the name of the model. I have created another file `model-list.csv` which bears the information of the said values and the corresponding model names. It looks something like :               Manufacturer,Value,Model Name     Lenovo, 4089AZ8, ThinkCentre     Lenovo, 4089A76, ThinkCentre     HP, Z800, HP Z800 Workstation      I want the values in the `List.csv` file to be replaced by the corresponding model name present in `model-list.csv`. As there are 2900+ items in the `List.csv` and about 150 items in `model.csv` file, I was planning to achieve this using a bash script, which is as follows:               #!/bin/bash          file1="List.csv"     file2="model-list.csv"     outfile="List_out.csv"     stagingfile="List-staging.csv"          rm -f "$outfile" "$stagingfile"          while read line     do             ModelNo=`echo "$line"|awk -F',' '{print $2}'`             ModelName=`echo "$line"|awk -F',' '{print $3}'`                       cat "$file1"|grep ",$ModelNo," > "$stagingfile"             if [ -s "$stagingfile" ]             then                          while read line1                     do                             NewLine=`echo "$line1"|sed "s/,${ModelNo},/,${ModelName},/g"`                             echo "$NewLine" >> "$outfile"                          done < "$stagingfile"                     rm -f "$stagingfile"             fi          done < "$file2"      When above script is executed, the `"$outfile"` contains almost 40-50 additional entries as compared to the `List.csv`. Anything wrong with the script?


title: Why does PyCrypto require a C compiler?

text: Is there a python crypto library that does not rely on anything besides python? Or pre-complied bundles of PyCrypto for Linux?


title: using sf probe to make u-boot faster

text: My uboot was running slow on a ARM cortex A9 processor based Xilinx zynq chip. Xilinx forum referred me to the following to solve this issue:                   +From 0a212cfc2dd4e4d1595de2ca2dde3f642e5707e7 Mon Sep 17 00:00:00 2001              +From: Mike Looijmans <mike.looijmans@topic.nl>              +Date: Fri, 18 Apr 2014 11:15:34 +0200              +Subject: [PATCH] configs/zynq-common: Don't add parameters to "sf probe"          + command          +          +When booting from QSPI flash, the system "hangs" for a few seconds           +between reading the devicetree and reading the kernel.           +         +This only happens for "run qspiboot", it did not happen when entering         +the read commands manually. I suspect it is triggered by reading the          +environment from flash somehow.              +              +"sf probe 0 0 0" triggers this, "sf probe" does not. So do not pass          +any parameters to sf probe.          +---          + include/configs/zynq-common.h |    2 +-       + 1 file changed, 1 insertion(+), 1 deletion(-)       +       +diff --git a/include/configs/zynq-common.h b/include/configs/zynq-common.h        +index 2c7f257..f2c1ddb 100644              +--- a/include/configs/zynq-common.h         ++++ b/include/configs/zynq-common.h         +@@ -268,7 +268,7 @@         +         "fatload mmc 0 ${loadbit_addr} ${bitstream_image} && " \              +         "fpga load 0 ${loadbit_addr} ${filesize}\0" \              +     "qspiboot=echo Booting from QSPI flash... && " \         +-        "sf probe 0 0 0 && " \              ++        "sf probe && " \              +         "sf read 0x2A00000 " STR(CONFIG_SYS_SPI_DEVTREE_OFFS) " ${devicetree_size} && " \         +         "sf read ${kernel_addr} " STR(CONFIG_SYS_SPI_UIMAGE_OFFS) " ${kernel_size} && " \         +         "bootm ${kernel_addr} - 0x2A00000\0" \              +--               +1.7.9.5              +      The link is here: But I could not get what I have to do so , as suggested above I changed `sf probe 0 0 0` to `sf probe` in zynq_common.h But even now the u-boot execution speed is the same. Is there any other correct method for making the changes?


title: how to output text to both screen and file inside a shell script?

text: Currently I have a shell script which logs messages to a log file like this:               log_file="/some/dir/log_file.log"     echo "some text" >> $log_file     do_some_command     echo "more text" >> $log_file     do_other_command      When executing this script, there is no output to screen, and, since I'm connecting to the server via putty, I have to open another connection and do "tail -f log_file_path.log", because I can't terminate the running script and I want to see the output in real time. Obviously, what I want is that the text messages are printed on screen and into file, but I'd like to do it in one line, not two lines, one of which has no redirection to file. How to achieve this?


title: What is the relationship between command line code and higher level language code?

text: I'm learning to use the terminal on my Ubuntu 14.04 and I'm running command line code in my shell (which I'm told is what is inside the terminal) to install programs. But I can also start my node.js server in my shell and I can then run javascript code in the terminal; it keeps track of values I store in variables and I can create functions and then use them and so on. However it does seem to change mode because I'm no longer in a specific folder of my operating system so maybe I'm no longer in my shell? So I started looking into shell commands: What Are "Commands? According to http://linuxcommand.org/lc3_lts0060.php commands can be one of 4 different kinds:   1. **An executable program** like all those files in /usr/bin. Within this category, programs can be compiled binaries such as programs written in C and C++, or programs written in scripting languages such as the shell, Perl, Python, Ruby, etc.   2. **A command** built into the shell itself. bash provides a number of commands internally called shell builtins. The cd command, for example, is a shell builtin.   3. **A shell function**. These are miniature shell scripts incorporated into the environment.    4. **An alias**. Commands that you can define yourselves, built from other commands.  Does this mean that I'm always running the higher level code I have in my files (e.g. x.php, x.js x.css x.html files) with the help of my shell every time I start a program? Or does it only mean that I can use the command line to start a program which then run somewhere else (if somewhere else, then where?)? How can you grasp the interaction between these different types of code/languages? For example: can you view it all as code put into a command line; line after line with some languages making calls to other languages which then return the control to the caller and so on, or what kind of mental model is useful for understanding what is going on?


title: How to find the PID of nginx process

text: I am trying to fix a problem with nginx and think that there is an nginx process running on my machine. When I run this command I get this output.               $ ps aux -P | grep nginx     1000      3947  0.0  0.0  13596   932 pts/0    S+   14:05   0:00 grep --color=auto nginx      But if I try to kill processes 1000, 3947, 13596 or 932 I get errors like: `bash: kill: (1000) - No such process` What's going on? How do I find and kill the nginx process?


title: Combining parameter expansion with modifiers in zsh

text: Say I have the following               $f1=/some/path     $f2=/some/subpath     $f3=/some/other/subpath      If I try:               test1=${$f1/$f2/${f3:t}}      zsh complains with `bad substitution`. However:               test2=${f3:t}      works well. What am I doing wrong?


title: How to set default console keyboard layout in Arch Linux?

text: Whenever I reboot my computer I have to set the keyboard layout in a console again with `loadkeys`. Is there a way to change the default keyboard layout that is loaded everytime the computer boots?


title: Why I'm still able to use ssh reverse tunnel after closing reverse ssh connection?

text: I have created a reverse ssh tunnel to connect to a computer behind NAT using: `ssh -R 9050:localhost:22 user@middleserver` in the destination system. I closed the terminal that I entered this command in. But I'm still able to connect to the destination computer using `ssh destuser@middleserver -p 9050` from my system Is this normal?


title: How do I force yum to download from a specific mirror?

text: In a Fedora system, I can access only ftp and not http. When I try to install a package with _yum_ , it usually tries to download from http mirrors. How do I force it to download from a ftp mirror(listed here http://mirrors.fedoraproject.org/publiclist/Fedora/17/i386/) ?


title: Missing "version.h" when installing fglrx

text: I have downloaded the fglrx driver installer from the ATI drivers page. when I start the installation, everything goes smoothly until I hit an error message, telling me to check `/usr/share/ati/fglrx-install.log`. The contents of that file are as follows: > Check if system has the tools required for installation. fglrx installation > requires that the system have kernel headers. > /lib/modules/3.8.11-200.fc18.x86_64/build/include/linux/version.h cannot be > found on this system. One or more tools required for installation cannot be > found on the system. Install the required tools before installing the fglrx > driver. Optionally, run the installer with --force option to install without > the tools. Forcing install will disable AMD hardware acceleration and may > make your system unstable. Not recommended. Now, after a bit of searching around, I found that the symbolic link called `build` in `/lib/modules/3.8.11-200.fc18.x86_64` points to a nonexistent location. I installed the `kernel-devel` package, and now it had pointed to an existing directory. However, in the `/lib/modules/3.8.11-200.fc18.x86_64/build/include/linux/` directory, that is populated with various header files - I cannot find the one I need - `version.h`. How can I solve this problem? Should I install the driver in a different manner? Which other package can I install to get the `version.h` file? I'm running a clean install (default) of Fedora 18, which I had updated today.


title: Apply "upgrade" certain packages with apt

text: I need to update my version of OpenSSL and so I looked to implement an "upgrade", but I do not want my versions of php and apache is updated, that I can do to accomplish this?


title: Running a script as Grub boot option

text: I'm assembling some DR stuff for my Linux boxes. One item that would be really handy would be a GRUB option that would run a script to change my boxes from static IPs to dynamic. I know we could do a single user mode, run a script, reboot, etc but it would greatly simply things for the other admins (mostly with a Windows background) to select one item and have it complete the process automatically. I would swear that I've seen configuration settings provided to let Grub do this at one point or another but it's been a while. Not sure what to google for. EDIT: I'm aware of the rc.local method, however I don't want this to run on every boot. I want there to be an option listed (line item in grub.conf, probably) which allows for a specific script to be run only when that boot option is selected.


title: Finding all the hard-links of a file without traversing the file system

text: I have seen in this page that inodes have a **link counter** to know how many files (read: "directory entry") point to this inode. Is there a way to know which directories contain such entries without traversing the whole file system? Is this information stored somewhere?               struct inode {         kdev_t                       i_dev;         unsigned long                i_ino;         umode_t                      i_mode;         nlink_t                      i_nlink;         uid_t                        i_uid;         gid_t                        i_gid;         …     };


title: centos 6, hostname won't resolve, dns issue, loop detected

text: I've searched everywhere and tried all the suggestions that I've seen, but I just can't get this to work now (it was working before). This is the first time I've ever installed a test server that I want to be accessible from outside my local network, so bare with me. I have a test box in my home that is behind my router (192.168.1.1 gateway), server IP on network is 192.168.1.9 which I've set up statically in the router to receive the traffic. When I first set this up, I used a temporary hostname for the server that I was going to change, which after I have changed now is when I'm experiencing the issues. I have another colocated server, with it's own name servers, and in that server I quickly set up a CNAME entry under my main domain that pointed to my home IP address. Basically at that time this was working, and visiting the cname entry let me access the document root on my server at home. I decided to change my hostname using a separate domain, and this is when everything went to shit. Here is what I did. In godaddy under my domain I setup 2 new hosts entries, ns1. mydomain.net, and ns2.mydomain.net that point to my home IP. I changed the nameservers for my domain to reflect these. I changed the hostname throughout the server, I setup BIND and added 2 zones to reflect my domain and IP address, and now I cannot get my domain name to resolve to my server. Below are some responses that I get, if you need me to post any more output let me know as the DNS settings are what I'm not super familiar with. I can access the web server document root fine using my wan IP address, or the dhcp address, but the hostname won't resolve, everything locally seems to work fine. iptables               -A INPUT -p udp -m state --state NEW -m udp --dport 53 -j ACCEPT     -A INPUT -p tcp -m state --state NEW -m tcp --dport 53 -j ACCEPT      /etc/resolv.conf               domain mydomain.net     search mydomain.net     nameserver 192.168.1.1      other names resolve               nslookup serverfault.com     Server: 192.168.1.1     Address: 192.168.1.1#53          Non-authoritative answer:     Name:    serverfault.com     Address: 198.252.206.16      but not mine               nslookup mydomain.net     ;; connection timed out; trying next origin     ;; connection timed out; no servers could be reached      EDIT: After doing some dns lookups, I'm getting a loop detected message. "Loop detected! We were referred back to 'My home IP'" Does this mean there is something wrong with my zone files?


title: bash command line editing (Emacs shortcuts)

text: When writing a command on the bash command line, I can use `CTRL+w` to delete a word backwards, or `ALT+d` to delete word forwards. The problem is, that these two shortcuts are not exactly complementary: `CTRL+w` deletes everything up to a space, whereas `ALT+d` deletes only up to any non-alphabetic character (i.e. stops at `/`) Is there a shortcut that acts as `ALT+d`, but backwards? So that when I am at the end of `/etc/hostname` and press shortcut, I end up with `/etc/`.


title: NFS partition mounted as read only

text: (Disclaimer: I've read "NFS sharing is read only" and I think it's not the same problem) I have just setup NFS on my raspberry (Raspbian) and I'm trying to access it from OSX. So far so good, I can mount the partition but unfortunately it's **read only**. Some more info: ## Client (OSX)               ➜  ~ mount     /dev/disk0s2 on / (hfs, local, journaled)     devfs on /dev (devfs, local, nobrowse)     map -hosts on /net (autofs, nosuid, automounted, nobrowse)     map auto_home on /home (autofs, automounted, nobrowse)     192.168.1.102:/export/data on /media (nfs)          ➜  ~  ls -ld /media         drwxr-xr-x  3 root  wheel  4096 Mar  8 15:57 /media      ## Server (Raspbian)               pi@raspberrypi ~ $ cat /etc/exports           /export       192.168.0.0/16(rw,fsid=0,insecure,no_subtree_check,async)     /export/data  192.168.0.0/16(rw,nohide,insecure,no_subtree_check,async)          pi@raspberrypi ~ $ cat /etc/idmapd.conf      [General]          Verbosity = 0     Pipefs-Directory = /var/lib/nfs/rpc_pipefs     # set your own domain here, if id differs from FQDN minus hostname     # Domain = localdomain          [Mapping]          Nobody-User = nobody     Nobody-Group = nogroup      As I said the problem comes when trying to create a file in the mounted directory:               ➜  /media  touch foo     touch: foo: Permission denied     ➜  /media  sudo touch foo     Password:     touch: foo: Permission denied      Note that **I can create a file from the server** , the problem must be in the nfs mount. (BTW I followed this guide to set the whole thing up) ## Additional info (edit): Here's how I'm mounting the partition on osx: `sudo mount -t nfs -o rw 192.168.1.102:/export/data /media`


title: Short read while trying to open partition

text: On my personal home computer running Kubuntu Linux 13.04 I'm having trouble mounting a partition that is very dear to me. My backup policy is to perform a backup about monthly, so I do have a backup from August :). Is there any way to recover the personal files that are on this drive? The drive is a 1.5 year old 1000 GiB Western Digital Green drive, with home mounted on `/dev/sdc2`, the filesystem root on `/dev/sdc6`, and media files on `/dev/sdc3`. Therefore of course `sdc2` would be the one to go! So far as I know there were no power outages or other such events during the life of the drive. I managed to get this information by running a Kubuntu LiveCD:               kubuntu@kubuntu:~$ sudo fdisk -l          Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes     255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors     Units = sectors of 1 * 512 = 512 bytes                                                                                Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x00008044            Device Boot      Start         End      Blocks   Id  System     /dev/sdc1   *        4094    88066047    44030977    5  Extended     /dev/sdc2        88066048  1419266047   665600000   83  Linux     /dev/sdc3      1419266048  1953523711   267128832   83  Linux     /dev/sdc5            4096     6146047     3070976   82  Linux swap / Solaris     /dev/sdc6         6148096    47106047    20478976   83  Linux     /dev/sdc7        47108096    88066047    20478976   83  Linux               kubuntu@kubuntu:~$ sudo mount -t ext4 /dev/sdc2 c1     mount: wrong fs type, bad option, bad superblock on /dev/sdc2,       missing codepage or helper program, or other error       In some cases useful info is found in syslog - try       dmesg | tail  or so                 kubuntu@kubuntu:~$ sudo debugfs -c /dev/sdc2      debugfs 1.42.5 (29-Jul-2012)          /dev/sdc2: Attempt to read block from filesystem resulted in short read while opening filesystem     debugfs:  quit               kubuntu@kubuntu:~$ sudo fsck /dev/sdc2     fsck from util-linux 2.20.1     e2fsck 1.42.5 (29-Jul-2012)     fsck.ext4: Attempt to read block from filesystem resulted in short read while trying to open /dev/sdc2     Could this be a zero-length partition?               kubuntu@kubuntu:~$ sudo fsck.ext4 -v /dev/sdc2     e2fsck 1.42.5 (29-Jul-2012)         fsck.ext4: Attempt to read block from filesystem resulted in short read while trying to open /dev/sdc2     Could this be a zero-length partition?               kubuntu@kubuntu:~$ dmesg | tail     [ 2684.532855] Descriptor sense data with sense descriptors (in hex):     [ 2684.532858]         72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00      [ 2684.532876]         05 3f c8 b0      [ 2684.532885] sd 5:0:0:0: [sdc]       [ 2684.532893] Add. Sense: Unrecovered read error - auto reallocate failed     [ 2684.532898] sd 5:0:0:0: [sdc] CDB:      [ 2684.532902] Read(10): 28 00 05 3f c8 b0 00 00 08 00     [ 2684.532917] end_request: I/O error, dev sdc, sector 88066224     [ 2684.532927] Buffer I/O error on device sdc2, logical block 22     [ 2684.532973] ata6: EH complete      Help me Unix & Linux, you're our only hope.


title: Multiple processes reporting signals received

text: If I run multiple programs with `program &` in one terminal, and then from another one start sending `SIGKILL` `SIGINT` or any other signal, will the terminal running all the processes tell me what process received what signal?


title: In Fedora 17 kde I don't know user or password to authenticate printer installation

text: I am trying to set up a new computer with Fedora 17 and KDE both working ok. I have plugged in an HP laser USB printer, and am trying to set it up. I enter "system settings -> printers" from the KDE menu, and am asked for a user name and password for authentication. There I get stuck, nothing I can remember gets me any further. I have no problem with `su` or `sudo` from the terminal window, nor with the printer on my previous machine with Fedora 12. Please can anyone help me out of this impasse? Incidentally, although this is on a dual boot machine, with grub, I have no file `grub.cfg` or anything like it.


title: List/query Open X11 Display Connections?

text: I am hitting this bug: NEWT errors when closing sketch on Linux · Issue #1651 · processing/processing · GitHub, when using `Processing` on Linux (Ubuntu 11.04); my messages are:               X11Util.Display: Shutdown (JVM shutdown: true, open (no close attempt): 1/1, reusable (open, marked uncloseable): 0, pending (open in creation order): 1)     X11Util: Open X11 Display Connections: 1     X11Util: Open[0]: NamedX11Display[:0.0, 0xa3b8aa8, refCount 1, unCloseable false]     Finished.      The problem is, if I start a Processing program after that, it will usually lock (start with a blank screen); and then I have to re-start again. So I wanted to go according to the error messages, and try listing these "Open X11 Display Connections" or "NamedX11Display"s on a live system, so I could close them. But it turns out, I have no idea what command tool, if any, to use for this purpose. (Btw, those messages are apparently from the Java `jogl` library). Is there such a tool, that would query the live state of X11 (as a whole) on a system, and list all open displays and connections? How could I proceed to close one, if the originating process (e.g. `processing`) has already exited the process list?


title: Apache Server on different disk partitions

text: I have an Apache server installed with Debian. Later, I partitioned my hard drive and installed Ubuntu on the new partition. Afterwards, I realized I could not access my Apache server while booted into Ubuntu. How can I make it so the Apache server is accessible over the Internet no matter which partition I am booted into? Or is that even possible?


title: Timescales of any task in linux kernel?

text: I am studying how Linux kernel works and getting interested in the timescale of anything that happens in the kernel. Of course I know it depends on the HW, but would like to get an example. For instance,   * Interrupt Service routine : ~1ms?   * System calls : ~10ms?   * Printf(output 1 character) : 20ms?(not sure at all) It would be appreciated if anyone could leave any comment or recommend a website which includes info like the above.


title: rsync redoing files?

text: I found rsync redoing files that have no modification. One file is >1gb so it takes a bit to do. My command is below. I'm running the command via ssh. The filesystem in question is a NTFS usb HDD to a ext3 filesystem. Both connected to the same virtual machine running ubuntu               rsync --stats --progress -r src dst


title: Installing GCC 4.5 on Fedora 16

text: The default GCC package available in the Fedora 16 repositories is `gcc-4.6`. I need to install `gcc-4.5` on my system.   I downloaded the packages from the kijo repository, but when I try to install them it shows that a newer `libstdc++4.6` is installed. If I try to uninstall `libstdc++4.6` it tries to uninstall the system itself! (Almost every package in the system). And it would not allow me install `libstdc++4.5` along with `libstdc++4.6`. Is there a easy way that I can install `gcc-4.5` on my system?


title: MAC OS X lion mac address spoofing problem

text: I have to change the MAC address of my Macbook due to ISP issues. I changed it using:               sudo ifconfig en1 ether my_new_mac_address      And it is changed successfully when I check it through:               ifconfig en1 | grep ether      It returns               ether my_new_mac_address      But when I `ping google`, It can't resolve that, which means it is not connecting to the Internet. Am I missing something? The IP and gateway was set perfectly. N.B:The spoofing worked in the same way in Ubuntu, it is connected to internet.


title: Parameter splitting

text: I have a bash script that is a simple wrapper around another process:               $ cat ~/bin/s3cmd     #!/bin/sh     trickle -u 80 ~/bin/s3cmd.py $*     $      This works great when the parameters don't contain spaces. However, it seems to fail whenever the parameters passed to the outer `s3cmd` script contain spaces, even if those are escaped on the command line. How do I whitespace-proof this, such that each single parameter is passed on properly to `s3cmd.py`?


title: User Kernel split in 64bit Linux

text: What is the default user/kernel split in the 64bit linux ? I read `Documentation/x86_64/mm.txt` (which someone pointed out), but I could not make out. Can somebody provide a direct answer (something like 3GB/1GB for 32bit implementation).


title: Lower resolution of LVDS-0 in different aspect-ratio nVidia

text: I am trying to clone 2 displays. I have a laptop with 1440x900 resolution and an external monitor with 1024x768 resolution. I want the laptop screen to show the same as the external monitor however, since the last update I cannot select a lower resolution for the laptop than it's native resolution of 1440x900 in nvidia-settings. **Simply put, I want the laptop screen to display 1024x768 and cloned to the external monitor.** I have looked into xrandr and came to the following commands, however this does not work. ~~I am using the nVidia 302.17 driver at this moment.~~ I have upgraded to 304.48, but the issue remains.               dennisf@anarki:~$ cvt 1024 768 60     # 1024x768 59.92 Hz (CVT 0.79M3) hsync: 47.82 kHz; pclk: 63.50 MHz     Modeline "1024x768_60.00"   63.50  1024 1072 1176 1328  768 771 775 798 -hsync +vsync          dennisf@anarki:~$ xrandr --newmode "1024x768_60.00"   63.50  1024 1072 1176 1328  768 771 775 798 -hsync +vsync          dennisf@anarki:~$ xrandr --addmode LVDS-0 1024x768_60.00     X Error of failed request:  BadMatch (invalid parameter attributes)       Major opcode of failed request:  153 (RANDR)       Minor opcode of failed request:  18 (RRAddOutputMode)       Serial number of failed request:  31       Current serial number in output stream:  32      Further information:               dennisf@anarki:~$ xrandr -q     Screen 0: minimum 8 x 8, current 1440 x 900, maximum 8192 x 8192     VGA-0 disconnected (normal left inverted right x axis y axis)     TV-0 connected 1024x768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm        1024x768       60.0*+        800x600        60.0          720x480        60.0          640x480        60.0          640x400        60.0          512x384        60.0          7936x32636    137.6       LVDS-0 connected 1440x900+0+0 (normal left inverted right x axis y axis) 331mm x 207mm        1440x900       60.1*+   60.1       HDMI-0 disconnected (normal left inverted right x axis y axis)       1024x768_60.00 (0x277)   63.5MHz             h: width  1024 start 1072 end 1176 total 1328 skew    0 clock   47.8KHz             v: height  768 start  771 end  775 total  798           clock   59.9Hz      Thank you.


title: Find files by the length of filename

text: I want to find all files by length of the file names. For example if I want to find files of length 1, such as a.go, b.go I put:               grep '.\{1\}' file      But this does not work. What command can I use to find files by file name length?


title: Where does g++ store compiled sources?

text: I compiled an application with a Makefile and g++ and it turned out, that g++ doesn't have to recompile the whole application again when I modify the Makefile (I changed to paths to the dynamic link libraries). At that time the application haven't yet compiled successfully, so there was no final executable application available. But g++ didn't compile the whole application again.   Where is this information or compiled sources stored? I didn't see anything neither in /tmp nor in any hidden file within my home dir, nor within the root directory of the application itself. (Maybe I didn't look well enough).


title: trying to search inside chmod with command

text: I am trying to find commands with the word "symbolic" inside the contents If I type                  man chmod      and                  /symbolic      you can see that chmod command has the line of "new modes of the file will also be printed, in both octal and symbolic notation. ~ " So I was expecting if I type                  man -f "symbolic"      the chmod command shows up, but it doesn't Why not? And how do I look up the words in "Full", not "short", command man page? so that I can look up chmod by searching the word "symbolic" Thanks


title: Print unique of who command

text: I want to show the online users using the `who` command but I want to have a unique output and not show any duplicates. I piped the output into `awk` but I am not very familiar with that, is this the right way and how to proceed?


title: How can I recall a numbered history command for edit?

text: I frequently search for changes with `history | grep 'string'` I get a list of commands in my history, along with the history line number), e.g.               history | grep 'git'            755  git status      1535  git push origin master      1570  git merge origin/one-146      1667  git reset --hard origin/master      I can now recall and execute a command in one go with `!nnn`, for example:               !755     git status     # On branch master     nothing to commit, working directory clean      My question is: How can I recall a numbered history command and stay on the commands line for editing and **not** execute it right away 'as is', the way that `!` does, so that I can change a couple of things peform presing return?


title: What are the systemd command line options "--switched-root" and "--deserialize"?

text: Doing a `ps` on my Linux box shows that `systemd` runs with the command line options `\--switched-root` and `\--deserialize`. Nothing in the man page or `/usr/share/doc/systemd` mentions them, and Google hasn't been much help. So, what do they do? I'm guessing that `\--switched-root` has something to do with pivot_root, but that's just a guess.


title: how to run .dump command in linux?

text: I want to create dump file of sqlite database from java but I can't run the below command from linux. I got the help of windows and I tried with linux but it appears one terminal nothing more than that. So can anyone help me how to write this command in linux?                 Process p = Runtime.getRuntime().exec("cmd /c start /b sqlite3 db.sqlite .dump > dump.txt");      My implementation in Linux is below:               String command= "/usr/bin/xterm";      Runtime rt = Runtime.getRuntime();       Process p = rt.exec(new String[]{command , "/home/ubuntu/test.sqlite .dump > /home/ubuntu/newsql111.sql"});      Can anyone tell me where is my mistake?


title: I need to RDP to a server through a reverse tunnel

text: I have a windows PC that is on network A and a windows PC on network B. Also in network B I have several Linux servers. From the PC on network A, I can ssh to any server on network B. I cannot, however, connect to the PC on network A from a computer on network B.                                                                     Windows PC Local                                                            __  _                                             can ssh                 [__]|=|                            .-,(  ),-.    --------->    .-,(  ),-.  /::/|_|                         .-(          )-.            .-(          )-.                (    Network A   )          (    Network B   )                '-(          ).-'           '-(          ).-'                    '-.( ).-'    <---------     '-.( ).-'                                     can't ssh               Linux Server #1          Windows PC Remote                               __  _                    __  _                                         [_Linux Server #2          [__]|=|                                        /: __  _                   /::/|_|                                          [__]|=|                                                                   /::/|_|              I would like to be able to RDP to my network A PC from my network B PC. Is this possible using some sort of reverse tunneling through one of the linux boxes?


title: how to include or add /dev with tar --one-file-system

text: I'm running tar on a complete remote filesystem using               ssh -n <hostname> 'sudo tar -cpvzf - --one-file-system /' | cat > Bak.tar.gz      This gave me a tarball. I tried importing this tarball into another service i'm using and ran into an issue because it appears it did not include the `/dev` directories. I'm wondering if I can do something like `\--include="/dev"` or `/dev` after the initial tar. Need some guidance here.


title: Permission of DVD device file not being retained when machine is rebooted

text: I am using Linux Fedora 4 and would like a non-root user to be able to write to DVDs using the DVD drive. I was able to do this by adding write access to the group of the device file `/dev/scd0` and have added the user to the relevant group. However, whenever the machine is rebooted, the device file reverts back to its original permissions. How can I configure it so that the permission stays the way I want it to? I tried creating a file called `11-local.rules` in the `/etc/udev/rules.d` directory with the following contents:               KERNEL=="scd0", MODE="0660"      But this did not help. The permission stays the way it is.


title: Identifying files with special characters in its name in a terminal

text: Something strange happened today.   I was connected to an HP server with putty, and saw two files with exact same name: > -rw-r--r-- 1 hemantj 3368 Apr 1 12:47 test   >  -rw-r--r-- 1 hemantj 20 Sep 1 12:47 test It was very strange as you can't have files with the same name. Later when I was connected with FileZilla I saw that there is some special   character at the end of the second file name. My Question: is it possible to highlight special characters in the file name in a terminal? I am connected to HP-UX and my shell is tcsh and ksh. **EDIT:** Thanks all for your reply but I think Keymon's solution is the simplest and more portable.   +1 for all of you -- I learned a lot from your responses


title: Display file using Dialog

text: I have a file on disk which contains some text I want to display on the screen. You can do it like this:               dialog --yesno "`cat FILE`" 10 100      However, I'm concerned that if `FILE` becomes large, I'm likely to exceed the command length limits of the shell. Is there some other way to accomplish this task? I want to display the contents of the file so the user can scroll through it (if it's _really_ long), and then select what to do next. (I've relabelled the "yes" and "no" buttons to something more meaningful.) Presumably trying to pipe six pages of text through the command line like this is going to break.


title: Make changes to /sys persistent between boots

text: I want to make `"echo 1 > /sys/kernel/mm/ksm/run"` persistent between boots. I know that I can edit `/etc/sysctl.conf` to make `/proc` filesystem changes persist, but this doesn't seem to work for `/sys`. How would I make this change survive reboots?


title: Install FFMPEG on RHEL/CentOS

text: I've been searching for hours now and trying various methods of installing FFMPEG on my CentOS server. This is what I have currently installed on my Ubuntu desktop:               FFmpeg version 0.6.2-4:0.6.2-1ubuntu1.1, Copyright (c) 2000-2010 the Libav developers       built on Sep 16 2011 17:00:39 with gcc 4.5.2       configuration: --extra-version=4:0.6.2-1ubuntu1.1 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --enable-libvpx --disable-stripping --enable-runtime-cpudetect --enable-vaapi --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libdc1394 --enable-shared --disable-static       WARNING: library configuration mismatch       libavutil   configuration: --extra-version=4:0.6.2-1ubuntu2+medibuntu1 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libdirac --enable-libgsm --enable-libopenjpeg --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --enable-libvpx --disable-stripping --enable-runtime-cpudetect --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-version3 --enable-vaapi --enable-libopenjpeg --enable-libfaac --enable-nonfree --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libfaad --enable-libdirac --enable-libfaad --enable-libmp3lame --enable-librtmp --enable-libx264 --enable-libxvid --enable-libdc1394 --enable-shared --disable-static       libavcodec  configuration: --extra-version=4:0.6.2-1ubuntu2+medibuntu1 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libdirac --enable-libgsm --enable-libopenjpeg --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --enable-libvpx --disable-stripping --enable-runtime-cpudetect --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-version3 --enable-vaapi --enable-libopenjpeg --enable-libfaac --enable-nonfree --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libfaad --enable-libdirac --enable-libfaad --enable-libmp3lame --enable-librtmp --enable-libx264 --enable-libxvid --enable-libdc1394 --enable-shared --disable-static       libswscale  configuration: --extra-version=4:0.6.2-1ubuntu2+medibuntu1 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libdirac --enable-libgsm --enable-libopenjpeg --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --enable-libvpx --disable-stripping --enable-runtime-cpudetect --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-version3 --enable-vaapi --enable-libopenjpeg --enable-libfaac --enable-nonfree --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libfaad --enable-libdirac --enable-libfaad --enable-libmp3lame --enable-librtmp --enable-libx264 --enable-libxvid --enable-libdc1394 --enable-shared --disable-static       libpostproc configuration: --extra-version=4:0.6.2-1ubuntu2+medibuntu1 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libdirac --enable-libgsm --enable-libopenjpeg --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --enable-libvpx --disable-stripping --enable-runtime-cpudetect --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-version3 --enable-vaapi --enable-libopenjpeg --enable-libfaac --enable-nonfree --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libfaad --enable-libdirac --enable-libfaad --enable-libmp3lame --enable-librtmp --enable-libx264 --enable-libxvid --enable-libdc1394 --enable-shared --disable-static       libavutil     50.15. 1 / 50.15. 1       libavcodec    52.72. 2 / 52.72. 2       libavformat   52.64. 2 / 52.64. 2       libavdevice   52. 2. 0 / 52. 2. 0       libavfilter    1.19. 0 /  1.19. 0       libswscale     0.11. 0 /  0.11. 0       libpostproc   51. 2. 0 / 51. 2. 0     Use -h to get full help or, even better, run 'man ffmpeg'     Hyper fast Audio and Video encoder     usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...      I'm particularly interested in `\--enable-librtmp`, as I need to use FFMPEG to stream to a RTMP server. I've followed numerous tutorials, (one in particular had me install a DAG repository which no longer exists x|) but aren't really having too much luck. How can I install it on my server with the functionality I need?


title: What are my options for integrating audacity into shell scripts?

text: Just generally, I mean. Ideally I want to be able to script the nyquist plugins directly from the Linux command line by means of one-liners. A cursory glance at scripting audacity shows that it's possible to use a command interpreter from within audacity, but as far as being able to use that interpreter or script the program itself, I wasn't able to come up with any info. What are my options for manipulating audio from the command line with audacity? Is it a bunch of hassle, or doable in one-liners? If it's not possible to write a one-liner, maybe it's better to use a Python library instead, or some other program... (recommendations encouraged).


title: Filter a .CSV file based on the 5th column values of a file and print those records into a new file

text: I have a .CSV file with the below format:               "column 1","column 2","column 3","column 4","column 5","column 6","column 7","column 8","column 9","column 10     "12310","42324564756","a simple string with a , comma","string with or, without commas","string 1","USD","12","70%","08/01/2013",""     "23455","12312255564","string, with, multiple, commas","string with or, without commas","string 2","USD","433","70%","07/15/2013",""     "23525","74535243123","string , with commas, and - hypens and: semicolans","string with or, without commas","string 1","CAND","744","70%","05/06/2013",""     "46476","15467534544","lengthy string, with commas, multiple: colans","string with or, without commas","string 2","CAND","388","70%","09/21/2013",""      5th column of the file has different strings. I need to filter out the file based on the 5th column value. Lets say, I need a new file from the current file which has records only with the value "string 1" in its fifth field. For this I tried the below command, **`awk -F"," ' { if toupper($5) == "STRING 1") PRINT }' file1.csv> file2.csv`** but it was throwing me an error as following:               awk: { if toupper($5) == "STRING 1") PRINT }     awk: ^ syntax error     awk: { if toupper($5) == "STRING 1") PRINT }     awk: ^ syntax error      I then used the following which gives me an odd output. **`awk -F"," '$5="string 1" {print}' file1.csv> file2.csv`** Output:               "column 1" "column 2" "column 3" "column 4" string 1 "column 6" "column 7" "column 8" "column 9" "column 10     "12310" "42324564756" "a simple string with a comma" string 1 without commas" "string 1" "USD" "12" "70%" "08/01/2013" ""     "23455" "12312255564" "string with string 1 commas" "string with or without commas" "string 2" "USD" "433" "70%" "07/15/2013" ""     "23525" "74535243123" "string with commas string 1 "string with or without commas" "string 1" "CAND" "744" "70%" "05/06/2013" ""     "46476" "15467534544" "lengthy string with commas string 1 "string with or without commas" "string 2" "CAND" "388" "70%" "09/21/2013" ""      P.S: I used the toupper command to be on the safe side, as I am not sure if the string will be in lower or higher case. Also, Please advise what is wrong with my code and if the space in the string matters while searching for a pattern using AWK.


title: Cannot add ubuntu to the suse grub

text: I am running SuSE 11.2. I also have windows and Ubuntu on the same machine. The problem is that I cannot get Ubuntu to show as a boot option on SuSE's grub. The Ubuntu partition is on `/dev/sda5`. Here is my `/boot/grub/menu.lst`:               # Modified by YaST2. Last modification on Wed Sep 15 13:08:06 SAST 2010     # THIS FILE WILL BE PARTIALLY OVERWRITTEN by perl-Bootloader     # Configure custom boot parameters for updated kernels in /etc/sysconfig/bootloader          default 0     timeout 8     ##YaST - generic_mbr     gfxmenu (hd0,2)/boot/message     ##YaST - activate          ###Don't change this comment - YaST2 identifier: Original name: linux###     title Desktop -- openSUSE 11.2 - 2.6.31.12-0.2         root (hd0,2)         kernel /boot/vmlinuz-2.6.31.12-0.2-desktop root=/dev/disk/by-id/ata-ST3160815AS_9RX3KRP8-part3 resume=/dev/disk/by-id/ata-ST3160815AS_9RX3KRP8-part2 splash=silent quiet showopts vga=0x31a         initrd /boot/initrd-2.6.31.12-0.2-desktop          ###Don't change this comment - YaST2 identifier: Original name: failsafe###     title Failsafe -- openSUSE 11.2 - 2.6.31.12-0.2         root (hd0,2)         kernel /boot/vmlinuz-2.6.31.12-0.2-desktop root=/dev/disk/by-id/ata-ST3160815AS_9RX3KRP8-part3 showopts apm=off noresume nosmp maxcpus=0 edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 x11failsafe vga=0x31a         initrd /boot/initrd-2.6.31.12-0.2-desktop          ###Don't change this comment - YaST2 identifier: Original name: windows###     title Windows         rootnoverify (hd0,0)         chainloader +1          #Don’t change this comment – YaST2 identifier: Original name: none#     title Ubuntu 10.04         root (hd0,4)         kernel /vmlinuz root=/dev/sda5 ro quiet splash         initrd /initrd.img


title: Want to install windows software in Linux Mint 16 Cinnamon

text: I have some software that I run under windows XP but now XP will no longer have support after April 2014, I'd like to run it in Linux Mint 16 Cinnamon. If there is no Linux Mint version of the software how do I get it to run on Linux Mint as this is the system I will be using from now on? I'm not an experienced user of Linux but I'll try and learn, then help someone else.


title: In a UID namespace, can I setuid to an unmapped UID?

text: Suppose I'm user ID 1000. I run a program inside a UID namespace, mapping UID 0 inside the namespace to UID 1000 outside the namespace. The program then attempts to change its own UID to 50, which doesn't have a corresponding UID outside the namespace. Does the program successfully change its own (kernel) UID? If so, what does its UID appear to be from outside the namespace? Is it still 1000, or is it something else?


title: Change terminal resolution on Whiite (Wii Linux)

text: Is there a way to change the terminal resolution in Whiite (Linux for Wii)? All the answers I can find suggest editing grub configuration, but Whiite uses a custom bootloader instead of grub.


title: Is there a archive of old man pages? specifically for the features available for grep in early 'ed'

text: This is just a bit of history rummaging... I'd like to know how different today's `grep` is to the original implementation, introduced by Ken Thompson in ed. which evolved to ex, which then became vi...   I think too, that `emacs` was an evolution of `ed` (with macros)...


title: Stop compiz from animating chromium history drop-down box?

text: I don't know how to stop compiz from animating the drop-down list from chromium browser, it only appears if you type something, and disappears when focus is lost. Any ideas on how to do it? I just don't want the default window animation to be applied on that. **EDIT** Doesn't seem to work: ![enter image description here](http://i.stack.imgur.com/2nMQG.png)


title: I can not remove folder from server

text: Accidentall I created the folder on remotely server (Server OS is Linux) using php: `mkdir("folder_name",0);` Now I can not delete this folder from server. I think this is from permission, because `0` is not correct permission. When I am trying delete this folder which php function `rmdir()`, php returns error               Unable to access on this folder.      Same error obtain I, when trying change access which php's `chmod()` function. I can not delete folder which FTP client also. So how can I delete this folder?


title: Looking for elegant iproute2 solution for host w/ 2 interfaces on 2 networks and 3 gateways

text: I've got a Linux webserver with 192.168.0.2/24 assigned to eth0 and 172.16.0.2/24 assigned to eth1. I must not change this. Here's the routing so far:               172.16.0.0/24 dev eth1 proto kernel scope link src 172.16.0.2     192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.2     172.16.0.0/16 via 172.16.0.1 dev eth1     default via 192.168.0.1 dev eth0      The default route leads to the Internet which the machine needs access to for downloading stuff. Now there are also packets (requests) coming in from the Internet via 172.16.0.254. How do I have to set up routing tables and rules in order to answer those requests? `iptables` is not possible here. Update: Seems like this works, but it doesn't look elegant to me:               ip r a 172.16.0.0/24 dev eth1 table 10     ip r a 172.16.0.0/16 via 10.16.0.1 t 10     ip r a default via 172.16.0.254 t 10     ip rule add from 172.16.0.2 t 10


title: What is the first chmod octal digit in a four-digit value for?

text: Sometimes I see `chmod` commands that use four octal digits instead of three -- what is the optional first digit for? For example, `chmod 777` is equivalent to `chmod a+rwx`; what's the same command for `chmod 2777`?


title: Reload of tmux config not unbinding keys (bind-key is cumulative)

text: I've been experimenting with different tmux keybinding settings and I've noticed the following: If I reload my tmux config (from within tmux) the keybindings I once had loaded will remain loaded. The only way (I know of) to clean this up is to quit all tmux sessions and restart. So it looks like tmux remembers all previously loaded keybindings and will only remove them on a fresh start or by explicitly unbinding them. To recreate this:   * open a terminal (A)   * start tmux   * check whether the keybinding shows a clock (press `PREFIX C-t`)   * press `PREFIX ?` to see the keybinding in the list   * edit `~/.tmux.conf`   * add a keybinding (`bind C-t display "Keybinding C-t"`)   * reload tmux config (`PREFIX : source-file ~/.tmux.conf`)   * check whether the keybinding works (press `PREFIX C-t`)   * press `PREFIX ?` to see the new keybinding in the list   * edit `~/.tmux.conf` again   * remove the keybinding (so remove `bind C-t display "Keybinding C-t"`)   * reload tmux config (`PREFIX : source-file ~/.tmux.conf`)   * check whether the keybinding works (press `PREFIX C-t`), it still displays "Keybinding C-t"   * press `PREFIX ?` to see that the new keybinding is still in the list   * exit tmux   * enter tmux   * check whether the original keybinding works again (press `PREFIX C-t`), it should now display a clock again   * press `PREFIX ?` to see that the new keybinding has been removed from the list **My question: is there a way to instruct tmux to "forget" all loaded configs and then load`.tmux.conf` ?**


title: Man pages for standard C and C++ libraries on Fedora 14

text: How do I install them? At present, `man fopen` gives me `No manual entry for fopen`. I have the compilers installed and have verified that things do build without problems. **Update:** This is what I got when I tried the suggested solutions on Fedora 14:               [root@damien agnel]# yum install man-pages libstdc++-docs     Loaded plugins: langpacks, presto, refresh-packagekit     Adding en_US to language list     Setting up Install Process     Package man-pages-3.25-1.fc14.noarch already installed and latest version     Package libstdc++-docs-4.5.1-4.fc14.x86_64 already installed and latest version     Nothing to do     [root@damien agnel]# man std::iostream     No manual entry for std::iostream     [root@damien agnel]#


title: Shift every mode by a constant factor of an audio signal

text: Is there any tool for linux which can shift every frequency of the spectrum of a sound signal by a constant factor and output the resulting sound? Especially I am looking for a way to simulate the Doppler effect for sound wave.


title: How to run time on multiple commands AND write the time output to file?

text: I want to run `time` command to measure time of several commands. What I want to do is:   * Measure the time of running of all of them added together   * Write the `time` output to a file   * Write the `STDERR` from the command I am measuring to `STDERR` What I do **_NOT_** want to do is   * Write the several commands into a separate script (why? because all of this is already a script that I am generating programatically, and creating _ANOTHER_ temporary script would be more mess than I want) What I tried so far: `/usr/bin/time --output=outtime -p echo "a"; echo "b";` Doesn't work, `time` is run only on the first one. `/usr/bin/time --output=outtime -p ( echo "a"; echo "b"; )` Doesn't work, `(` is unexpected token. `/usr/bin/time --output=outtime -p { echo "a"; echo "b"; }` Doesn't work, "no such file or directory". `/usr/bin/time --output=outtime -p ' echo "a"; echo "b";'` Doesn't work, "no such file or directory". `time ( echo "a"; echo "b"; ) 2>outtime` Doesn't work, since it redirects all `STDERR` into `outtime`; I want only the `time` output there. And of course, `time --output=outime echo "a";` Doesn't work, since `\--output=outime: command not found`. How can I do it?


title: Add all users in one group to another group?

text: I have some users in a group called `aa` and I need to give them the rights to write to a folder which is currently `tomcat:tomcatdeploy`. The straightforward way to do this is to add all the users to the `tomcatdeploy` group, one-by-one. Is it possible to say that members of group `aa` are also automatically members of `tomcatdeploy` by somehow adding the `aa` group to the `tomcatdeploy` group? Or is that trying to push the UNIX permissions scheme too far?


title: Beginner's question: Accessing network location on domain

text: I'm new to Linux so this might seem a little naive! So, my computer is connected to a university network, in the computer science department. This domain is called "cs". However, "cs" is a subdomain of the whole university network, "myuni". For example, let's imagine the website for the department is www.cs.myuni.edu. Now, if I want to access a directory on the "cs" domain, I open a terminal and type in `cd /cs/shared_directory1`, which is fine. But what if I want to access a directory on the "myuni" domain? Would I type in `cd /myuni/shared_directory2`, `cd //myuni/shared_directory2`, or something else? Or is it not possible because, perhaps, you can only access locations on one domain above you, not two?


title: How to go back n levels of directories from the command line?

text: For example, I do the following `cd`s in succession-               cd /tmp     cd /home/admin     cd /root/     cd /some_other/directory      Now I am in `/some_other/directory`. Now, is there anyway to go back to `/tmp`, the directory from where I started, from the command line? Just like we navigate directories using the back button in the GUI? `cd -` just takes me one level back.


title: SSH key-only remote login, is disabling password a good practice?

text: I need a maintenance user which only requires a remote login. I'll preferably use only public keys to login into the account. I thought of just creating the user with `useradd myuser`, adding later the required public keys to its `authorized_hosts` file. `useradd` disables the password by default. Do I still require to run a `passwd -l myuser` to lock it? Any drawbacks here?


title: Is Red Hat Linux licensed

text: Am confused so thought of asking a question. According to this Red Hat Becomes Open Source’s First $1 Billion Baby, it is opensourced so my question is: Where can I download the Opensource version all weblinks provided points RHEL it is commercial isnt it? Am I missing something ?


title: How do I set up an encrypted swap file in Linux?

text: How do I set up an encrypted swap file (not partition) in Linux? Is it even possible? All the guides I've found talk about encrypted swap partitions, but I don't have a swap partition, and I'd rather not have to repartition my disk. I don't need suspend-to-disk support, so I'd like to use a random key on each boot. I'm already using a TrueCrypt file-hosted volume for my data, but I don't want to put my swap in that volume. I'm not set on using TrueCrypt for the swap file if there's a better solution. I'm using Arch Linux with the default kernel, if that matters.


title: What is the difference between "*.pl" and *.pl in grep? Why does quoting change the result?

text: What is the difference between:   `grep "string" . -r --include *.pl` and `grep "string" . -r --include "*.pl"` The latter includes files in subdirectoried while the former not. Why?


title: Prevent Wacom tablet from moving mouse pointer

text: I have a Wacom CTF-221 graphics tablet, and I use it with Linux Wacom drivers. However when I draw it's annoying that the mouse pointer moves with the pen and clicks outside of the drawing window. When I draw in GIMP, I see another pointer that is "locked" inside the image, so I think that my PC sees two devices, one as a tablet and one as a virtual mouse. Is it possible to disable this behavior, so that my tablet movement will be seen only by the program I'm drawing to?


title: How to test for possible conflicts while using alias in bashrc?

text: Is there a simple way to list all the command conflicts that have occurred in the system due to the bashrc update involving alias commands? For example, someone writes `alias ls=/path/to/user-generated/executable` in bashrc. How does one find out that this is masking an actual command (`ls`). One way seems to be to run all the aliases before and after sourcing bashrc and diff the output. Are there any better ways? I'm running Ubuntu 12.04. **bash --version** GNU bash, version 4.2.24(1)-release (i686-pc-linux-gnu)


title: ls recursive on home dir only with no flags specfied other than color

text: Like the topic says whenever I am in my home directory and run ls it shows me every file in every folder recursively, I cannot find any documentation of why this would happen, I have been looking on google everywhere to no avail. I'm not sure exactly when it started doing this so I'm not sure what the culprit is. It also does this as root also, but it doesn't do this in any directory but the home directory. This leads me to believe that it a setting on the directory or a file in it. Any help would be appreciated! CentOS 6.4 64bit               dr-xr-xr-x 130 user     user      55M Dec 20 22:05 user          $ uname -a     Linux 3.10.9-xxxx-grs-ipv6-64 #1 SMP Wed Aug 21 11:51:59 CEST 2013 x86_64 x86_64 x86_64 GNU/Linux          $ which ls     alias ls='ls --color=auto'             /bin/ls      More info:               $ type ls     ls is aliased to `ls --color=auto'          $ type -a ls     ls is aliased to `ls --color=auto'     ls is /bin/ls          $ ls     file1     file2     folder1     folder1\file3     folder1\file4     folder2     folder2\file5     folder3     file6      and so on and so forth it lists every file in the home directory and then each file in each folder               $ strace ls     write(1, "WWW_ERRORS\n", 11WWW_ERRORS     )            = 11     write(1, "WWW_ERRORS\\404.html\n", 20WWW_ERRORS\404.html     )  = 20     write(1, "WWW_ERRORS.rar\n", 15WWW_ERRORS.rar     )        = 15     write(1, "xbmc\n", 5xbmc     )                   = 5     close(1)                                = 0     munmap(0x3627ad0b000, 4096)             = 0     close(2)                                = 0     exit_group(0)                           = ?


title: How can I continue past this point in installing Solaris 11 under VMware Fusion 5.0.4 on Mavericks?

text: I have a Mac running VMware Fusion 5.0.4 on OSX Mavericks, and I do not seem to be able to get past a certain point on installation on either of two installers I tried. A (text) window comes up, labelled 'System Configuration Tool', with options of 'F2_Continue', 'F6_Help', and 'F9_Quit'. The text of the initial screen says, 'If your keyboard does not have function keys, or they do not respond, press ESC; the legend at the bottom of the screen will change to show ESC keys for navigation and other functions.' I haven't been able to get past this screen or get any change to register in a way that makes a difference to the screen. F2, F6, and F9 do their usual Macintosh effects and nothing else I can discern; hitting escape, or manually hitting ^[, made no observable change. I'm not sure how far I trust function keys under VMware, but escape has otherwise worked. Other forms of input, chiefly hitting return, have had the desired effect. How under VMware Fusion on Mavericks can I get past this point of the installation? No VMware Tools have been installed on the VM; I haven't logged in or gotten past this point in setup.


title: AWK for data smoothing

text: I need some help to smooth some data with awk olny of column 4 and next. This is a data example:               Date;time;Time_ms;A;B;C;D     23.11.2012;15:03:00;41236627696;1;2;2;3     23.11.2012;15:04:00;41236628391;2;3;3;11     23.11.2012;15:06:00;41236629097;1;23;7;15     24.11.2012;15:07:00;41236627696;1;4;5;3     24.11.2012;15:08:00;41236628391;3;12;1;2     24.11.2012;15:09:00;41236629097;2;23;71;15;8     23.11.2012;15:10:00;41236627696;7;1;2;2;3     23.11.2012;15:11:00;41236628391;2;3;12;1;     23.11.2012;15:12:00;41236629097;22;2;7;15      The output should not modify Date;time;Time_ms and print the average of A with the A field of n row before and the A field of n row after. The same should be done for the B, C, D... column. For example if n=1 the second row will be:               23.11.2012;15:04:00;41236628391;(1+2+1)/3;(2+3+23)/3;(2+3+7)/3;(3+11+15)/3      Maybe something like this can be a startpoint               BEGIN { WIDTH=3 }          {       DATA[(++N)%WIDTH]=$0    }          (N>=WIDTH) {             V=0             for(X=(N+1); X<=(N+WIDTH); X++)                     V+=DATA[X%WIDTH];                  print V/WIDTH;     }      Source


title: Can not change brightness on Toshiba P855 - tried every distro already

text: I'm trying to use Linux on a Toshiba P855 laptop. And I have one big problem: the screen brightness can't be changed, and stays at maximum. Tried different distros, also tried many boot options in the `/etc/default/grub` file, but no success. Currently I'm with Kubuntu 12.04, and the function keys for brightness don't work (they never did on any distro), so I'm able to use only the slider for the brightness. But even then - nothing really changes. All is working on Windows. What's wrong here? EDIT: Additional information Well, in `/sys/class/backlight` I have a symlink: `toshiba -> ../../devices/LNXSYSTM: 00/TOS1900:00/backlight/toshiba/` and in that `toshiba` folder I have:   * actual_brightness   * bl_power   * brightness device -> `../../../TOS1900:00/`   * max_brightness   * power (folder)   * subsystem -> ...   * type   * uevent and in `/proc/acpi/` I have:   * ac_adapter (folder)   * battery (folder)   * button (folder)   * event   * toshiba (folder)   * wakeup


title: Delete the files on the destination which are found in the source using rsync

text: I was wondering is there any way to delete all the files in the destination using `rsync` which are found in source. I have 30+ dir in source and 100+ files on the destination I want only the 30+ in the destination to be delete recursively wondering if `rsync` or any other would help me do that... Source               a/     b/     c/      destination               a/     abc/     xyz/     b/     c/     ...


title: Find out which modules are associated with a usb device?

text: Could you recommend a way to figure out which driver is being used for a USB device. Sort of a usb equivalent of `lspci -k` command.


title: /shell-script: syntax error near unexpected token `done'

text: I am getting `syntax error near unexpected token done` while executing my shell script:               while read filename     do       echo "$filename"       if [ -s $filename ]; then         tail -10 $filename | grep `date '+%Y-%m-%d'` >> $lastlines1         echo "- Next Error File - " >> $lastlines1       done       else       echo " no errrors"     fi      Any ideas, where am I going wrong?


title: Why is my condition always false?

text: I tried to write a script which creates a user. First it needs to check if:   1. root is running   2. if user maybe already exists I Also tried to set the password equal to the username which was typed in. Overall this works fine if i copy it step by step and execute it step by step. But the whole script won't work.               #!/bin/bash     if [ "$(id -u)" = "0" ]; then         read -p "User: " username         pass=$username              if [ getent username>/dev/null 2>&1 ]; then             echo "$username already exists"             sleep 10             exit 1         else                 useradd -m $username             echo "$pass" | passwd $username --stdin             [ $? -eq 0 ] && echo "User was created" || echo "Error while creating"             unset username              fi     else         echo "No root"         sleep 3         exit 2       fi


title: What's the difference between && and ; when forking sleep to background?

text: I have just asked a question about forking a process to sleep in the backgroud.   The notation I came up with myself looks like this:               sleep 10 && echo "hello world" &      This answer to a different question uses a different format.               ( sleep 10 ; echo "hello world" ) &      I know that `&&` only allows the second process to start if the first one returns true. Can sleep fail? Is there a situation where I should prefer one over the other?


title: install BIND9 AS A source RPMs

text: I want to install BIND9 with its source code on Linux (CentOS 6.3), we know by using `yum install bind*` we don't get the source code, we get only the binary files. Can anybody explain to me how to install BIND with its whole source code especially the `.c` files by using source RPM? Something like this:               $ yumdownloader --source module-init-tools


I've installed VMWare Player 6.0.1 build - 1379776 on a Red Hat Enterprise linux Server release 6.1 Beta ( Santiago ). When I attempt to start my virtual machine, I get the following the error:                 Could not open /dev/vmmon: No such file or directory.       Please make sure that the kernel module `vmmon' is loaded.      `uname -r`               2.6.32-122.el6.x86_64      When I install vmmon I get the following error: `sudo modprobe vmmon`               FATAL: Error inserting vmmon (/lib/modules/2.6.32-122.el6.x86_64/misc/vmmon.ko):    Invalid module format       My 2nd question is: When I install it with `vmware-modconfig –console –install-all` I get the following error. How can I install all these packages?               Gtk-Message: Failed to load module "pk-gtk-module": libpk-gtk-module.so: cannot open    shared object file: No such file or directory     Gtk-Message: Failed to load module "canberra-gtk-module": libcanberra-gtk-module.so: cannot open shared object file: No such file or directory     Logging to /tmp/vmware-root/vmware-modconfig-9282.log     Icon name must be set.


title: Is there a tool that can monitor bandwidth usage of a single process?

text: I've found a nice monitor which allows me to log a variety of runtime data of a single process. I'm looking for an equivalent that does the same for bandwidth usage. Ideally, the command should look like `bwmon --pid 1 --log init.log`. Is there such? Can it run without admin privileges?


title: What does dd stand for?

text: I know very well what the command does, but `man dd`, `info dd` tell me: 'Convert and copy a file', as does GNU Coreutils. Google says its an abbreviation of everything between medicine and bad webchat slang; except someone saying it means 'data destroyer', something used in PC forensics - I'd be horrified if my dd destroyed _my_ data! Any insight? :-) * * * **Update** : Of course I had to check the jargon file: > The Unix dd(1) was designed with a weird, distinctly non-Unixy keyword > option syntax reminiscent of IBM System/360 JCL (which had an elaborate DD > ‘Dataset Definition’ specification for I/O devices) Still sounds pretty ambiguous, but then it says: > though the command filled a need, the interface design was clearly a prank. Heh :-)


title: Can I determine the number of sub-directories in a directory using `ls -l`?

text: When displaying directories using `ls -l`, their number of links (the second field in the output) is at least two: one for the dir name and one for `.`               $ mkdir foo     $ ls -l     total 2     drwxr-xr-x  2 user   wheel  512  4 oct 14:02 foo      Is it safe to always assume that the number of links above 2 corresponds to the number of subdirectories in this dir (`..` links) ?


title: Where and how do I create new system-wide menu items for CentOS/RH 5?

text: I have some CentOS 5.5 systems. I have installed the rdesktop rpm, however no entry appears to be made in the gnome or kde menus for it. Where is the menu structure in the filesystem? Is it one location shared for both Gnome and KDE installations, or are they in separate places? I am presuming that once I find this structure, I can copy an existing entry and point it at my newly installed program (rdesktop in this case). I want to do this so that I can do it automatically at kickstart time in the future. Is this a bad assumption? Should I do this another way? Update: It turns out rdesktop actually did install an icon, intuitively named "krdc". But the general question stands.


title: Processor use and core use

text: I want to play around with threading and parallelism. I know my processor has multiple cores, but do not know how to see what is happening on each of them. What is the right way to access this information? More concretely, I am planning the following: I imagine writing a little program that launches several threads, these threads should then be spread over the cores and communicate with each other where needed. I would like to be able to observe where which thread is running, any hints? I am completely new to trying this kind of thing (I would also be quite happy with any information related to this that does not directly address this question). Best, Bart (googling only got me to "cat /proc/cpuinfo", which seems to tell me I have 7 processors. This is not a true fact, which tells me I do not know how to read this output.)


title: How to I install zabbix-agent over apt-get

text: Why is it that on my Ubuntu 13.04 system I can easilly install **zabbix- agent** by doing `apt-get install zabbix-agent`.   When I do it in Debian 7.1, it says that the package zabbix-agent can not be found. I run Zabbix version 2.0.8 on the zabbixserver.


title: Trouble installing lxml with custom install location for libxml2/libxslt

text: I am attempting to install a python module called `lxml` to my account on a supercomputer running RHEL. I do **NOT** have root access or super user status. `lxml` requires the dev/devel versions of `libxml2` and `libxslt`, because they include header files that `lxml` needs to build. But the supercomputer has the non-dev versions installed to its root `/usr` directories, so I installed the dev versions to my `home` directory by building them from source. Both built smoothly without throwing any errors, and all of the necessary header files are in `$HOME/usr/local/include/libxml2/libxml`, etc. However, whenever I try to `pip install lxml`, it tries to use the non-dev `libxml2` & `libxslt` in the root `/bin`:               [myusername@q0144 ~]$ pip install --install-option="--prefix=$HOME/python_modules" lxml     ... (some unimportant messages) ...     Building against libxml2/libxslt in the following directory: /usr/local/lib     building 'lxml.etree' extension     gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include -I/usr/local/include/libxml2 -I/tmp/pip_build_myusername/lxml/src/lxml/includes -I/N/soft/rhel6/python/2.7.3/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.linux-x86_64-2.7/src/lxml/lxml.etree.o -w     In file included from src/lxml/lxml.etree.c:346:     /tmp/pip_build_myusername/lxml/src/lxml/includes/etree_defs.h:9:31: error: libxml/xmlversion.h: No such file or directory     /tmp/pip_build_myusername/lxml/src/lxml/includes/etree_defs.h:11:4: error: #error the development package of libxml2 (header files etc.) is not installed correctly     ...(many more lines saying that the headers are missing, etc.)      And there's several dozen more lines saying that the development packages aren't installed correctly, since it's looking at the wrong ones. How do I get the system to use the versions of `libxml2`/`libxslt` that I installed? I even source my `$HOME/bin`, `$HOME/usr`, etc. directories first in `.cshrc`. Just to make sure to cover all my bases, I also tried building `lxml` from source, following the directions in the `build.txt` document included in the source tarball:               [myusername@q0144 lxml-3.3.5]$ python setup.py build_ext -i -I $HOME/usr/include/libxml2/libxml --without-cython --with-xslt-config=$HOME/usr/local/bin/xslt-config     Building lxml version 3.3.5.     Building without Cython.     Using build configuration of libxslt 1.1.28     Building against libxml2/libxslt in the following directory: /usr/local/lib     /N/soft/rhel6/python/2.7.3/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'     warnings.warn(msg)     running build_ext     building 'lxml.etree' extension     gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include -I/usr/include/libxml2 -I/N/hd00/myusername/Quarry/python_modules/lxml-3.3.5/src/lxml/includes -I/N/u/myusername/Quarry/usr/include/libxml2/libxml -I/N/soft/rhel6/python/2.7.3/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.linux-x86_64-2.7/src/lxml/lxml.etree.o -w     In file included from src/lxml/lxml.etree.c:346:0:     /N/hd00/rccaton/Quarry/python_modules/lxml-3.3.5/src/lxml/includes/etree_defs.h:     13:32: fatal error: libxslt/xsltconfig.h: No such file or directory     compilation terminated.     error: command 'gcc' failed with exit status 1      So I basically get the same problem with it looking at `/user/local/lib` instead of my `$HOME/user` etc. directories. How do I get around this?


title: How can I install a Linux distribution to my DVD-RW?

text: I have got a DVD-RW on which I'd like to install some linux distributions, but I've tried a few (Ubuntu 13.10, Crunchbang, ElementaryOS and some others, don't really remember), but they didn't work, which has me worried that it might not be possible. The problem is that I will be using both my USB ports and my HDD for data, so that is not an option. I'd just like to know if it was possible to install a distribution to my DVD- RW? If I need to change some config files in the source and compile it myself (which I think is what I need to do), I can do that myself if you could tell me where to look.


title: In AwesomeWM, is the use of `c:kill()` as soft as clicking on the red cross in another window manager?

text: In AwesomeWM, windows are closed with the method `c:kill()` (bound to `Meta`-`Shift`-`c`) When I use that key binding, the window just close instantly! Therefore I wondered :   * Is that way as soft as clicking on the red cross in another window manager? (such as openbox)   * Is there a softer way to close a window? (from the window-manager side)


title: dig vs nslookup

text: Why sometimes those two commands printing different results?               ~$ dig facebook.com          ; <<>> DiG 9.9.2-P1 <<>> facebook.com     ;; global options: +cmd     ;; Got answer:     ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 6625     ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1          ;; OPT PSEUDOSECTION:     ; EDNS: version: 0, flags:; udp: 512     ;; QUESTION SECTION:     ;facebook.com.          IN  A          ;; ANSWER SECTION:     facebook.com.       205 IN  A   173.252.110.27          ;; Query time: 291 msec     ;; SERVER: 8.8.8.8#53(8.8.8.8)     ;; WHEN: Sun Oct  6 17:55:52 2013     ;; MSG SIZE  rcvd: 57          ~$ nslookup facebook.com     Server:     8.8.8.8     Address:    8.8.8.8#53          Non-authoritative answer:     Name:   facebook.com     Address: 10.10.34.34


title: Add thousands separator in a number

text: In python                re.sub(r"(?<=.)(?=(?:...)+$)", ",", stroke )       To split a number by triplets, e.g.:                echo 123456789 | python -c 'import sys;import re; print re.sub(r"(?<=.)(?=(?:...)+$)", ",",  sys.stdin.read());'      123,456,789      How to do the same with bash/awk?


title: bash completion not working for one user

text: On my Debian Wheezy system I have several users. For one user, lets call him martin (UID 1000) bash completion is not working. It works fine for all other users, even though they all use the same `$HOME/.bashrc` and `$HOME/.profile`. This is very strange problem, because when I copy martin's whole home directory to testuser, bash completion works fine for testuser:               rm -rf /home/testuser     cp -a /home/martin /home/testuser     chown -R testuser:testuser /home/testuser      This leads me to believe, that whatever is causing this problem, it is not any setting in user home. Does anybody know what might be causing this strange problem ? **UPDATE:** the problems described above are experienced when I am logged in a virtual terminal (Gnome terminal). But I have just discovered that when logging in from a console (ALT+F1), bash completion works. Also, when in virtual console as martin (and bash completion does not work), when I do `su - martin` and log in, suddenly bash completion works. Looks like there is a difference between logging in from virtual console and normal console (or `su - martin`)


title: Where can I find openbox logs?

text: I have a multi head openbox setup with fglrx as my drive. I chosen openbox from the gnome login screen of 12.10. My openbox crashes when I click to desktop left or right, but this does not happens always but rarely. Yet loosing all desktop if pretty irritating. Where can I find crash log of the openbox?


title: Using a variable in a regex

text: How can I use a variable string in a regular expressions                while read line         do             if [[ line =~ *"$key"* ]]; then                 echo line             fi         done < "$filename"      `$key` is a string variable and I want to print all the lines that has the value of `$key`


title: why does blktrace only write blocks of 8?

text: I want to understand the I/O pattern a database is writing to disk to decide how many disks to use for best performance. To analyse the I/O pattern I want to use blktrace and I have to grok it first. This is what I try here. I have a USB stick that I attach to my computer and it becomes /dev/sdd. Now I start               dd if=/dev/sdd of=/dev/null      and on a separate window I start               blktrace -d /dev/sdd -o - | blkparse -i -      and expect to see read (R) operations that get merged (M) and put into the queue (Q). That works, but to my understanding the block size is always 8:               8,48   6    15257     2.157995037  2470  M   R 816696 + 8 [dd]     8,48   6    15258     2.157996273  2470  Q   R 816704 + 8 [dd]     8,48   6    15259     2.157996520  2470  M   R 816704 + 8 [dd]     8,48   6    15260     2.157997794  2470  Q   R 816712 + 8 [dd]      Now I am stopping everything and tell the system to read only one byte:               dd if=/dev/sdd of=/dev/null count=1 bs=1     1+0 records in     1+0 records out     1 byte (1 B) copied, 0.00325544 s, 0.3 kB/s      This shows up on the blkparse console like this:               8,48   6        1    17.220316681  2543  G   N [dd]     8,48   6        2    17.220317209  2543  I   N 0 (00 ..) [dd]     8,48   6        3    17.220317707  2543  D   N 0 (00 ..) [dd]     8,48   6        4    17.220787473  2543  Q   R 0 + 8 [dd]     8,48   6        5    17.220790545  2543  G   R 0 + 8 [dd]     8,48   6        6    17.220791330  2543  P   N [dd]     8,48   6        7    17.220793515  2543  Q   R 8 + 8 [dd]     8,48   6        8    17.220794597  2543  M   R 8 + 8 [dd]     8,48   6        9    17.220796134  2543  Q   R 16 + 8 [dd]     8,48   6       10    17.220796419  2543  M   R 16 + 8 [dd]     8,48   6       11    17.220797695  2543  Q   R 24 + 8 [dd]     8,48   6       12    17.220797943  2543  M   R 24 + 8 [dd]     8,48   6       13    17.220798862  2543  I   R 0 + 32 [dd]      what's going on here? Why does a read of **_one byte_** show up as 3 "R" requests, each with a Q and a M action? Why does it "seem to" read 32 or 24 bytes? Where is docutainment to educate me further?