Out of Swap - What happens?

On my debian VM machine with 512MB RAM and 348MB Swap, what will happen if i open a 1GB file in an editor and get out of memory? Will it crash the system? Or if not, how will linux handle this? Wouldn't it be wise to install Swapspace so if needed there will be created enough swap automatically and dynamically?               sudo apt-get install swapspace


Why doesn't GCM HTTPS work with nginx?


Passing all files of specific filetype in current and subdirectories

I have constructed an elaborate 500+ character command with many arguments and switches to autosign multiple PDF documents. I'm using JSignPDF and I'd like to use it's batch mode including the current directory and subdirectories. The relevant part of the command I'm having trouble with is:               java -jar ../jsignpdf-1.4.3/JSignPdf.jar *.pdf -a      ...which of course works great for all PDF files in the current directory. How can I make it so it picks up all .pdf files in all the subdirectories as well? I've tried a few things which haven't worked... novice and not even worth mentioning...things like -r (obviously would-/did-n't work). I'm wondering if this is a simple answer or in need of some awk magic, if that would even be valid. Any help is greatly appreciated.


bash -e exits when let or expr evaluates to 0

I have a bash script that sets -e so the script will exit on any exit status != 0. I'm trying to do some basic shell arithmetic assigned to variables and sometimes the expression equals 0 which causes the exit status of the let or expr command to be "1". Here's an example:               #!/bin/bash -ex     echo "Test 1"     Z=`expr 1 - 1` || true     echo "Z will print"     let "A=4 - 4"     echo "A WILL NEVER PRINT $A"     Y=`expr 1 - 1`     echo "Y WILL NEVER PRINT $Y"     X=$(expr 2 - 2)     echo "X WILL NEVER PRINT $X"      The output is:               $ ./test_error.sh      + echo 'Test 1'     Test 1     ++ expr 1 - 1     + Z=0     + true     + echo 'Z will print'     Z will print     + let 'A=4 - 4'      My question is what's the idiomatic bash scripting way to allow the script to fail on real exit errors and not on basic arithmetic equaling 0. I could suffix all those expressions with:               A=`expr $C - $D`    || true      But that seems hacky.


How to install Debian on a loopback device?

I'd like to install Debian on a loopback device (`/dev/loop0`). I can easily access the command prompt by booting off the DVD and asking for a shell, and I'm assuming it should also be easy to mount the loopback device on `/`. The part that I don't know is: how do I manually run the installer, after I have mounted `/`?


How can I get the address of my local machine?

I'm on a macbook running Lion. In `Terminal` I'm connected to my schools server with `ssh`. I navigated to a folder on the server and have a file I want to copy to my local machine, but I don't know what the IP address of my local machine is. How can I get it? I'm in the folder on the server, and I want to copy `read.txt` onto my local machine's hard drive. I've tried `scp ./read.txt [my computer name].local/newRead.txt` but it doesn't work.


How to identify a website's form parameter

In THC Hydra, when you type `Hydra -U` you get the following syntax (template): `<url>:<form parameters>:<condition string>` What I'm wondering is how to determine the form parameter. Is there a way to do it with just THC Hydra or do you need burp suite as well? OR, even better, is there a way to do it just by viewing the site's HTML form? and how would you do that? If this isnt clear enough, please let me know and ill try and make it clearer.


Can't use gcc on x64 debian:               $ gcc a.cpp     Assembler messages:     Fatal error: No compiled in support for x86_64      what should I do? Some people propose installing binutils, but they are already there. (Adding -m64 doesn't change anything). Where does this message come from? a.cpp is just an empty file. \--help=target gives               The following options are target specific:       -m128bit-long-double        sizeof(long double) is 16       -m32                        Generate 32bit i386 code       -m3dnow                     Support 3DNow! built-in functions       -m3dnowa                    Support Athlon 3Dnow! built-in functions       -m64                        Generate 64bit x86-64 code       -m80387                     Use hardware fp       -m8bit-idiv                 Expand 32bit/64bit integer divide into 8bit                                   unsigned integer divide with run-time check       -m96bit-long-double         sizeof(long double) is 12       -mabi=                      Generate code that conforms to the given ABI       -mabm                       Support code generation of Advanced Bit                                   Manipulation (ABM) instructions.       -maccumulate-outgoing-args  Reserve space for outgoing arguments in the                                   function prologue       -maes                       Support AES built-in functions and code generation       -malign-double              Align some doubles on dword boundary       -malign-functions=          Function starts are aligned to this power of 2       -malign-jumps=              Jump targets are aligned to this power of 2       -malign-loops=              Loop code aligned to this power of 2       -malign-stringops           Align destination of the string operations       -mandroid                   Generate code for the Android platform.       -march=                     Generate code for given CPU       -masm=                      Use given assembler dialect       -mavx                       Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1,                                   SSE4.2 and AVX built-in functions and code                                   generation       -mavx2                      Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1,                                   SSE4.2, AVX and AVX2 built-in functions and code                                   generation       -mavx256-split-unaligned-load Split 32-byte AVX unaligned load       -mavx256-split-unaligned-store Split 32-byte AVX unaligned store       -mbionic                    Use Bionic C library       -mbmi                       Support BMI built-in functions and code generation       -mbmi2                      Support BMI2 built-in functions and code                                   generation       -mbranch-cost=              Branches are this expensive (1-5, arbitrary units)       -mcld                       Generate cld instruction in the function prologue.       -mcmodel=                   Use given x86-64 code model       -mcpu=                      This switch lacks documentation       -mcrc32                     Support code generation of crc32 instruction.       -mcx16                      Support code generation of cmpxchg16b instruction.       -mdispatch-scheduler        Do dispatch scheduling if processor is bdver1 or                                   bdver2 and Haifa scheduling is selected.       -mf16c                      Support F16C built-in functions and code                                   generation       -mfancy-math-387            Generate sin, cos, sqrt for FPU       -mfentry                    Emit profiling counter call at function entry                                   before prologue.       -mfma                       Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1,                                   SSE4.2, AVX and FMA built-in functions and code                                   generation       -mfma4                      Support FMA4 built-in functions and code                                   generation        -mforce-drap                Always use Dynamic Realigned Argument Pointer                                   (DRAP) to realign stack       -mfp-ret-in-387             Return values of functions in FPU registers       -mfpmath=                   Generate floating point mathematics using given                                   instruction set       -mfsgsbase                  Support FSGSBASE built-in functions and code                                   generation       -mfused-madd                This switch lacks documentation       -mglibc                     Use GNU C library       -mhard-float                Use hardware fp       -mieee-fp                   Use IEEE math for fp comparisons       -mincoming-stack-boundary=  Assume incoming stack aligned to this power of 2       -minline-all-stringops      Inline all known string operations       -minline-stringops-dynamically Inline memset/memcpy string operations, but                                   perform inline version only for small blocks       -mintel-syntax              This switch lacks documentation       -mlarge-data-threshold=     Data greater than given threshold will go into                                   .ldata section in x86-64 medium model       -mlwp                       Support LWP built-in functions and code                                   generation        -mlzcnt                     Support LZCNT built-in function and code                                   generation       -mmmx                       Support MMX built-in functions       -mmovbe                     Support code generation of movbe instruction.       -mms-bitfields              Use native (MS) bitfield layout       -mno-align-stringops        This switch lacks documentation       -mno-fancy-math-387         This switch lacks documentation       -mno-push-args              This switch lacks documentation       -mno-red-zone               This switch lacks documentation       -mno-sse4                   Do not support SSE4.1 and SSE4.2 built-in                                   functions and code generation       -momit-leaf-frame-pointer   Omit the frame pointer in leaf functions       -mpc32                      Set 80387 floating-point precision to 32-bit       -mpc64                      Set 80387 floating-point precision to 64-bit       -mpc80                      Set 80387 floating-point precision to 80-bit       -mpclmul                    Support PCLMUL built-in functions and code                                   generation       -mpopcnt                    Support code generation of popcnt instruction.       -mprefer-avx128             Use 128-bit AVX instructions instead of 256-bit                                   AVX instructions in the auto-vectorizer.       -mpreferred-stack-boundary= Attempt to keep stack aligned to this power of 2       -mpush-args                 Use push instructions to save outgoing arguments       -mrdrnd                     Support RDRND built-in functions and code                                   generation       -mrecip                     Generate reciprocals instead of divss and sqrtss.       -mrecip=                    Control generation of reciprocal estimates.       -mred-zone                  Use red-zone in the x86-64 code       -mregparm=                  Number of registers used to pass integer arguments       -mrtd                       Alternate calling convention       -msahf                      Support code generation of sahf instruction in                                   64bit x86-64 code.       -msoft-float                Do not use hardware fp       -msse                       Support MMX and SSE built-in functions and code                                   generation       -msse2                      Support MMX, SSE and SSE2 built-in functions and                                   code generation       -msse2avx                   Encode SSE instructions with VEX prefix       -msse3                      Support MMX, SSE, SSE2 and SSE3 built-in                                   functions and code generation       -msse4                      Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1 and                                   SSE4.2 built-in functions and code generation       -msse4.1                    Support MMX, SSE, SSE2, SSE3, SSSE3 and SSE4.1                                   built-in functions and code generation       -msse4.2                    Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1 and                                   SSE4.2 built-in functions and code generation       -msse4a                     Support MMX, SSE, SSE2, SSE3 and SSE4A built-in                                   functions and code generation       -msse5                      This switch lacks documentation       -msseregparm                Use SSE register passing conventions for SF and                                   DF mode       -mssse3                     Support MMX, SSE, SSE2, SSE3 and SSSE3 built-in                                   functions and code generation       -mstack-arg-probe           Enable stack probing       -mstackrealign              Realign stack in prologue       -mstringop-strategy=        Chose strategy to generate stringop using       -mtbm                       Support TBM built-in functions and code generation       -mtls-dialect=              Use given thread-local storage dialect       -mtls-direct-seg-refs       Use direct references against %gs when accessing                                   tls data       -mtune=                     Schedule code for given CPU       -muclibc                    Use uClibc C library       -mveclibabi=                Vector library ABI to use       -mvect8-ret-in-mem          Return 8-byte vectors in memory       -mvzeroupper                Generate vzeroupper instruction before a transfer                                   of control flow out of the function.       -mx32                       Generate 32bit x86-64 code       -mxop                       Support XOP built-in functions and code                                   generation             Known assembler dialects (for use with the -masm-dialect= option):         att intel            Known ABIs (for use with the -mabi= option):         ms sysv            Known code models (for use with the -mcmodel= option):         32 kernel large medium small            Valid arguments to -mfpmath=:         387 387+sse 387,sse both sse sse+387 sse,387            Known vectorization library ABIs (for use with the -mveclibabi= option):         acml svml            Valid arguments to -mstringop-strategy=:         byte_loop libcall loop rep_4byte rep_8byte rep_byte unrolled_loop            Known TLS dialects (for use with the -mtls-dialect= option):         gnu gnu2


