Webcam Device Driver to support H.264

I have a Creative Live Cam Connect HD (id: 041e:4093) and this webcam has an on-board H.264 encoder. Unfortunately v4l2 only inputs the feed as MJPG.               $ v4l2-ctl --list-formats     ioctl: VIDIOC_ENUM_FMT      ...     Index       : 1     Type        : Video Capture     Pixel Format: 'MJPG' (compressed)     Name        : MJPEG      Basically I need to use this webcam to get a H.264 feed. Is there a different driver that I can use to use the on-board encoder instead of having to use Gstreamer to encode the feed on my machine? Since there are no pre-built drivers to do what I want, I am trying to write my own driver. I found lots of recourses for writing linux drivers but not specifically for webcams. Can you point me to some resources or provide an outline of what I need to do? I never wrote a driver before.


Change OpenVPN client, can I use the same server configurations using scp?

I want to change my old FC 4 client to new Fedora 19 client, but I need to use all the same files on openvpn and IP address. Can I use SCP command for copy all this configurations? Thanks!


Nvidia ethernet port not detected on Centos 7

When I tried to install Centos 7, my Nvidia ethernet port was not detected during the installation, whereas in all other distros it works perfectly without any problem. My rig is an AMD Athlon x2 64 processor and Nvidia chipset. The output of `lspci -nn | grep -i net`:               00:0a.0 Ethernet controller [0200]: NVIDIA Corporation MCP77 Ethernet [10de:0760] (rev a2)


How does ssh work when client and host are on the same machine?

