title: Static route in Centos 6

text: Here is my `route -n` output:               Kernel IP routing table     Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     192.168.122.0   0.0.0.0         255.255.255.0   U     0      0        0 virbr0      And if I try to add a static route by this command:               route add -net 192.168.50.0 netmask 255.255.255.0 gw 192.168.50.1      I get the following output: `SIOCADDRT: No such process` Why that? Can anybody explain my the concept of adding static routes in linux. If I also have a `route-eth0` file under the `/etc/sysconfig/network-scripts/` directory, with this line in it: `123.123.123.0/24 via 123.123.124.1`, no effect is achieved after I restart the network. So, can anybody give me some explanations, links or related stuff to read on this?


title: Fixing System boot failure due to GRUB Error

text: We have a Debian based system, which unpredictably goes in to non bootable mode. Listed are the errors that usually occurs in the system.               1 > GRUB RESUE     2 > INTIRAMFS     3 > INIT SCRIPT FAILURE      Currently, we are looking out to point a reason for these errors. To start, I have collected the hard disk information of **GRUB RESUE** error machine It would be great, If someone points the root cause for these errors. What are the measures that should be taken to avoid these errors. **FDISK information:**               Disk /dev/sda: 320.1 GB, 320072933376 bytes     255 heads, 63 sectors/track, 38913 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0xc4bd0d2c             Device Boot      Start         End      Blocks   Id  System     /dev/sda1   *           1        3395    27261952   83  Linux     /dev/sda2            3395       28631   202706944   83  Linux     /dev/sda3           28631       38902    82503680    5  Extended     /dev/sda5           28631       38641    80404480   83  Linux     /dev/sda6           38641       38902     2095104   83  Linux      **parted information:**               Expected info:          Model: ATA ST320LT012-9WS14 (scsi)     Disk /dev/sda: 320GB     Sector size (logical/physical): 512B/4096B     Partition Table: msdos          Number  Start   End     Size    Type      File system     Flags      1      2097kB  27.9GB  27.9GB  primary   ext3            boot      2      27.9GB  235GB   208GB   primary   ext3      3      235GB   320GB   84.5GB  extended      5      235GB   318GB   82.3GB  logical   ext3      6      318GB   320GB   2145MB  logical   linux-swap(v1)           Recieved info:      Model: ATA ST9320325AS (scsi)     Disk /dev/sdb: 320GB     Sector size (logical/physical): 512B/512B     Partition Table: msdos          Number  Start   End     Size    Type      File system     Flags      1      1049kB  27.9GB  27.9GB  primary   ** EXT3 MISSING **                boot      2      27.9GB  235GB   208GB   primary   ext3      3      235GB   320GB   84.5GB  extended      5      235GB   318GB   82.3GB  logical   ext3      6      318GB   320GB   2145MB  logical   linux-swap(v1)      case **GRUB RESCUE** In this when we try to mount our SDA partiton               mount /dev/sda1 /mnt/test  : It throws **Mount: you must specify filesystem type**          mount -t ext3 /dev/sda1 /mnt/test  :      It throws **VFS: can't find ext3 filesystem on dev sda1**     mount: wrong fs type, bad option, bad superblock on /dev/sda1,        missing codepage or helper program, or other error        In some cases useful info is found in syslog - try        dmesg | tail  or so      Partition creation script details:               device="/dev/sda"     echo "Partition create process start for ${device}"     a=$(fdisk -l | grep ${device})     disk=`echo $a | awk '{print $3}' | sed 's/\:$//'`     if [[ "$disk" == 320* ]];then #For 320GB primary disk         fdisk -u ${device} < hddSectorInfo.sh              ###hdd Sector info###         # n p 1 4096 54527999         # n p 2 54530048 459943935         # n e 3 459948032 624955391         # n l 459952128 620761087         # n l 620765184 624955391         # a 1  w  q         ####               fi     mkfs.ext3 -F ${device}1     mkfs.ext3 -F ${device}2     mkfs.ext3 -F ${device}5     mkswap ${device}6     swapon ${device}6      Also. request some pointers on partition creation..                       1. Making /boot as separate partition is a must ??      Hard disk drive's smart info: Request pointers in fixing issue:


title: Check SSE3 support from bash?

text: Is there a way to check whether or not the current system supports SSE3 from a bash script? I'm currently writing an installer script, and the program in question has an alternate version that takes advantage of SSE3, and I would like the installer to download that version of the computer's CPU supports SSE3.


title: Augeas in shell script

text: I'm trying to use augtool in shell script ex:               #!/bin/bash          augtool <<-EOF     print /augeas/load     EOF      However if I execute this script, the script will run indefinitely with no output and the CPU usage is 100% via top cmd. the command can be run successfully using               $augtool     $print /augeas/load     /augeas/load/Webmin/excl[4] = "/*.dpkg-bak"     /augeas/load/Webmin/excl[5] = "/*.dpkg-new"     /augeas/load/Webmin/excl[6] = "/*.dpkg-old"     /augeas/load/Webmin/excl[7] = "/*.rpmsave"     /augeas/load/Webmin/excl[8] = "/*.rpmnew"     /augeas/load/Webmin/excl[9] = "/*~"     ... lots of output...     augtool> quit      I'm using Ubuntu 12.04.2 and the version of augtool is 0.10.0. My question is: how to use augtool in shell script? * * * [edited] I execute the strace command and get the following error:               lstat64("/augeas/load/", 0xbfc637d8) = -1 ENOENT (No such file or directory)      and then it keeps looping and showing:               write(2, "\7", 1)                 = 1     rt_sigprocmask(SIG_BLOCK, [INT], [], 8) = 0     rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0     rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0     read(0, "", 1)                    = 0      However if I execute this script with root, it runs successfully