Making Bootable USB, problems copying /proc

I'm creating a bootable usb as a cloned partition and am running into problems copying `/proc` to the usb. I know `/proc` contains a lot of virtual files, but I'm not sure how to copy them over. It seems that if I use `cp` it doesn't treat them as virtual files. So with large virtual files like `kcore` it uses all the usbs disk space right away. However if I try and boot with just the folders created, it fails. What would be the best way to copy them over and still keep them as virtual files? Or, what are the minimal files I can copy to the usb to allow it to boot? The distro is fedora 12. I should mention the process I'm using:   1. create partitions on usb to match the installation you want to clone    2. copy the files from the installation to the usb partitions   3. install bootloader on the boot partition (grub) Everything has gone fine so far except for copying `/proc`. I've done this before and haven't had this problem until now.


Revert commits and commit them to a branch?

I'm cloning a popular open source project into GitHub, and I only realized this after it was too late. I'm also trying to convert this project over to use Maven instead of Ant/Ivy for a build tool. I was able to convert the repository from SVN to Git via the aptly-named `svn2git`, then started making changes toward the Maven migration. I failed to realize at the get-go that I needed to create a separate branch for my Maven migrations. Is there a way for me to take my revisions, remove them from `master`, and send them to a new branch?


log out/in because of google-chrome-stable package update?

After i configured my Fedora 14 to do auto updates:               gconftool-2 -t string -s /apps/gnome-packagekit/update-icon/auto_update all     gconftool-2 -t integer -s /apps/gnome-packagekit/update-icon/frequency_get_updates 3600     gconftool-2 -t bool -s /apps/gnome-packagekit/update-icon/notify_available 0     gconftool-2 -t bool -s /apps/gnome-packagekit/update-icon/notify_complete 0     gconftool-2 -t bool -s /apps/gnome-packagekit/update-icon/notify_critical 0     gconftool-2 -t bool -s /apps/gnome-packagekit/update-icon/notify_update_complete_restart 0     gconftool-2 -t bool -s /apps/gnome-packagekit/update-icon/notify_update_started 0      I get this funny message. Why do i have to log out/in because of the google-chrome-stable package has been updated?


RAMDISK incomplete write error kernel panic

I am building Linux Kernel 2.6.36.4 on a Dell Laptop which has Linux Kernel 2.6.35.11 running. BTW I got the source from kernel.org. The source had few syntax errors which I fixed in the process and finished building Kernel. After reboot, I keep getting following error: > RAMDISK: incomplete write error(6022 != 28860)   >  write error   >  Kernel Panic - not syncing: VFS: Unable to mount root fs on unknown- > block(0, 0)   >  Pid: 1, comm: swapper Not tainted 2.6.36.4 #2   >  Call Trace:   >  ? printk.... I followed following steps while building the source: >   1. tar xvf linux-2.6.36.4.tar.bz2 >   2. sudo cp /boot/config-2.6.35.11generic ~/linux-2.6.36.4/.config >   3. cd ~/linux-2.6.36.4 >   4. make menuconfig >   5. sudo make >   6. sudo make modules_install >   7. sudo make install >   8. sudo update-initramfs -k 2.6.36.4 -c >   9. sudo update-grub > I tried following things after my internet search:   * After reboot with working kernel, ran `sudo update-initramfs -u -k all`   * Ran `fsck` However I still get this error for every attempt to boot using 2.6.36.4 Has anybody come across such an issue and what do you suggest in this context? Thank you in advance! EDIT:   Some developers have increased the ramdisk size to few MBs from 4096 default. Is that a good idea?


L2TP IPsec VPN client configuration

I have Linux (Fedora) box and I want to conject to VPN described as "L2TP IPsec VPN" one. I have got following credentials: * * * user=xxxxxxxxx pass=xxxxxxxxx VPN server= XXX.XXX.XXX.XXX IPsec key=xxxxxxxxx * * * I tried to use NetworkManager, vpnc with no luck. What software to use?


iptables log file

I have ubuntu and I want to know where can I find the log file of iptables?   I find out `/var/log/messages`, but I am not sure this is a correct log file or not. And I also want to know when this log file is changed? I add one rule to prevent my machine to respond to ping message but when I ping my machine I didn't see any changes to `/var/log/messages`


Linux distro that contains Windows fonts in default

I personally don't like Linux and Mac OS X fonts. **They are too cartoonish and childish (fat, bold).** So, I would like to find a Linux distribution that contains Windows fonts in default. I know it may not be legal, but I am sure such distros exist; or at least I hope ;). I tried to install MS fonts on Ubunty and it's better. but still the fonts are not the same as on Windows. The gnome interface don't bother me such. I am worried mostly about rendering in browsers in Ubuntu. Do you know about such distribution that has all Windows fonts and renders pages in the firefox the same way as on windows? Is KDE rendering better than Gnome rendering in browsers? **UPDATE:** Here is a comparison, so you see what I mean. The top picture is from Win 7 Firefox and the second from Ubuntu 13.04 Firefox browser. You can clearly see that on Ubuntu the text under the title is deformed and not so high as it supposed to be on Wndows. How to fix that, so proportion of the fonts on Ubuntu are the same? I have installed the MS fonts on Ubuntu. But it is not helping. ![enter image description here](http://i.stack.imgur.com/s4ObR.jpg)


asound.conf file is corrupted does not allow the play with the correct sound card as a result it keeps failing

I have this following asound.conf file, but when i play $ speaker-test it fails. How can you tell asound.conf that each and every time on restart of pc also use this sound card only?               "card 2: PCH [HDA Intel PCH], device 0: ALC892 Analog [ALC892 Analog]       Subdevices: 1/1"??               $ aplay -l     **** List of PLAYBACK Hardware Devices ****     ALSA lib conf.c:1220:(parse_def) default is not a compound     ALSA lib conf.c:1686:(snd_config_load1) _toplevel_:2:13:Invalid argument     ALSA lib conf.c:3406:(config_file_open) /etc/asound.conf may be old or corrupted: consider to remove or fix it     card 1: Device [C-Media USB Audio Device], device 0: USB Audio [USB Audio]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 2: PCH [HDA Intel PCH], device 0: ALC892 Analog [ALC892 Analog]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 2: PCH [HDA Intel PCH], device 1: ALC892 Digital [ALC892 Digital]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 2: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 2: PCH [HDA Intel PCH], device 7: HDMI 1 [HDMI 1]       Subdevices: 1/1       Subdevice #0: subdevice #0          $ cat /etc/asound.conf         pcm.default {             type hw # Kernel PCM             card 2             device 0 # Device number (default 0)             #[subdevice] INT # Subdevice number, -1 first available (default -1)             #mmap_emulation BOOL # enable mmap emulation for ro/wo devices              }         pcm.!default {             type hw # Kernel PCM             card 2             device 0 # Device number (default 0)             #[subdevice] INT # Subdevice number, -1 first available (default -1)             #mmap_emulation BOOL # enable mmap emulation for ro/wo devices         }      I tried this it works but how to avoid using the hw:2,0 but use some static string so that on reboot it does not get lost?               pcm.!default {              type asym              playback.pcm {                      type plug                      slave.pcm "hw:0,1"              }      }


How can I determine if HTML5 player is running in browser?

I would like to find a command-line or a **script** that will show me if HTML5 player is running or not in a browser (firefox or chromium). For example, to determine if Flash player is running in a browser, I use next command:               pgrep -lfc ".*((c|C)hrome|chromium|firefox|).*flashp.*"


Display the function body in Bash

I have setup several functions in my `.bashrc` file. I would like to just display the actual code of the function and not execute it, to quickly refer to something. Is there any way, we could see the function definition?


mounting local network folder in Ubuntu

I add a folder in /etc/fstab:               //172.30.12.37/test/ /home/my/test cifs user=afs,pass=123456,auto,exec,umask=002,gid=1000,uid=1000,file_mode=0777,dir_mode=0777 0 0      Now test link can be seen in nautilus sidebar. But when I click on this icon, an error will be displayed:               mount: only root can mount //172.30.12.37/test/ on /home/my/test      How I can mount this folder from terminal with root user?


Sort one column only, keeping remaining columns untouched

How to (numerically) sort a specific column in a text file, without affecting other columns (irrespective of whether they are sorted or unsorted)? On other threads I found `-s` argument, but it does sort other columns. Observation               $ cat tmp.txt     1 1     2 3     5 4     1 3          $ sort -s -n -k1,1 tmp.txt     1 1     1 3     2 3     5 4


How to go back to original top panel in Debian Mint xfce?

Changes to the top panel in LMDE w/ xfce have corrupted the formatting; everything is flush left now. Unable to get the time, window switcher and other items to go flush right. How do I revert to the original panel layout so I can start over? PS: Do NOT use sudo prepended before Risto's steps below.


Bash variable in Awk script