I illustrate my question with the help of docker containers but this example is orthogonal to the rest of the problem. In fact any program that allows the use of bridge interfaces and `ssh` would do. I use a Docker container which runs a `sshd` daemon in the background which is spawned by `supervisord` which runs in the foreground. I mainly use ssh to have a secure way of X11-forwarding without having to bind mount `/tmp/.X11-unix` into may container and totally exposing the socket to the container. If I use `docker top containername` right after I started the container I get the following output:               UID                 PID                 PPID                C                   STIME               TTY                 TIME                CMD     root                4732                535                 1                   19:56               ?                   00:00:00            /usr/bin/python /usr/bin/supervisord     root                4745                4732                0                   19:56               ?                   00:00:00            /usr/sbin/sshd      which is as expected. Now, I exposed port 22 on the container to port 5000 on the host. Hence, I can login into my container using `ssh -X username@localhost -p 5000`. I know how ssh works when client and host are different computers and on different networks but I have some questions when client and host are one the same computer (in my case client is my normal machine and host is the container on my normal machine). I know that docker sets up a bridge between the physical network device on my normal machine and the virtual network device on my machine.   1. But how exactly do my normal machine and the container`communicate with each other? Do they use the IP addresses assigned to them by the bridge device and communicate via those?   2. How are the ports involved in this process do they remove the need to use IP addresses?   3. Is there a most efficient/recommended way of using ssh when client and host are on the same machine and configured in the way I just outlined. Extensive internet search did not reveal sufficient answers. That being said I, of course, would not assert that such a site does not exist!


How to get wget to use the direct URL file name as output file name for a shortened URL

I'm trying to download all the books from a URL list in bulk. The list is in a text file in http://ligman.me/W3TuLr. I'm trying to use `wget` on linux for this. All these URLs seem to be created using a URL shortening service. The problem is when I run `wget --server-response --input-file=list.txt`, the files are downloaded ok, but wget uses the shortened URL tag as their name, while I can see in server responses that the `Location` header for the direct file URL contains the real readable book name in it. How can I get `wget` to write the output file in the readable file name? `wget` version is 1.13.4. I'm open to any other linux comnands which can perform the same task.


Is there a workaround for Debian file-completion trashing $_?

I have years of experience on Slackware linux, and have never seen this problem there. Lately I have been administering Debian servers, and this has become an annoyance. I frequently use "$_" in a bash command to repeat the final argument of the previously-typed command. Sometimes, I get the following behavior:               dschrag@mo:~/dev/dancer$ ls -l app/db/schema/     total 12     -rw-r--r-- 1 dschrag dschrag 268 May 19 10:51 gau_account.sql     -rw-r--r-- 1 dschrag dschrag 558 May 19 13:02 gau_import.sql     -rw-r--r-- 1 dschrag dschrag 270 May 19 13:09 gau_source.sql     dschrag@mo:~/dev/dancer$ cd $_     -bash: cd: _filedir: No such file or directory     dschrag@mo:~/dev/dancer$      I've looked around enough to see that `_filedir` is used in many pre-defined (by default) shell functions defined in `/usr/share/bash- completion/bash_completion`. I use file-completion without thinking, to the point it's hard for me to figure out the exact thing I am doing when this glitch occurs. Has anyone taken the trouble to dig deeper into this?


Disable kernel logging during initialization

I'm using a Linux image generated with buildroot for an embedded system. I recently disabled some modules from being generated with the image and now some logging messages are being shown during the kernel intitialization, after uboot has done its job. This is the first message that appears:               Starting logging: Jan  1 00:00:03 mdb_linux syslog.info syslogd started: BusyBox v1.21.1      and then lots of these messages start flooding the boot process. Most of them are kern.warn and kern.info. What should I do to disable them?


concat file content horizontally in vi/vim

I have a text file that contains a big matrix, that columns are split like the following example:                    col1 col2 col3     row1  ..   ..   ..      row2  ..   ..   ..     row3  ..   ..   ..     row4  ..   ..   ..     row5  ..   ..   ..     row6  ..   ..   ..               col4 col5 col6     row1  ..   ..   ..      row2  ..   ..   ..     row3  ..   ..   ..     row4  ..   ..   ..     row5  ..   ..   ..     row6  ..   ..   ..      How can I concatenate the splitted columns horizontally so that the file can be something like this:                    col1 col2 col3 col4 col5 col6     row1  ..   ..   ..   ..   ..   ..      row2  ..   ..   ..   ..   ..   ..      row3  ..   ..   ..   ..   ..   ..      row4  ..   ..   ..   ..   ..   ..      row5  ..   ..   ..   ..   ..   ..      row6  ..   ..   ..   ..   ..   ..


Shortcut for tabn & tabp in vim/vi

When I open several files using `vim+tabf`, switching across the files will involve using `tabp` & `tabn`. Can I have a quicker way to do so?


tmux choose-session format

Can I specify a "format" for the `choose-session` window beyond text attributes, foreground, background and other cosmetic factors? Specifically: can I somehow set something that will always supply the right `-F` format string I use for `list-sessions`, `list-windows`, etc.? I would like to be able to choose a session from a list which has some additional formatting and information about the different sessions compared to the defaults...


Temporary files problem

Recently my server started to behave weird and I have two issues which I believe to be related.   * In _Vi_ :     * When I try to save a file I get :                          E509: Cannot create backup file          and I need to save using _:x!_ - if I dont force, it does not save.     * When I open a file I get:                          E303: Unable to open swap file for "filename", recovery impossible              * And any time I quit, I get:                          E138: Can't write viminfo file /root/.viminfo!            * Wordpress It started to happen at the same time as the problem with Vi, all my installations of WordPress have a similar problem: every time I try to upload anything : image, theme, plugin, I get :               Missing a temporary folder.       and I cannot upload the file.   * Some element of solution:  I have tried to to fsck at reboot, it worked and the problem was fixed for a while, then it got corrupted again (a few hours later). Any idea what's the problem? Any idea how to fix it? I am running Ubuntu 12.04 on Amazon EC2


SSH access from inside and outside a LAN using the same terminal command

I have a Raspberry Pi (RPi) and I am making remote connections to it using ssh. I have managed to set up ssh correctly such that I can access the RPi both from a local area network and from the internet (using a specific port that I opened on my router). Assuming an user name `john` and a RPi named `raspi`: **Inside LAN access**               ssh john@192.168.2.7     ssh john@raspi     ssh raspi      **Outside LAN access**               ssh -p 1234 john@12.345.67.89     ssh -p 1234 12.345.67.89      But how can I simply do `ssh raspi` from outside my LAN?. Is there a way to configure raspi to point to two IP-adresses, one in a LAN and one over the internet? What I basically want is to access my RPi in a single way, no matter whether I am at home or work.


"No Ethernet card" while installing debian stable

I have a new Intel NUC D54250WYK. I would like to install the latest Debian stable version. After successfully booting from a CD burned from debian-7.3.0-amd64-netinst.iso, the install fails with:               No Ethernet card was detected.  If you know the name of the     driver needed by your Ethernet card, you can select it from the list.      According to the specs, this machine has an Intel I218V Gigabit Ethernet controller. I tried choosing the `e1000e` driver, but the same screen reappears. When I go to the command line I can use lspci to see:               # lspci -v | grep Ethernet     00:19.0 Ethernet controller: Intel Corporation Device 1559 (rev 04)      Is this a matter of the installer not having the necessary updates for this hardware, or is this a problem with the hardware itself? EDIT: I have subsequently also tried the debian-7.3.0-amd64-xfce-CD-1.iso. The same problem occurs. This is the more detailed `lspci` output:               # lspci -vnnk -s 00:19.0     00:19.0 Ethernet controller [0200]: Intel Corporation Device [8086:1559] (rev 04)             Subsystem: Intel Corporation Device [8086:2054]             Flags: bus master, fast devsel, latency 0, IRQ 5             Memory at f7c00000 (32-bit, non-prefetchable) [size=128K]             Memory at f7c3c000 (32-bit, non-prefetchable) [size=4K]             I/O ports at f080 [size=32]             Capabilities: [c8] Power Management version 2             Capabilities: [d0] MSI: Enable- Count=1/1 Maskable- 64bit+             Capabilities: [e0] PCI Advanced Features      David


How to make installation package for many Linux distributions

I make support for cross platform desktop application based on Qt for Linux distributions. Currently I support of building installation .deb packages than can be used on Ubuntu systems. I build 2 installation packages for every new version of our application: one package for amd64 systems, and another one - for i386 (that for some reasons doesn't work on amd64 systems). For doing this I have to compile my application and build package on separate machines. Also I am going to start supporting the application on arm systems that as I understand also needs separate package type. How can I handle with this? Besides that not all Linux distributions can use .deb packages for software installation. For example Fedora. On that case I need to build .rpm installation package. And so on... Recently I used alien to convert my .deb package to .rpm and install it on Fedora. I was able to install it but found some small problems with installed application. So I need some universal way to make installation file for my application that can be used on almost all Linux distributions (or on most of them). Can anybody give me some advice on it. How can I build one installation package for different architectures? What is the way to make my package runnable on different Linux distributions? I would appreciate any help or useful link connected to my problem.


How can I selectively copy files from one directory to another directory?

On Linux, how do I selectively copy most - but not all - files from a directory (`dir1`) to another directory (`dir2`)? I do not want to copy `*.c` and `*.txt` files to `dir2`. The `cp` man page online cannot help me.


How to delete part of a path in an interactive shell?

Is there a shortcut in bash and zsh to delete one component of a path? For example, if I type `ls ~/local/color/`, and the cursor is at the end of line, is there a shortcut to delete the `color/` at the end? Ideally I want solutions in both vi-mode and emacs-mode


Why does the mountpoint of my root filesystem change?

When I look at the output of `lsblk` it will usually show:               lsblk     NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT     sda      8:0    0 298.1G  0 disk     ├─sda1   8:1    0  1023M  0 part /boot     └─sda2   8:2    0 297.1G  0 part /     sr0     11:0    1  1024M  0 rom      with `/` being the mountpoint of my root filesystem. However, if I start `sudo systemctl start docker` I get the following output:               lsblk     NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT     sda      8:0    0 298.1G  0 disk     ├─sda1   8:1    0  1023M  0 part /boot     └─sda2   8:2    0 297.1G  0 part /var/lib/docker/btrfs     sr0     11:0    1  1024M  0 rom      and now the mountpoint of my root filesystem has according to `lsblk` changed to `/var/lib/docker/btrfs`. This raises three questions for me:   1. Is this true?   2. Is this in order or should this not be the case?   3. Why?


Compare two files strictly line-by-line, without insertions or deletions

I have two files that essentially contain a memory dumps in a hex format. At the moment I use diff to see if the files are different and where the differences are. However, this can be misleading when trying to determine the exact location (i.e. memory address) of the difference. Consider the following example showing the two files side-by-side.               file1:       file2:          0001    |    0001     ABCD    |    FFFF     1234    |    ABCD     FFFF    |    1234      Now `diff -u` will show one insertion and one deletion, although 3 lines (memory locations) have changed between the two files:                0001     +FFFF      ABCD      1234     -FFFF      Is there an easy way to compare the two files such that each line is only compared with the same line (in terms of line numbering) in the other file? So in this example it should report that the last 3 lines have changed, along with the changed lines from `file1` and `file2`. The output doen't have to be diff-style, but it would be cool if it could be colored (at the moment I color the `diff -u` output using `sed` so that could easily be adapted).


add "check if fetchmail is running" to this script

while ! postqueue -p | grep -q empty; do       sleep 1     done     killall wvdial      this script checks if my mail queue is empty, then disconnects my modem. now i would like to add also a checking to fetchmail if is running. i am not sure how to develop it but i know that it can be something like the down example.               while ! postqueue -p | grep -q empty && "fetchmail process is not running"; do       some help please?


Problem with read variable from AWK

I'm trying to get memory info by this command:               #!/bin/bash     set -x     cat /proc/meminfo | grep "MemFree" | tail -n 1 | awk '{ print $2 $4 }' | read numA numB     echo $numA      I'm getting this               + awk '{ print $2 $4 }'     + read numA numB     + tail -n 1     + grep MemFree     + cat /proc/meminfo     + echo      My attempts to read these data to variable were unsuccessful. My question is how I can read this to variables? I want to read how many memory is free like: 90841312 KB


Error when calling a script from inside another script

I'm writing a couple of scripts to start `vlc` and periodically update its playlist. The `update_pls.sh` works well if I execute it from prompt, but when I call it from `start_vlc.sh`, in each `for` cycle I get this:               ./update_pls.sh: 20: ./update_pls.sh: 10#18: not found     ./update_pls.sh: 20: ./update_pls.sh: 10#18==DIA: not found      **start_vlc.sh:**                  #!/bin/bash        echo `date`        echo "A arrancar o VLC..."        cvlc --loop --fullscreen --extraintfttp --http-password kepler        sh update_pls.sh      **update_pls.sh:**                  #!/bin/bash        /usr/bin/env > /Videos/cron_env.log        DIR=/Videos        FILES=$DIR/*        DIA=`(date +%d)`        HORA=`(date +%H)`        echo `date`        echo "Dir: $DIR"        echo "A fazer update da playlist.m3u..."        > $DIR/playlist.m3u        for f in $FILES        do          a=`(basename $f .mov | cut -b 1-2 | sed 's/[^0-9]//g')`          b=`(basename $f .mov | cut -b 3-4 | sed 's/[^0-9]//g')`          if [ -n "$a" ]; then                :          else            a="99"          fi          if (( 10#$a<DIA)) || ((10#$a==DIA && 10#$b<=HORA )); then            echo -e "$f\n" >> $DIR/playlist.m3u            echo "Adicionado o video $f"          fi        done        echo "A fazer upload da playlist para o VLC..."        curl -u '':kepler "http://localhost:8080/requests/status.xml?command=pl_empty"        curl -u '':kepler "http://localhost:8080/requests/status.xml?command=in_enqueue&input$        curl -u '':kepler "http://localhost:8080/requests/status.xml?command=pl_play"      I can't manage to find the cause of this and would apreciate any help. Vasco


How can I alter my Xorg config file to fix the screen distortion I am experiencing?

I have a system running FreeBSD 8.2-RELEASE-p2 with an LCD display attached capable of running at a native resolution of 1600 x 900. I have configured Xorg the way I think it should work, however the right side of the display image shows on the left side of the screen: ![enter image description here](http://i.stack.imgur.com/2MEHK.jpg) The display looks correct at lower resolutions... Is it some setting in the Xorg.conf file causing this? What steps can I try to troubleshoot / correct this? Here is my Xorg.conf file:               Section "ServerLayout"         Identifier     "X.org Configured"         Screen      0  "Screen0" 0 0         InputDevice    "Mouse0" "CorePointer"         InputDevice    "Keyboard0" "CoreKeyboard"         Option "AutoAddDevices" "false"     EndSection          Section "Files"         ModulePath   "/usr/local/lib/xorg/modules"         FontPath     "/usr/local/lib/X11/fonts/misc/"         FontPath     "/usr/local/lib/X11/fonts/TTF/"         FontPath     "/usr/local/lib/X11/fonts/OTF"         FontPath     "/usr/local/lib/X11/fonts/Type1/"         FontPath     "/usr/local/lib/X11/fonts/100dpi/"         FontPath     "/usr/local/lib/X11/fonts/75dpi/"     EndSection          Section "Module"         Load  "dri2"         Load  "glx"         Load  "dbe"         Load  "dri"         Load  "extmod"         Load  "record"     EndSection          Section "InputDevice"         Identifier  "Keyboard0"         Driver      "kbd"     EndSection          Section "InputDevice"         Identifier  "Mouse0"         Driver      "mouse"         Option      "Protocol" "auto"         Option      "Device" "/dev/sysmouse"         Option      "ZAxisMapping" "4 5 6 7"     EndSection          Section "Monitor"         Identifier   "GenericMonitor0"         VendorName   "Monitor Vendor"         ModelName    "Monitor Model"     EndSection          Section "Monitor"         Identifier   "Monitor0"         VendorName   "Acer"         ModelName    "S202HL"         HorizSync    30-80         VertRefresh  55-75         # 1600x900 @ 60.00 Hz (GTF) hsync: 55.92 kHz; pclk: 119.00 MHz         Modeline "1600x900_60.00"  119.00  1600 1696 1864 2128  900 901 904 932  -HSync +Vsync              # 1200x675 @ 60.00 Hz (GTF) hsync: 41.94 kHz; pclk: 65.09 MHz         #Modeline "1200x675_60.00"  65.09  1200 1248 1376 1552  675 676 679 699  -HSync +Vsync              # 1280x720 @ 60.00 Hz (GTF) hsync: 44.76 kHz; pclk: 74.48 MHz         #Modeline "1280x720_60.00"  74.48  1280 1336 1472 1664  720 721 724 746  -HSync +Vsync              # 1024x576 @ 60.00 Hz (GTF) hsync: 35.82 kHz; pclk: 47.00 MHz         #Modeline "1024x576_60.00"  47.00  1024 1064 1168 1312  576 577 580 597  -HSync +Vsync              Option "PreferredMode" "1600x900_60.00"         #Option "PreferredMode" "1600x675_60.00"         #Option "PreferredMode" "1280x720_60.00"         #Option "PreferredMode" "1024x576_60.00"         Option "DPMS"     EndSection               Section "Device"             ### Available Driver options are:-             ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",             ### <string>: "String", <freq>: "<f> Hz/kHz/MHz"             ### [arg]: arg optional             #Option     "ShadowFB"              # [<bool>]             #Option     "DefaultRefresh"        # [<bool>]             #Option     "ModeSetClearScreen"    # [<bool>]         Identifier  "Card0"         Driver      "vesa"         VendorName  "Intel Corporation"         BoardName   "Core Processor Integrated Graphics Controller"         BusID       "PCI:0:2:0"     EndSection          Section "Screen"         Identifier "Screen0"         #Device     "Card0"         #Monitor    "Monitor0"         SubSection "Display"             Depth     24             Modes "1280x720_60.00" "1024x768"             #Virtual 1200 675         EndSubSection     EndSection          Section "Screen"         Identifier "Screen1"         Device     "Card0"         Monitor    "Monitor0"         SubSection "Display"             Viewport   0 0             Depth     1         EndSubSection         SubSection "Display"             Viewport   0 0             Depth     4         EndSubSection         SubSection "Display"             Viewport   0 0             Depth     8         EndSubSection         SubSection "Display"             Viewport   0 0             Depth     15         EndSubSection         SubSection "Display"             Viewport   0 0             Depth     16         EndSubSection         SubSection "Display"             Viewport   0 0             Depth     24         EndSubSection     EndSection      * * * **EDIT:** Updated with information. This is a VGA cable connected to the onboard video controller. `pciconf -lv` reports it as:               vgapci0@pci0:0:2:0: class=0x030000 card=0x04381028 chip=0x00428086 rev=0x12 hdr=0x00         vendor     = 'Intel Corporation'         class      = display         subclass   = VGA      It's a brand new VGA cable, but I will try with a different cable. There is no onboard DVI.


Word-splitting when parameter is used within command substitution

What needs to be done to ensure that a parameter containing embedded spaces is handled correctly when used within a command substitution? Perhaps an example will illustrate               $ file="/home/1_cr/xy z"     $ basename $file     xy          $ #need to pass basename a quoted $file to prevent the z in 'xy z' from being eaten     $ basename "$file"     xy z          $ #Now using $file inside a command substitution without quoting.....     $ #....the command substitution causes 'xy z' to split     $ set -- $(basename "$file")     $ printf "%s\n" "$@"     xy     z          $ #But quoting the command substitution does not prevent 'xy z'......      $ #....from being split before being passed to basename     $ set -- "$(basename $file)"     $ printf "%s\n" "$@"     xy      What do i need to do so that               $ set -- $(basename $file)     $ printf "%s\n" "$@"      yields               xy z


Move to next capital letter

Is there an easy way to move to the next capital letter with vim? I'm often working with camel-cased variables and it could be useful.


Recursive find that does not find hidden files or recurse into hidden dirs

I am wanting to search recursively through a directory and find all files that are not hidden files themselves and are not in a hidden dir. I tried using `find . -type f -not -name '.*'` which excludes any base name hidden files, but it still recurses into hidden directories.               dir/        file.py        .hidden_file        .hidden_dir/           file.c      I would want the output to be:               ./dir/file.py      however, I get:               ./dir/file.py     ./dir/.hidden_dir/file.c      EDIT: I would like to list only files, i.e., `-type f`


Difference between > and | with /dev/tty

When I run this command:               echo "1" > /dev/tty # runs successfully       but when I run this:               echo "1" | /dev/tty #permission denied      What is the difference between these two operators `>` and `|` and why does the pipe cause an error?


Explanation of version build time as opposed to version number, eg OpenSSL 1.0.1e versus h

Recently, to deal with newly revealed SSL bugs I upgraded my pure Debian distribution. OpenSSL reports a version number of 1.0.1e which is not the latest, however, I am told that it is ok, because the reported build time produced by: > openssl version -b is June 4, 2014. So, even though the "version" is older, I am assured that Debian somehow "patched" the vulnerabilities, so I don't actually need 1.0.1h as security posts claim, because my 1.0.1e is patched. I guess I don't understand this. Can anybody explain what the heck is going on? How am I supposed to know that the vulnerabilities are patched if it says 1.0.1e, not 1.0.1h as it should? Why doesn't Debian just freaking put 1.0.1h in the distribution? I do not get this.


Why is Debian updating old package versions instead of offering new versions? (openssl)

I am a very inexperienced server owner and wanted to make sure I have a fix for heartbleed.   After updating, "openssl version" still shows 1.0.1e and I wondered what to do to get a heartbleed free version. After googling I found out about "openssl version -b" and Debians "backporting policy"   Since my build is from 8.April I assume I have a fixed version.      You can find several discussions of users like me being unsettled by this.   They are essentially invalidating the significance of version numbers.   Why are they doing this?


Awk: expanding first field along the column

I have a task which requires some awk scripting: Lets say I have a file:               A,under1     ,under2     ,under3     ,under4     ,under5     B,new1     ,new2     ,new3     C,sm1     ,sm2 How could I make it look like this using awk?               A,under1     A,under2     A,under3     A,under4     A,under5     B,new1     B,new2     B,new3     C,sm1     C,sm2 In other words, I want to expand first field along the column.


How to easily install Google Chrome and Firefox on RHEL 5.4 (RedHat)?

I heard that it should be not that hard to install Google Chrome and the latest Firefox on RHEL 5.4. (the OS our company support is only up to RHEL 5.4). It probably requires some `make install` and will uses the C compiler. Can somebody give a definite and tested answer? (instead of some webpage that might not work or dated back to 2007). Please also mention any required packages (probably yum packages) and how to install them.


What does it mean if a directory has only x (executable) permission for certain user/group?

I stumbled across the directory `/etc/ssl/private` on Ubuntu (12.04), it has following permission:               drwx--x---   2 root ssl-cert  4096  7月  8  2012 private/      I wonder what does this mean for group `ssl-cert`? And why is it set this way?


graphics are not rendering properly with Freelancer pc game in wine linux mint

I have a dual-boot system, running Windows XP and Linux Mint16. A friend introduced me to the PC game **Freelancer** , and I have been enjoying it greatly. For now I have only gotten it to work in Windows. I have tried looking up help all over the web, but nobody seems to be having the same problem as me. When I use **PlayOnLinux** to install the game, it installs just fine, but when it runs, the polygons don't render properly. Other than that the game play is fine. To make things worse, another friend was able to play the game on his ARCH Linux system with hardware only one model newer than mine. ![enter image description here](http://i.stack.imgur.com/ld0mj.png) **PC specs** :   * Dell Latitude D620    * GFX: Intel 945GM embedded graphics with default mint drivers   * If more information is needed, I can provide it. Thanks in advance for the speedy answer.


Who is doing the job: ffmpeg or the shell?

## First part of my question: I read on the ffmpeg documentation (`section 3.2 How do I encode single pictures into movies?`) the following: > To encode single pictures into movies, run the command:                 ffmpeg -f image2 -i img%d.jpg movie.mpg          > Notice that `%d' is replaced by the image number: img%03d.jpg means the > sequence img001.jpg, img002.jpg, etc... My question is: Who is doing the translation between `img%03d.jpg` and `img001.jpg, img002.jpg, etc`? Is it the shell or ffmpeg? ## Second part: I would like to ask ffmpeg to encode a sequence of images into a video. However, my sequences often start with an index different from 1, (e.g. we can call it `start_index`) and end on an index that we can call `end_index`. Moreover, the sequence uses increments of value `increment`, e.g.:               img_0025.png, img_0030.png, img_0035.png, ... img_0100.png      where `start_index` was 25, `end_index` was 100, and `increment` was 5. I would like feed an image sequence like the above to ffmpeg without having to rename the sequence first. The documentation explains how to do this with symbolic links, but I was wondering if there is a way to avoid them altogether, maybe using advanced globbing on zsh.