title: Configuring the display properties on openSuse (Gnome) running as VirtualBox VM

text: I just created a VM using Suse Studio and I built just a simple openSUSE 11.3 VM based on the gnome template. I have not added any other software (except for Firefox and the Kernel modules, to be able to add VirtualBox Guest Additions, but using Yast). I am trying to use the gnome display program to change my resolution, and I am getting the following message: "Display configuration could not be run" - "Failed to execute child process "gnome-display-properties" (No such file or directory)". Of course I tried to lookup gnome-display in the software repository, but I had no luck there. Anyone has run into the same issue?


title: Download Manager for Linux

text: I need some good download manager for Linux (like IDM on windows). I want it to be able to install a browser plugin too, which allows you to download movies from youtube or other sites easily. It should also make as many as connection possible.


title: Nano syntax highlighting for C# and/or ASP. Net

text: Has anyone got (or can point in the direction of) a nanorc file that contains syntax highlighting for C# and/or ASP.Net?


title: force rsync to overwrite files at destination even if they're newer

text: I have an rsync backup script I run, which also restores files back where they came from when I ask. But if the files at the destination are newer than those in the backup when I try to restore, it will not replace them. I really want to replace the newer files with those in the backup but I don't see a way to make rsync do this. tldr: is there a way to force rsync to overwrite files at the destination? **edit:** I've been running `rsync -avhp` When I want to restore a backup, i use the same command with the "to" and "from" swapped. So it tries to copy files from the backup drive to the place on my computer they belong.


title: net.ipv4.conf.all.mc_forwarding: why is my access denied?

text: On Debian 12.04 LTS I am trying to access the key `net.ipv4.conf.all.mc_forwarding` by doing : > sudo sysctl -w net.ipv4.conf.all.mc_forwarding=1 But every time I am doing this, I get the message > error: permission denied on key 'net.ipv4.conf.all.mc_forwarding' Why do I get this message? How can I change this key?


title: Check last messages

text: I let a `make` command running last night when connected via SSH to a remote machine. Then had to close that SSH session, letting `make` run. How can I check the last printed messages on the console (to know if no error was issued)?


title: Modules for USB wireless adapter missing?

text: I have an USB wireless adapter that is recognized as:               # lsusb     ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter.      I am using this adapter on a device that has a much slimmed down kernel running Debian Jessie. I have installed the various applications needed: wireless-tools, wpa- supplicant, ralink-firmware package, hostapd and bridge-utils. I have rebuilt the kernel to include various modules and built the driver that accompanied the adapter. ![enter image description here](http://i.stack.imgur.com/BRkJA.png) ![enter image description here](http://i.stack.imgur.com/11nJW.png) ![enter image description here](http://i.stack.imgur.com/TViHq.png)               # iwconfig      recognizes my adapter as ra0               # iwlist ra0 scan      returns the networks that should be available               # iw list      returns nothing.               # iw ra0 info     command failed: No such device (-19)      Hosting a AP fails:               # /usr/sbin/hostapd -dd /etc/hostapd/hostapd.conf     random: Trying to read entropy from /dev/random     Configuration file: /etc/hostapd/hostapd.conf     Could not open file /sys/class/net/ra0/phy80211/name: No such file or directory     netlink: Operstate: linkmode=0, operstate=6     nl80211: Set mode ifindex 6 iftype 2 (STATION)     nl80211: Failed to set interface 6 to mode 2: -19 (No such device)     nl80211: Try mode change after setting interface down     nl80211: Set mode ifindex 6 iftype 2 (STATION)     nl80211: Failed to set interface 6 to mode 2: -19 (No such device)     nl80211: Interface mode change to 2 from 0 failed     nl80211 driver initialization failed.      Connecting to a AP fails also:               # wpa_supplicant -Dnl80211 -ira0 -c/etc/wpa_supplicant/wpa_supplicant.conf     nl80211: Could not configure driver to use managed mode     ra0: Failed to initialize driver interface      I also tried the adapter on a laptop running debian wheezy. There everything was fine. Am I missing some modules?               # lsmod     Module                  Size  Used by     rt5370sta             742575  1     cfg80211              210493  0     rfkill                 14017  1 cfg80211     hostap                103696  0     lib80211                5372  1 hostap     xt_nat                  1750  3     xt_tcpudp               3046  6     ipt_MASQUERADE          2286  2     iptable_nat             2881  1     nf_nat_ipv4             3399  1 iptable_nat     nf_nat                 17347  4 xt_nat,ipt_MASQUERADE,iptable_nat,nf_nat_ipv4     nf_conntrack_ipv4      13503  6     nf_defrag_ipv4          1285  1 nf_conntrack_ipv4     xt_state                1108  5     nf_conntrack           77834  6 ipt_MASQUERADE,iptable_nat,nf_nat_ipv4,nf_nat,nf_conntrack_ipv4,xt_state     iptable_filter          1347  1     ip_tables              11196  2 iptable_nat,iptable_filter     x_tables               17193  6 xt_nat,xt_tcpudp,ipt_MASQUERADE,xt_state,iptable_filter,ip_tables     ppp_deflate             3787  0     bsd_comp                5006  0     evdev                   9979  0     tsc2007                 5157  0     option                 21380  1     usb_wwan               11156  1 option     usb_storage            45150  0     scsi_mod              120215  1 usb_storage     ppp_async               7246  1     ppp_generic            26588  7 ppp_deflate,bsd_comp,ppp_async     slhc                    5513  1 ppp_generic     crc_ccitt               1517  1 ppp_async     phy_mxs_usb             2952  2     ci_hdrc_imx             3956  0     ci_hdrc                 7027  1 ci_hdrc_imx     ehci_hcd               58577  1 ci_hdrc     usbserial              35306  5 option,usb_wwan