I have this flat file database(ff_servers.db) with following contents:               192.168.154.2 Alaska   hp     192.168.157.3 Colorado dell     192.168.156.3 hawaii   hp      From command line, I could run:               awk "BEGIN{IGNORECASE=1;}/alaska/ {print $NF}" ff_servers.db`      and I would get               hp      However, from a bash script, I'm having problems with "$NF" Here's the dump of that script:               machine_type=`awk "BEGIN{IGNORECASE=1;}/${server_name}/ {print \$NF}" ff_servers.db`     awk "BEGIN{IGNORECASE=1;}/${server_name}/ {print $NF}" ff_servers.db     ++ awk 'BEGIN{IGNORECASE=1;}/colorado/ {print }' ff_servers.db     + target_arch='192.168.157.3   Colorado           dell'      So obviously, $NF is not being translated properly. Where am I doing wrong?


How to edit rpm's HEADER and NAME-VERSION-RELEASE

Is there's a way or a tool that can modify the `HEADER` and the `NAME-VERSION- RELEASE` for an existing `rpm` without installing/rebuilding it?


RHEL6 Install MySql-Python without internet connection?

Using RHEL 6 how can you install MySql-Python package without a internet connection? I can SCP files to the server but our current restrictions do not allow a direct or proxy connection to the internet from the RHEL server. It looks like it can be easily installed via YUM however YUM cannot update repositories without an internet connection.


Setting up a restricted NIS server

I'm currently trying to configure an NIS server with restricted access such that the `passwd` and `group` maps are exported to "trusted" hosts only. To this end, I have tried creating a netgroup (in the aptly-named file `/etc/netgroup`) containing the names of trusted hosts and I wanted to add a rule like               ALL:ALL EXCEPT @nis_netgroup      to `/etc/hosts.deny`. This has a double benefit for me: it restricts access to both the NIS maps and an NFS share. There are several issues with that approach, however, that I need help with:   * This is not very secure as host names can be easily spoofed   * The `yp` tools insist that the domain name for all my hosts is `.local`, regardless of the search domain I have set. So even if I had set up a domain like `.my.domain` and my NIS server was named `server` (so that its FQDN would be `server.my.domain`), after binding to that server, `ypwhich` would return `server.local`. So this requires me to set "strange" host names in the `netgroup` file.   * Even if I pass both of the above steps, _it doesn't work_ : the NIS server machine keeps trying to bind to itself and fails. The one clue I found in `/var/log/syslog` that could pertain to this problem:               named[<pid>]: bad zone transfer request 'local/IN'      What does this mean? I have administrated a similar setup in the past except that all clients were configured with static IPs so `/etc/hosts.allow` simply listed these IPs while `/etc/hosts.deny` would deny any other requests. The reason I can't use this approach in the current setup is that I'm using dynamic DNS with DHCP-assigned IPs for the clients. Is there a way to let host access be controlled via the dynamically assigned IPs (i.e. to do paranoid hostname-address lookups using the dynamic DNS)? The `hosts_access(5)` page says I can use a string starting with `/` to specify clients from a file so I thought I'd use that syntax in conjunction with my DNS zone file. No joy! The NIS server still fails to bind to itself under these circumstances. I'm not sure whether or not this is related to the `.local` domain issue (the DNS zone files obviously use the `.my.domain` domain not `.local`). Any help?


How to open and work with terminals using bash script?

I need to open four terminals each will then connect to four different remote pcs and open specific directory locations on those pcs. Each terminal will be opened in different locations on my pc's desktop screen. How this can be done using bash scripts? I am using Ubuntu-12.04. This would be a great help because everytime doing this is a overkill to me.


Attempt to fake a 2D multidimentional array in bash by storing the array name as string

I am trying to create a structure that will allow me to group data inside an array in bash Here is what I have tried:               indexes=()     first_element=( value='one' another_value='two' yet_another_value='three')     indexes+=('first_element')          second_element=( value='four' another_value='five' yet_another_value='six')     indexes+=('second_element')          for i in "${indexes[@]}"     do         # Here the i variable contains the name of the array I am supposed to loop through         # but I cannot fugure out how to access that array using the stored string...         for j in "${j[@]}"         do             #Here I am supposed to get the actually array             echo "$j"         done     done      Of course it doesn't work... Am I doing something wrong, or is it impossible to access variables that way?


How are the different kernel naming schemes relate?

I am running Ubuntu 13.10 with the Kernel 3.8.0-030800-generic downloaded from http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.8-raring/ When I want to run for example turbostat or cpupower commands, I get the following:               cpupower not found for kernel 3.8.0-030800     You may need to install linux-tools-3.8.0-030800-generic      Unfortunately there seems to be no package for linux-tools for this kernel available. I noticed that there are different naming schemes for the kernels, for example, the packages for linux-tools available here are following the naming: 3.8.0-{19-39} whereas the version of our kernel ends in 030800. How do these two naming schemes relate to each other? What is the correct way to install linux-tools for this kernel?


scan directories of .pdf and .ps files for keyword in title and author

I have got directories full of research papers. I would like to scan the files for keywords in the titles, the author lists, etc. Does a tool for that purpose exist?


Do IPTABLE rules apply to other devices on a network?

I have an embedded device that listens to a specific port to be programmed by vendor specific software. If I have a network that consists of a small linux computer and this industrial device would setting a rule that blocks access to the port block access to the industrial device as well?


What privileges are needed to delete a read-only btrfs subvolume?

I want to delegate non-root user to delete read-only subvolumes (snapshots). What exactly capabilities/rights I need to grant, so that he can remove his own read-only snapshots? I've already mounted the btrfs with `-o user_subvol_rm_allowed` so users can remove read/write snapshots. I need it to augment otherwise brillant SnapBtr.py, so non-root users can operate it.


Variable assignment outside of case statement

In many languages it is possible to assign the result of a case/switch statement to a variable, rather than repeating the variable assignment many times within the case statement. Is it possible to do something like this in the Bash shell?               color_code=$(case "$COLOR" in       (red)    1;;       (yellow) 2;;       (green)  3;;       (blue)   4;;     esac)      (Or, as an aside, in any other shells?)


Extracting a 2.7GB 7z file

I currently have a 2.7GB 7z file that backed up my computer (it extracts to about 6.2GB of data) I am running on a Chromebook with Crouton. The Chroot is running Kali with a Unity front end. I am trying to extract the 7z file using the p7zip package. I keep getting the following error.               (kali)austin@localhost:~/zip$ 7z x backup.7z          7-Zip [64] 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18     p7zip Version 9.20 (locale=C,Utf16=off,HugeFiles=on,2 CPUs)          Processing archive: backup.7z          Error: Can not open file as archive          (kali)austin@localhost:~/zip$       I figure I am either missing an argument or something and I realize this might be a localized problem, however I don't know where else to turn for help.


Run a script after lid is opened

I would like to run a script after my laptop lid is opened. is there anything like `rc.local` that is run after the laptop wakes up after suspending? I use Ubuntu 12 (I need it because some of the systems settings are reset after the lid is closed)


How does Grub boot off of a Windows partition?

I have a dual boot laptop that was built by Dell with Windows/Red Hat. The grub configuration says that it was made by Anaconda. The partitions are as follows:               /dev/hda1  Dell Utility     /dev/hda2  Windows 2000     /dev/hda3  extended (presumably Windows)     /dev/hda5  Linux [\]     /dev/hda6  Linux Swap     /dev/hda7  Linux [\home]      The bootable partition is /dev/hda2, the Windows partition. I get that the Dell Utility partition is booted by the BIOS, so I can ignore that. What I don't understand is how Grub (which is located, I assume, on hda5, which is where its configuration files are) is starting when the machine boots, since it must be booting /hda2, at least according to the BIOS.


Nice and child processes

Can someone tell me what the relationship between a specified `nice` level and child processes ? for example, if I have a default `nice` of `0`, and i start a script with `nice 5`, which in turn starts some child processes (in this case about 20 in parallel), what is the nice of the child processes ? Thanks,


Is the purpose of setting the version number of a file using chattr similar to optomistic locking in a database?

For instance if you record the version number before editing the file, and check it again before saving the file, you can be assured that nobody else wrote to the file while you were editing it. (although to be honest I don't see it changing the version number automatically when changing a file).


Script to extract selected entries from a bibtex file

I have a large bibtex file with many entries where each entry has the general structure               @ARTICLE{AuthorYear,     item = {...},     item = {...},     item = {...},     etc     }      (in some cases `ARTICLE` might be a different word e.g. `BOOK`) What I would like to do is write a simple script (preferably just a shell script) to extract entries with given AuthorYear and put those in a new .bib file. I can imagine that I can recognize the first sentence of an entry by AuthorYear and the last by the single closing `}` and perhaps use `sed` to extract the entry, but I don't really know how to do this exactly. Can someone tell me how I would achieve this? It should probably be something like               sed -n "/AuthorYear/,/\}/p" file.bib      But that stops due to the closing `}` in the first item of the entry thus giving this output:               @ARTICLE{AuthorYear,     item = {...},      So I need to recognize whether the `}` is the only character at a line and only have 'sed' stop reading when this is the case.


Finding all files containing a word and then counting the number of lines

I need to recursively find all files that contain a specific word and if the word exists in file I need to find out the number of lines in that file. I have been trying to use `grep` but I have been not successful so far.


Granting permission for all users in a group to write to a directory and all its subdirectories

Trying out Linode for the first time, running an Arch Linux image, I successfully installed nginx as root. This, however, made `/usr/share/nginx/html` inaccessible to non-root users. Intuitively, I thought this would work:   * `newgrp www` (create a new group)   * `chgrp -R www /usr/share/nginx/html` (associate directory recursively with new group)   * `chmod -R g=rw /usr/share/nginx/html` (give read-write permissions to new group)   * `usermod -a -G www john.doe` (add non-root user to new group) However, I still could not write files to `/usr/share/nginx/html` as john.doe. I also tried   * `chown -R :www /usr/share/nginx/html` to see if it had any effect—it didn't. Here's what the setup looks like currently:               [john.doe@hydrogen nginx]$ ls -l     total 4     drwxrw-r-x 4 root www 4096 Dec 19 08:10 html     [john.doe@hydrogen nginx]$ id     uid=1000(john.doe) gid=100(users) groups=100(users),10(wheel)     [john.doe@hydrogen nginx]$ groups john.doe     wheel www users      Could someone kindly identify what I'm misunderstanding / missing that I can't write to this directory?


How to install multiple packages via pacman in a single command?

Is it possible to install multiple packages via a single pacman command? E.g.               Pacman -S package_1,package_2


How to show specific lines from specific columns of a file

First off, I'm not allowed awk, sed or perl. For my assignment I was given a file of employee list:               Marketing  Ranjit Singh   FULLEagles       Dean Johnson        Marketing  Ken Whillans   FULLEagles       Karen Thompson      Sales      Peter RobertsonPARTGolden TigersRich Gardener       President  Sandeep Jain   CONTWimps        Ken Whillans        Operations John Thompson  PARTHawks        Cher                Operations Cher           CONTVegans       Karen Patel         Sales      John Jacobs    FULLHawks        Davinder Singh      Finance    Dean Johnson   FULLVegans       Sandeep Jain        EngineeringKaren Thompson PARTVegans       John Thompson       IT         Rich Gardener  FULLGolden TigersPeter Robertson     IT         Karen Patel    FULLWimps        Ranjit Singh         Long story short, the user is prompted to give a name or portion of a name and that word is searched for ONLY in the second 'column'. If it is found there then the user is then asked whether they want the person's team-name (third column, word next to "PART" or "FULL" etc.) or the person's partner (last column). The end result is then only to show the full name alongside the team name or partner. I can't figure out the last step... Cutting only the lines with the matches to the original search and displaying only the needed 'columns'.               while :     do         echo Enter the name of the player you want to search for:         read name         if (cut -c12-26 emplist | grep -n ${name} > namefile)         then             while :             do                 echo 'See partner (P/p) or team name (T/t)?'                 read answer                 if [ ${answer} = "T" -o ${answer} = "t" ]                 then                     **#Steps for showing only the full name and the team name**                      break                 elif [ ${answer} = "P" -o ${answer} = "p" ]                 then                     **#Steps for showing only the full name and the partner name**                     break                 else                     echo Please enter only T or M.                 fi                 done         elif [ ${name} = "ZZZ" ]         then             break         else             echo Name not found.         fi     done


Script running forever

could you please provide me insight on why the following script runs forever even after last echo statement ran successfully? Thank you for your help.               cd /app/pme/${property:DeployEnv}/ruleengine     ./stop.sh     unzip -o ruleengine.app.zip     unzip -o ruleengine.${property:DeployEnv}.zip     dos2unix *.sh     echo begin chmod     chmod ugo+rx *.sh     echo end chmod     echo begin run.sh     ./run.sh     echo end run.sh     cd /app/pme/${property:DeployEnv}/ruleengine     pwd     echo start rm commands     rm ruleengine.app.zip     rm ruleengine.${property:DeployEnv}.zip     echo end rm commands     exit


Symbolic link permissions

I have access to a remote Linux machine where everytime I create a symbolic link, it is created by default with the following permissions: `lrwxrwxrwx` If I try to change the permissions of the symbolic link (i.e. not the path that it points to) using for example:               chmod g-w my_symbolic_link      `chmod` runs correctly (no error message is printed) but when I check the permissions again, they are still the same (`lrwxrwxrwx`). I am waiting to hear from the machine administrator, but I was wondering if this is normal behavior, or if it is something specific to the box. Thanks


Hide top and bottom menus from Midnight Commander

Can I hide top ("File", "Options", etc) and bottom ("Help", "View", "Edit", etc) menus from Midnight Commander? If so, how can I do it?


listing package dependents

I stupidly did "yum remove python" which also ended up removing all the packages that required python as well. Luckily, I have access to another Linux machine that is a near clone of this machine, and it still has all those packages installed. The catch is that it belongs to someone else and I can, at most, poke around. I also don't know what to specifically re-install on my machine. The list (when I removed python) was humongous. I was wondering if there were any commands I could enter into this twin machine that could tell me: Of the currently installed packages, which ones depend on python? I could then use that list to manually re-install each one back on my own machine. So it's really more of the python dependents, not dependencies. From looking around, I came across such commands like "repoquery --whatrequires" & "rpm --whatrequires", but these don't seem to generate the same list as "yum remove python". The 2 machines run RHEL 6.


Is there a good way to poll in a real-time process which is kernel friendly?

I have an application which uses boost asio and I would like to use `poll()` to detect ready network events (packets) and process them as quickly as possible. Additionally, I would like to use SCHED_FIFO for this process (which is single threaded) try to control the jitter (main problem I'm trying to solve..) Now the limitation, the kernel is 2.6.32 (without real-time patch.) Which has the additional problem that there are some kernel processes which run on the core where my app is running which I cannot move out (i.e. the kernel doesn't appear to have true isolation - I know this comes in a later kernel - but I can't upgrade to that yet.) So, now if I'm unfriendly, and I do the following:               while(some_condition)       service.poll();      This process will spin the core, and because SCHED_FIFO is set, it will never relinquish to the other kernel processes that need to run on this core, and all sort of unpredictable bad stuff happens. Now my question is, how I can do this poll loop and ensure that I relinquish so that the other threads get to run for a little bit at least? I see two options,   1. Some sort of sleep   2. if no events were handled by `poll()`, I could call `run_one()` which blocks for one event only, but the problem here is that this event could be the packet I want, and now I have jitter again... Have I missed any other approaches?


How can I paste (overwriting) with vim?

In `vim` I use `yy` and `p` all the time to yank and paste lines. However, if I want to replace one line multiple places in the file, I can't use `yy` `p` `dd` `p` because the `dd` deletes the line to the clipboard / register. While I should probably know how to use registers better, i feel like there is probably a way to `p` that replaces the current line. Google wasn't much help in finding anything, and the VIM tutorials I found did not cover this. I just ordered a book from amazon but I hope someone can let me know before it gets here ;)


Worker MPM or Prefork?

I understand that there is a comparison topic between the two modules but this is different. I was contacting cPanel support in order to help me freeing up some memory usage on the VPS. They found Apache 2.4 'httpd' child processes are using approximately 80MB RSS, while on their test server, a similar Apache 2.4 build only uses approximately 3MB RSS per Apache child process. After discussing the issue for a while, they suggested switching to the Worker MPM in Apache 2.4 rather than using Prefork. I searched for what they said, and found that Worker MPM use a less memory but it is not thread safe. Some other topics on websites tell that Worker will not work with php applications or mod_php. I'm not sure if this is correct or not. I'm too confused what should I do? I have php scripts running on my accounts and don't want to interrupt any of them or get data corrupted. What are your suggestions guys? Does switching to Worker MPM will solve the problem of running out of memory without interrupting php applications? Is there any solution regarding the Apache usage? As 80MB RSS is too high comparing to the 3MB RSS.


to run script over several folders?

Currently I have a script that can run only in a single folder.               #!/bin/bash     for file in ls -1 *.jpg|sort -t . -n -k 3     do       echo "compute ./scripName $file"       ./scriptName $file     done       Question: I have a several folders containing `*.jpg` images. I need a script that can over all images of all folders.


Log in with specific shell at terminal login

If I log in to a system over ssh, I can use the default shell with a simple `ssh user@host`, or specify something like `ssh user@host 'bash --norc --noprofile'` or `ssh user@host ksh`. Is it possible to have similar behaviour when logging in on a local terminal, ie one where my terminal is connected directly to the system and I'm prompted for a username? The specific usage scenario is running `screen` at login time, where a duff config option will prevent screen starting, and thus prevent the login succeeding. If I have ssh access, I can log in and run specific commands to fix things, but if I only have terminal access, I can't see how I could fix things up.


How to install Debian from USB? (Using full size image not netinstall)

I learned of a way to install Debian from USB using the netinstall image, which is fine. However it means I have to spend hours and hours downloading packages to do the install. Is there a way I can simply download (for example) the CD1 with most of gnome and then use that? The netinstall method using this does not work because there is not enough space. (I have enough space, it is that the method has a limitation). I rarely have CDs on hand and some machines do not have CD/DVD drives anyway. I will research on this topic and answer my own question if need be, however any help in the meantime is appreciated.


Starting Darkice automatically via daemontools

I have installed and configured darkice in Raspbian and it works fine if I run it with "sudo darkice". I want to run darkice automatically so I tried to run it via daemontools with the following steps but it is not working. please help.   1. open a shell to your server, and type the following:              apt-get install daemontools     apt-get install daemontools-run     mkdir /etc/service/darkice     chmod 2775 /etc/service/darkice     touch /etc/service/darkice/run        2. `vi /etc/service/darkice/run` and add these lines:              #!/bin/sh     echo Running service     exec darkice


Cannot open shared folder under Debian (VirtualBox)

There is a virtual machine under Debian 7.1.0 Wheezy i386 (guest). Host is Linux Mint 12. The shared folder is set up with auto-mount, but it doesn't appear in `/media` directory, as said in the user manual. There are no analogous problems in Linux Mint 13 (another guest), the folder appears normally in `/media`. I have installed `build-essential` and `module- assistant` and ran `VBoxLinuxAdditions.run` from VBoxGuestAdditions but nothing is changed.


Restructuring directories into a hierarchy

I have the following type of folder structure containing thousands of folders. The folder names are as such with different names etc               .test     .test.subfolder     .test.subfolder.subsubfolder          .folder     .folder.one     .folder.two     .folder.one.one      What I need to achieve is the following: I want the folders to be renamed e.g. from `.test` to `test`, and then move `.test.subfolder` so that the folder `.subfolder` is within the folder `test` without the `.`, and then `.test.subfolder.subsubfolder` so that `subfolder` is within the folder `test` and `subsubfolder` is within `test/subfolder`. This needs to be recursive since there are many folders. Keep in mind that the files within the folders should still need to be intact. Is this at all possible?


Get all regex matches between two patterns and print them to file

I've got a file with a bunch of long lines. I'd like to grab every group between two patterns and print them to a new file, one match per line. I could manage to do this with Python, but I'd prefer using just command line tools for this task. If there is no end pattern, I'd like to grab everything 'till the end of the line. Something like:               input:      xxSTART relevanttext xxEND something else xxSTART even more relevant          output:     relevanttext     even more relevant


Deamon openvpn configuration file with .conf?

In the video connected to a Linux to another Linux via SSH, the second openvpn daemon already started and configured with user/password requested at the entrance. http://youtu.be/tSNCE6j2zxM How do I configure OpenVPN daemon to get it already started and configured with user / password automatically? What are the directories to move? Commands?


Kate editor: how to jump to modified lines?

Say I'm editing a long document and I have made a number of changes. I want to be able to jump to each changed line. Is there a way to do this? I know about line modification indicators and I have those turned on. But for a long document, it is not easy to find those line modification indicators. I want a way to jump directly there. I turned on scroll bar marks. I'm not sure what that feature is supposed to do, but it doesn't seem to do anything.


yum update version issue

I am using fedora 13 (2.6.33 ). Due to some reasons I cannot update the kernel nor can I upgrade fedora itself to 18 due to some legacy software I am using for business purpose. So my question is how do I update my applications to the latest versions using yum without actually updating the kernel/distro. For eg when I               yum update firefox      It shows me the firefox version 3.x. instead of 19.0. I have the option to download the binaries from website but for some applications I manually have to resolve the dependency issue. So how do I temporarily set my source to fedora 18 source for some specific application.


Where is the cron timer

Is there any way to access the `cron` timers and get the seconds left until the next execution of scripts in the `crontab` or maybe the seconds since the last?


How to specify the inbox for fetchmail?

I'm setting up a system calling `fetchmail` from the commandline and specifying that the mail be stored in a specific file which is not `/var/spool/mail/$USERNAME`.


Command line friendly spreadsheets

Does such a thing exist? Text-based spreadsheets that display well in a CLI environment. I'm aware that I could `cat foobar.csv`and do as I please, but it isn't particularly practical or attractive. I cannot imagine it would be hard to format a table, and maybe follow certain rules (math?) as well. Emacs has `org-mode` which handles text-based tables quite well, and allows exporting to multiple formats. However, one must use Emacs! Which as a Vim user I would prefer to avoid.


OPENVPN AS - Could not connect to the test server on the Internet

I have set up OpenVPN on my server and I can access it through Tunnelblick. I am however having issues to set up OpenVPN Access Sever. After Install I noticed that in the server name field there was my server internal lan address so I changed it to the public ip. After this I tried to connect but the connection drops. I tried to run the Connectivity Test but no luck and all I get is the following... Test Results for TCP               Result: Error     Explanation:    Could not connect to the test server on the Internet.     IP Address Tested:  (not found)     Reverse DNS result: (unknown)      Test Results for UDP               Result: Error     Explanation:    Could not connect to the test server on the Internet.     IP Address Tested:  (not found)     Reverse DNS result: (unknown)


Using regular expressions with cp

This is a simple question. I'm trying to copy all of the files in the current directory that start with "axis-2" and end with ".jar" into a target directory, let's say it's ~/MyDirectory. My first thought was to try               cp '^axis2.*jar$' ~/MyDirectory      But this isn't working. I'm not even sure I can use regular expressions with cp. I also haven't really used regular expressions in a while and my syntax could be totally off. When I try this cp just outputs a "No such file or directory" error message. Does anyone have any suggestions of how to go about this? Thanks!


Can Qt SDK be used for development on any Linux distro?

Fisrt of all I am a Windows developer guy but really like Linux. On Windows, Visual Studio provides an excellent IDE for C and C++ development. The only other IDE and toolkit I like is the Qt SDK and I've used it a bit on Windows. I currently run Linux in a VirtualBox VM on Windows 7 so that I can mess around with it fearlessly. I have a KDE-based Kubuntu 11, which is quite heavy. I also have an Xfce-based Xubuntu 11 VM (which I like) and Linux Mint 11. I want to delete the Kubuntu VM but KDE is based on Qt, and the other distros I have use gnome/GTK+. Would Qt on a Gnome-based distro be any different than using it on a KDE-based distro?


Enforce strict outbound ports (or ranges) for protocol

Is it possible to narrow the allowed range of outbound ports that can be used for a specific protocol (e.g. HTTP(S))? I understand that, by default, the system will randomly allocate any available port but is that configurable to use a specific one?


UNIX- Identify which processes are running more that 6hours

I need to know which processes are running more than 6 hours in UNIX. How can I find those out?


How do Apache2 VirtualHosts get resolved?

As I understand it, when you request a url from a website using your browser, it asks the DNS server that the OS is pointing at if it knows the ip address that relates to the dns-name of the server; then if the DNS server finds the server requested, it returns the ip so that the browser can request the url from the webserver. Considering at this point that the browser requests the URL using the ip address of the server and not the dns-name, how does the webserver (Apache2) know how to return correct VirtualHost, that is associated with the dns-name? My head tells me that it has something to do with the browser headers, but I'm not completely certain of this. **Note:** Here's a related solution


How to transparently monitor SSH access/network traffic in Gentoo/general linux?

What's the most effective way to monitor SSH access in Gentoo Linux? My Gentoo box is operating locally behind my broadband router. I have SSH port forwarding on the router and a DNS entry pointing to my router on the internet. Is there a way to silently record what external domain/IP the incoming connection to my Gentoo box comes from? Similarly what's the best method of recording all network traffic to and from this box, again without being noisy about it?


Navigate through a stack of locations in vim?

Typing ```` at location X brings you back to the last visited location in the text file. Hitting it again brings you back to X This switching is similar to `Ctrl+6` to open the last opened file. But how do can I hop several levels of locations backwards (and then forward)? I mean something like the `Ctrl+]` and `Ctrl+T` feature for navigate through the stack of visited tags.


Touchpad won't work after login

Everytime I start my computer, when it gets to the login part of GUI, my touchpad works except I cannot turn it off using `Fn``F3` (I'm using a Dell inspiron n4120). Soon after I log in, the touchpad fails to recognize any input. I have checked and my OS (Fedora 15) does recognize the touchpad using the command:               xinput --list


How do I install user theme extension in Gnome in Fedora 16?

Upon going to the user themes extension webpage, I get the following message:               This extension is incompatible with your version of GNOME. This extension supports the GNOME unstable release, 3.3.2      I have Gnome Version 3.2.1 according to System Info. So how would I go about installing the lastest unstable Gnome releases? **EDIT** : I am running Fedora 16 **EDIT 2** : I would like to know if there is a repository to be installed so that I can simply `yum update` to the latest Gnome development version (downloading and installing gnome-shell-3.3.3 from here or here gives me an error with a list of dependencies yet to be satisfied) **EDIT 3** : I remember successfully installing gnome-shell-extension-user- theme via yum a few months ago that worked just fine with Gnome, anybody know how to install an older version of the extension that is compatible with Gnome 3.2?


Starting syslog-ng

I've recently installed syslog-ng but am confused about how to start it (on Fedora). I do:               /etc/init.d/syslog-ng start       which reports that it's started ok. However, it doesn't actually do anything until I do:               /sbin/syslog-ng      at which point it starts behaving as I'd expect. Is this expected behaviour?


Nested virtualization: run RHEVH inside KVM

I have laptop with 16GB RAM, trying to install Red Hat Enterprise Virtualization Hypervizor 3.3 on Virtual Machine Manager (KVM) based Guest, but it gives error "Virtualization Hardware not found" ? What's possible solution for this error? ? Like in Oracle VM Box there is a option to enable support for Virtualization for Guest machine, is there anything like same in Virtual Machine Manager? Is it possible to test RHEV 3.3 on any of the virtualization like KVM, Oracle VM Box or VM Ware Workstation 10?


Access to the files beyond Wine's virtual disks

I'm totally new to Linux. I would like to know if the executables run through Wine have any access beyond the virtual drives provided by Wine (e.g. `C:/`, `D:/`)?


What commands should be run when retiring a remotely hosted server?

I have a dedicated server from a friendly host located a substantial distance away from me, so the only access to the machine is SSH. It's a month to month deal, so I don't own the hardware. I'm migrating everything to a new server, and I was thinking that it would be possible for the next tenant to get creative with data recovery utilities and recover my data that was previously stored on the same hard drive. What commands, if any, should I run on a dedicated server to "back out" of the server with a reasonable attempt at protecting any data that was on it? The server is your typical LAMP variety.


How to sign already built Debian package?

I have a project with a custom build-system, so the Debian package is just one of a targets: I do it with `dpkg-deb`. But now I want to upload my package to some enterprise repo - and I need some files like `.dsc` and `.changes`, also they should be signed with PGP. What is the easiest way to sign already built package and generate those files?


Fedora 16: keystroke only get beep sound and doesn't work

I'm using my laptop and suddenly the keystroke doesn't work anymore. When I press the keystrokes, it produces beep sound but doesn't work. Then I notice if I keep on pressing the same keystroke for several seconds, it will work. On command-line environment, it works fine, but in GNOME, it works as above. What is wrong with this? The version is Fedora 16 x86_64


Replace all the occurences of a term in the files contained in a folder

In a folder on my system, I have a `C++` project that I'm trying to compile. This process uses some `C++` idioms which are not supported by my compiler version. In particular, often inside the code it is used the data value `'nullptr'`. What I want to do is to replace all occurrences of `nullptr` with `NULL`. I can do this in `VIM` with the command:               :%s/nullptr/NULL/g       How can I do this for all the files in a directory once, without opening each file and executing the command?


What is kondemand?

I have searched the web for the answer of this question but couldn't find a clear answer. Best answer I found was as follows: > kondemand is a kernel thread that belongs to the ondemand governor of > cpufreq subsystem, which changes the p-states of the system, based on the > utilization statistics. Thus it’s something that helps in power management. But still there is uncertainty about the meaning **in what way kondemand helps power management** or **is it really a process/thread concerning with power management?** Can someone please explain it?


using tr -t command [comprehension question]

When using `tr -t` command, `string1` should be truncated to the length of `string2`, right?               tr -t abcdefghijklmn 123          # abc... = string1, 123 = string2     the cellar is the safest place    # actual input     the 3ell1r is the s1fest pl13e    # actual output      'to truncate' is another word for 'to shorten', right?`tr` translates, according to the pattern, completely ignoring the `-t` option. If I autocomplete to `--truncate-set1` [to assure that I use the correct option] produces the same output. **Question** : what am I doing wrong here? I work in BASH, on a Debian based Distro. **UPDATE** _Please note that this is a copy of a comment I made below_ I thought `tr -t` means: _shorten string1 to the length of string2_. I see that `a` is translated to `1`, that `b` would be translated to `2` and that `c` is translated to `3`. This has nothing to do with shortening. 'To truncate' seems to mean something different than I thought. [I'm no native speaker]


Deleting a pattern from a file and appending it to the end?

I have a log file which have contents like below:                #SOME MORE DATA      These switches don't have latest images :     SWEs-elmPCI-A-01#      #SOME MORE DATA          These switches don't have latest images :     SWEs-elmPCI-B-01#      #SOME MORE DATA         These switches don't have latest images :     SWEs-elmPCI-C-01#      #SOME MORE DATA          These switches don't have latest images :     SWEs-elmPCI-D-01#      #SOME MORE DATA         These switches don't have latest images :     SWEs-elmPCI-B-01#      #SOME MORE DATA       I want to delete all such lines from the file and append it to the end of the file in a way such that it becomes like :               #ALL the remaining data at top     These switches don't have latest images :     SWEs-elmPCI-A-01#     SWEs-elmPCI-B-01#     SWEs-elmPCI-C-01#     SWEs-elmPCI-D-01#     SWEs-elmPCI-B-01#      I am thinking of using `sed -n '/These*/{n;p}'` but still unable to achieve the result. NOTE : SOME MORE DATA means more content in the file and these types of lines could be any where in the file               These switches don't have latest images :     SWEs-elmPCI-B-01#


Ubuntu 11.04 and large external drives

I have a Hitachi USB external 3 terabyte drive attached to a Dell Precision T1500. When connected to the computer running Ubuntu 11.04 (2.6.38-11-generic #50-Ubuntu SMP Mon Sep 12 21:17:25 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux) the following appears in the logs:               [1636365.665558] usb 2-1.7: new high speed USB device using ehci_hcd and address 15      [1636365.813198] scsi18 : uas      [1636377.895182] scsi 18:0:0:0: Direct-Access     Hitachi  Hitachi HDS72303 A580 PQ: 0 ANSI: 4      [1636384.388480] scsi 18:0:0:0: uas_eh_abort_handler tag 0      [1636384.388485] scsi 18:0:0:0: uas_eh_device_reset_handler tag 0      [1636384.388487] scsi 18:0:0:0: uas_eh_target_reset_handler tag 0      [1636384.388489] scsi 18:0:0:0: uas_eh_bus_reset_handler tag 0      [1636384.468415] usb 2-1.7: reset high speed USB device using ehci_hcd and address 15      [1636384.609589] scsi 18:0:0:0: Device offlined - not ready after error recovery      [1636384.609649] scsi 18:0:0:0: rejecting I/O to offline device      [1636384.609663] scsi 18:0:0:0: rejecting I/O to offline device      [1636384.610978] scsi 18:0:0:1: Enclosure         Hitachi  SES              A580 PQ: 0 ANSI: 4      [1636384.611472] scsi 18:0:0:2: uas_eh_device_reset_handler tag -1      [1636384.611477] scsi 18:0:0:2: uas_eh_target_reset_handler tag -1      [1636384.611481] scsi 18:0:0:2: uas_eh_bus_reset_handler tag -1      [1636384.707808] usb 2-1.7: reset high speed USB device using ehci_hcd and address 15      [1636384.838735] scsi 18:0:0:2: Device offlined - not ready after error recovery      [1636384.838952] sd 18:0:0:0: Attached scsi generic sg4 type 0      [1636384.839029] ses 18:0:0:1: Attached Enclosure device      [1636384.839080] ses 18:0:0:1: Attached scsi generic sg5 type 13 [1636415.301027] sd 18:0:0:0: uas_eh_abort_handler tag 0      [1636415.301036] sd 18:0:0:0: uas_eh_device_reset_handler tag 0      [1636415.301042] sd 18:0:0:0: uas_eh_target_reset_handler tag 0      [1636415.301046] sd 18:0:0:0: uas_eh_bus_reset_handler tag 0      [1636415.381053] usb 2-1.7: reset high speed USB device using ehci_hcd and address 15      [1636415.522005] sd 18:0:0:0: Device offlined - not ready after error recovery      [1636415.522080] sd 18:0:0:0: rejecting I/O to offline device      [1636415.522093] sd 18:0:0:0: rejecting I/O to offline device      [1636415.522101] sd 18:0:0:0: rejecting I/O to offline device      [1636415.522107] sd 18:0:0:0: [sdc] READ CAPACITY failed      [1636415.522110] sd 18:0:0:0: [sdc]  Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK      [1636415.522116] sd 18:0:0:0: [sdc] Sense not available.      [1636415.522123] sd 18:0:0:0: rejecting I/O to offline device      [1636415.522129] sd 18:0:0:0: [sdc] Write Protect is off      [1636415.522133] sd 18:0:0:0: [sdc] Mode Sense: 00 00 00 00      [1636415.522139] sd 18:0:0:0: rejecting I/O to offline device      [1636415.522144] sd 18:0:0:0: [sdc] Asking for cache data failed      [1636415.522147] sd 18:0:0:0: [sdc] Assuming drive cache: write through      [1636415.522355] sd 18:0:0:0: [sdc] Attached SCSI disk      From what I've found in the Internet it may be tied to having a partition larger than 2 TB. I connected the drive to an Windows XP system and split the drive into two NTFS partitions, 1.5 TB each. It currently has a GUID partition table. I've tried using gdisk to see the drive but Linux isn't acknowledging that the drive is in any way usable. It seems to work under Windows and OS X, though (or at least it's seen by the utilities for formatting and partitioning under those OS's...) Am I missing something simple here to get it to work properly under Linux?


Centos/RHEL 5.5/5.6 supported SCSI adapters

We have a batch of SuperMicro 6014H-82 servers that have Adaptec 2015S SCSI controllers fitted. Unfortunately, according to the bug tracker (0002087: CentOS installer won't detect harddrives) it looks like in Centos 5.5 and 5.6 support for this is broken in some way. The issue is tagged with "To be fixed in 5.6" but it isn't (we were unable to get Centos 5.5 or 5.6 to install). There is a workaround described in this bug report involving Centos 5.4 but we tried and failed (with Centos 5.5 and 5.6). Also, even if it did work, I'm not comfortable with this because it is really just a hack. I happy enough to buy new controllers for these boxes but I'm having a tough time finding out which controllers actually work with Centos 5.5 or 5.6 that have U320 + RAID5 support. I've visited multiple vendor sites but in most cases their supported OS versions are a bit vague. **Does anyone know of a reliable HCL for Centos 5.5/5.6 or RHEL 5.5/5.6** or can tell me what U320 SCSI controllers with RAID 5 support can be used with Centos/RHEL 5.5/5.6? I've spent the last two days researching this and come up with nothing.


Home Directories and pam.d using LDAP

Background:   I'm not too familiar with the ins and outs of pam and LDAP authentication on a configuration side. I've used systems that use pam but I've only worked on applications, not systems themselves. Questions:   Using pam to control authentication via LDAP, does this mean that a home directory will not be created on the system? If not, would I create users on the server or somehow push users to the system from an LDAP source?


Delete a matching line in a file doesn't work

So, I have this piece of a code:               while read line              do                 if [ $line = $maddr ] ;                 then                     sed -i '/${maddr}/d' mailinglist                     found=true                     break                      fi             done < mailinglist      If the read line matches my variable (a string) then delete the whole line. When it didn't work, I tested it with the flag **-x** , the pattern is found and it enters the if cycle, it even does the sed command, but the line stays there. (I create the "mailinglist" file in the script, so I thought, maybe it didn't have write permission, but I checked it and as far as I can tell, I do have the permission - I basically don't change anything about permissions in the script). I believe the sed command there is right (I have to edit the file and save it right away). Can you help me?


ls, regexp and environment variable

I wanted to declare an environment variable that stocks all the extensions of video files so I can use it when using the shell. I tried several things but never got it to work: If in my .bash_profile I put:               export VIDEOS={mp4,wmv,avi,flv,mkv,m4u,mpg,mpeg}      it only takes the last element:               [nbarraille@nbarraille ~]echo $VIDEOS     mpeg      If in my .bash_profile I put:               export VIDEOS="{mp4,wmv,avi,flv,mkv,m4u,mpg,mpeg}"      or               export VIDEOS='{mp4,wmv,avi,flv,mkv,m4u,mpg,mpeg}'      Then, when I display it it looks OK, but it doesn't work when I use it in a ls for example:               [nbarraille@nbarraille ~] echo $VIDEOS     {mp4,wmv,avi,flv,mkv,m4u,mpg,mpeg}     [nbarraille@nbarraille ~] ll *.$VIDEOS     ls: cannot access *.{mp4,wmv,avi,flv,mkv,m4u,mpg,mpeg}: No such file or directory      And when I run the exact same command without using the variable, it works:               [nbarraille@nbarraille ~] echo *.{mp4,wmv,avi,flv,mkv,m4u,mpg,mpeg}     example.avi     example2.mpg      Also, when I reboot, it looks like my .bash_profile is not loading, and the $VIDEOS variable is empty. I have to do a `source ~/.bash_profile` in order to get it to work (and I have to redo so every time I open a new terminal. Any idea? Thanks!


What port range will ipfw nat use for aliasing?

I am using `ipfw nat` with the following config               ipfw -q nat 1 config if em0      Which TCP and UDP ranges will the NAT choose its alias ports from? I would like it to be always from the range 49152–65535, so that I can do:               add allow tcp from any to me 22     add allow tcp from any to me 80     add deny tcp from any to me 1-49151     add nat 1 tcp from any to me recv em0 established      Does `ipfw` support this easily? If not, is there some way I can enforce this behaviour?


How to manually manage grub.cfg for Grub2?

I am setting up my system. The features of it are:   * GPT partition table (not sure how important this is)   * Triple boot - Gentoo, Debian and Mint.   * Custom kernel (kernel git repo) shared amounst distros. Now I am wanting to write my own lines for grub and not have the distros place their own lines in grub. I also don't really want one distro to have the role of creating the grub.conf file. As **everybody** is advocating the scripts, there is no one mentioning about hand crafting one. I am fairly sure editing it by hand is safe, so long as I make sure no script touches it. Another solution that I might be forced into is to configure every distro the same way (no kernels in menu, keep the custom config synced between distros), or just use one distro to manage the boot. How should I implement this?


Looking for X terminal with correct window resize handling

Is there any X terminal program, which reflows the content when I'm resizing the window? Gnome-terminal and Sakura does it well _halfway_ : when I'm shrinking the window and re-expanding it, the stuff comes back to the right side of the screen as I want: _Opening a big window:_               line 1 abcdefghijklmnopqrstuvwxyz       | right margin     line 2 abcdefghijklmnopqrstuvwxyz       |       _Shrinking it:_               line 1 abcdefghijklm | right margin     line 2 abcdefghijklm |      _Resizing to original (gnome-terminal, sakura), that's what I want to see:_               line 1 abcdefghijklmnopqrstuvwxyz       | right margin     line 2 abcdefghijklmnopqrstuvwxyz       |      _Resize to original (xterm, lxterm, PuTTY/win32), I don't like this:_               line 1 abcdefghijklm                    | right margin     line 2 abcdefghijklm                    |       That's okay, some terminals works well, others not. But when I'm opening a small window and expand it, all terminals works the same way: the lines remain wrapped at the left side, instead of re-flowing and re-wrapping: _Small window (line 1 and 2 just ran out of window):_               line 3 abcdefghijklm | right margin     nopqrstuvwxyz        |     line 4 abcdefghijklm |     nopqrstuvwxyz        |      _Resize to larger:_               line 3 abcdefghijklm                    | right margin     nopqrstuvwxyz                           |     line 4 abcdefghijklm                    |     nopqrstuvwxyz                           |      **What I want to see instead:**               line 1 abcdefghijklmnopqrstuvwxyz       | right margin     line 2 abcdefghijklmnopqrstuvwxyz       |     line 3 abcdefghijklmnopqrstuvwxyz       |     line 4 abcdefghijklmnopqrstuvwxyz       |      Is there a chance to get this result? (I'm using Ubuntu with LXDE, if it matters).


A question about permissions of hierarchical directories

I have some directories, with following permissions:               drwxr-xr-x 18 user1 root 4096 Oct 27 11:25 /home/test1/test2     drwxr-xr-x 24 user1 root 4096 Oct 21 08:38 /home/test1     drwxr-xr-x 492 root root 12288 Nov 17 01:31 /home     drwxr-xr-x 23 root root 4096 Nov  6 18:46 /      My question: If I understand right, permission of `/home` says that only root can add/delete files (or directories) in this directory, but then there's the directory `test1` which has `user1` as its owner. That means that user `user1` can add/delete files (or directories) in `/home/test1`. Does this mean that directory permission of `/home` is only valid till its immediate children and not its all descendants (grandchildren and so on)? And it must be only root who let `user1` be the owner of its child `/home/test1` and from then on, `user1` can control owners of its children (and all descendants)?


How to timestamp a transcripted talk?

I'm trying to mark each paragraph of transcripted text with timestamps of when/where it occurs in the audio. `mplayer` and `emacs` are getting me close. `mplayer`, in the terminal, outputs a stream of suitable time info; eg. (command and sample log)               mplayer au-file 1>event.log 2>&1          A:   0.8 (00.7) of 3207.0 (53:27.0)  0.1% [J     A:   0.9 (00.9) of 3207.0 (53:27.0)  0.1% [J     A:   1.0 (01.0) of 3207.0 (53:27.0)  0.1% [J      Certain un-bound keys (eg, `F12`) can be used to flag an event in the log-- specifically for the start of a paragraph.               xdotool key --window $termID F12          A:   3.1 (03.0) of 3207.0 (53:27.0)  0.1% [J     No bind found for key 'F12'.                              A:   3.2 (03.2) of 3207.0 (53:27.0)  0.1% [J     A:   3.3 (03.3) of 3207.0 (53:27.0)  0.1% [J      The above works fine. The next thing it needs is line numbers to be injected into `event.log`. I will probably use `emacs` to trigger both these events from within `emacs`, by binding a key to read the current `point` position and appending it to the log. Yes, your guessed it, I have a problem. It seems that `mplayer` is keeping a stream pointer (or something?) because when it writes its next line it overwrites text I've appended. I don't know what is going on, but none of my added lines appar in the final log... I've used `echo $number >>events.log`. I've watched the log via `tail -f events.log` and it shows one of my lines occasionally, so they must be getting there... Is there some way around this?   Either by some `fu` to the log, or an entirely different method, eg. some tool which does exactly this, in real time.. I've looked at subtitling tools and audio-video editors, but they seem to be too clunky.. I'm open to any ideas.


certificate errors trying to create a virtualenv on old Ubuntu

On an old Ubuntu 8.04 (cannot upgrade yet) I need to create a Python virtualenv, install some packages and then my software. I do get certificate errors:               Could not fetch URL https://pypi.python.org/simple/xlrd/: connection error:         [Errno 185090050] _ssl.c:340: error:0B084002:x509 certificate   routines:X509_load_cert_crl_file:system lib          Will skip URL https://pypi.python.org/simple/xlrd/ when looking for     download links for xlrd      so I cannot upgrade `pip` or `setuptools`, and have no luck finding how to update just the certificate (the system is old and cannot be update using `apt`). The python installed is the latest `python-2.7` (I have to use `pip-2.7` and `virtualenv-2.7` in order not to get the old system versions that I don't want to touch). How can I install appropriate certificates, or work around this issue?


How to write any Unicode Key without Pre-programmed key for it in kbd?

I am trying to find some Unix tool to input any Unicode key. I am fine with X application or console but I use Vi/m and it may have this property. For example, suppose I want to input key `"U+0303"` or the key `"U+007E"` in Unicode. You should get something below, source, with the unicodes:               U+0303 ◌̃ combining tilde and U+007E ~       I am looking for a general tool, not be depended on certain kbd layouts. It is actually better if it is was some very basic tool without unnecessary bells- and-whistles. The simplest win.


Testing C++ code with bash commands

I've read a programming problem and then I wrote code for it. But I thought my algorithm was not working right, so I wrote another piece of code that it was not optimal but, I think, correct. Now I have about 100 input and output data sets and I want to give this input to the both C++ programs and compare outputs. If there are differences in the outputs, I will find out if my code is not correct. My problem is that there are too many test cases (about 100) and the outputs are big text files and I can't check them by myself. I wonder how I can do this with bash functions and commands? My input text files are `input1.txt`, `input2.txt`, etc. My outputs text files are similar to inputs. My programs are written in C++.


PECL memcached installation gets error

I installed Zend Server 6 (debian). Also installed several packages:               apt-get install gcc     apt-get install g++     apt-get install libncurses5-dev      apt-get install zlib1g     apt-get install zlib1g-dev     apt-get install libmemcached-dev      After that I tried to install pecl memcached:               /usr/local/zend/bin/pecl install memcached      I got some errors while pecl memcached installing: http://codepad.org/iWuKlgxb What is the reason of these errors?


Extract timestamp from a gzip file

How can I know the raw original timestamp of a file `foo` compressed with `gzip` without having to decompress `foo.gz`? `gzip --verbose --list foo.gz` and `file foo.gz` will print formatted date and time.


Why .Xauthority needs not to be owned by the root account in order to get past login?

I've just got the same problem from here, and solved it using what was stated in the first answer (akonsu's one). However, I would love to know why `~/.Xauthority` needs not to be owned by the root account in order to get past login with a regular user (in other words: why is that the reason for the login failure), and - do you have an assumption as to how akonsu found that as a solution?


Samba share permission denied user writing file but still shows

Very strange issue... Samba share on remote:               [javaerpm]         path = /u/abas/erpm/java         force user = erpm         guest ok = yes         read only = no         writeable = yes      Mount command on local using root:               root@crunchbang:/mnt/abas# mount -t cifs -o username=guest,rw,exec,auto //10.0.0.2/javaerpm ./javaerpm      Root can read/write/cd no problem at all:               root@crunchbang:/mnt/abas# cd javaerpm     root@crunchbang:/mnt/abas/javaerpm# touch test     root@crunchbang:/mnt/abas/javaerpm# ll     total 1     -rw-r--r--  1  501 users   0 Sep 24 09:55 test     root@crunchbang:/mnt/abas/javaerpm# rm test      But if I switch to a regular user and do the same thing I get this:               shawn@crunchbang:/mnt/abas/javaerpm$ touch test     touch: cannot touch `test': Permission denied      I can `ll` and I can see that it wrote the file anyways:               shawn@crunchbang:/mnt/abas/javaerpm$ ll     total 1     -rw-r--r--  1  501 users   0 Sep 24 09:55 test      I can even `rm` no problem:               shawn@crunchbang:/mnt/abas/javaerpm$ rm test     shawn@crunchbang:/mnt/abas/javaerpm$      I've tried different mounting options. `uid=501` doesn't change anything. Tried `nounix` but then it doesn't work at all and I see nothing using root or shawn user.