Intel Xeon stuck at 800mhz CPU Freq on RHEL 6.5

Currently running into a headache trying to figure out why my CPU speed is stuck as such a low frequency. After doing some research, I found that cpuspeedutil does actually control the state of the CPU rather than the BIOS it seems, but every change I try to make using CPUFREQUTIL does not affect the CPU whatsoever. Currently setup: Intel(R) Xeon(R) CPU E3-1270 v3 @ 3.50GHz RHEL 6.5 with kernel 2.6.32-431.el6.x86_64 Every time I run a command to change the min and max freq settings (CPUSPEEDUTILS), it changes some items as you can see below: **FYI: The code below is only from A SINGLE CPU CORE (#0 out of 7 Cores)** As you can see here, I set the Current gov. policy to performance by running: **cpufreq-set -g performance**               [root@f1-w2 /]# cpufreq-info     cpufrequtils 007: cpufreq-info (C) Dominik Brodowski 2004-2009     Report errors and bugs to cpufreq@vger.kernel.org, please.     analyzing CPU 0:       driver: **acpi-cpufreq**       CPUs which run at the same hardware frequency: 0 1 2 3 4 5 6 7       CPUs which need to have their frequency coordinated by software: 0       maximum transition latency: 10.0 us.       hardware limits: 800 MHz - 3.50 GHz       available frequency steps: 3.50 GHz, 3.50 GHz, 3.30 GHz, 3.10 GHz, 2.90 GHz, 2.70 GHz, 2.50 GHz, 2.30 GHz, 2.10 GHz, 2.00 GHz, 1.80 GHz, 1.60 GHz, 1.40 GHz, 1.20 GHz, 1000 MHz, 800 MHz       available cpufreq governors: userspace, performance       current policy: **frequency should be within 800 MHz and 3.50 GHz.**                       The governor "performance" may decide which speed to use                       within this range.       **current CPU frequency is 800 MHz (asserted by call to hardware).**      It seems that whatever I do to change any of the settings, the above line always reads: **current CPU frequency is 800 MHz (asserted by call to hardware).** You can see below running the cpuinfo shows that the CPU is running @ 3501.000, but when I run ./i7z, it still shows that the frequency is set to 800mhz:                   [root@f1-w2 ~]# **cat /proc/cpuinfo**     processor   : 0     vendor_id   : GenuineIntel     cpu family  : 6     model       : 60     model name  : Intel(R) Xeon(R) CPU E3-1270 v3 @ 3.50GHz     stepping    : 3     **cpu MHz       : 3501.000**      cache size  : 8192 KB     physical id : 0     siblings    : 8     core id     : 0     cpu cores   : 4     apicid      : 0     initial apicid  : 0     fpu     : yes     fpu_exception   : yes     cpuid level : 13     wp      : yes     flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid fsgsbase bmi1 hle avx2 smep bmi2 erms invpcid rtm     bogomips    : 6983.18     clflush size    : 64     cache_alignment : 64     address sizes   : 39 bits physical, 48 bits virtual     power management:      Here is a ls -la of sys/devices/system/cpu/cpu0:               total 0     drwxr-xr-x  8 root root    0 May 23 15:13 .     drwxr-xr-x 12 root root    0 May 23 15:05 ..     drwxr-xr-x  6 root root    0 May 23 15:05 cache     drwxr-xr-x  2 root root    0 May 23 15:13 cpufreq     drwxr-xr-x  7 root root    0 May 27 11:02 cpuidle     -r--------  1 root root 4096 May 23 15:05 crash_notes     drwxr-xr-x  2 root root    0 May 27 11:02 microcode     lrwxrwxrwx  1 root root    0 May 27 11:02 node0 -> ../../node/node0     drwxr-xr-x  2 root root    0 May 23 15:10 thermal_throttle     drwxr-xr-x  2 root root    0 May 23 15:05 topology      here is a cat of sys/devices/system/cpu/cpu0/cpufreq:               total 0     drwxr-xr-x 2 root root    0 May 23 15:13 .     drwxr-xr-x 8 root root    0 May 23 15:13 ..     -r--r--r-- 1 root root 4096 May 27 10:28 affected_cpus     -r-------- 1 root root 4096 May 27 10:28 cpuinfo_cur_freq     -r--r--r-- 1 root root 4096 May 27 10:28 cpuinfo_max_freq     -r--r--r-- 1 root root 4096 May 27 10:28 cpuinfo_min_freq     -r--r--r-- 1 root root 4096 May 27 10:28 cpuinfo_transition_latency     -r--r--r-- 1 root root 4096 May 27 10:28 related_cpus     -r--r--r-- 1 root root 4096 May 27 10:28 scaling_available_frequencies     -r--r--r-- 1 root root 4096 May 23 15:31 scaling_available_governors     -r--r--r-- 1 root root 4096 May 27 10:28 scaling_cur_freq     -r--r--r-- 1 root root 4096 May 27 10:28 scaling_driver     -rw-r--r-- 1 root root 4096 May 23 15:39 scaling_governor     -rw-r--r-- 1 root root 4096 May 27 10:28 scaling_max_freq     -rw-r--r-- 1 root root 4096 May 27 10:28 scaling_min_freq     -rw-r--r-- 1 root root 4096 May 27 11:02 scaling_setspeed      As you can see, even when I changed settings VIA CPUFREQ, you can see that the MHZ is still set to 800MHZ:               [root@f1-w2 cpufreq]# cat cpuinfo_min_freq     800000     [root@f1-w2 cpufreq]#      Immediately changed the MIN CPU FREQ to 2.00ghz and ran cpufreq-info:               [root@f1-w2 cpufreq]# cpufreq-info     cpufrequtils 007: cpufreq-info (C) Dominik Brodowski 2004-2009     Report errors and bugs to cpufreq@vger.kernel.org, please.     analyzing CPU 0:       driver: acpi-cpufreq       CPUs which run at the same hardware frequency: 0 1 2 3 4 5 6 7       CPUs which need to have their frequency coordinated by software: 0       maximum transition latency: 10.0 us.       hardware limits: 800 MHz - 3.50 GHz       available frequency steps: 3.50 GHz, 3.50 GHz, 3.30 GHz, 3.10 GHz, 2.90 GHz, 2.70 GHz, 2.50 GHz, 2.30 GHz, 2.10 GHz, 2.00 GHz, 1.80 GHz, 1.60 GHz, 1.40 GHz, 1.20 GHz, 1000 MHz, 800 MHz       available cpufreq governors: userspace, performance       current policy: frequency should be within **2.00 GHz** and 3.50 GHz.                       The governor "performance" may decide which speed to use                       within this range.       **current CPU frequency is 800 MHz (asserted by call to hardware).**      Thought I changed the min freq, it shows between 2.0 and 3.5 ghz, but you can see above that the current CPU FREQ is still 800mhz. Output from i7z shows it still stuck @ 800mhz:               Cpu speed from cpuinfo 3491.00Mhz     cpuinfo might be wrong if cpufreq is enabled. To guess correctly try estimating via tsc     Linux's inbuilt cpu_khz code emulated now     True Frequency (without accounting Turbo) 3491 MHz       CPU Multiplier 35x || Bus clock frequency (BCLK) 99.74 MHz     Socket [0] - [physical cores=4, logical cores=8, max online cores ever=4]       TURBO DISABLED on 4 Cores, Hyper Threading ON       Max Frequency without considering Turbo 3491.00 MHz (99.74 x [35])       Max TURBO Multiplier (if Enabled) with 1/2/3/4 Cores is  39x/39x/38x/37x       Real Current Frequency 798.04 MHz [99.74 x 8.00] (Max of below)             Core [core-id]  :Actual Freq (Mult.)      C0%   Halt(C1)%  C3 %   C6 %  Temp             Core 1 [0]:   797.97 (8.00x)         1.4    98.7       1       0    28             Core 2 [1]:   797.94 (8.00x)           1     100       0       0    28             Core 3 [2]:   798.04 (8.00x)           1     100       0       0    29             Core 4 [3]:   797.81 (8.00x)           1      99       1       0    28      Any information would be greatly appreciated!! EDIT: Currentl BIOS SETTINGS: ![BIOS CPU](http://i.stack.imgur.com/wvDMW.png) ![enter image description here](http://i.stack.imgur.com/ppcKw.png)


Is xinitrc executed when logging in?

I have a `~/.xinitrc` with the following content               xrdb -merge $HOME/.Xdefaults      this `xinitrc` is basically useless because it's not loaded when the user logs in, I don't think that I'm doing something wrong because the same command works on the `bash`, my question is: does `xinitrc` recognize the environment variables?


What does ` (backquote/backtick) mean in bash?

I came across the following command               sudo chown `id -u` /somedir      And I wonder what is the meaning of the ` symbol. I noticed for instance that while the command above works well the one below does not               sudo chown 'id -u' /somedir


Fedora preupgrade-cli fails

I have an ancient version of Fedora which I'd like to upgrade. I have command line access only (through PuTTy on a Windows machine). From what I've read, `preupgrade-cli` is what I should be doing, but that always fails with the message "[Errno 256] No more mirrors to try."               [root@localhost ~]# cat /etc/fedora-release     Fedora release 9 (Sulphur)     [root@localhost ~]# preupgrade-cli     Loaded plugins: blacklist, refresh-packagekit, whiteout     Loaded plugins: refresh-packagekit     please give a release to try to pre-upgrade to     valid entries include:        "Fedora 16 (Verne)"        "Fedora 15 (Lovelock)"        "Fedora 13 (Goddard)"        "Fedora 11 (Leonidas)"        "Fedora 12 (Constantine)"        "Fedora 17 (Beefy Miracle)"        "Fedora 14 (Laughlin)"        "Fedora 10 (Cambridge)"     [root@localhost ~]# preupgrade-cli "Fedora 16 (Verne)"     Loaded plugins: blacklist, refresh-packagekit, whiteout     Loaded plugins: refresh-packagekit     preupgrade-main (mirrorlist)       url: http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-16&arch=$basearch       now: http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-16&arch=i386     preupgrade (mirrorlist)       url: http://mirrors.fedoraproject.org/mirrorlist?path=pub/fedora/linux/releases/16/Fedora/$basearch/os/       now: http://mirrors.fedoraproject.org/mirrorlist?path=pub/fedora/linux/releases/16/Fedora/i386/os/     preupgrade-updates-newkey (mirrorlist)       url: http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f16.newkey&arch=i386       now: http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f16.newkey&arch=i386     Can't set up new repo preupgrade-updates-newkey - removing     preupgrade-fedora (mirrorlist)       url: http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-16&arch=i386       now: http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-16&arch=i386     preupgrade-updates (mirrorlist)       url: http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f16&arch=i386       now: http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f16&arch=i386     Fetched treeinfo from http://ftp.heanet.ie/pub/fedora/linux/releases/16/Fedora/i386/os//.treeinfo     treeinfo timestamp: Thu Nov  3 03:11:15 2011     .treeinfo                                                                                |  906 B     00:00     /boot/upgrade/vmlinuz checksum OK     /boot/upgrade/initrd.img checksum OK     Traceback (most recent call last):       File "/usr/share/preupgrade/preupgrade-cli.py", line 305, in <module>         pu.main(myrelease)       File "/usr/share/preupgrade/preupgrade-cli.py", line 204, in main         stage2file = self.retrieve_non_critical_files()       File "/usr/lib/python2.5/site-packages/preupgrade/__init__.py", line 556, in retrieve_non_critical_files         self._retrieve_file(self.mainimage,targetdir)       File "/usr/lib/python2.5/site-packages/preupgrade/__init__.py", line 437, in _retrieve_file         tmp = self.instgrab.urlopen(fileinfo)       File "/usr/lib/python2.5/site-packages/urlgrabber/mirror.py", line 417, in urlopen         return self._mirror_try(func, url, kw)       File "/usr/lib/python2.5/site-packages/urlgrabber/mirror.py", line 390, in _mirror_try         mirrorchoice = self._get_mirror(gr)       File "/usr/lib/python2.5/site-packages/urlgrabber/mirror.py", line 287, in _get_mirror         raise URLGrabError(256, _('No more mirrors to try.'))     urlgrabber.grabber.URLGrabError: [Errno 256] No more mirrors to try.     [root@localhost ~]# traceroute ftp.heanet.ie     traceroute to ftp.heanet.ie (193.1.193.64), 30 hops max, 60 byte packets      1  192.168.1.254 (192.168.1.254)  0.318 ms  0.383 ms  0.584 ms      2  b-ras1.pgs.portlaoise.eircom.net (159.134.155.8)  31.286 ms  34.831 ms  35.415 ms      3  tenge-5-1-1.pe1.pgs.lmk-pgs.eircom.net (86.43.247.133)  39.728 ms  39.806 ms  40.421 ms      4  tenge-7-1-1.core1.bdt.core.eircom.net (86.43.252.249)  48.627 ms  48.872 ms  48.938 ms      5  * * *      6  83.71.115.181 (83.71.115.181)  55.914 ms  33.992 ms  38.373 ms      7  te0-0-0-1-cr2-cwt.hea.net (193.242.111.16)  83.851 ms  44.684 ms  44.839 ms      8  te5-1-blanch-sr1.services.hea.net (193.1.236.2)  39.659 ms  40.871 ms  44.635 ms      9  * * *     10  * * *     11  * * *     12  * * *     13  * * *     14  te5-1-blanch-sr1.services.hea.net (193.1.236.2)  53.721 ms !X * *      Updating for Fedora 17 also fails. (I tried 16 first, because 17 is out of order in the list, so I never noticed it.)               [root@localhost ~]# preupgrade-cli "Fedora 17 (Beefy Miracle)"     Loaded plugins: blacklist, refresh-packagekit, whiteout     Loaded plugins: refresh-packagekit     preupgrade-main (mirrorlist)       url: http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-17&arch=$basearch       now: http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-17&arch=i386     preupgrade (mirrorlist)       url: http://mirrors.fedoraproject.org/mirrorlist?path=pub/fedora/linux/releases/17/Fedora/$basearch/os/       now: http://mirrors.fedoraproject.org/mirrorlist?path=pub/fedora/linux/releases/17/Fedora/i386/os/     preupgrade-updates-newkey (mirrorlist)       url: http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f17.newkey&arch=i386       now: http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f17.newkey&arch=i386     Can't set up new repo preupgrade-updates-newkey - removing     preupgrade-fedora (mirrorlist)       url: http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-17&arch=i386       now: http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-17&arch=i386     preupgrade-updates (mirrorlist)       url: http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f17&arch=i386       now: http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f17&arch=i386     Fetched treeinfo from http://ftp.heanet.ie/pub/fedora/linux/releases/16/Fedora/i386/os//.treeinfo     treeinfo timestamp: Thu Nov  3 03:11:15 2011     .treeinfo                                                                                |  906 B     00:00     /boot/upgrade/vmlinuz checksum OK     /boot/upgrade/initrd.img checksum OK     Traceback (most recent call last):       File "/usr/share/preupgrade/preupgrade-cli.py", line 305, in <module>         pu.main(myrelease)       File "/usr/share/preupgrade/preupgrade-cli.py", line 204, in main         stage2file = self.retrieve_non_critical_files()       File "/usr/lib/python2.5/site-packages/preupgrade/__init__.py", line 556, in retrieve_non_critical_files         self._retrieve_file(self.mainimage,targetdir)       File "/usr/lib/python2.5/site-packages/preupgrade/__init__.py", line 437, in _retrieve_file         tmp = self.instgrab.urlopen(fileinfo)       File "/usr/lib/python2.5/site-packages/urlgrabber/mirror.py", line 417, in urlopen         return self._mirror_try(func, url, kw)       File "/usr/lib/python2.5/site-packages/urlgrabber/mirror.py", line 390, in _mirror_try         mirrorchoice = self._get_mirror(gr)       File "/usr/lib/python2.5/site-packages/urlgrabber/mirror.py", line 287, in _get_mirror         raise URLGrabError(256, _('No more mirrors to try.'))     urlgrabber.grabber.URLGrabError: [Errno 256] No more mirrors to try.      Is there any way to get around this and install an upgrade, or would I be better off to back up my data, wipe, and start from scratch? http://mirrors.fedoraproject.org/publiclist/Fedora/17/ and http://ftp.heanet.ie/mirrors/fedora-secondary/updates/17/ and http://ftp.heanet.ie/mirrors/fedora-secondary/releases/17/Fedora/ all suggest that ftp.heanet.ie does host Fedora 17, but for some reason the preupgrade command is not finding it there. Should I use a different mirror (if so, how?) or reconfigure something else in the connection to ftp.heanet.ie?


How to disable wlan0 when shutdown

Since a long time ago my Sony Vaio with Lubuntu 11.10 is showing a red FAIL message during the shutdown process. It tries to kill some process and the white messages on the screen frozen for some seconds (a little pause) and then the FAIL appears and the shutdown goes on. But it was not like this when I'd installed Lubuntu. Something happened and I didn't know until last week. Last week I discovered why it is pausing the shutdown process for a while. I disabled the wireless adaptor using the button in front of my laptop (that is, the hardware was off). Then I noticed that the shutdown was so quickly. No FAIL messages and my laptop was off after maybe 5 or 6 seconds. So I'm almost sure that some wlan0 connection is holding the shutdown process. Maybe it is trying to keep connected or trying to disable the connection. If I disable it using the button, everything is fast. Any idea to fix this? * * * **Edit:** following the suggestion given by @Gilles, now the shutdown process is very fast. I used his script with the additional line `rfkill block all`. But, as we can see on the image below, the script is returning some `not found`. ![enter image description here](http://i.stack.imgur.com/SKnEK.png)


How can I install ncdu on Red Hat?

The answers provided to this question doesn't help. I'ved tried               yum install ncdu      But I'm getting               No package ncdu available


How to edit the "Internal Server Error" without redirecting to somewhere else?

On the web this is what I see:               Internal Server Error          The server encountered an internal error or misconfiguration and was unable to complete your request.          Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.          More information about this error may be available in the server error log.      I tried to find out where this content is originating from within the server itself.               [root@a ~]# find / -xdev -type f -print0 | xargs -0 grep -H "The server encountered an internal error"      the output is:               Binary file /usr/sbin/httpd matches     Binary file /usr/sbin/httpd.worker matches     Binary file /usr/sbin/httpd.event matches     Binary file /usr/sbin/tcpdump matches     /var/www/error/HTTP_INTERNAL_SERVER_ERROR.html.var:    The server encountered an internal error and was      /var/www/error/HTTP_INTERNAL_SERVER_ERROR.html.var:    The server encountered an internal error and was       My question are: which one of this file is it coming from? Can I edit it directly ?


unable to open openmpi ? Terminal / OSX 10.9.1

Hi I am trying to simulate an example of a software using terminal on OSx 10.9.1. When I execute examples the terminal said Bus error:10 and some errors abput openmpi. I downloaded Openmpi versions 1.6.5, 1.7.4 and lastly 1.4.5 from this website `http://www.open-mpi.org` But now, the terminal say               mca: base: component_find:       `unable to open /usr/local/lib/openmpi/mca_ess_env: dlopen(/usr/local/lib/openmpi/mca_ess_env.so, 9): Symbol not found: _orte_jmap_t_class` Please help me how can I fix it?


How to write a script to read wifi SSID and password from USB drive at boot up and auto logon to wifi network

I have an embedded system that is running Debian. I want to be able to provide wifi network SSID and password information via a USB thumb drive. That way I can easily deploy it to any wifi network. Would it be possible at boot up to have a script read the wifi SSID and password from the USB drive and automatically connect to the wifi network? Anybody have a script to do this? Is there a better way to accomplish this?


Virtual mouse driver, possible X11 problems

I created virtual mouse driver according to Essential Linux Device Drivers book. After I wrote coordinates `echo x y > /sys/ ... /coordinates` into sysfs node, my program generates event packets through event interface `/dev/input/event5` (I checked this). This event interface is attached to the GPM `gpm -m /dev/input/event5 -t evdev`. But mouse don't move. **Maybe this will help: in Xorg.0.log i see the following:**               [ 666.521] (II) config/udev: Adding input device (/dev/input/event5)     [ 666.521] (II) No input driver/identifier specified (ignoring)      It seems, that code is ok, but some outer features interfere my module work. Can I ask for help?


Apply two commands to result of find

I am trying to apply two command (`echo` and `haml --check`) to result of my `find`.               haml --check `find . -name "*.haml"`     # return Syntax error on line 2: Illegal nesting: nesting within plain text is illegal.     # but I don't know which file          echo `find . -name "*.haml"`     # returns list of files (space separated)       Ideally I want to print the file name and then output of `haml --check` of that file in `stdout`.


How to change highlight color in calibre ebook reader

How can I change the text highlight color of epub books in calibre reader? It uses system default for PDFs but it highlights the epub text in yellow color which is irritating.


who -b date format varies strangely

I run `who -b` to get the date of the last reboot. It returns 2013-10-29 14:55. Now ran by a daemon (I am sending this date to a server) it returns Oct 29 14:55. But some other times (before last reboot in Oct 29) it would return something like 2013-10-24 13:17 consistently. First set of questions : What in an environment controls this ? Why is it different from the sudo user and the daemon ? And why did it change in between 2 reboots ? Another question : Is there a way to have this date with format 2013-10-29 14:55 ? I could format it but the year is missing. (i.e do you know what flag to pass who -b) ?


Batch up a number of jobs to run concurrently

> **Possible Duplicate:**   >  Four tasks in parallel… how do I do that? I have a group of jobs to run (a few hundred jobs) - they have a variety of command names and parameters. Each one runs anywhere from a few minutes to a few hours (and I don't really know which ones will run longer than others until I run them). They are pretty much CPU bound, but some do significant I/O, so I want to run 4 at a time (one per CPU core). Is there already a simple command to do this? Something like _runbatch -n 4 filename_ that will read the file and execute n jobs at a time until it's done. Since some of the command lines have special characters and spaces in parameters, using _xargs -P_ to run them under _bash -c_ seems a little problematic to get everything escaped properly. I've thought about just building a makefile and using _make -j_ or building a simple Perl job scheduler that runs jobs in the background and dispatches a new one as each one finishes, but wanted to see if there was a more elegant solution that already exists?


Bash wait for jobs and limit job count

> **Possible Duplicate:**   >  Four tasks in parallel… how do I do that? Suppose a loop invoking a command                grep -v '#' < files.m3u | sed 's/\\\\/\/\//g' | sed 's/\\/\//g' | while read line      do         filename=$(basename "$line")         avconv -i "$line" "${filename%.*}.wav"      done      Putting & after avconv will keep spawning avconv for each file. Now I want to do two things:   * I want to limit the number of processes spawned to 4   * When the loop is done I want to wait for the last one to be ready


running strace for specific period of time

How to run strace on a user process for specific period of time, say 1 minute, without terminating the user process and without using Ctrl+C? I want to create a script to automating strace execution for a user process.


Where are my ALSA, pulseaudio lib

I tried to install darkice with lame. To compile it, I need ALSA and Pulsaudio:               checking for lame library at /usr ... found at /usr      checking for vorbis libraries at /usr ... configure: WARNING: not found, building without Ogg Vorbis     checking for opus libraries at /usr ... configure: WARNING: not found, building without Ogg Opus     checking for faac library at /usr ... configure: WARNING: not found, building without faac     checking for aacplus library at /usr ... configure: WARNING: not found, building without aacplus     checking for twolame library at /usr ... configure: WARNING: not found, building without twolame     checking for alsa libraries at /usr/lib/alsa-lib ... configure: WARNING: not found, building without ALSA support     checking for pulseaudio libraries at /usr/lib64/pulseaudio/libpulse ... configure: WARNING: not found, building without PULSEAUDIO support     checking for jack libraries at /usr ... configure: WARNING: not found, building without JACK support     checking for samplerate libraries at /usr ... configure: WARNING: not found, building libsamplerate support      I can add with `\--with-*-prefix=` a path for this libraries. But I have no idea where on my system I can find them, or what I need to install, to compile with them. I tried `/usr/lib` and `/usr/lib64`, both don't work. **My question is where do I get these libraries from?** system: Fedora release 19 (Schrödinger’s Cat) 3.11.6-200.fc19.x86_64


confusing about PSS in /proc/pid/maps

I found one great explanation about smaps from info about smaps To my understanding, I thought that > shared_clean + shared_dirty + private_clean + private_dirty = rss I wrote a program to verify it:               void sa();     int main(int argc,char *argv[])     {         sa();         sleep(1000);     }          void sa()     {        char *pi=new char[1024*1024*10];        for(int i=0;i<4;++i) {   //dirty should be 4M             for(int j=0;j<1024*1024;++j){                     *pi='o';                     pi++;             }        }        int cnt;        for(int i=0;i<6;++i) {   //clean should be 6M             for(int j=0;j<1024*1024;++j){                     cnt+=*pi;                     pi++;             }        }        printf("%d",cnt);     }      But to my surprise,the `/proc/pid/smaps` is:               09b69000-09b8c000 rw-p 00000000 00:00 0 [heap]     ...     Size:           10252 kB     Rss:            10252 kB     Pss:             4108 kB //<----I thought it should be 10M     Shared_Clean:       0 kB     Shared_Dirty:       0 kB     Private_Clean:      0 kB //<----I thought it should be 6M     Private_Dirty:   4108 kB     Referenced:      4108 kB     Swap:               0 kB     KernelPageSize:     4 kB     MMUPageSize:        4 kB      Anything wrong with my understanding? * * * according to answer of Mat, > The pages in the 6M you're only reading can't really be considered clean. A > clean page is one that is synchronized with its backing store (whatever that > is, swap, a file, etc.). . I rewrite the codes using mmap,this time its result is as expected :) create a dummy file first:               time dd if=/dev/zero of=test.bin bs=30000000 count=1      new code:               void sa(char *pi)     {        for(int i=0;i<4;++i) {             for(int j=0;j<1024*1024;++j){                     *pi='a';                     pi++;             }        }        //just to use it to avoid the following code will not optimized off by the compiler         int dummycnt=0;        for(int i=0;i<6;++i) {             for(int j=0;j<1024*1024;++j){                     dummycnt+=*pi;                     pi++;             }        }        printf("%d",dummycnt);     }               int main()     {            int fd  = open("./test.bin",O_RDWR);            char *p = (char *)mmap(0,                           1024*1024*10, //10M                           PROT_READ|PROT_WRITE,                           MAP_SHARED,                           fd,                           0);            sa(p);            sleep(10000);     }       cat /proc/pid/smaps:               b6eae000-b78ae000 rw-s 00000000 08:05 134424     ..../test.bin     Size:              10240 kB     Rss:               10240 kB     Pss:               10240 kB     Shared_Clean:          0 kB     Shared_Dirty:          0 kB     Private_Clean:      6144 kB     Private_Dirty:      4096 kB     Referenced:        10240 kB     Swap:                  0 kB     KernelPageSize:        4 kB     MMUPageSize:           4 kB


Regular expressions with ExpectJ

I've been used the ExpectJ Java library to automate some jobs on a Linux server, however now I need to automate a job that sends a different text response for each execution. Here is the output:               Last unsuccessful login: Fri Mar 30 15:21:31 CST 2012      ********************************************************************************          ********************************************************************************     [YOU HAVE NEW MAIL]      local-login [/home/user]%      And in my code I have the following:               s.expect("Login as:");     s.send("userlogin\n");     s.expect("userlogin@iphost's password:");     s.send("password\n");      I receive the output shown, but I wasn't be able to send the next command because I don't know how read the last answer, I tried to use a regular expression but it doesn't work.


How can I find a file whose name includes a given string, such as "abcde"?

Within a set of directories, how do I find a file whose name includes a given string, such as "abcde"?


How to find a file containing a string?

> **Possible Duplicate:**   >  How can I find a file whose name includes a given string, such as "abcde"? How to find files in terminal that contains the string "foo"? I tried the following but doesn't work.               find *foo*.*  // any character before or after "foo" of any extension.      I tried googling UNIX or bash wild card but doesn't provide me any useful result.


Copy image from clipboard to file

Is it possible to take an image from the clipboard and output it to a file (using X)? I can do this with text easily:               $ xclip -selection c -o > file.text      But when I try the above with an image nothing is written. * * * The reason I want to do this is I don't have an image editor installed, and it got me thinking whether I could do this without installing one.


Gajim, gtalk, and logind

Since the Google talk outage earlier this month, I keep not being able to connect using gajim. I tried deleting all the configuration, updated to the latest development version, and tried in different IM clients (pidgin works fine) but so far gajim refuses to log into gtalk: it claims I have the "wrong password or username". Those are correct and work fine in pidgin. The only clue I have is this error I keep getting in `~/.xsession-errors` or on `stdout` when I run gajim.               (E) gajim.logind_listener A problem occured while activating logind listener      Any idea?


VIM: Display Hex Code Inline

I would like to have hex codes been displayed inline, no matter what filetype is activated in the current session. So far I've found something existent and suitable for my needs: https://github.com/skammer/vim-css-color/blob/master/after/syntax/css.vim I tried to recode the syntax file to effect all types of code, but didn't get it in the end. To be honest, I've just no clue about coding for vim. Could anyone help? I would be really glad if someone could... =/


Upgrading to linux kernel 3.0.1 but my ethernet card is still not found?

Please forgive my ignorance, as I am still fairly new when it comes to linux under the hood! Anyways - following up on my previous semi-related post, instead of trying a Debian testing image, I installed Debian stable and installed the latest 3.0.1 kernel via dpkg. Specifically:   1. Ran `apt-get update` on internet enabled computer (computer A)   2. Transplanted /var/lib/apt/lists and /etc/apt/sources.list from computer A to new laptop with no internet (computer B)   3. `apt-get --print-uris --yes install synaptic | grep ^\' | cut -d\' -f2 > packageuri.htm` to get package download URLs   4. Downloaded the packages from computer A and copied them to computer B   5. Installed synaptic with dpkg   6. Ran synaptic and updated the laptop by generating a download script (feature in synaptic)   7. Ran script from computer A, copied packages to computer B, `dpkg -i *.deb`   8. Downloaded the linux-image and all related files (though `apt`, synaptic didn't let me install `linux-image-3.0.1-*` for some reason) similarly to step 3   9. Installed files via `dpkg`. `update-grub` was run and new kernel is detected   10. Boot into new system, still have no internet. According to this link, installing >= 2.6.38 should allow the card to be used. Am I missing something? Thanks!


Can I make grep treat escaped multiline as a single line?

How can I make tools like `grep` treat multilines escaped with a backslash as a long single line? Let's say I have some files that looks like this:               testvar=test1 \             test2 \             test3          othervar=oth1 \              oth2      If I now `grep` for testvar it will return `testvar=test1 \`, but is there any way I can have it return `testvar=test1 test2 test3`? More or less how to treat those multiple escaped lines as a single line? **Note** : If this can't be done with `grep`, hints about how to do this with other tools like `sed` or `awk` to get the same result are also welcome.


Windows and Ubuntu dual boot

I have installed Ubuntu 14.04 on a partition. Now I have Ubuntu and Windows 8.1 for dual boot. I followed this tutorial to install Ubuntu.   Now when I switch on the computer I have the following options in the grub.   * Ubuntu   * Ubuntu (advandced)   * Windows Boot Manager (on /dev/sda2)   * System setup Is this normal? I mean, what is Windows Boot Manager? Should it say just Windows?   Why can I access the BIOS if I select System Setup?


Line spacing in chat using pidgin

I started using pidgin again and I cannot find the option to configure line spacing in chat. the default appears to be 1.5 lines between messages. How can I change that? Or is it another "feature" that all users will love so there is no way to configure it? Yeah, kinda frustrated with it...


How can I modify and rebuild the Finnix ISO to include my own scripts?

I've been using this live boot distro, Finnix to do some installation work on several virtual machines. I'd like to modify the ISO file to include a script I need to do installations. I've booted the virtual machine and gotten as far as copying the `/dev/cdrom` contents to a new Folder and modified it as needed. Now I'd like to turn the plain folder back into a bootable ISO image and `nc` it back to my host machine for subsequent boots, modified with my additional content. How can I turn the folder with the modified content back into a bootable ISO image?


Replace "-from" with "this" in the begining of line

I want to replace "-from" with "this" in the begining of line. This should happen when that line has 'R' at the end and line above it has "D" at the end. For example for the block shown below:               -from XXXXXXXXXXXXXXXXX/D        -from XXXXXXXXXXXXXXXXX/R        -from XXXXXXXXXXXXXXXXX/K        -from XXXXXXXXXXXXXXXXX/L        -from XXXXXXXXXXXXXXXXX/G        -from XXXXXXXXXXXXXXXXX/R       the output should look like:               -from XXXXXXXXXXXXXXXXX/D        -this XXXXXXXXXXXXXXXXX/R        -from XXXXXXXXXXXXXXXXX/K        -from XXXXXXXXXXXXXXXXX/L        -from XXXXXXXXXXXXXXXXX/G        -from XXXXXXXXXXXXXXXXX/R        Anything is fine, `sed`, `awk`, `grep`, etc.


RHEL - Login screen not showing

I have a **RHEL 5.6** system which shut down unexpectedly due to a power failure. I restarted the machine to figure out if something is wrong. However, the machine is not showing the login screen. It is stuck after the services listing page.(The page where the OS will notify the loading of services is OK or failed). I am trying to figure out someway to login to the system.               ctrl + alt + F7 - This key combination will allow me to login to the graphical interface.           ctrl + alt + F1 - This key combination will allow me to login to the command line mode of Linux.       Is there any other way to login to the system? Because, the system is stuck and am not pretty sure, even if the above mentioned methods might work.


Cross-compiling Slackware: is the build order listed anywhere?

I'm building a Slackware system from source and hitting a dependency wall here. (Before you ask: no, I'm not trying to "make it faster"; I'm building against a different C library.) Getting a toolchain and the very basics (coreutils, archivers, shell, perl, kernel, etc.) was simple enough, but when I look at the remaining several hundred packages I don't know what order they need to be built in to meet their dependencies. Looking through the various docs I don't see any build order listed, and there's no master build script either, just the individual packages' SlackBuilds. And .tgz's don't list dependencies like deb's or RPM's do. Is this just something Patrick keeps in his head that the rest of us mortals will have to figure out manually, or am I missing a doc somewhere? I tried using BLFS but Slackware seems to build X much earlier in the process than BLFS does. I suppose I can simply try to build everything, note when dependencies fail, and manually make a dependency tree, but I'm hoping there's just a build list somewhere I'm missing...


Position of "double_buffer yes" in ~/.conkyrc

According to the Archlinux wiki, in the "Prevent flickering" section, the line "double_buffer yes" should be placed "below the other options, not below TEXT or XY". But when I look at Crunchbang default Conky, there are several options (not TEXT or XY) below "double_buffer yes" (line 45). So is the positioning of "double_buffer yes" not critical (so long as it is above TEXT or XY)?


SpellCheck in FreeBSD

In FreeBSD; the SpellCheck doesn't work for me.   For example I installed `midori` from the ports. In dependencies it installed `enchant`and `enchant` had the option for some dictionary (i.e. Hspell, Aspell ...). I went with `aspell`. I even installed `aspell-en`dictionary. But at the end I have no spell check in FreeBSD.


Checking if a file exists in several directories

I've been working on this far too long and need some help. I need a script that will look at files in a directory and see if it exists in one of several directories. I need something like this:               for files in /downloads/ #may or may not be in a sub-directory     do        print if file exists in /media/tv, /media/movie, or /media/music     done      the files will not be in the root of the directory. I cant just search /media, because I don't want to search in cd-rom or videos I am using the latest version of Ubuntu server


addgroup vs groupadd

I happen to know there is a slight difference between `adduser` and `useradd`.   (i.e., `adduser` has additional features to `useradd`, such as creating a home directory.) Then what is the relation between `addgroup` and `groupadd`?   Is there a preferred way to create a group?


Unable to set partition type correctly using parted

I'm trying to create a bootable USB stick with FreeDos for BIOS updates in Centos 6.5, following instructions from: chtaube.de I created the empty 30MB img file using `dd`:               [root@dumbledore freedos_boot]# dd if=/dev/zero of=FreeDos-image.img bs=1M      count=30     30+0 records in     30+0 records out     31457280 bytes (31 MB) copied, 0.0756911 s, 416 MB/s      The author of the mentioned article says this command should copy 30MB, I get 31MB. Is this a problem? Then I use `parted` to create partitions in the resulting FreeDos-image.img file.               root@dumbledore freedos_boot]# parted FreeDos-image.img      GNU Parted 2.1     Using /home/dthacker/freedos_boot/FreeDos-image.img     Welcome to GNU Parted! Type 'help' to view a list of commands.     (parted) unit %     (parted) mklabel msdos                                                          (parted) mkpart primary fat16 0 100%     Warning: The resulting partition is not properly aligned for best performance.      Ignore/Cancel? C                                                               (parted) mkpart primary fat32 0 100%     Warning: The resulting partition is not properly aligned for best performance.     Ignore/Cancel? I                                                               (parted) set 1 boot on                                                         (parted) p                                                                       Model:  (file)     Disk /home/dthacker/freedos_boot/FreeDos-image.img: 100%     Sector size (logical/physical): 512B/512B     Partition Table: msdos          Number  Start  End   Size  Type     File system  Flags     1      0.00%  100%  100%  primary               boot, lba                                                                                The File System type should be FAT16, but it's not getting set. What do I need to do differently to set it correctly?


How can I get high-precision timestamps (better than 1s) with Samba?

I did a quick test and got the results below. Whats with the horrible time resolution? Is there a way I can make it better?               creation     129971441605098285     mod     129971442166583272     a.ToFileTimeUtc()     129971442170000000     b.ToFileTimeUtc()     129971442170000000      The results of ToFileTimeUtc (which returns the number of 100ns ticks since Jan 1, 1601) show that the timestamps have been rounded to the nearest second, instead of being stored with their full precision. I'm using Samba on Ubuntu. I grabbed the config file from somewhere. I'm transferring files to a NTFS filesystem mounted by linux over samba               [global]     netbios name = toltec     workgroup = METRAN     security = user     wins support = yes     preferred master = yes     os level = 65               [homes]     comment = %u's Home Directory     browsable = no     read only = no


Difference between 'ifconfig' and 'ip' commands

I read some articles/tutorials on 'ifconfig' command, most of them included a common statement - > "ifconfig is deprecated by ip command" and suggested to learn ip command. But none of them explained how 'ip' command is more powerful than 'ifconfig'. What is the difference between both of them?


How to backup all my data?

I need to backup all my data from a server (in 10 minutes), preferably keeping the symlinks. Any suggestions?


linux + squashfs-tools for red-hat 5.3

I want to install the squashfs-tools-4.0-5.el6.i686.rpm But I have the following dependencies ( after RPM installation ) please advice what the additional packages that I need to install on my linux red-hat 5.3 in order to solve the dependencies issue ?               [root@localhost WORK]# rpm -i squashfs-tools-4.0-5.el6.i686.rpm      warning: squashfs-tools-4.0-5.el6.i686.rpm: Header V3 RSA/SHA1 signature: NOKEY, key  ID c105b9de       error: Failed dependencies:         libc.so.6(GLIBC_2.11) is needed by squashfs-tools-4.0-5.el6.i686         libc.so.6(GLIBC_2.7) is needed by squashfs-tools-4.0-5.el6.i686         rpmlib(FileDigests) <= 4.6.0-1 is needed by squashfs-tools-4.0-5.el6.i686         rpmlib(PayloadIsXz) <= 5.2-1 is needed by squashfs-tools-4.0-5.el6.i686      uname -a                  [root@localhost WORK]# uname -a         Linux localhost 2.6.18-128.el5PAE #1 SMP Wed Dec 17 12:02:33 EST 2008 i686 i686 i386 GNU/Linux


How to change the user timezone?

I know that (for example in Debian) one could use `dpkg-reconfigure tzdata` to change the timezone of the **system** but I am wondering how one could change the **user** timezone (if Linux/Unix supports such an idea at all). I normally work on the server remotely through ssh and given that the server works with UTC internally (files, ...) and timezones are rather superficial, I would like to see the times in my desired timezone depending on where I am connecting from. Is this possible?


What is a channel?

http://www.di.uevora.pt/~lmr/syscalls.html In that reference about system calls, appears a function called dup(). It is said that it duplicates channels. Then my question is, what is a channel?


Sort the output of find -exec ls

Is it possible to the output of `find … -exec ls -ls ;` sorted alpabetically, by filename? This is my cron command:               find /home/setefgge/public_html -type f -ctime -1 -exec ls -ls {} \;      This command works okay, for the most part. But the results are not sorted in any meaningful sequence. It would be very helpful if they would be sorted by the file name field.


HDMI output with HD 3000 only works with DVI output also in use

After moving to a new apartment I realized it was no longer practical to use my main desktop for my projector (Optoma HD100X) in the living room (the cable run would be crazy and I'd been planning on putting together an HTPC anyway). So, I ordered the necessary parts and put the whole thing together this friday. I went for an Asus P8H77-I motherboard and a Pentium G860 processor since that way I'd have integrated graphics and the motherboard comes with DVI, VGA, DP and HDMI outputs. Now, at first I hooked everything up to my main workstation's secondary monitor via the DVI port everything worked just fine. Then I moved the HTPC to my living room and hooked it up to the projector via a 10 meter HDMI cable. The projector shows the usual UEFI bootup stuff just fine and the GRUB boot menu shows up. Then once past that the projector stops receiving a signal. After a little testing I concluded that if I run the cable to my main desktop (iMac 27") and use a DP-to-HDMI adapter it works just fine. I also discovered that if I hook up my secondary monitor (also 1920x1080) to the HTPC at the same time as the projector is hooked up to it then I get an image on both the monitor and the projector. So in short:   * Main desktop + HDMI to projector => HDMI output to projector works   * HTPC + DVI to monitor => DVI output to monitor works   * HTPC + HDMI to projector => No HDMI output to projector   * HTPC + HDMI to projector + DVI to monitor => 1080p output to both monitor and projector (but trying to extend the desktop rather than just clone it results in both the monitor and the projector going blank) Now, I don't have a long enough DVI cable to test the projector with a DVI connection to the HTPC but I have a nagging suspicion that it would work just fine (projector is ceiling mounted so I'm not in any hurry to get it down just to test this). Does anyone have any experiences with a problem like this? For now I've left my secondary monitor sitting next to the HTPC so I can use the HTPC but I'd rather move it back to my main desktop). To me this seems like something I should be able to deal with in software. Right now the HTPC is running Debian (wheezy as the version of ALSA in squeeze didn't recognize the integrated sound card) although I've also tried Ubuntu and Fedora, Fedora had the exact same issue and with Ubuntu the Live image installer worked but it refused to give any video output at all (DVI or HDMI) after installing and rebooting. I should probably also note that running `Xorg -configure` (with X and gdm off, of course) results in an error that reads `Number of created screens does not match number of detected devices` and then it dumps out an Xorg file which looks a bit quirky, including that it is set to use the `vesa` driver. **Edit:** I just noticed that if I start the HTPC with the monitor connected but not turned on then both the projector and the monitor wind up reporting "No signal". I'm starting to think that there's some kind of handshake issue here... **Edit 2 (2012-11-22):** Posted an answer myself earlier thinking my problem was solved but now I'm having the same issue with the new HDMI cable. After a couple of reboots I stopped being able to get a video signal from the computer to the projector. I did however notice a pattern: If video output worked during initial stages of boot (UEFI, grub, Linux until X starts) then on the boot it will not work **at all** , not even for the EUFI splash screen. On those bootups where I get the UEFI splash screen I also get grub and debian booting right up to the point where it's about to switch to 1920x1080, then the projector just reports "no signal". So at this point I'd be happy with a way to force X to always drive the HDMI port @ 1920x1080 just to get this running reliably.


Directory sync across SSHFS involving symlinks

I have 2 Ubuntu Linux boxes with similar directory structures, LX02 and LX04. When I ssh from a terminal on LX02 to LX04 and go to my main scripting directory, /root/sbin, I see a different set of subdirectories than when I go the same directory from a terminal session on LX04. Why? **DETAILS**   Both machines have a /0 directory that contains mountpoint directories for each remote host as in...               /0/LX02     /0/LX04      /etc/fstab contains entries to mount the remote host's root (/) directory to these. There is a 'mount bind' entry to mount the local (/) directory which avoids special coding for the local host in scripts. /root/sbin is a symlink to /usr/local/sbin on each machine. _The local /root/sbin directory on LX02 looks like..._                root@LX02:/  cd /root/sbin           root@LX02:~/sbin  ls -l | grep '^d'          drwxr-x--- 2 root root  4096 2011-07-16 00:49 Archives-sbin-20110825     drwxr-x--- 2 root root  4096 2010-07-28 08:13 lst     drwxr-xr-x 2 root root  4096 2012-04-11 09:28 Misc     drwxr-xr-x 2 root root  4096 2012-04-11 09:28 Slates     drwxr-xr-x 2 root root  4096 2012-04-11 09:28 Tomboy     drwxr-xr-x 2 root root  4096 2012-04-11 09:28 Ubuntu_8.04     drwxr-x--- 2 root root  4096 2010-07-28 08:13 www     drwxr-xr-x 2 root root  4096 2012-09-27 12:48 zim      _Going to /0/LX04/root/sbin from an LX02 terminal session results in..._                root@LX02:/0/LX04/root/sbin  cd /0/LX04/root/sbin           root@LX02:/0/LX04/root/sbin  ls -l | grep '^d'          drwxr-x--- 2 root root  4096 2011-07-16 00:49 Archives-sbin-20110825     drwxr-x--- 2 root root  4096 2010-07-28 08:13 lst     drwxr-xr-x 2 root root  4096 2012-04-11 09:28 Misc     drwxr-xr-x 2 root root  4096 2012-04-11 09:28 Slates     drwxr-xr-x 2 root root  4096 2012-04-11 09:28 Tomboy     drwxr-xr-x 2 root root  4096 2012-04-11 09:28 Ubuntu_8.04     drwxr-x--- 2 root root  4096 2010-07-28 08:13 www     drwxr-xr-x 2 root root  4096 2012-09-27 12:48 zim      _However, the /root/sbin directory on LX04 actually looks like..._                root@LX04:/  cd /root/sbin           root@LX04:~/sbin  ls -l | grep '^d'          drwx------ 4 root root 12288 2011-12-23 03:23 Archives     drwx------ 2 root root  4096 2011-07-16 00:49 Archives-sbin-20110825     drwxr-xr-x 3 root root  4096 2012-11-14 00:22 Examples     drwxr-x--- 2 root root  4096 2011-04-29 13:50 fnc     drwxr-x--- 2 root root  4096 2011-05-19 15:00 lst     drwxr-xr-x 3 root root  4096 2012-10-28 10:01 Synergy     drwxr-x--- 2 root root  4096 2011-03-10 20:54 tmp     drwxr-x--- 2 root root  4096 2011-03-10 20:54 www      ### What's happening here?


mkisofs can't find file

I'm trying to create a .iso file using `mkisofs`. I have the following folders:               my OS     |     |--src     |--bin      I used the following command:               mkisofs -R -input-charset utf8 -b bin/boot.bin -no-emul-boot -boot-load-size 4 -o os.iso bin      the command was run from the parent directory (my OS) and I got the following error:               genisoimage: Uh oh, I cant find the boot image 'bin/boot.bin' !      I checked, and the file `bin/boot.bin` does exists. I tried writing `./` before the directory, and using real paths, but no good. Can any one help me?


Script to get file from SFTP and run it

We have 5 servers running our code: A, B , C, D and E. From a local machine, we sftp the file to A. Then               ssh id@A     su - applicationname     sftp id@A     get <file>     bye     tar -xzf <file>     logout     logout      The same procedure we apply for others B to E. Is there any way we can simplify this using script? We have requested linux team to provide passwordless authentication. But we don't know how to do sftp inside a SSH session using a script.


Keyboard layout changed. How and why?

Yesterday, I upgraded my kernel (to 3.5.0-19-generic), rebooted, and had to reinstall my video drivers to get full resolution. (After upgrading the kernel, the resolution always goes to 640x480, until I reinstall the drivers in Console Login). Now that I'm back in KDE (I didn't notice if it had changed in the Console Login), my keyboard layout has changed to the US format, so, for example `Shift`+`2` prints `@` instead of `"`. In KDE's System Settings -> Input Devices -> Keyboard -> Layouts, it seems to show the correct settings: Map=gb, Layout="English (UK)", Variant="English (UK, extended WinKeys), Label="gb". That's fine. I changed it and changed it back, and nothing has changed; it's still using the US layout. After a little googling, I found that there are X server settings, which I've found in `/etc/default/keyboard`. I've never edited this file before and its last modification (according to `ls -l`) was a month ago. But in there, `XKBLAYOUT="us"`. It also says:-               # If you change any of the following variables and X is configured to     # use this file, then the changes will become visible to X only if udev     # is restarted.  You may need to reboot the system.      I need to reboot? Seriously? Any idea what changed my keyboard layout, and/or how can I prevent this from happening again? Why don't the KDE settings take precedence? **UPDATE:** This must have been some sort of freak occurrence. Some of KDE's keyboard shortcuts I had configured, weren't working either. Changing XKBLAYOUT to "uk", and rebooting changed everything back to normal.


How do I trigger a script when a folder is updated in Solaris 5.10?

We are trying to write a script to move away files as soon as they drop in a folder. One way of achieving this is running rsync in a script on cron scheduler. The problem with this approach is the system overhead. We cannot run it every second and if we run it after an interval of time then we leave the files vulnerable (accessible to senders) for that time gap. Reqirement is that the files should vanish as soon as they arrive. I checked stackoverflow and found the incron command. But this is only available on Linux and not on Solaris.


What does Arch Linux offer?

I use Macs, Ubuntu, FreeBSD, OpenBSD, and Fedora for different purposes. I'm fairly busy and trying out a new distro takes a lot of time, but I hear lots of good things about Arch Linux from people I admire. I do mostly scientific computing (and some web development), and use Linux as both a desktop and a server. Does Arch offer anything I'm not already getting from one of my current installs? I'm particularly interested in the differences between Arch and Debian


count lines in a file

I'm sure there are many ways to do this: how can I count the number of lines in a text file?               $ <cmd> file.txt     1020 lines


Can I build a linux distro with libc instead of glibc

I recently had a conversation with a friend who is a highly skill software engineer, and he showed me some articles outlining the fact libc was much better than glibc. I wonder if its possible to use libc instead, and what kind of problems would I come up against if I went this route?


How to crop a particular part of a YouTube video clip?

Having an MPEG4 (MP4 container, H264 AVC video, AAC audio) video clip downloaded from YouTube, how to crop a particular piece of it (remove everything before a particular starting point timestamp an after a particular finish point timestamp) with free Linux tools? PS: I don't mind employing a patented or even a BLOB codec library.


Does Android really use the same kernel as Linux?

I read from somewhere that Android uses the Linux Kernel. Is it really true? I thought the Linux Kernel was meant for desktop operating systems.


How to grab the audio channel from an MP4 video file into a separate audio file?

Having an MPEG4 (MP4 container, H264 AVC video, AAC audio) video clip downloaded from YouTube, how to separate its audio channel into an independent audio (without de&re-compressing the audio preferably) file with free Linux tools?


NMAP probing VirtualBox Client

Cannot seem to probe virtual guests from the virtual host. **These guests can be probed from other devices on the same LAN/Network** , but not the host. I can understand why it might be struggling, but I am wondering if anyone ever found a way to make it work. HOST: OSX 10.6 GUEST: FreeBSD 8 (two of them) Edit: Adding some finer details, I have networking set to "bridged", I can ping and regularly consume services running on TCP/IP on both guests. All of my nmap probe attempts are done from the root account on the host.


SSH to a remote computer having only the public IP

Is it possible to connect to a computer behind a router via SSH knowing only the public IP address (of the router)?


How do I use SSH keys for passwordless SSH via X11 apps (like nautilus)?

I just reinstalled Linux on my laptop, and I'm trying to get SSH pubkey authentication working via X11 applications. Specifically, I'm trying to use `baobab` to display the usage of a remote filesystem, and I need to SSH in as root but root has no password, o I need to use an SSH key to authenticate. In the terminal, if I `ssh root@theserver` I get right in with no password, but if I use Baobab or Nautilus to connect, it asks me for my password. How can I have it use my SSH key? I'm using Gnome on Ubuntu 10.10 in case it matters. On my previous install this worked, and I don't know if I did something before to make it work. if so, I've forgotten what... In fact, my previous install would pop up an X11 dialog asking for my SSH private key password if I needed to unlock it. How do I make that happen again?


reference problem in using sed

I'm trying to use `sed` command to find/replace a pattern in file.   It gives:               sed: -e expression #1, char 27: invalid reference \1 on `s' command's RHS      My command is:               sed 's/"([A-Z]+)",/"\1","\L\1"/g' file.txt       What is the problem?   How can I fix it?


Find when the file was closed in Unix

I know `ls -l` will give the modified time of file, but it is giving the time when the file was opened, not closed (using `Ctrl`+`D` or something) Please tell me how to find the time of file closed               [BASH]$date     Wed May  7 10:33:01 EEST 2014     [BASH]$cat >aa     adf     adsf     #waited 8 mins before closing file (time of closing: 10:41)     [BASH]$ls -l aa     -rw-------    1 orclschd staff             9 May  7 10:33 aa     [BASH]$date     Wed May  7 10:41:47 EEST 2014     [BASH]$stat aa     bash: stat: command not found     [BASH]$uname     AIX       Here I have created a file named `aa`, The file was created at 10:33 but when I closed the file and I checked the file's modified date it still showed 10:33. But the file creation end date (closed time) is 10:41 . Is there is any command in AIX to find when the file is closed or can we write any bash script to track the file automatically?


Why does a software package run just fine even when it is being upgraded?

Say I am running a software, and then I run package manager to upgrade the software, I notice that Linux does not bring down the running process for package upgrade - it is still running fine. How does Linux do this?


Where does this convention for quotation marks (`` ...'') come from?

Frequently I get asked the question: > ``K., where does this convention for quotation marks come from? You know, > the one with the two grave accents introducing a quoted string and two > regular upright single quotation marks ending it?'' I have no idea. Where does this come from?