title: Human readable memory sizes in top?

text: Is there an option in `top` to show memory sizes in human readable format? Example:               PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND                                 3960 phil      20   0 1347280 383112  30316 S   0.0  9.5   6:59.45 firefox      It would be nicer to show RES as 374m (instead of 383112). I'm currently using Arch Linux. Ubuntu seems to use human readable representations by default. (I tried `man top` but could not find the option. Maybe I missed it.)


title: speed up gzip compression

text: Is it possible to speed up the `gzip` process? I'm using               mysqldump "$database_name" | gzip > $BACKUP_DIR/$database_name.sql.gz      to backup a database into a directory, `$BACKUP_DIR`. the manpage says: > -# --fast --best   >  Regulate the speed of compression using the specified digit #, where -1 or > --fast indi‐ cates the fastest compression method (less compression) and -9 > or --best indicates the slowest compression method (best compression). The > default compression level is -6 (that is, biased towards high compression at > expense of speed).   * How effective would it be to use `\--fast`?   * Is this effectively lowering the CPU usage on a modern computer? ### My test results I didn't notice any acceleration:   * 7 min, 47 seconds (with default ratio `-6`)   * 8 min, 36 seconds (with ratio `\--fast` ( = 9 )) So it seems it takes even longer to use the fast compression? Only higher compression really slows it down:   * 11 min, 57 seconds (with ratio `\--best` ( = 1 )) After getting the Idea with `lzop` I tested that too and it really is faster:   * 6 min, 14 seconds with `lzop -1 -f -o $BACKUP_DIR/$database_name.sql.lzo`


title: How to make festival evaulate its own scheme expressions from the command line, so as to change voices as needed?

text: I can't seem to find any documentation on this. This forum post shows someone trying to change the voice used by festival, outside of the festival interpreter, using a command-line flag.               festival --\(voice_kal_diphone\) --tts "Langalist.txt"      It doesn't work. As a solution, the OP's program's configuration file ends up being edited. Everyone here also seems to use that method to select voices. But surely, if from within the program's scheme interpreter the expression               luisetta@riverbrain:~$ festival          Festival Speech Synthesis System 2.1:release November 2010     Copyright (C) University of Edinburgh, 1996-2010. All rights reserved.          clunits: Copyright (C) University of Edinburgh and CMU 1997-2010     hts_engine:      The HMM-based speech synthesis system (HTS)     hts_engine API version 1.04 (http://hts-engine.sourceforge.net/)     Copyright (C) 2001-2010  Nagoya Institute of Technology                   2001-2008  Tokyo Institute of Technology     All rights reserved.     For details type `(festival_warranty)'     festival> (voice_name_here)      from the list of voices returned by typing               festival> (voice.list)      works, then there must be a way to get the program to interpret its own scheme expressions via the command line too, right?


title: Readable comments on separate lines in a multi-line bash command with pipelines?

text: When creating shell scripts using pipelines, and using the backslash to continue lines, I want to insert comments **on separate lines** , in a robust, readable and portable fashion. For example, given this uncommented multi-line command (stolen from @DigitalRoss for its clarity):               echo abc |          tr a-z A-Z |          sort |          uniq      ... the below is aesthetically closest to what I want to accomplish, but for obvious reasons, does not work ... and yes, I'm well aware that this isn't something normally worth commenting:               # Perform critical system task.     # NOTE - An example of what does *not* work.     echo abc |         # Convert lowercase to uppercase.          tr a-z A-Z |               # Sort the results.          sort |               # Only show unique lines.          uniq      **Existing related answers appear unsatisfactory for me** , as follows: First, glenn jackman's answer (adding arguments to an array, and then executing the array) works for single commands, but does not work for pipelining (and even if it did, it adds complexity that I would like to avoid). Second, @Gilles' answer here (which uses `:`) also doesn't appear to work with pipelining, because it alters the flow of the pipeline:               $ echo "abc" | :     $      ( **NOTE** : If there is an equivalent to `:` that passes output unmodified, that would be aesthetically acceptable, but I haven't been able to find one. I could write a custom one, but it would reduce portability.) Finally, the last part of DigitalRoss' answer on StackOverflow works well for adding comments on the same line, but I strongly prefer comments on separate lines. Otherwise, when lines have widely varying lengths, readability is reduced:               echo abc |         # normal comment OK here`          /usr/local/bin/really/long/path/ridiculously-long-filename.sh |  # another normal comment OK here          sort |        # the pipelines are automatically continued          uniq          # final comment      I'm looking for answers that preserve readability and minimize complexity, or else some background on why what I'm looking for is infeasible.


title: How does this vim command work `:g/#/+1t.`