ssh: Read from socket failed: Connection reset by peer

When I try to ssh to a remote host, I get the following error messages:               root@cloudstack-server-1:~/.ssh# ssh ubuntu@172.17.4.17 -v     OpenSSH_5.9p1 Debian-5ubuntu1.1, OpenSSL 1.0.1 14 Mar 2012     debug1: Reading configuration data /etc/ssh/ssh_config     debug1: /etc/ssh/ssh_config line 19: Applying options for *     debug1: Connecting to 172.17.4.17 [172.17.4.17] port 22.     debug1: Connection established.     debug1: permanently_set_uid: 0/0     debug1: identity file /root/.ssh/id_rsa type 1     debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-1024     debug1: Checking blacklist file /etc/ssh/blacklist.RSA-1024     debug1: identity file /root/.ssh/id_rsa-cert type -1     debug1: identity file /root/.ssh/id_dsa type 2     debug1: Checking blacklist file /usr/share/ssh/blacklist.DSA-1024     debug1: Checking blacklist file /etc/ssh/blacklist.DSA-1024     debug1: identity file /root/.ssh/id_dsa-cert type -1     debug1: identity file /root/.ssh/id_ecdsa type -1     debug1: identity file /root/.ssh/id_ecdsa-cert type -1     debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9p1 Debian-5ubuntu1.1     debug1: match: OpenSSH_5.9p1 Debian-5ubuntu1.1 pat OpenSSH*     debug1: Enabling compatibility mode for protocol 2.0     debug1: Local version string SSH-2.0-OpenSSH_5.9p1 Debian-5ubuntu1.1     debug1: SSH2_MSG_KEXINIT sent     Read from socket failed: Connection reset by peer      BTW, I generate a key-pair id_rsa/id_rsa.pub in my local host and paste the id_rsa.pub to the remote host's file `authorized_keys`. I also enable password login in remote host. Now, I have no idea about the error messages--`Read from socket failed: Connection reset by peer`. Please give me some advices.