text: I was playing vimgolf (very addictive by the way) and I can't understand one of the solutions to this challenge http://vimgolf.com/challenges/4d1a34ccfa85f32065000004 The challenge is to convert this text:               Make the pairs of lines match up by making each second line same as first:          # Appending text:     The name "Vim" is an acronym for "Vi IMproved"     The name "Vim" is an acronym for          # Editing text:     Vim is a text editor originally released by Bram Moolenaar in 1991 for the Amiga     Trivia: Vim is a text editor released by Bram Moolenaar in 1991 for the Amiga          # Deleting text:     Vim has a vi compatibility mode     Vim has a vi compatibility mode but when not in this mode Vim has many enhancements over vi      to this: Make the pairs of lines match up by making each second line same as first:               # Appending text:     The name "Vim" is an acronym for "Vi IMproved"     The name "Vim" is an acronym for "Vi IMproved"          # Editing text:     Vim is a text editor originally released by Bram Moolenaar in 1991 for the Amiga     Vim is a text editor originally released by Bram Moolenaar in 1991 for the Amiga          # Deleting text:     Vim has a vi compatibility mode     Vim has a vi compatibility mode      My question is, how the second line of this solution works:               :g/#/+2d<CR>:<Up><BS><BS>1t.<CR>ZZ      and by second line I mean `:g/#/+1t.`


title: Force GNU screen to reflow to current terminal width on reattach?

text: I would like to force GNU screen to reflow to the existing terminal width when I reattach a session. It seems to me this worked properly before I upgraded a machine to CentOS 6, but I cannot figure out how to restore it. (`TERM=xterm`) Whenever I reattach a session, regardless of state when I detached it, it launches at 80 columns, resizing my terminal (PuTTY, in this case) along with it. I'm launching & reattaching with:               screen -aA -R <session>      My .screenrc contains only the following, and a few irrelevant key bindings:               term xterm          defscrollback 10000          # status line at the bottom     hardstatus on     hardstatus alwayslastline     hardstatus string "${-}%{.0c}%-w%{.y0}%f%n %t%{-}%+w %=%{..G}[%H] %{..Y} %D %M %d, %Y %c | Load: %l"     caption splitonly "%{.yK}%3n t"     caption string "%{.c0}%3n %t"          vbell off          # Fix fullscreen programs     altscreen on


title: NVidia, Compiz and Desktop Effect Problem

text: I installed the Nvidia driver on OpenSuse 12.1. The driver was downloaded from http://en.opensuse.org/SDB:NVIDIA_drivers. But after I installed the Nvidia driver, I cannot activate any desktop effects ("The following desktop effects could not be activated".) The whole graphic rendering is not optimal or not good. For example, if Dolphin is opening, you can see a small Dolphin icon jump. But during the animation the icon leaves a grey trail. Also if the window is moved, it starts to jitter. Here is my xorg.conf               Section "Files"         ModulePath   "/usr/lib64/xorg/modules/extensions/nvidia"         ModulePath   "/usr/lib64/xorg/modules/drivers"         ModulePath   "/usr/lib64/xorg/modules"     EndSection          Section "Monitor"              # HorizSync source: edid, VertRefresh source: edid         Identifier     "Monitor1"         VendorName     "Unknown"         ModelName      "Samsung SyncMaster"         HorizSync       30.0 - 81.0         VertRefresh     56.0 - 75.0         Option         "DPMS"     EndSection          Section "Device"         Identifier     "Device0"         Driver         "nvidia"         VendorName     "NVIDIA Corporation"         BoardName      "GeForce 7600 GT"         BusID          "PCI:5:0:0"         Screen          0     EndSection          Section "Device"         Identifier     "Device1"         Driver         "nvidia"         VendorName     "NVIDIA Corporation"         BoardName      "GeForce 7600 GT"         BusID          "PCI:5:0:0"         Screen          1     EndSection          Section "Screen"         Identifier     "Screen0"         Device         "Device0"         Monitor        "Monitor0"         DefaultDepth    24         Option         "TwinView" "0"         Option         "metamodes" "DFP-0: nvidia-auto-select +0+0"         SubSection     "Display"             Depth       24         EndSubSection     EndSection          Section "Screen"         Identifier     "Screen1"         Device         "Device1"         Monitor        "Monitor1"         DefaultDepth    24         Option         "TwinView" "0"         Option         "metamodes" "DFP-1: nvidia-auto-select +0+0"         SubSection     "Display"             Depth       24         EndSubSection     EndSection          Section "Extensions"         Option         "Composite" "On"     EndSection      Thank you.


title: Correct way of updating plugins for webapplications hosted on linux

text: I am developing a plugin for PrestaShop, it works but the issue is with its autoupdate. Sometimes it fails on customers server due to permissions issues. The plugin is downloaded as a zip(using php/curl) and then unzipped as plugin_temp using by a php script, then renamed to plugin. As I have been told during this process, either the perms change or the ownership changes. What is the correct way of handling such an update ? Should the zip be extracted to /tmp ? I am guessing since a large number of web applications have autoupdating plugins there must be some sort of standard procedure.. Thanks


title: visit a website with multiple domains on the same server using the IP address

text: I've a web server hosting multiple domains, user webmin and virtualmin. How can I view the website for example www.abc.com by IP address? As I remember, something like user mode of Apache can view the website by IP address in format like `123.123.123.123/~username`, but it seems not to work for my situation.


title: Solaris 10 : Remove trailing blank lines from multiple files