Why `host` and `nslookup` on Solaris 10 resolves hostnames while `ping` and `telnet` does not?

* `/etc/resolv.conf` contains a nameserver that is alive (as reported by the `ping` command)   * `host` or `nslookup` is able to resolve `google.com`              $ host google.com     google.com has address 74.125.228.3     google.com has address 74.125.228.4     ...     $ nslookup google.com     ...     Non-authorative answer:     Name:   google.com     Address: 74.125.228.0     Name:   google.com     Address: 74.125.228.1     ..        * `ping` or `telnet` is not able to resolve `google.com`              $ ping google.com     ping: unknown host google.com     $ telnet google.com     google.com: node name or service name not known


"lsof: can't read namelist from /dev/ksyms" on Solaris

On Solaris, when I type the command               lsof -l      I encountered this error:               lsof: can't read namelist from /dev/ksyms      Anyone knows what this error means and how I can get open the list of open FD's using lsof in Solaris?


Periodicaly dropping packets

I'm here on an Ubuntu 12.10 Dell machine. Every 8.5 minutes packets get dropped, I don't lose the connection completely but for some seconds, no connections are successful. I had this problem before and it vanished but now it's back again. I started to monitor all packages with Wireshark and first suspected that an unusual high number of ARP requests somehow DDOS my connection but this does not seem to be the problem. I started to ping a host on the Internet and charted the ping requests and responses and it's absolutely periodic, so I suspect it must be something with my system. I can figure out if DNS resolution does not work, I don't get an address via DHCP or the routes are set up incorrectly but I have no idea where to start looking in this case. (I obviously tried Google) Where could I start looking for problems? Kernel log doesn't show anything. Is there a buffer for incoming data that could overflow? Any tables in the kernel that could be purged periodically? I forgot to add, the machine is connected to a switch under my desk. I also have a windows machine which is connected to the same switch and does not have any problems. Also I plugged the Linux box directly into the socket in the wall and I had the same problems. **Additional information** As far as I understand the dump, the connection are not reset, they just time out. I get a lot of tcp retransmission requests. The ARP requests come from network crawlers which try to discover devices. While they sometimes sent up to 1000 requests for an IP address that does not exist, I could not see a correlation between those bursts and my failing connections. Also the activity of the crawlers are not periodic while my connections always fail after exactly the same time (about 8.5 minutes) so I ruled them out. I could so far not detect other unusual traffic. As I said, I unplugged the linux box and plugged it directly into the network socket in the wall, without the IP phone and the switch in between and the behaviour is exactly the same. Therefore I don't think it's a problem with the equipment. **I gave up**   I reinstalled Ubuntu and now it works normally again.


How can I get a static C compiler?

I'm playing around with chroot environments, and I'd like to have a portable C compiler so that I can easily set up some basic build-tools in each environment without having to move too many libraries around. Gcc seems pretty bloaty for what I want to do, but if it's reasonably easy to build a static gcc I wouldn't mind a few dozen megabytes. I am also looking at the Tiny C Compiler, which is smaller but still looks like it's got an impressive feature set. However, running ./configure --help in the source directory doesn't list any option for building tcc statically, and I'm not sure how it might be done otherwise.


CMake Error: The current directory is different than

I'm trying to compile the source code for Shrewsoft VPN. The instructions say to compile the source on step 4. However... I get this error:               user@ubuntu:~/Ubuntu One/Programs/ShrewSoft VPN$ sudo cmake –DQTGUI=YES –DETCDIR=/etc –DNATT=YES     CMake Error: The current CMakeCache.txt directory /home/user/Ubuntu One/Programs/ShrewSoft VPN/CMakeCache.txt is different than the directory /home/user/Programs/ShrewSoft VPN where CMakeCache.txt was created. This may result in binaries being created in the wrong place. If you are not sure, reedit the CMakeCache.txt     CMake Error: The source directory "/home/user/Ubuntu One/Programs/ShrewSoft VPN/–DNATT=YES" does not exist.     Specify --help for usage, or press the help button on the CMake GUI.      **Instructions:**               Compile the Source Code for the Shrew Soft VPN Client     1.  $> cd ~/Downloads          2.  $> tar –xzvf shrewsoft-client.tgz          Change to Download directory     $> cd ~/Downloads     Unpack the Source files.     $> tar –xzvf shrewsoft-client.tgz     3.   Change to the source directory.          $> cd ~/Downloads/ike     4.   Run cmake.          For GUI Installation (recommended):          $> cmake –DQTGUI=YES –DETCDIR=/etc –DNATT=YES          For non-GUI Installation:          $> cmake -DNATT=YES     5.   Run make.          $> make     6.   Run make install. NOTE: Run