text: I'm working on Solaris 10.What is the easiest way to remove blank lines from multiple files at once?


title: How can I install perf 3.4.25?

text: By installing `perf` using               sudo apt-get install linux-tools-common     sudo apt-get install linux-tools-3.2.0.23      gave me > perf version 3.2.14 How can I install `perf` 3.4.25? Is it related to kernel version? I found source here http://lxr.linux.no/#linux+v2.6.39/tools/perf/ but there is no way to download it. which version kernel comes with **perf 3.4.25?**


title: $PATH in /etc/profile not inherited by user shell

text: I have this in `/etc/profile` in Fedora 17:               PATH=$PATH:"/usr/pgsql-9.2/bin"     EDITOR="/usr/bin/emacs -nw"     PSQL_EDITOR="/usr/bin/emacs"     PAGER="/usr/bin/less"          export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL EDITOR PSQL_EDITOR PAGER      The $PATH variable concatenation is in effect when I login as `root` or as `postgres` but not when I login to my account. I'm using terminator. As root:               # echo $PATH     /usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/pgsql-9.2/bin:/root/bin      As postgres:               $ echo $PATH     /usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/usr/pgsql-9.2/bin:/usr/pgsql-9.2/bin      In my account:               $ echo $PATH     /usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/home/cpn/.local/bin:/home/cpn/bin      Notice the absence of the `/usr/pgsql-9.2/bin` path. `/home/cpn/.bash_profile` has this line:               PATH=$PATH:$HOME/.local/bin:$HOME/bin     export PATH      When I `su -` (notice the `-`) to my account the path is there so I guess it is a matter of `login` vs `not login` shell. How to make the terminal to always open a login shell?


title: PAM Authentication and SSH access based on user info stored in sqlite3

text: I have an application that runs on a `Linux` box. The application stores all its user information (like - `username`, `password`, `ssh-allowed`, etc) in an `sqlite3` database as follows.               username        password        ssh-allowed     admin           X               y        regularuser     X               n         The application users will login to a GUI to use the application. But all the application users who have their `ssh-allowed` as `y` are allowed to login to the `Linux` box using `ssh`. Other application users (with `ssh-allowed` as `n`) are not allowed to login to the `Linux` box using `ssh`. So in the above case `admin` user will be allowed to `ssh` to the `Linux` box but `regularuser` will be denied `ssh` access to the `Linux` box. W.r.t the GUI, in order to perform `authentication` using `PAM` for user info stored in `sqlite`, I use libpam-sqlite. Actually, I have modified it to work with `sqlite3` database and it is available here. Now to the question: When an application user attempts to login to the `Linux` box, How can I perform `authentication` and then decide to either allow or deny `ssh` access based on the `ssh-allowed` parameter that is stored in the `sqlite3` database using `PAM` (or any other way)? Please NOTE: All the user info is store in the `sqlite3` database only and NOT in `/etc/passwd`, `/etc/shadow`, `/etc/group` files. IOW the application does not have rights to add/remove records in the `/etc` files. NOTE2: I had the same question posted in SO; thought this is a better forum for Linux related questions.


title: /usr/bin/which returns cryptic error "which: no ls in ((null))"

text: I am writing a simple shell program. When I use /usr/bin/which with my shell in mac osx and ubuntu, it acts normally. When I use the exact same command on Red Hat Enterprise Linux Client release 6.3 (Santiago), I get this error: "which: no ANYCOMMANDHERE in ((null))". Is there any intuition for this? I can't even find what the error means (Let me know if showing my source will help). **EDIT: My path is (from inside the shell):**               $ echo $PATH     /usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin      Thanks, Jon


title: Insert a line after a block of text with sed

text: I have text file: `file.conf`               ### Option: LogFile     #       Name of log file.     #       If not set, syslog is used.     #     # Mandatory: no     # Default:     # LogFile=          ### Option: LogFileSize     #       Maximum size of log file in MB.     #       0 - disable automatic log rotation.     #     # Mandatory: no     # Range: 0-1024     # Default:     # LogFileSize=1      I want to search for a line containing `LogFile`, skip subsequent non-blank lines, and insert a new line with predefined content just before the next blank line. And I have tried:               sed --posix -e '/\bLogFile\b/{:a;n;/^ *$/!ba;i\LogFile=/tmp/log1.log' -e '}' file.conf      And this is working fine, for those option blocks which are followed by a blank line. However, it is also possible that the file ends with no blank line, in which case I want to insert the new line at the end of the file. In this example, it would happen if I was looking for `LogFileSize` instead of `LogFile`. How can I handle this case?


title: Running Linux kernel in Virtualbox

text: I just built a Linux kernel on Ubuntu and now I want to make it run on VirtualBox. I wanted it to be in an img format. I created a hard drive image by doing the commands:               $ qemu-img create disk.img 512M     $ mkfs.ext2 -F disk.img      What should I do next?


title: How to configure Samba to use Windows's login ID?

text: I'm trying to access the Linux share folder from Windows using Windows's domain authentication. I come across the integration of `Windows Active Directory` into Samba on a Linux box, thus I have this being configure in `smb.conf`:               # LDAP settings             passdb backend = ldapsam:ldap://xxx.xxx.xxx.xxx:xxx             ldap suffix = DC=org,dc=huahsin,dc=IT             ldap user suffix = OU=Users,OU=Tech,OU=MY             ldap admin dn = CN=AccountA,OU=Users,OU=Tech,OU=MY,DC=org,DC=huahsin,DC=IT             ldap passwd sync = yes      And this is how I configure to my share folder:               [homes]        comment = Home Directories        browseable = yes        path = /home/huahsin/share      Anyhow I'm still not able to access my share folder. May I know what are the missing part in Samba configuration in order to authenticate through Windows's login ID when accessing a Linux share folder?


title: How can I enhance the output of find and grep?

text: I really don't look forward to having to do `find`/`grep` because the output, as returned by               find . -exec grep sometext {} \; -print      is just not very easy to read even when you dump it in a file. What I would like is if the file name had an indentation of 0 and then each file line where a match was found were indented with the line number and each match is highlighted in color. Let me know if this is possible. I just can't read the awful output as it comes out of the command that I know. I go between ksh and bash.


title: LVM2: lvcreate -L - What does 's', 'S' suffix stand for?

text: `man lvcreate` - Am I blind or there is no description for "sS" ? (I can't find on redhat manual pages as well)               -L, --size LogicalVolumeSize[bBsSkKmMgGtTpPeE]                   Gives  the  size  to allocate for the new logical volume.                   A size suffix of K for kilobytes, M for megabytes, G for                   gigabytes, T for terabytes, P for                   petabytes or E for exabytes is optional.                   Default unit is megabytes.


title: SSH asking for passphrase on public key with no passphrase set

text: I have been using public key authentication on my servers for a while now, but I am experiencing issues on a new 'client' trying to connect to github. I have read many threads to verify that my permissions are set up correctly and have generated a new key for github. The problem I am facing is that ssh is asking for my passphrase even though I did not set a passphrase. I have even re-made the key to be 100% sure that I did not enter a passphrase. **ssh -vvv** gives the following related output:               debug1: Offering public key: /home/me/.ssh/github.pub     debug2: we sent a publickey packet, wait for reply     debug3: Wrote 368 bytes for a total of 1495     debug1: Remote: Forced command: gerve mygithubusername c3:71:db:34:98:30:6d:c2:ca:d9:51:a8:c6:1b:fc:f7     debug1: Remote: Port forwarding disabled.     debug1: Remote: X11 forwarding disabled.     debug1: Remote: Agent forwarding disabled.     debug1: Remote: Pty allocation disabled.     debug1: Server accepts key: pkalg ssh-rsa blen 277     debug2: input_userauth_pk_ok: fp c3:71:db:34:98:30:6d:c2:ca:d9:51:a8:c6:1b:fc:f7     debug3: sign_and_send_pubkey     debug1: PEM_read_PrivateKey failed     debug1: read PEM private key done: type <unknown>     Enter passphrase for key '/home/me/.ssh/github.pub':       I have searched to figure out why it is telling me **PEM_read_PrivateKey** failed, but I cannot find a solution. I do not use an agent or anything. I configure my ~/.ssh/config file similar to the following:               Host github     Host github.com     Hostname github.com     User git     PubkeyAuthentication yes     IdentityFile /home/me/.ssh/github.pub      Thanks in advance.


title: AWK Search massive file and write to variable name

text: I want to pull data that I will need to reformat from a simulation file I am working with to prepare it as input for running other simulations. The target data is an optimized chemical z-matrix. The only difference from the example in the link is that the digits are stored as variables under the z-matrix. I'm working with files which can span thousands to hundreds of thousands of lines, and have throughout it other intermediate z-matrices which are extremely similar to my target data. However, there is a unique leading line and a line after the data I need so the data in between those two lines should be relatively simple to extract. Here is an example:                Final structure in terms of initial Z-matrix:      Cl      C,1,B1      C,2,B2,1,A2      H,2,B3,1,A3,3,D3,0      H,2,B4,1,A4,3,D4,0      C,3,B5,2,A5,1,D5,0      C,6,B6,3,A6,2,D6,0      C,7,B7,6,A7,3,D7,0      H,3,B8,2,A8,1,D8,0      H,3,B9,2,A9,1,D9,0      H,7,B10,6,A10,3,D10,0      H,7,B11,6,A11,3,D11,0      H,8,B12,7,A12,6,D12,0      H,8,B13,7,A13,6,D13,0      H,8,B14,7,A14,6,D14,0      O,6,B15,3,A15,2,D15,0           Variables:      B1=1.81746475      B2=1.52136867      A2=110.80057513      B3=1.0898967      A3=106.92512231      D3=-121.94499481      B4=1.08989406      A4=106.92581701      D4=121.94497834      B5=1.52808963      A5=111.92359259      D5=179.99770382      B6=1.523193      A6=116.49970868      D6=179.97424974      B7=1.52739317      A7=113.56269053      D7=179.98802896      B8=1.09816794      A8=110.50682514      D8=58.2854688      B9=1.09816384      A9=110.50888758      D9=-58.28349045      B10=1.10022643      A10=107.84652382      D10=56.40290615      B11=1.10022793      A11=107.84460667      D11=-56.42958848      B12=1.09398015      A12=110.97242167      D12=-59.62466169      B13=1.09473047      A13=110.53459142      D13=179.99742235      B14=1.09397826      A14=110.9720435      D14=59.61905862      B15=1.21736254      A15=121.22780588      D15=-0.02140167      1\1\GINC-C0959\FOpt\RB3LYP\6-31G(d)\C5H9Cl1O1\SKYLERS\10-Sep-2013\0\\#      I also need to reformat this data, replacing the commas in the first part with spaces and the variables need to be left indented letters followed by right indented numbers. I also want to set up this script to write this data to a new file based on the name of the input file. My goals in summary:   1. open file abc.out   2. start reading after "final structure in terms of initial Z-matrix:"   3. reformat Z-matrix   4. reformat variables   5. write to file abc.cm So far these are some of the awk portions i was thinking of using:                 {FS=","};{OFS=" "};{print $0}       {FS="="};{printf "%-4s%13.8f", $1, $2}      What I still haven't figured out:   * How do I write to a file based on the input file name?    * How do I read only between the first and last lines?   * How should I split this at "Variables:"?


title: Adding files to initrd makes linux not be able to read it

text: I'm using clonezilla-1.2.12 and need to add the Broadcom firmware to the initrd so it can netboot. (clonezilla is debian-based and debian no longer includes the firmware blobs as they're non-free. Naturally then clonezilla doesn't either.) (I can't use the Ubuntu-based clonezilla as Ubuntu has a bug in it where the Broadcom 5708 chipset Just Doesn't Work.) I have what seems like a good process for doing so:               ~# mkdir /tmp/cz-newinitrd      ~# cd /tmp/cz-newinitrd     /tmp/cz-newinitrd# xzcat /media/CLONEZILLA/live/initrd.img.orig > initrd     /tmp/cz-newinitrd# (cd /; find lib/firmware/bnx2 | cpio -o -H newc --append -O /tmp/cz-newinitrd/initrd)     /tmp/cz-newinitrd# xz -c initrd > /media/CLONEZILLA/live/initrd.img      BUT linux refuses to recognize the redone initrd: ![boot failure](http://i.stack.imgur.com/kekYd.png) I also tried making a single cpio archive (without using --append) and got the same result. If I completely skip modifying the archive and just uncompress/recompress I still get the same result. What is going wrong here?


title: SSH, FTP, HTTP stopped working

text: I'm facing a problem with a Linux webserver of mine. It's a VM Ubuntu 10.4 LTS which runs a Wordpress network site. Out of the blue with no changes being made on the back end, ftp has stopped as has ssh. In addition, I cannot reach the host/site at all, but I can successfully ping it from inside the network... Similarly, I can do an nslookup just fine. I'm very perplexed as to what's wrong. Below's a table of what's ok, which I hope might be useful to helpers.               Nslookup          YES     Ping              YES - Only within network     FTP               NO     SSH               NO     HTTP              NO - Apache, Mysql "appear" to be running fine though     Other Servers     YES     on Cluster ok     Ports open        YES - listening on all the necessary: 80, 22, 23, 25, 3306 etc.     Telnet            ??? - Ports 80, 3306 don't work, others do      From the above I've gathered it's to do with my box, well that was obvious, but seeing that DNS resolution is ok (internally at least) and how random services have gone down, I'm wondering if there has been some kid of bug or virus, or if the networking just broke out of the blue. Many, many thanks in advance!


title: mdadm with overlaying lvm - remove a hard drive

text: This is a hypothetical question, I'm just evaluating in which way I should configure my hard drives for my home-server and for that I need to know this: Let's say I have a Raid5 configured with mdadm and put the resulting devices md0 and md1 into LVM to get one big, failsafe drive: ![enter image description here](http://i.stack.imgur.com/xvvhs.png) Now the grey 1TB drive crashes and since it as been a few years when 1TB drive were the most recent technology, I want to buy a 2TB drive instead. What would be the best way to bring this new 2TB drive into my Raid system? Of course I could replace the broken 1TB drive with a 2TB one, but then I would waste 1TB of this drive that can't be used. Would it be possible to shrink the md1-array and place the new drive into the md0-array instead?


title: Trimming one part if equal to another part?

text: I use an e-mail quote attribution string like this:               On dd mmm yyyy hh:mm +hhmm, from info@example.org (Example Dot Org):      where `info@example.org` is the sender's e-mail address and `Example Dot Org` is the sender's real name. When no real name is provided (or even sometimes when one is), the two are identical, and I end up with an attribution string like this:               On dd mmm yyyy hh:mm +hhmm, from info@example.org (info@example.org):      If (and only if) this is the case, I want to remove the `(info@example.org)` part, leaving me with only:               On dd mmm yyyy hh:mm +hhmm, from info@example.org:      I already have a shell script which calls out to Perl to massage the e-mail before feeding it to my editor, and am thinking I could simply add some code to that to massage the attribution line as well. The solution could be done in Perl, awk, sed, or something else (though preferably not something _too_ exotic). I do know that the attribution line is the first non-blank line following the first blank line of the input, and I don't mind hardcoding against my preferred attribution line format. Simply deleting the part in paranthesises is trivial, but **how to do it only when it is equal to what precedes it?** Preferably without risking altering anything else in the email (text file).


title: Chroot in to reinstall Grub2 reinstall, mnt/ is empty

text: I have a common problem: I installed Fedora 18 on my PC that has Windows on it. When I start the PC I don't get asked which system I want to boot, Windows is chosen always. So I found out that I have to reinstall Grub2. So I booted from a Live CD and entered rescue mode (hit `e` in Grub2 and added `single` to the line that begins with "linux.."). Then I should do `chroot /mnt/sysimage`, but there is no such directory. When I do `cd mnt` and `ls`, it is empty. So I have no idea how to change root. When I do `fdisk -l`, the Fedora instalation is in partition `/dev/mapper/fedora-root`. How can I correctly chroot into the Fedora installation and reinstall Grub2?


title: How to add printer ricoh 2018d?

text: I'm using Linux Mint 13 and got some troubles with installing Ricoh 2018d. I also have an another printer, "Hewlett-Packard HP LaserJet Professional P1102w" and this was piece of cake. I've just do this: Menu > Printer > add > pick HP from network printers branch (ricoh is not shown) > next > .. > finish


title: Attaching USB-Serial device with custom PID to ttyUSB0 on embedded

text: I'm attempting to get an FTDI USB-Serial device with a custom PID to automatically (or even manually) attach to ttyUSB%n, without much success. The device's normal VID/PID is 0403/6001. When programmed this way, it works perfectly and automatically attaches itself to ttyUSB0 when plugged in. Even with the driver recompiled to respect our new PID, when programmed with the custom one ttyUSB0 does not appear, but it does recognize it as an ftdi_sio device and loads the driver. I have added our PID to the header and source:               // in ftdi_sio_ids.h     #define FTDI_CUSTOM_PID 0xABCD // not the actual pid                    // then in ftdi_sio.c     static struct usb_device_id id_table_combined [] = {         // devices....         { USB_DEVICE(FTDI_VID, FTDI_CUSTOM_PID) },         // ....      Recompiled the entire kernel and reflashed the device. When I plug the device in I get:               usb 1-1: new full-speed USB device number 2 using at91_ohci     usbcore: registered new interface driver usbserial     usbserial: USB Serial Driver core     USB Serial support registered for FTDI USB Serial Device     usbcore: registered new interface driver ftdi_sio     ftdi_sio: v1.6.0:USB FTDI Serial Converters Driver      lsusb shows the correct custom VID/PID. The driver seems to recognize that it's supposed to use ftdi_sio with it, but doesn't attach it to ttyUSB0 like it would with the unmodified PID. Any suggestions as to what I'm doing wrong here?


title: (SSH) Is it dangerous to close terminal without "exit"?

text: This happened many times. While the SSH active, I'm so tired and just close the terminal without `exit` Is it dangerous to doing like that?


title: When and why should I use apt-get update?

text: ### General question: Could some explain what the command `apt-get update` does and when I really should use it? * * * ### Remarks Please give a **detailed answer**. Not just a copy of the man page, unless your version is really detailed (I put one definition from man page below). > **apt-get update** : Used to re-synchronize the package index files from > their sources. The indexes of available packages are fetched from the > location(s) specified in /etc/apt/sources.list(5). An update should always > be performed before an upgrade or dist-upgrade. * * * ### Sub-questions:   * Where is stored the package index? On a database? On a file?   * What happens if I do `apt-get install` without updating the cache? Is there a chance that the remote package would not exist anymore and that the link would be broken?   * Is there some agreed politic about deb repositories? For example, should a repository only contains the last version of a package, or on the contrary should it contains all versions available for a specific distribution release? * * * ### Context I ask my question because I am studying the Docker framework. One of its feature is the _Dockerfile_ , which allows you to build a sort of OS image by executing some instruction from this file. One property of this image is that it should always be the same, whatever the context is (time of build, etc). I'm afraid that if I launch `apt-get update` command at different time, the result would be different and so my images would be different.


title: Webcam Device Driver to support H.264

text: 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.


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

text: 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!


title: Nvidia ethernet port not detected on Centos 7

text: 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)


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

text: 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!


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

text: 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.


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

text: 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?


title: Disable kernel logging during initialization

text: 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?


title: concat file content horizontally in vi/vim

text: 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  ..   ..   ..   ..   ..   ..


title: Shortcut for tabn & tabp in vim/vi

text: 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?


title: tmux choose-session format

text: 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...


title: Temporary files problem

text: 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


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

text: 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.


title: "No Ethernet card" while installing debian stable

text: 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


title: How to make installation package for many Linux distributions

text: 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.


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

text: 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.


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

text: 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


title: Why does the mountpoint of my root filesystem change?

text: 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?


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

text: 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).