How do I mount a shared VMWare folder on startup?

So I'm following this article on how to mount a shared vmware folder. I can successfully mount with the following command:               mount -t vmhgfs .host:/foo /home/user/Documents/foo      However, I can't seem to get it work with `/etc/fstab`. I added this line:               .host:/foo /home/user/Documents/foo vmhgfs defaults 0 0      When I start up my machine, it prompts me to press `S` to skip mount or `M` for manual recovery and it won't mount. I'm forced to press `S` to skip to get into the OS. How can I fix this? Edit: So I've found that VMware is already automatically mounting it to /mnt/hgfs/foo so my temporary workaround is a symlink to that directory. Is it possible to override this behavior so that I don't need a symlink?


How can I debug Apache, not starting upon boot

Apache is already set up as a service, since:               $ sudo update-rc.d apache2 defaults      System start/stop links for /etc/init.d/apache2 already exist.      But Apache isn't starting. How can I start debugging what is going wrong? I'm running Linux Mint, so a Debian flavour.


Why isn't /etc/rc.local executed when I log in?

I'm trying to run a script at login, and this is the way I've found to do it. I'ved edited `/etc/rc.local` with a line such as `bash /home/me/script.sh`. I've made that script executable. It doesn't seem that my command is being executed upon login. What steps could I take to debug this? My distro is Linux Mint 12 running Gnome.