title: add "check if fetchmail is running" to this script

text: 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?


title: Problem with read variable from AWK

text: 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


title: Error when calling a script from inside another script

text: 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


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

text: 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.


title: Word-splitting when parameter is used within command substitution

text: 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


title: Move to next capital letter

text: 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.


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

text: 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`


title: Difference between > and | with /dev/tty

text: 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?


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

text: 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.


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

text: 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?


title: Awk: expanding first field along the column

text: 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.


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

text: 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.


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

text: 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?


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

text: 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.


title: Who is doing the job: ffmpeg or the shell?

text: ## 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.


title: Intel Xeon stuck at 800mhz CPU Freq on RHEL 6.5

text: 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)


title: Is xinitrc executed when logging in?

text: 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?


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

text: 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


title: Fedora preupgrade-cli fails

text: 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?


title: How to disable wlan0 when shutdown

text: 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)


title: How can I install ncdu on Red Hat?

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


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

text: 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 ?


title: unable to open openmpi ? Terminal / OSX 10.9.1

text: 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?


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

text: 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?


title: Virtual mouse driver, possible X11 problems

text: 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?


title: Apply two commands to result of find

text: 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`.


title: How to change highlight color in calibre ebook reader

text: 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.


title: who -b date format varies strangely

text: 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) ?