Does CentOS fall into System V family? How is it considered to be while comparing with Unix System V family?

CentOS is `"derived entirely from the Red Hat Enterprise Linux (RHEL) distribution"` (more here).   1. Does it fall into any UNIX System V family? Such as PDP-11 or etc?   2. If not, where does CentOS stands for comparing with System V family for zero downtime or performance etc?


How are the GPG usage flags defined in the key details listing?

When I list the details of a key I get output like this:               $ gpg --edit-key SOMEID     pub [..] created: [..] expires: [..]   usage:SC     [..]     sub [..] created: [..] expires: [..]   usage: E      Or even `usage: SCA` on another key (the master-key part). What does these abbreviation in the usage field mean? I can derive that:               S -> for signing     E -> for encrypting      But what about `C` and `A`? And are there more? And where to look stuff like this up?


Unable to start GNOME after hibernation

I'm using Debian 6 (Squeeze) and I happened to hibernate my laptop today. After hibernation everything was very slow (a lot of disk accesses... most likely page faults, I guess) but this is a usual behaviour in my case. My usual fix to this situation is rebooting. However, this time I rebooted and GNOME never came back. GRUB is loaded and a lot of stuff is output to the console however at some point, when the console is replaced by a black screen in which GNOME will be loaded the black screen stays there. I've been using `fglrx` driver for a year, however, I changed it in `xorg.conf` into `vesa`. This showed a little improvement as, although the situation repeated, instead of seeing a full black screen I could read:               lp: driver loaded but no devices found     ppdev: user-space parallel port driver      Those messages stayed on top of the screen blinking as if they were cleared and written in a loop. The fans went on so I guess there was some kind of loop doing something. Hitting the power button shut down the laptop properly (the usual shutdown messages appeared in the screen). I haven't seen any unusual output rather than that in `dmesg`, `/var/log/kern.log` `/var/log/messages`. Any ideas on what I can do? Maybe `dpgk-reconfigure` some packages?


Use `dd` to cut file end part

There is probably simple trick to do this, but I can't figure from man page. How do I cut last 1MB from file with undetermined size for example, by using `dd`?


I want my Ubuntu 9.04/9.10 back, is there any current similar distro?

I was switching to Linux in the optimal time, around Ubuntu 9.04/9.10. I am a programmer, so I don't want to be a "Linux guru", that's why Ubuntu **was** perfect for me - until Unity/Gnome3. In latest Ubuntu releases (11.04/11.10), several important things have just disappeared. There's no Compiz-Fusion support, no Gnome2 applets. The position of the panels is fixed. The Unity launcher is "for-dummies", but I'm not. Lots of customisation options are gone. On the computer I've performed distro- upgrade, I've installed LXDE now, it's like Gnome (I've replaced LXDE's file manager with Nautilus), but it does not support Compiz-Fusion. So, the question is: which Linux distro is like Ubuntu 9.04/9.10, which I can just install, set up Compiz-Fusion shortcuts, select panel's position, add applets, and it just works? Should I go back to Ubuntu 10.04 LTS? What about Mint? I don't wanna dig too deep into the soul of window managers and desktop environments.


need portable crontab host-checking/failover logic across Linux & Cygwin

A host-ping test that always works correctly from the interactive `bash` command line in **Cygwin** , is behaving incorrectly in its own crontab-- always selecting the second host--and I can't figure out why:               SHELL=/bin/bash          */29 7-23 * * *  [ -n "$(pidof unison)" ]  || (partner=5.174.63.120; ping -A -c5 $partner 6 7 |grep -w "ttl" || partner=5.3.172.247; time nice unison-sync  $partner &> /tmp/sync.master.dev.log )      which ping     /usr/bin/ping      This basically wants 5.174.63.120 to be the 1st choice sync host preference, however if it doesn't ping back at the moment then use 5.3.172.247 instead for this round. If `unison` is not already running, that is. Yet running from the command-line always works as expected, echoing the first IP address if available, else the second:               partner=5.174.63.120; ping -A -c5 $partner 6 7 |grep -w "ttl" || partner=5.3.172.247; echo  $partner      In Ubuntu this works both in `crontab` and cli. Is there a better way I can accomplish this, that is both compact and still portable on both my OSes (Linux Ubuntu 11.10 and Cygwin under Windows7,32bit)? Even better, I'd like to generalize my host-checking to more that two, but still code it into a concise crontab line: Use A if reachable, else use B if reachable, else use C if reachable, ... else just use Z.


Multi-machine tool in the spirit of moreutils' `parallel`?

`parallel` from moreutils is a great tool for, among other things, distributing `m` independent tasks evenly over `n` CPUs. Does anybody know of a tool that accomplishes the same thing for multiple machines? Such a tool of course wouldn't have to know about the concept of multiple machines or networking or anyhting like that -- I'm just talking about distributing `m` tasks into `N` _clusters_ , where in cluster `i` `N_i` tasks are run in parallel. Today I use my own BASH scripts to accomplish the same thing, but a more streamlined and clean tool would be great. Does anyobdy know of any?


How to start nvidia x server settings from command line?

I am using Ubuntu 10.04, I know I can start NVIDIA x server settings by choose : **System -> Preference -> Monitors** on the top bar. But how can I start the NVIDIA x server settings window by run a command from terminal? What is that command?


How to bypass flash version check in linux firefox and use Gnash

Is it possible, and how, for Gnash to present itself as Adobe Flash to avoid "install Adobe Flash" messages while viewing flash-based websites?