Trouble getting help in vim

I have just finished the `vimtutor` and everything went fine except for the last part (Lesson 7.1: Getting Help). I type `:help` and the help manual is shown as it is supposed to. But then I try (as suggested) the commands `:help w`, `:help c_CTRL-D`, `:help insert-index` and `:help user-manual` and the following appears at the bottom left of the screen:               E434: Can't find tag pattern     Press Enter or type command to continue      I press enter and a bunch of nonsensical characters appear on the screen, but I don't get any help. Why could this be happening and how can I fix it? **Note:** I'm running Fedora 20 and have the following packages installed: `vim-common`, `vim-minimal`, `vim-enhanced`, `vim-filesystem`. * * * Okay so I tried running `vim --version` and this is what I get:               $ vim --version     VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Sep 11 2013 12:26:40)     Included patches: 1-27     Modified by <bugzilla@redhat.com>     Compiled by <bugzilla@redhat.com>     Huge version without GUI.  Features included (+) or not (-):     +acl             +farsi           +mouse_netterm   +syntax     +arabic          +file_in_path    +mouse_sgr       +tag_binary     +autocmd         +find_in_path    -mouse_sysmouse  +tag_old_static     -balloon_eval    +float           +mouse_urxvt     -tag_any_white     -browse          +folding         +mouse_xterm     -tcl     ++builtin_terms  -footer          +multi_byte      +terminfo     +byte_offset     +fork()          +multi_lang      +termresponse     +cindent         +gettext         -mzscheme        +textobjects     -clientserver    -hangul_input    +netbeans_intg   +title     -clipboard       +iconv           +path_extra      -toolbar     +cmdline_compl   +insert_expand   +perl            +user_commands     +cmdline_hist    +jumplist        +persistent_undo +vertsplit     +cmdline_info    +keymap          +postscript      +virtualedit     +comments        +langmap         +printer         +visual     +conceal         +libcall         +profile         +visualextra     +cryptv          +linebreak       +python/dyn      +viminfo     +cscope          +lispindent      -python3         +vreplace     +cursorbind      +listcmds        +quickfix        +wildignore     +cursorshape     +localmap        +reltime         +wildmenu     +dialog_con      -lua             +rightleft       +windows     +diff            +menu            +ruby/dyn        +writebackup     +digraphs        +mksession       +scrollbind      -X11     -dnd             +modify_fname    +signs           -xfontset     -ebcdic          +mouse           +smartindent     -xim     +emacs_tags      -mouseshape      -sniff           -xsmp     +eval            +mouse_dec       +startuptime     -xterm_clipboard     +ex_extra        +mouse_gpm       +statusline      -xterm_save     +extra_search    -mouse_jsbterm   -sun_workshop    -xpm        system vimrc file: "/etc/vimrc"          user vimrc file: "$HOME/.vimrc"      2nd user vimrc file: "~/.vim/vimrc"           user exrc file: "$HOME/.exrc"       fall-back for $VIM: "/etc"      f-b for $VIMRUNTIME: "/usr/share/vim/vim74"     Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H   -I/usr/local/include  -O2 -g -pipe -Wall -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches  -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1           Linking: gcc   -L. -Wl,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,--enable-new-dtags  -Wl,-z,relro  -L/usr/local/lib -Wl,--as-needed -o vim        -lm -lnsl  -lselinux  -lncurses -lacl -lattr -lgpm -ldl   -Wl,--enable-new-dtags  -fstack-protector -L/usr/local/lib  -L/usr/lib/perl5/CORE -lperl -lresolv -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc             I think it's quite the same you have. Where else could the problemm be?


Any unix utility/tool to auto backup files before saving?

I would like to know if there is any existing unix utility or tool that would make a backup of a file with a date/timestamp appended to the filename. Basically I am looking to automatically make backup of my config files like the `.bashrc`, `.vimrc`, etc when I change the file and save using some text editor. `vim` specific solution would also be helpful. May be adding some kind of hook only for specific files that creates a copy of the previously saved file and then goes on to save the currently modified file.


puppet certificate catching error

After installing puppet master and client, when I request for catalog, I am getting the following error:               [root@INFINI-ONE puppet]# puppet agent -t     warning: peer certificate won't be verified in this SSL session     info: Caching certificate for infini-one.infinicluster     err: Could not retrieve catalog from remote server: Error 400 on SERVER: No      support for http method POST     warning: Not using cache on failed catalog     err: Could not retrieve catalog; skipping run      And later:               [root@INFINI-ONE puppet-2.7.14]# puppet agent -t     warning: peer certificate won't be verified in this SSL session     warning: peer certificate won't be verified in this SSL session     info: Caching certificate for infini-one.infinicluster     err: Could not retrieve catalog from remote server: SSL_connect returned=1      errno=0 state=SSLv3 read server certificate B: certificate verify failed.  This      is often because the time is out of sync on the server or client     warning: Not using cache on failed catalog     err: Could not retrieve catalog; skipping run     err: Could not send report: SSL_connect returned=1 errno=0 state=SSLv3 read      server certificate B: certificate verify failed.  This is often because the      time is out of sync on the server or client


How to route 3 computer in wireless ad-hoc network?

I have three computers connected on the same wireless ad-hoc network with the following adresses :               192.168.1.3  <----->  192.168.1.5  <----->  192.168.1.6      On computer 5, I only did :               route add -net 192.168.1.6 netmask 255.255.255.255 dev wlan1     sysctl -w net.ipv4.ip_forward=1      Here is a look to my routing table :               Destination   Gateway       Genmask         Flags   Metric  Ref   Use   Iface     0.0.0.0       192.168.20.1  0.0.0.0         UG      100     0     0     eth0      169.254.0.0   0.0.0.0       255.255.0.0     U       1000    0     0     eth0      192.168.1.0   0.0.0.0       255.255.255.0   U       0       0     0     wlan1     192.168.1.6   0.0.0.0       255.255.255.255 UH      0       0     0     wlan1     192.168.20.0  0.0.0.0       255.255.255.0   U       0       0     0     eth0      Why isn't is working ? How can I forward the packet from computer .3 to computer .6 ?


Can we get compiler information from an elf binary?

Is there some chance to know how a binary was built, under Linux? (and or other Unix) Compiler, version, time, flags etc... I looked at `readelf` and couldn't find much, but there might be other ways at analyzing the binary code/section etc... Anything you know how to extract?


Insert selected filename while copying in Midnight Commander

Is it possible to paste the selected filename into the copy popup, so when I hit `F5` this filename will be in the 'to' section, so I can adjust it? For example: I want to copy `/home/piotr/testFile.log` to `/home/piotr/testFile2.log`.   I open both panels in the same directory and hit F5, but the 'to' value is: `/home/piotr` and I would like it to be `/home/piotr/testFile.log`, so I can simply adjust the name instead of typing it from the scratch.


How to start a GUI program in a VM with PHP

I have an Ubuntu 12.04 VM running on my online server where there is no display attached. I want to start `Teamviewer` there on that VM to get graphical access to that server. I guess I have to give the PHP user www-data somehow sudo access to start the Teamviewer GUI in a virtual X-Session via `gksu`. How would I have to configure sudo to achieve this? And how could I call that from within a PHP-script on an Apache, that is running on that server? (I could install another desktop environment if that would be more performant)


SELinux outbound access to other sites with restrictions

We have CentOS 6 configured with SELinux to host a number of websites. Unfortunately SELinux is preventing websites from accessing (outbound) sites, such as download.wordpress.com to update wordpress or Joomla installation. We would like to have both SELinux enabled and the ability for these sites to do such connections. Our fear is that we do               # setsebool -P httpd_can_network_connect 1      and some 'developer' will create a php script to start outbound spamming resulting in our IP being black listed. Is there a way to enable outbound connections and limit restrict such outbound issues at the same time? Thanks.


LiveCD for LFS 7.0

Most of the live CD systems I have come across don't seem to have the LFS requirements pre-installed (i.e. everything on this list). Are there any live CD systems that come with the required software for LFS 7.0 preinstalled? I have used the LFS liveCD in the past, but it looks like it is too out of date to be used with book 7.0.


Monitoring PHP file access with loggedfs - access denied

I am trying to see how many files are included for each page call on my site. When I run:               sudo loggedfs -f /path/to/webroot      I get a printout of files - I think from a cron job that might be running. But when I try to access the site, Apache gives me an access denied page. As soon as I cancel loggedfs, Apache serves up the page correctly. I thought loggedfs was supposed to be passive and not affect access to files - is there another way to do this?


xmodmap for key combination

With Logitech K290 keyboard via USB, F. keys are not accessible by default, and I need to press `Fn` before using them, which is not really usable. The `Fn` key alone does not fire any event in `xev`. Pressing `F1` without `Fn` fires two key events, keycode 50 (`Shift_L`) and keycode 133 (`Super_L`) and displays a message "Touchpad disabled" on my Kubuntu (the same message for every keys `F1` through `F4`) Althoug most media keys works, I'd rather have direct F. keys access. Do you know of any way to toggle `Fn` behavior? Here is the output for when I press F1 without fn:               KeyPress event, serial 40, synthetic NO, window 0x1a00001,         root 0x2c6, subw 0x0, time 64638420, (-352,274), root:(1462,621),         state 0x10, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,         XLookupString gives 0 bytes:          XmbLookupString gives 0 bytes:          XFilterEvent returns: False          KeyPress event, serial 40, synthetic NO, window 0x1a00001,         root 0x2c6, subw 0x0, time 64638420, (-352,274), root:(1462,621),         state 0x11, keycode 133 (keysym 0xffeb, Super_L), same_screen YES,         XLookupString gives 0 bytes:          XmbLookupString gives 0 bytes:          XFilterEvent returns: False          FocusOut event, serial 40, synthetic NO, window 0x1a00001,         mode NotifyGrab, detail NotifyAncestor          FocusIn event, serial 40, synthetic NO, window 0x1a00001,         mode NotifyUngrab, detail NotifyAncestor          KeymapNotify event, serial 40, synthetic NO, window 0x0,         keys:  4294967238 0   0   0   0   0   4   0   0   0   0   0   0   0   0   0                   32  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0             KeyRelease event, serial 40, synthetic NO, window 0x1a00001,         root 0x2c6, subw 0x0, time 64638436, (-352,274), root:(1462,621),         state 0x51, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,         XLookupString gives 0 bytes:          XFilterEvent returns: False          KeyRelease event, serial 40, synthetic NO, window 0x1a00001,         root 0x2c6, subw 0x0, time 64638436, (-352,274), root:(1462,621),         state 0x50, keycode 133 (keysym 0xffeb, Super_L), same_screen YES,         XLookupString gives 0 bytes:          XFilterEvent returns: False          MappingNotify event, serial 40, synthetic NO, window 0x0,         request MappingPointer, first_keycode 0, count 0      And for f2 (still no fn):               KeyPress event, serial 40, synthetic NO, window 0x1a00001,         root 0x2c6, subw 0x0, time 64782724, (-202,438), root:(1491,799),         state 0x10, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,         XLookupString gives 0 bytes:          XmbLookupString gives 0 bytes:          XFilterEvent returns: False          KeyPress event, serial 40, synthetic NO, window 0x1a00001,         root 0x2c6, subw 0x0, time 64782724, (-202,438), root:(1491,799),         state 0x18, keycode 133 (keysym 0xffeb, Super_L), same_screen YES,         XLookupString gives 0 bytes:          XmbLookupString gives 0 bytes:          XFilterEvent returns: False          FocusOut event, serial 40, synthetic NO, window 0x1a00001,         mode NotifyGrab, detail NotifyAncestor          FocusIn event, serial 40, synthetic NO, window 0x1a00001,         mode NotifyUngrab, detail NotifyAncestor          KeymapNotify event, serial 40, synthetic NO, window 0x0,         keys:  4294967238 0   0   0   0   0   0   0   1   0   0   0   0   0   0   0                   32  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0             KeyRelease event, serial 40, synthetic NO, window 0x1a00001,         root 0x2c6, subw 0x0, time 64782780, (-202,438), root:(1491,799),         state 0x58, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,         XLookupString gives 0 bytes:          XFilterEvent returns: False          KeyRelease event, serial 40, synthetic NO, window 0x1a00001,         root 0x2c6, subw 0x0, time 64782780, (-202,438), root:(1491,799),         state 0x50, keycode 133 (keysym 0xffeb, Super_L), same_screen YES,         XLookupString gives 0 bytes:          XFilterEvent returns: False      F1 with fn gives expected result:               KeyPress event, serial 40, synthetic NO, window 0x1a00001,         root 0x2c6, subw 0x0, time 64820204, (-856,-213), root:(1097,247),         state 0x10, keycode 67 (keysym 0xffbe, F1), same_screen YES,         XLookupString gives 0 bytes:          XmbLookupString gives 0 bytes:          XFilterEvent returns: False          KeyRelease event, serial 40, synthetic NO, window 0x1a00001,         root 0x2c6, subw 0x0, time 64820284, (-856,-213), root:(1097,247),         state 0x10, keycode 67 (keysym 0xffbe, F1), same_screen YES,         XLookupString gives 0 bytes:          XFilterEvent returns: False


Windows shared network printer keeps using rear tray as source

I am trying to set up network printing on my Linux Mint 15 (64 bit) system (dualboot with Windows 7). The printer is a Canon PIXMA MG5100 and is connected (via USB) to a computer running Windows XP. It was shared through the printer properties menu (Control Panel > Printers and Faxes) I was able to print to this printer from my computer in Windows 7. Using `system-config-printer`, I've found the printer (by entering the internal IP of the XP computer as the 'host' when adding using the "Find Network Printer" option). I've tried to print a blank page to test it, but the printer simply tries to take paper from the rear tray (of which there isn't any). I want it to use paper from the cassette, but the printer won't do that. I've tried setting all paper source related settings (in LibreOffice and the actual printer itself) to 'Cassette'. I've also tried re-adding the printer via the CUPS web interface (not sure if that's the right name for it) at `http://localhost:631`. I've done it using both smb and lpd in both interfaces. In the web interface, my printer isn't automatically detected, so I have to manually add it. The driver is "Canon PIXMA MG5100 - CUPS+Gutenprint v5.2.9" Since I am able to get the printer to start printing, and since I got it working perfectly in Windows, I believe this _could_ be related to Linux in some way. I just want the printer to use the cassette as the paper source. Edit: Also, on the Windows XP computer, when it tries to use rear tray paper, a message appears that tells me to load paper into the rear tray. It also mentions that when paper that is not A4 or some other standard size will be taken from the rear tray. This _shouldn't_ be anything that could affect me since I'm printing in A4. It's not mentioned clearly, but it's possible that the printer might somehow be "thinking" that I'm not printing in A4.


Can I apply `tmux` to a bash script?

Is it possible for me to use `tmux` to SSH into a Raspberry Pi, run a Bash script, and then leave the session (from my laptop), while the Raspberry Pi continues to run the script?


How can I delete input in the terminal?

* Xubuntu 13.10 Say I paste a command, something like               sudo apt-get install abc yxz 123 DEF MMM KKK      into the terminal. Then I suddenly had a change in mind and thus I would like to delete the last 3 packages without using backspace. Is there a way to mark them, as in using something like `ctrl + shift + left`?


I would like to manage my ssh passwork with gnome-keyring. I am on Ubuntu 12.04.3 LTS, gnome3. I don't have root access to the system. The question is in the title indeed:               gnome-keyring-daemon: insufficient process capabilities, unsecure memory might get used      This worries me. What does it mean?


Clean way to temporarily replace a config file?

I use a drawing program called Inkscape, which has both a GUI and a command line interface. When used on the command line, it has a large number of options that can only be controlled through a user-specific config file, which is hardcoded to be:               $HOME/.config/inkscape/preferences.xml      This config file always contains the options that were most recently used in the GUI, which may be the wrong ones when I'm scripting. To work around this, I have my script save a copy of the config file, replace it with a standard config file, run the program, and then copy the saved config file back. This works OK but is not really clean. For example, it won't work properly if two instances of the script are being run concurrently. On Unix, is there a cleaner way to carry out this task of faking out a program so it takes its config file from someplace that I want, rather than from the pathname hardcoded in the program? Maybe something involving links, or something like BSD jails?


Linux system calls

I want to obtain information about memory used by different users and different processes which users are running and statistics about those processes like memory consumption ,execution speed etc using Linux system calls. I don't want to use commands like free,top etc.Can any one suggest how to do so?


Use scp to transfer a file from local directory X to remote directory Y

I took a look around at other questions here and at various "scp usage" tutorials on Internet, but I can't sort out what's wrong. I'm using Linux Mint and I'm trying to figure out how **scp** works. I've a file **file.ext** (on my computer) in directory **/home/name/dir/** I connect to a remote machine using **ssh** , like:               ssh -p 2222 username@domain      it asks me the password and the shell displays:               username@domain ~ $      now, If I issue the command (before I ran ssh I was in the local directory **/home/name/dir** ):               scp -r -P 2222 file.ext username@domain       output is:               cp: cannot stat ‘file.ext’: No such file or directory      Same result if instead of file.ext I write the complete path               scp -r -P 2222 /home/name/dir/file.ext username@domain       Also, the server admin told me that I shall upload the file to my remote home directory (instead of root), like:               scp -r -P 2222 file.ext username@domain:~/      but when I do it and press "Enter" nothing happens, as If the shell was waiting for further input. Summary of my problems:   * cp: no such file or directory   * shell "stuck" on ~/ Any suggestions?


No write access to $HOME directory

While loading the KDE UI Linux boots to kdm, then I get a "bad" sound and black screen. Logs reveal the line in the title. I can `ctrl` - `alt` - `F4` just fine from there. Tried:   * `chmod 755` on `/`,`/home`,`/home/kellogs`   * Verified I have no SElinux on the machine    * Removed samba from services that are launched at boot time What else? (logs show `$HOME` as equivalent to /home/kellogs, so it knows where to go...). Oh, and, it used to work fine until I screwed around with samba... http://i.stack.imgur.com/R3mGk.jpg ![enter image description here](http://i.stack.imgur.com/R3mGk.jpg)


How to ignore "certificate is not yet valid" errors

I have systems that sometimes lose time drastically due to low RTC battery voltage such that the system time lies outside these boundaries (`/etc/openvpn/certificate`):               Not Before: Jun 18 16:40:18 2012 GMT     Not After : Jun 16 16:40:18 2023 GMT      I would still like to have these systems connect to the VPN, so I don't get messages like: > Feb 6 13:50:58 hostname ovpn-client[2217]: VERIFY ERROR: depth=1, > error=certificate is not yet valid: > /C=ZA/ST=GA/L=Johannesburg/O=Embedded_IQ/CN=Embedded_IQ_CA/emailAddress=info@example.com I can avoid this problem by simply correcting the datetime on these systems, but it's not always feasible... these are remote systems.


syntax error: unexpected end of file

#!/bin/csh -f          set no=1460     while ("$no">0)     if [$no>900]; then      set m=3     else if ["$no">450 && "$no"<901]; then      set  m=2     else      set m=1     fi     mv *$no.bin test/abc-$m-$no.bin     set no =$no-1     end      I'm a newbie to shell scripts. I'm trying to rename 1460 files using a csh script, but I get a syntax error "syntax error: unexpected end of file" I'm on `tcsh` shell.   I've tried both `fi` and `end` to end the `if` condition. I get the same error.


Linux script for printing name

I have to Prompt the user to enter his/her name and Print all combinations of three letters from the name. How to write script for this?


What is the kernel syntax when booting from ZFS?

I'm trying to write a `grub.cfg` completely from scratch that will boot one of several FreeBSD systems off of a single ZFS pool named `tank` with a set of root file systems named `root1`, `root2`, `root3`. When I look at the official GRUB2 docs, there is one example in 5.3               menuentry "FreeBSD" {               insmod zfs               search --set=root --label freepool --hint hd0,msdos7               kfreebsd /freebsd@/boot/kernel/kernel               kfreebsd_module_elf /freebsd@/boot/kernel/opensolaris.ko               kfreebsd_module_elf /freebsd@/boot/kernel/zfs.ko               kfreebsd_module /freebsd@/boot/zfs/zpool.cache type=/boot/zfs/zpool.cache               set kFreeBSD.vfs.root.mountfrom=zfs:freepool/freebsd               set kFreeBSD.hw.psm.synaptics_support=1     }      I figured that `freepool` is likely the ZFS pool name which I would replace with `tank`. I _suspect_ that the `x@y` syntax is the way to refer to a file `y` on the file system `x` of the pool selected by the `search`. Then I would replace this with `/root1@/boot/kernel/kernel`. Sadly, the `x@y` syntax is undocumented and I don't want to _just try with fingers crossed_ , but rather _understand and know what I'm doing_. Can anyone shed light on this?


Unix commands for generating random alphabet

I have to write a script for this program. choose a random letter within `a-z`. Ask the user to guess the letter, match it with the chosen letter. If matched, display "correct", else prompt if the guessed letter is above or below the chosen letter. Can someone demonstrate with examples of how I might do this in the shell?


The best way to expand glob pattern?

I need to expand a glob pattern (like `../smth*/*`, or `/etc/cron*/`) into a list of files, programmatically. What would be the best way to do it?


Kill backgrounded SSH when shell exits

I'm trying to spawn an SSH from my bash profile script that runs in the background for connection sharing (via its control socket). The problem I'm running into is a reliable way to ensure the SSH doesn't stay running once the TTY is closed (or more directly; once the parent bash shell has exited). I know the shell can run commands (to terminate SSH) when it exits gracefully, but I'm trying to handle all possible scenarios where the shell doesn't get a chance to shut things down. Is there a clever way I can do this? The best idea I've had is               ssh -o PermitLocalCommand=yes -o LocalCommand='cat >/dev/null; kill $PPID' $HOST &      But this won't work because I need the command to only background once it has successfully started. Alternatively, I can't use `-fN` instead of the shell's `&` because the SSH `-f` only backgrounds after the `LocalCommand` has completed. Also I'm trying to avoid running any command on the remote host. Otherwise I could probably do something like `ssh -fN $HOST 'cat >/dev/null'`


Route a local connection via an ethernet link in QNX

I am currently facing a challenge in QNX, where I have 2 Network Interfaces - viz. one Network port from PCIe Ethernet Expansion card (wm0) and other from the normal Ethernet port (en0). I have assigned static IP to both the interfaces, with different subnet. In order to check the throughput speed and performance between the two interfaces, I have connected via loopback connection, which is the current requirement. I basically want to check for 'ping' between the interfaces. But when I ping one IP it gets the ICMP response (which is normal scenario), even when the two Network Interfaces are physically disconnected. Thus, my idea of checking the Network connection between the two interface will fail by this, as it gives the ping response even it is disconnected. In QNX, feature of ping from a specific Network Interface is not there, i.e. " **ping -I {Interface} IP** " is unavailable and I tried using Packet Filtering, but wasnt able to configure as it is Embedded board with lot of limited utilities. My requirement is : If en0 is disabled for receiving, wm0 is disabled for sending, and now I will ping to the IP assigned to wm0, it should work. And the vice versa case to confirm. Any alternative method, or idea to accomplish the above requirement would be of great help?


Bulk rename files with numbering

How do I bulk rename multiple files named _Image401.jpg, Image402.jpg,..._ to _Image 001.jpg, Image002.jpg, ..._ ?


Convert seconds to well format date

I want to display `/proc/uptime` in well format as:               DD:HH:MM:SS      `/proc/uptime` give me up time of system in seconds, is there a standard solution that convert seconds to this format?


free / top difference. Does free show virtual memory?

`free -m` shows me the following in my system:                            total       used       free     shared    buffers     cached     Mem:          3954       3842        111          0        248       2585     -/+ buffers/cache:       1008       2945     Swap:         3811          4       3807      So memory looks pretty used up, but `top` sorted by memory shows the following top-processes:                 PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                                8891 minecraf  20   0 2374m 277m 9.9m S    1  7.0   0:12.21 java                                                                                8704 root      39  19 2802m 272m  11m S    0  6.9   0:28.73 java            The virtual memory used by java seems to be huge, but i learned on the internet that that's not a problem. So i guess my question is: Why does `free` show the virtual memory, if it's not that meaningful?


Finding the latest version of package which doesn't require upgrading libc (on Debian)

When I try to upgrade packages using `aptitude -t wheezy-backports`, they often require newer `libc` than is installed. Proposed solutions remove hundreds of packages. Is there a way to request only the versions which wouldn't require upgrading `libc` (preferably from the command line)?


How can i make usage to print only once

#!/bin/bash          usage ()           {          echo "run with 1st argument                 -mux2 or mux4 or mux8 or default(mux2) or all ( all the 3 mux)"           echo "2nd argument                 -struct or ifs or cases or asgn or default(struct) or all(all the                  conditions)"          echo "3rd argument               -on (waveform) or off (no wave) or default(off)'     echo "run                 - should take mux2 struct off as arguments"     }          if [ "$1" == "mux2" -o "$1" == "mux4" -o "$1" == "mux8" ]; then          if [ "$2" == "struct" -o "$2" == "ifs" -o "$2" == "cases" -o "$2"=="asgn" ]; then            if [ "$3" == "on" ]; then            iverilog -o mux "$1".v  "$1"TB.v -D "$2"             vvp mux            gtkwave T.vcd            elif [ "$3" == "off" -o "$3" == "" ]; then            iverilog -o mux "$1".v  "$1"TB.v -D "$2"             vvp mux            else            usage            fi           elif [ "$2" == "all" ]; then           $0 $1 struct $3           $0 $1 ifs $3           $0 $1 cases $3           $0 $1 asgn $3           elif [ "$2" =="" ]; then           $0 $2 struct $3           else           usage           fi          elif [ "$1" == "all" ]; then          $0 mux2 $2 $3          $0 mux4 $2 $3          $0 mux8 $2 $3          elif [ "$1" == "" ]; then          $0 mux2 stuct          else          usage          fi      The usage is displaying more than once when I run script with the following arguments:               run all jhjjk     run all all kjkj      How can I make usage to print only once?


efivars data missing from procfs and sysfs

I'm trying to install ubuntu on a Tab-X 10.1 Intel WinPad. The UEFI loader only allows booting from 32 bit efi images. Ubuntu only supports UEFI in 64 bit versions. I'm trying to get the 64 bit version of Ubuntu to generate a 32 bit EFI image - I installed `grub-efi-ia32` replacing `grub-efi-amd64`. When reinstalling grub-efi, it complained that:               Fatal: Couldn't open either sysfs or procfs directories for accessing EFI variables.      I checked, and the efivars module is loaded. `/sys/firmware/efi/efivars` exists and is empty. `/sys/firmware/efi/vars` does not exist. I couldn't mount efivarfs because it doesn't seem to be installed. I'm a bit stuck - any Ideas?


How can I make CentOS 6 treating WiFi flexibly like Ubuntu 12.04?

In my office, I have AT&T Uverse. The router is a 2wire 3600HGV. The WiFI is provided by a Cisco Linksys E1000 that is plugged in the 2wire device. With my notebook running Ubuntu 12.04 LTS 64bit, I have both the eth0 (192.168.1.66/24) and eth1 (10.0.0.124/24). Both are managed via DHCP. Whether I have an Ethernet cable plugged in or not, DNS works. I just got a used netbook. I installed CentOS 6.5 on it using a DVD with a minimal desktop. By default the NetworkManager manages the wlan0. DNS works. I manually configured a static IP for the wired interface. As soon as I enabled the interface, DNS stops working. I dug around the system and searched the Internet looking for answers but haven't found a clue. Would be appreciative for any hints.


Why does xdg-open text_file differ from sudo -u me xdg-open text_file?

If I run the following command, the text file opens in my preferred editor (kate).               $ xdg-open text_file      However, if I try the following, where `sparhawk` is my username, I get several warnings, and the jbidwatcher opens instead.               $ sudo -u sparhawk xdg-open text_file      What is the difference? * * * ## Background I have a script triggered by udev that will hence run as root. I'm attempting to open a log file using the user's default editor. Here is some more output that might be helpful.               $ xdg-mime query default text/plain     kate.desktop     $ sudo -u sparhawk xdg-mime query default text/plain     jbidwatcher.desktop     $ sudo -iu sparhawk xdg-mime query default text/plain     jbidwatcher.desktop     $ sudo -Eu sparhawk xdg-mime query default text/plain     kate.desktop     $ sudo -iEu sparhawk xdg-mime query default text/plain     jbidwatcher.desktop      I also attempted testing after `sudo -i`. In all cases, the output was `jbidwatcher.desktop`.


Run a command that is shadowed by an alias

Let's say i have the following alias in bash - `alias ls='ls --color=auto'` - and i want to call ordinary `ls` without options. Is the only way to do that is to unalias, do the command and then alias again? Or there is some nifty trick or workaround?


How to export string about France to Microsoft excel file?

One string file `Str.rc` about French language is here:               ID_STR_BRIGHTNESS;,"Luminosité"     ID_STR_CHILE_EASTER_ISLAND;,"Île de Pâques"     ID_STR_CURRENT_CH;,"Saisie chaîne"     ID_STR_DETAILS;,"Détails"      ...... Now I can export it to a Microsoft `Str.xls` like this:               cat ./Str.rc | sed 's/.*,//g' > ./Str.xls      But it will get,for example,'D茅tails' from 'Détails' in this way. By the way,I try to get the file Str.rc encoding format via command: `enca Str.rc`, and it return as following:               enca: Cannot determine (or understand) your language preferences.     Please use `-L language', or `-L none' if your language is not supported     (only a few multibyte encodings can be recognized then).     Run `enca --list languages' to get a list of supported languages.      So,what can I do for this?


Tcsh: Searching history using Ctrl-P and Ctrl-N

What are the equivalent functions in `tcsh` for the following `zsh` functions?               up-line-or-history     history-beginning-search-backward     down-line-or-history     history-beginning-search-forward      I have the following code in my **,zsh** that I am hoping to translate **in full** to my ".tcsh". The code below is supposed to bind `Ctrl-P` and `Ctrl-N` to such history search functions:               up-line-or-history-beginning-search () {       if [[ -n $PREBUFFER ]]; then         zle up-line-or-history       else         zle history-beginning-search-backward       fi     }     down-line-or-history-beginning-search () {       if [[ -n $PREBUFFER ]]; then         zle down-line-or-history       else         zle history-beginning-search-forward       fi     }               zle -N up-line-or-history-beginning-search     zle -N down-line-or-history-beginning-search          bindkey '^P' up-line-or-history-beginning-search     bindkey '^N' down-line-or-history-beginning-search      Any ideas about what the equivalent `tcsh` code would look like?


How can I alter the appearance of "Qt::IBeamCursor" in ReText?

I'm running Lubuntu 12.10, fully updated. I used `apt-get` to install `ReText 3.1.4`, a **qt** app, and the various recommends. I managed to get the page and font appearance to my liking by using Qt4 settings and CSS. But I cannot change the insertion bar's appearance from minimal width and black to something a little broader and red. The image below shows the more visible cursor (insertion bar) I have in Leafpad text editor (gtk2) as well as the code I used. Can I get the equivalent effect in ReText? ![cursor](http://i.stack.imgur.com/ic1pu.png) I'm guessing what I want to change is described here as the `Qt::IBeamCursor`. So my question would specifically be: can `Qt::IBeamCursor` be modified by an end-user just by using CSS (and not something more technical)? In the context of `ReText`, I have a CSS file here: `~/.config/ReText project/ReText.css` which I've used to customize the color and size of text within `code` and `pre` tags.


network traffic monitor in Debian?

I am using Debian wheezy. I am using a limited connection for Internet with 2.5 GB data limit. So I shouldn't use Internet beyond that limit. are there any available data monitors which can do me such functionality. Thank you.


SSH via Corkscrew to a remote server not working

I am trying to SSH to a remote server from my college network (proxy). However, I am getting this error whenever I try to SSH to the host               ssh_exchange_identification: Connection closed by remote host      Here is the complete description :- Command :-               ssh -vvv root@serverIP -p serverPort      Output :-               OpenSSH_5.9p1 Debian-5ubuntu1, OpenSSL 1.0.1 14 Mar 2012     debug1: Reading configuration data /home/prashant/.ssh/config     debug1: /home/prashant/.ssh/config line 1: Applying options for *     debug1: Reading configuration data /etc/ssh/ssh_config     debug1: /etc/ssh/ssh_config line 19: Applying options for *     debug2: ssh_connect: needpriv 0     debug1: Executing proxy command: exec /usr/bin/corkscrew 144.16.192.213 8080  serverIP serverPort     debug1: identity file /home/prashant/.ssh/id_rsa type -1     debug1: identity file /home/prashant/.ssh/id_rsa-cert type -1     debug1: identity file /home/prashant/.ssh/id_dsa type -1     debug1: identity file /home/prashant/.ssh/id_dsa-cert type -1     debug1: identity file /home/prashant/.ssh/id_ecdsa type -1     debug1: identity file /home/prashant/.ssh/id_ecdsa-cert type -1     debug1: permanently_drop_suid: 1000     ssh_exchange_identification: Connection closed by remote host      My config file contains this               Host *     ProxyCommand /usr/bin/corkscrew 144.16.192.213 8080  %h %p      Can anyone help me in solving this issue ? Thanks !


Extract directory from wget's stdout

I am trying to `wget` a tarball from github.com and, without creating a temporary file, extract a subdirectory from it:               wget -qO- https://github.com/django-nonrel/django-nonrel/tarball/develop | tar xzf - django      It gives me an error saying:               tar: django: Not found in archive     tar: Exiting with failure status due to previous errors      Apparently I am doing something wrong.


What is the best procedure for setting up a triple-boot system?

I have a machine that I wish to install 3 operating systems on. The systems are, in no particular order, Windows 8, Ubuntu, and Backtrack Linux. Is there some document or step-by-step guide to the correct way to partition the drive and bootloader in order to install all 3 operating systems?


Local host always being added to /etc/hosts.deny when trying to SSH

I have a rather odd problem with my server. For some reason the local hostname for my workstation keeps getting added to the `/etc/hosts.deny` and when I try to SSH I get: > ssh_exchange_identification: Connection closed by remote host If I use another workstation and delete my hostname from the file, I have a about a 10 second window to login from my workstation before its added again. My workstation is running Mac OSX Mountain Lion and I'm using `ssh` from the Terminal. Any idea what could be up or how to find out what's up?


Stop a task based on output

I have a task that runs written in Mono, however sometimes (randomly) the Mono runtime will hang after the task is complete and just print:               _wapi_handle_ref: Attempting to ref unused handle 0x2828     _wapi_handle_unref_full: Attempting to unref unused handle 0x2828     _wapi_handle_ref: Attempting to ref unused handle 0x2828     _wapi_handle_unref_full: Attempting to unref unused handle 0x2828     ...      to stderr forever. Is there a way of parsing stderr and killing the task when a certain pattern is matched? A timeout is out of the question because the task can legitimately take upwards of an hour to complete normally, but if there is no work to be done will exit instantly (or at least it's supposed to).


Linux server crash (kernel NULL pointer dereference + soft lockup - CPU#1 stuck)

I have a Linux 3.2.0-4-amd64 #1 SMP Debian 3.2.46-1 x86_64 GNU/Linux server that keeps crashing, usually once every 24-72 hours. I'm running `lighttpd`, `mysql`, `haproxy` and a couple of always-running `java` processes together with a bunch of shorter-lived `java` processes. Below I have linked the `/var/log/syslog` and `/var/log/messages`. They both contain the kernel NULL pointer dereference and the soft lockup bugs lines.   * syslog: http://pastebin.com/7VxdkEYu   * messages: http://pastebin.com/UdiN2y0d Does anyone have any idea on how to debug this?


Adding paths to PATH using a multi-line syntax

As far as I understand, the usual way to add a path to the `PATH` environment variable is by concatenating paths separated by the `:` character. For example, if I want to add three paths to it `/my/path/1`, `/my/path/2` and `/my/path/3`, I would have to do it as follows:               PATH=$PATH:/my/path/1:/my/path/2:/my/path/3      which is not easy to read. Is there a way to **define** or **add** paths to the `PATH` variable using a **multi-line syntax**? Perhaps using arrays? I am looking for something like this:               PATH =      $PATH     /my/path/1     /my/path/2     /my/path/3      In case there are interesting solutions that are shell specific, I am looking for a solution in zsh.


Can't get to desktop

After installing a base command line install of Ubuntu 10.04, I installed slim and xfce which worked fine for the first 2 or 3 reboots. However, now when I start up, it gets to the slim login screen, I enter in my username and press enter, then I just get a black screen with a couple of random looking characters at the top left of the screen. Why might this have started to happen?


Make vim / curl recognize https:// links

I recently noticed vim/vimdiff can open links (using curl, it seems), which is an awesome feature. I wanted to use it today, like this: vimdiff deps https://raw.github.com/symfony/symfony-standard/v2.0.10/deps But the `https://` does not seem to trigger this awesome mechanism too. There is no authentication on this page, I think `https://` is just there to provide data encryption. How can I force vim to recognize the `https://` protocol?


Why do I need to hit enter to get my shell prompt after my init.d script completes?

I had to write my own CentOS init.d script for celery because it only ships with one for Debian. You can see the script I wrote when I answered my own stack overflow question 3989656. But there's a problem with this script. if I invoke it:               sudo service celeryd start      then I need to hit enter to get a shell prompt after it completes. This is a problem because I want to invoke it via ssh from another machine by doing:               ssh 192.168.2.3 sudo service celeryd start      and ssh never returns. (I use fabric to start and stop remote services, and this hangs it because it invokes the ssh command above). What would cause this behavior, and how do I fix it in my script? Note that if I do "sh -x /etc/init.d/celeryd" as recommended by Thomas Themel in the comments, the output is:               runuser -s /bin/bash - apache -c 'ulimit -S -c 0 >/dev/null 2>&1 ; /usr/local/django/portalapps/manage.py celeryd --pidfile /var/run/celery.pid -f /var/log/celeryd.log -l INFO'      I don't understand how the daemon function in /etc/init.d/functions (which is what produces this series of bash commands) actually daemonizes the process.


sbopkg is not working with proxy

Sbopkg used to work on my computer untill the network admin started to make a compulsory for the user to use proxy before connecting to the Internet. So, when I tried to sync to slackbuilds, I'm getting these errors:               root@meh:~# sbopkg -r     Syncing with the remote repository into /var/lib/sbopkg/SBo/13.1.     rsync: failed to connect to slackbuilds.org: Connection timed out (110)     rsync error: error in socket IO (code 10) at clientserver.c(122) [Receiver=3.0.7]          Rsync reported a socket error which may be due to     a problem with the LINK value in sbopkg.conf.     (The repo's LINK is currently set to: slackbuilds.org::slackbuilds/13.1).     Please check your settings and try again later.


What is the most complete MS Word alternative?

I need to edit `*.doc` and `*.docx` files on Linux. What should I use?   * Emulation + MS Office   * OpenOffice   * OpenOffice variants   * Alternatives?


Should I install an antivirus?

Are builtin security features allied to secure user behavior enough to protect a Linux system? Or should I install an antivirus software?


yum installs an old version of cmake

For some reason when I run `yum` to get cmake it will install an older version. Could it be because my repo list is not complete? I'm on CentOS 6 using a minimal desktop install from the non-net install CD. Could anyone give me a repo link or something? Same thing happens on Scientific Linux. I would take compiling it myself as a last resort because I'm trying to ma `yum install cmake` work in a bash script.


Which library files are needed to run a binary with an alternate libc version?

I built Firefox 26 on Mint 16 because the Ubuntu 10.04 build utilities are too old to build it. It does need to run on 10.04, however, since that's the target OS I'm building for. It built and runs just fine on Mint 16. When moving the package over to 10.04 and attempting to run, I get errors because the OS uses a different libc version than Firefox was built against. The actual error is:               /lib/libc.so.6: version `GLIBC_2.17' not found      I've been doing a lot of research trying to solve this, and so far have discovered the following: I can point a binary at an alternate path for library files with               export LD_LIBRARY_PATH="/opt/lib"      I placed the `libc.so.6` from Mint 16 into `/opt/lib` on 10.04 and ran the above command. But after changing that variable, i get:               error while loading shared libraries: __vdso_time:        invalid mode for dlopen(): Invalid argument      Not just for firefox, but for every command, including things like `ls`. A bit more research suggests that I need a _set_ of library files to make this work, not just `libc.so.6`. The problem is, I don't know which ones I need to copy over? Then I discovered `ldd`. `ldd ./firefox` shows:               ./firefox: /lib/libc.so.6: version `GLIBC_2.17' not found (required by ./firefox)         linux-vdso.so.1 =>  (0x00007fffe9289000)         libpthread.so.0 => /lib/libpthread.so.0 (0x00007f80ee456000)         libdl.so.2 => /lib/libdl.so.2 (0x00007f80ee252000)         libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f80edf3d000)         libm.so.6 => /lib/libm.so.6 (0x00007f80edcba000)         libc.so.6 => /lib/libc.so.6 (0x00007f80ed934000)         /lib64/ld-linux-x86-64.so.2 (0x00007f80ee68b000)         libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007f80ed71c000)      And I thought, "maybe I just need to copy all of those on the list". Except I couldn't find a `linux-vdso` anywhere on Mint 16, and it's vdso that is being complained about. So my question is, which libraries do I need to move from Mint 16 to Ubuntu 10.04 into /opt/var, to make Firefox run on 10.04?


Downgrade php version on debian

I have a big problem with my sites after I migrated to a new server.   The only difference is the php version. On the old server I have `5.3.3-7+squeeze15` and on the new server there is `5.3.3-7+squeeze17`. Can I downgrade to the older version? If so then how? The distro I'm using is Debian Squeeze 6.0.8.


Invoking PolicyKit/polkit via xinit/startx?

I recently upgraded a minimal installation of Ubuntu (with no full-fledged DE) from precise to saucy and since doing so I'm no longer able to mount removable drives as a normal user. I googled a bit and found it's something related to policykit... but I can't find any example of how to invoke policykit in an .xinitrc file, i.e., without using a display manager. Also, the Ubuntu repos have the following packages:               lxpolkit     policykit-1     policykit-1-gnome     policykit-desktop-privileges      and they each have similar descriptions, so I'm not even sure which of them I should install. Does anyone using startx/xinit to start X have a working config with policykit and/or instructions they can share?


Check if folder is a mounted remote filesystem

What is the best way (reliable, portable, etc.) to check if a given folder is on a mounted remote (nfs) filesystem within a shell script? I am looking for a command that would look like:               chk-remote-mountpoint /my/path/to/folder


How to connect to Wi-Fi network in Arch Linux?

tl;dr After reading the Arch wiki articles on installation, wireless setup and WPA supplicant, trying the suggestions below and a host of forum threads, I'm unable to get _either_ of the following cards to connect to my wireless network when booting the Arch Linux 2013-09-01 ISO:   * Edimax Technology Co., Ltd EW-7811Un 802.11n Wireless Adapter (ID 7392:7811)   * Realtek Semiconductor Corp. RTL8192CU 802.11n WLAN Adapter aka. Bolse® 300Mbps Wifi Wireless N USB Micro Mini Adapter (ID 0bda:8178) * * * Approach 1 (default): The default way of doing this is supposed to be just `systemctl stop dhcpcd.service` followed by `wifi-menu`. It finds the network:               [SSID] + wpa 10      After a timeout it reports that the connection failed. If I run `wifi-menu` a _second_ time it doesn't ask for a password, but when finished it finally gives some debug hints:               Job for netctl@wlp0s29f7u5\x2dBTHub4\x2dGRK6.service failed. See 'systemctl status netctl@wlp0s29f7u5\x2dBTHub4\x2dGRK6.service' and 'journalctl -xn' for details.      The former reports that the service is "loaded" but not "active" (literally `inactive (dead)`). The latter says:               WPA association/authentication failed for interface 'wlp0s29f7u5'      Does this mean the key in `/etc/netctl/wlp0s29f7u5-BTHub4-GRK6` is wrong? I can't tell when programs want the _actual_ Wi-Fi password and when they want something like the `psk` value from `wpa_passphrase` (`man 5 netctl.profile` doesn't say, for example). * * * Approach 2 (`wpa_supplicant` and `wpa_passphrase` as per deeraf and warl0ck's suggestions and the wiki page):               # echo 'ctrl_interface=/var/run/wpa_supplicant' > wifi.conf     # wpa_passphrase essid passphrase >> wifi.conf     # wpa_supplicant -B -i interface -c wifi.conf     Successfully initialized wpa_supplicant     # dhcpcd -A interface     [...]     timed out     exited      * * * I tried connecting with `iw` directly, but got some strange output:               # iw dev wlp0s26f7u5 connect [SSID]     command failed: Operation not supported (-95)


How to install software from Arch boot disk to existing Arch system?

I've got an existing Arch Linux installation. After booting from the installation media, is there some way to install software either from the installation media or using the network I've set up using the installation media (that is, without setting up networking again after an `arch-chroot`)? The use case is that my installation with the base system doesn't seem to have the `wireless_tools` package installed which seems to be necessary to get a wireless connection. Since setting up a wired connection is infeasible at the moment, it would be great to use the boot disk for this.


Can I `ls` all files in a directory from "1", "2",...,"9", "10", "11", ..., "20", "21", ...?

I have a directory with files named "1", "2",...,"9", "10", "11", ..., "20", "21", ... inside. Can I list them in the order of "1", "2",...,"9", "10", "11", ..., "20", "21", ...? I have tried `ls -ls`. It doesn't list the files that way, but instead "1", "10", "11", ..., "19", "2", "20", "21", .... I guess a feature like that will be helpful sometimes.


Syntax of DISPLAY=:0 unity --replace or DISPLAY=:0 compiz --replace

Why don't the commands have a & between the setting of DISPLAY and running unity or compiz. I understand that both work (re-starting unity or compiz), but fail to see why are they the way they are.


How can I trap a program that returns 139 (segmentation fault) in bash?

I have a bash script that tests some programs and one of the program returns `Segmentation fault` so I tried to add a trap in the head of my script:               trap "echo 'segfault occured!'" SIGSEGV      That however didn't do anything. I used               echo $?      just after the program that produces the segfault and I get **139** as output. How can I add a trap for that specific error code?


Xen HW virtualization on Power architecture?

https://en.wikipedia.org/wiki/Xen#Hardware- assisted_virtualization.2C_allowing_for_unmodified_guests The wikipedia page says Xen has HW virtualization for Intel and AMD CPU's. **Q:** Does Xen supports HW virtualization on Power architecture? ps.: regarding: http://www.zdnet.com/ibm-and-linux-the-next-billion- dollars-7000020757/


I started an upgrade of my Kubuntu 12.04 system with this command, as usual:               sudo apt-get --show-upgraded dist-upgrade      I came back later and it had failed:               Preconfiguring packages ...     (Reading database ... 478306 files and directories currently installed.)     Preparing to replace  ...     Unpacking replacement base-files ...     Processing triggers for man-db ...     Processing triggers for install-info ...     ...     Processing triggers for initramfs-tools ...     update-initramfs: Generating /boot/initrd.img-3.8.0-32-lowlatency          gzip: stdout: No space left on device     E: mkinitramfs failure cpio 141 gzip 1     update-initramfs: failed for /boot/initrd.img-3.8.0-32-lowlatency with 1.     dpkg: error processing initramfs-tools (--unpack):      subprocess installed post-installation script returned error exit status 1     Errors were encountered while processing:      initramfs-tools     E: Sub-process /usr/bin/dpkg returned an error code (1)      here's the problem: $ df -h output:               Filesystem                    Size  Used Avail Use% Mounted on     /dev/sda1                     894M  879M     0 100% /boot      manually deleted older files and now some space is free               Filesystem                    Size  Used Avail Use% Mounted on     /dev/sda1                     894M  129M  717M  16% /boot      I ran this next:               sudo apt-get autoremove      Next: `sudo apt-get -f install` output:               The following extra packages will be installed:       initramfs-tools     The following packages will be upgraded:       initramfs-tools          dpkg: dependency problems prevent configuration of initramfs-tools:      initramfs-tools depends on initramfs-tools-bin (<< 0.99ubuntu13.3.1~); however:       Version of initramfs-tools-bin on system is 0.99ubuntu13.4.     dpkg: error processing initramfs-tools (--configure):      dependency problems - leaving unconfigured     No apport report written because the error message indicates its a followup error from a previous failure.                              Errors were encountered while processing:      initramfs-tools     E: Sub-process /usr/bin/dpkg returned an error code (1)      `sudo apt-get install initramfs-tools`   the above fails `dpkg -l initramfs-tools` output:               Desired=Unknown/Install/Remove/Purge/Hold     | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend     |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)     ||/ Name           Version        Description     +++-==============-==============-============================================     iF  initramfs-tool 0.99ubuntu13.3 tools for generating an initramfs      `sudo apt-get install --reinstall initramfs-tools` output:               The following packages will be upgraded:       initramfs-tools     1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.     1 not fully installed or removed.     Need to get 0 B/49.2 kB of archives.     After this operation, 0 B of additional disk space will be used.     dpkg: dependency problems prevent configuration of initramfs-tools:      initramfs-tools depends on initramfs-tools-bin (<< 0.99ubuntu13.3.1~); however:       Version of initramfs-tools-bin on system is 0.99ubuntu13.4.     dpkg: error processing initramfs-tools (--configure):      dependency problems - leaving unconfigured     No apport report written because the error message indicates its a followup error from a previous failure.                              Errors were encountered while processing:      initramfs-tools     E: Sub-process /usr/bin/dpkg returned an error code (1)      Here is the output of `apt-cache policy initramfs-tools-bin initramfs-tools`:               initramfs-tools-bin:       Installed: 0.99ubuntu13.4       Candidate: 0.99ubuntu13.4       Version table:      *** 0.99ubuntu13.4 0             500 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages             100 /var/lib/dpkg/status          0.99ubuntu13 0             500 http://us.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages     initramfs-tools:       Installed: 0.99ubuntu13.3       Candidate: 0.99ubuntu13.4       Version table:          0.99ubuntu13.4 0             500 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages      *** 0.99ubuntu13.3 0             100 /var/lib/dpkg/status          0.99ubuntu13 0             500 http://us.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages      As suggested below, here are my next steps:               $ sudo apt-get update     $ sudo apt-get -f install initramfs-tools=0.99ubuntu13 initramfs-tools-bin=0.99ubuntu13          Reading package lists... Done     Building dependency tree            Reading state information... Done     The following packages were automatically installed and are no longer required:       ...     Use 'apt-get autoremove' to remove them.     The following packages will be DOWNGRADED:       initramfs-tools initramfs-tools-bin     0 upgraded, 0 newly installed, 2 downgraded, 0 to remove and 4 not upgraded.     1 not fully installed or removed.     Need to get 59.2 kB of archives.     After this operation, 2,048 B disk space will be freed.     Do you want to continue [Y/n]?      Get:1 http://us.archive.ubuntu.com/ubuntu/ precise/main initramfs-tools all 0.99ubuntu13 [49.2 kB]     Get:2 http://us.archive.ubuntu.com/ubuntu/ precise/main initramfs-tools-bin amd64 0.99ubuntu13 [9,988 B]     Fetched 59.2 kB in 0s (124 kB/s)                 dpkg: warning: downgrading initramfs-tools-bin from 0.99ubuntu13.4 to 0.99ubuntu13.     (Reading database ... 478624 files and directories currently installed.)     Preparing to replace initramfs-tools-bin 0.99ubuntu13.4 (using .../initramfs-tools-bin_0.99ubuntu13_amd64.deb) ...     Unpacking replacement initramfs-tools-bin ...     Setting up initramfs-tools-bin (0.99ubuntu13) ...     dpkg: dependency problems prevent configuration of initramfs-tools:      initramfs-tools depends on initramfs-tools-bin (>= 0.99ubuntu13.3); however:       Version of initramfs-tools-bin on system is 0.99ubuntu13.     dpkg: error processing initramfs-tools (--configure):      dependency problems - leaving unconfigured     No apport report written because the error message indicates its a followup error from a previous failure.                              Errors were encountered while processing:      initramfs-tools     E: Sub-process /usr/bin/dpkg returned an error code (1)      Next I tried Giles's suggestion:               sudo dpkg --configure -a --force-depends     sudo apt-get install -f     sudo apt-get dist-upgrade      **Result: it is solved! Thanks!**


How to change which program is executed by default

Surely this is an easy question, that I just don't know how to search for, but if I have two identically named executable files, one in _/usr_ and one in _/usr/local_ (for example), how can I change which one is executed by default without specifying the path, as in _/usr/local/file_ , if `$ which` returns _/usr_? Centos6.4 btw.


Gnome3/cinnamon set keyboard shortcut

I cannot find where I can set keyboard shortcut for switching languages. **Update:**   New problem: I cannot set `Alt`+`Shift` combination for that.


Why I cannot download pdf files?

I use Debian (Linux) and since some day I cannot download any `.pdf` file. I don't know if it's because of the web browser (I'm using Epiphany and the other ones do not work). I don't know how to use the terminal properly, so any simple answer would be welcome.


Can't connect to a wireless network in Arch Linux netctl

I just installed arch linux on my laptop.   But after rebooting, I can't connect to the internet.   Wi-fi is the only available connection to me.   I used the command wifi-menu then after choosing my wifi and entering my passkey, I still can't connect to the internet.   This is the error I got:   > Job for netctl@wlp6s0\x2dWifi.service failed. See 'systemctl status > netctl@wlp6s0\x2dWifi.service' and 'journalctl -xn' for details.   > This the output after running systemctl status netctl@wlp6s0\x2dWifi.service > netctl@wlp6s0\x2dWifi.service - Networking for netctl profile wlp6s0x2dWifi   >  Loaded: loaded (/usr/lib/systemd/system/netctl@.service; static   >  Active: inactive (dead)   >  Docs: man:netctl.profile(5) Please help. I tried to follow the wiki for netctl but it doesn't work. Maybe i just missed something.


Sound is staticy on Squeeze

I have recently setup a Debian Squeeze virtual machine, which uses OpenBox, via VirtualBox and got things work somewhat right, but I am having issues with sound. When I launch Google Chrome, which is the only browser I have in the VM, and go to YouTube, in order to test the sound via a video, everything sounds staticy. How do I get rid of the static? This is what the machine reports to be the sound card > 00:05.0 Multimedia audio controller: Intel Corporation 82801AA AC'97 Audio > Controller (rev 01)


The -F option for ls

For command `ls`                  -F, --classify               append indicator (one of */=>@|) to entries      Wikipedia says `*` represents executable and `/` dir. Regular files are not followed by any of the above symbols. But `*` follows text file and pdf file too. Are they executables? Do the `-F` indicators always mean same as the first field in `-rwxrwx---`? It seems like there is no difference between hardlinks and the files in either the `-F` indicators or the first field in `-rwxrwx---`. How do you distinguish them? Thanks.


Will a '*' (star) in globbing match only characters (i.e , a-z and 0-9)?

I havie a simple question here: does a `*` (star wildcard) match only characters (letters and numbers) in glob style? Or will it also match special characters? In bash, `*` matches everything, while in csh `*` it matches only alphanumeric characters. Is there any rule of compatibility for this? Can anyone clarify?


Using port 587 with sendmail

I have been using sendmail to send out mails using internally available mail server. But currently port 25 is blocked for security reasons. I would like to know if there is a way to specify port number in the sendmail utility. I am trying to make use of the secure SMTP-MSA port 587 as an alternative assuming I could get that port opened up. I was not able to find anything in the man pages for sendmail. Is there any alternate utility that could do this?


Running a command without ./

I am trying to understand something that might be very simple for a lot of you but is quite puzzling from me as a daily Windows user. I am following the docker installation on Mac OS X. One of the steps is:               $ chmod +x boot2docker      The next step is using boot2docker like this:               $ boot2docker init      However this does not work for me. What works is:                $ ./boot2docker init      So the tutorial assumes that I need to implicitly run with `./` or is there a way in bash to avoid typing that and execute something?


Mac Terminal - moving files

I am trying to use Mac Terminal command to move files to a new location. I have a list of almost 2000 filenames with full paths in a text file. (All of them are in one parent directory, but distributed within multiple sub- directories.) I want to move these files into a single folder outside the parent directory. How do I do this? I need the command to do something like this:               mv 'files listed in abc.txt' to destination      Thanks in advance.


how to make getopts just read the first character post `-`

I have a shell script `testShell.sh` which uses `getopts` as below:               #!/bin/bash     while getopts ":j:e:" option; do         case "$option" in             j) MYHOSTNAME=$OPTARG ;;             e) SCRIPT_PATH=$OPTARG ;;             *) ;;         esac     done          echo "j=$MYHOSTNAME"     echo "e=$SCRIPT_PATH"     shift $((OPTIND - 1))     echo "remaining=$@"      When I test run it like following:               $ testShell.sh  -jvalue1 -evalue4 -Djvalue3  -pvalue2      The output which I get is following:               j=value3     e=2     remaining=      But I would like the output as:               j=value1     e=value4     remaining=-Djvalue3 -pvalue2      **Is it possible to make sure that** `getopts` **only looks at first character post** `-` **symbol?** so that it doesn't interpret `-Djvalue3` as `-jvalue3` and `-pvalue2` as `-e2`.


Print a multiline variable in a column

I have a script that collects values from a cluster. The values, in some cases, have multiple lines. I have a printf format that specifies how the data should be positioned however, it doesn't take into account multiple lines and therefore the spacing is skewed.               The data should look like this:          Service Group          AutoStart List          System List     foo                    sys1                    sys1                            sys2                    sys2      Instead it looks like this               Service Group          AutoStart List          System List     foo                    sys1                         sys2                    sys1     sys2      The AutoStart List and System List should be identical, however regardless of that fact I've not figured out how to force the values into the correct columns.               sgheader="\n\033[4m\033[1m%-30s %-30s %-15s\033[0m\033[0m"     sgformat="\n%-30s %-30s %-15s"                    printf "${sgheader}" "Service Group" "Autostart List" "System List"      printf "${sgformat}" "${svcgroup}" "${autostrtlist}" "${hosts}"


Use CTRL-SPACE to open menu on Linux Mint

I'd like to use the keyboard shortcut `CTRL` + `SPACE` to open/close the Linux Mint menu (similar to how `Command` + `SPACE` is used on OS X to show/hide Spotlight). I tried going to Settings -> Keyboard -> Shortcuts -> Cinnamon and setting `CTRL` + `SPACE` for the key "Menu button". Upon restarting, the key combination doesn't work at all. This is a vanilla install of Linux Mint 17.


I, actualy, don't know where to ask this, but this can be related to Linux. **Firefox on Arch Linux always asks about download destination** , even if there's a default download destination folder set up through options interface or even about:config. **How can I fix that?** _Additional info:_ It's been normal till 22.0. I've tried to re-create profile or even create new, clean one, and try there and still got the same problem. I've also tried to ask this question on #firefox @ freenode, but haven't got any reply.


Virtual box for centos PAE

I am trying to get virtualbox to install on a very touchy box. It keeps complaining. /etc/init.d/vboxdrv setup KERN_DIR=/root/linux-2.6.18.5 That runs and gives this error:               Attempting to install using DKMS          Creating symlink /var/lib/dkms/vboxhost/4.1.0/source ->                      /usr/src/vboxhost-4.1.0          DKMS: add Completed.     You can use the --kernelsourcedir option to tell DKMS where it's located.     Failed to install using DKMS, attempting to install without     make KBUILD_VERBOSE=1 SUBDIRS=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 -C /root/linux-2.6.18.5 modules     test -e include/linux/autoconf.h -a -e include/config/auto.conf || (            \             echo;                                                           \             echo "  ERROR: Kernel configuration is invalid.";               \             echo "         include/linux/autoconf.h or include/config/auto.conf are missing.";      \             echo "         Run 'make oldconfig && make prepare' on kernel src to fix it.";  \             echo;                                                           \             /bin/false)            ERROR: Kernel configuration is invalid.              include/linux/autoconf.h or include/config/auto.conf are missing.              Run 'make oldconfig && make prepare' on kernel src to fix it.          mkdir -p /tmp/vbox.0/.tmp_versions     rm -f /tmp/vbox.0/.tmp_versions/*            WARNING: Symbol version dump /root/linux-2.6.18.5/Module.symvers                is missing; modules will have no dependencies and modversions.          make -f scripts/Makefile.build obj=/tmp/vbox.0       gcc -m32 -Wp,-MD,/tmp/vbox.0/linux/.SUPDrv-linux.o.d  -nostdinc -isystem /usr/lib/gcc/i386-redhat-linux/4.1.2/include -D__KERNEL__ -Iinclude  -include include/linux/     autoconf.h -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -O2 -pipe -msoft-float -mpreferred-stack-boundary=2  -ffreestanding -Iincl     ude/asm-i386/mach-default -fomit-frame-pointer  -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign -include /tmp/vbox.0/include/VBox/SUPDrvMangling.h      -I/root/linux-2.6.18.5/include -I/tmp/vbox.0/ -I/tmp/vbox.0/include -I/tmp/vbox.0/r0drv/linux -I/tmp/vbox.0/vboxdrv/ -I/tmp/vbox.0/vboxdrv/include -I/tmp/vbox.0/vboxd     rv/r0drv/linux -D__KERNEL__ -DMODULE -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -DVBOX_WITH_HARDENING -DCONFIG_VBOXDRV_AS_MISC -DRT_ARCH_X86      -DVBOX_WITH_64_BITS_GUESTS   -DMODULE -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(SUPDrv_linux)"  -D"KBUILD_MODNAME=KBUILD_STR(vboxdrv)" -c -o /tmp/vbox.0/linu     x/SUPDrv-linux.o /tmp/vbox.0/linux/SUPDrv-linux.c     cc1: error: include/linux/autoconf.h: No such file or directory      Is there anyone with experience compiling linux kernels (and hopefully virtualbox) that could help me with this?


Terminal application erased from Ubuntu 13

I had a bit of rough time with Ubuntu yesterday when the home screen went blank and no program icons or sidebars were visible. Today after recovering from it and saving the essential data, I have found that the terminal applications packed with Ubuntu has erased itself from applications and instead new terminal applications called UXTerm and xTerm have appeared in its place. They do almost the same job but have many limitation such as not being able to copy and paste from terminal screen. I really want to get back my old terminal application :(


Change the DNS server in etisalat USB modem

I need to use the open DNS : 208.67.222.222,208.67.220.220 in my network connection. I use etisalat 3.75 USB modem HUAWEI in my Ubuntu 12.04 PC. I had tried to add this DNS in : > /etc/network/interfaces > > /etc/resolv.conf with no success.


Debian Wheezy problem with packages and architectures

I recently installed Debian wheezy on my desktop PC. Here is the `uname -a` command:               Linux devnet 3.2.0-4-amd64 #1 SMP Debian 3.2.46-1+deb7u1 x86_64 GNU/Linux      Once the installation finished, I started installing some packages (chromium and JAVA7), but I've come across a problem and I don't know how to solve it. When trying to install chromium, I get the following error:               caled@devnet:~$ sudo apt-get install chromium      Then asks for password and lists packages to be installed, everything fine. But then I get:               /bin/sh: 1: /usr/sbin/dpkg-preconfigure: not found     dpkg: error processing /var/cache/apt/archives/libc-bin_2.13-38_amd64.deb (--unpack):      package architecture (amd64) does not match system (i386)     Errors were encountered while processing:      /var/cache/apt/archives/libc-bin_2.13-38_amd64.deb     E: Sub-process /usr/bin/dpkg returned an error code (1)      Ok, from that I get that it is having a problem installing the libc-bin package for the amd64 architecture, but that is the correct architecture for my PC, uname -a says so. I've tried multiple approaches: allowing i386 packages               sudo dpkg --add-architecture i386      Also installing dependencies:               sudo apt-get -f install      I also thought that it might be a trouble with my locales, but I generated my locales as root:               locale-gen      Finally, I gave it a shot by installing just the `libc-bin` package using synaptic, but still nothing has worked. Any ideas what I could be missing? Any help will be greatly appreciated, stating to feel frustrated...


Grub v2: kernel "has invalid signature"

Can somebody explain what this exact error message means?               grub> linuxefi /boot/i386/loader/linux     error: /boot/i386/loader/linux has invalid signature.      What is Grub trying to tell me? That the file isn't a valid ELF binary? Or that it isn't 64-bit? Or something else? (This is Grub v2.00, not Grub Legacy.)


Most innocuous package to install to test yum?

I'm trying to test yum is working in CentOS from a local repo. To do this I need a package that:   1. Isn't already installed with standard OS install   2. Is small in size   3. Has few or no dependencies   4. Doesn't affect everyday operation of OS or perform anything in the background   5. Is available in the standard repo So what package could I yum that would meet these criteria?


Using UART bluetooth module via hciattach

I have a bluetoothmodule here on my UART and would like to use it via hciattach. It is a KC21v6.3 Module from kc-Wirefree. As far I found out, it has a CSR-Chip on it. So is tried the following:               # hciattach -n -s 115200 /dev/ttyS0 csr      That gives me a "Initialization timed out." If I try the same with the type "any" it works so far that I get a "Device setup complete".               # hciconfig      gives me a:               hci0:   Type: BR/EDR  Bus: UART             BD Address: 00:00:00:00:00:00  ACL MTU: 0:0  SCO MTU: 0:0             DOWN              RX bytes:22 acl:0 sco:0 events:0 errors:0             TX bytes:150 acl:0 sco:0 commands:30 errors:0      But after that, when i try to               # hciconfig hci0 up      I always get an               Can't init device hci0: Connection timed out (110)      I have no idea what to try any-more. Don't I have to specify the "csr" chip? Or does it have anything to do with the firmware of my KC21 (it understands AT Commands and also has an "AT HciMode" Command) ... I already tried this one before using the "hciattach" command, but nothing changed. Any help would be appreciated. kindly regards Tom


Which drive had a "journal commit I/O error"?

I received a message:               kernel:[123456.789012] journal commit I/O error      Which disk drive had the journal error?


What does lo in iptables mean exactly?

I have seen countless examples of this rule in iptables:               -A INPUT -i lo -j ACCEPT      I thought `lo` means localhost (a.k.a. `127.0.0.1`), but when I commented it out, I can't access the server using its private ip address `192.168.1.3`, which means it is more than just localhost. Further, does this rule refers to the source ip, destination ip, or both. Meaning, if I were to spoof a source coming from `127.0.0.1`, would it be accepted? I tried looking in the man page but could not find an answer to this. It would be helpful if someone can point to me in the right direction.


-bash: pkcs12: command not found

I am trying to export the private key and certificate to p12 file using below command in my mac os X - Mountain Lion:               pkcs12 -export -out privkey.pem -inkey privkey.pem -in rsaCert.crt      but I am getting this error: > -bash: pkcs12: command not found To verify if it is there or not, I typed below man command:               man pkcs12      which is showing appropriate manual page. Any ideas?


Using the Echo Command with Sleep command

So I asked a question on here a few weeks ago and the response I got was helpful but I figured I would add some info to get a better response. I work with a computer system that has 8 servers (4 primary 4 alternates) and has 16 nodes on those servers (4 on each server with the same on each alternate). The nodes can't load until the servers come online. So I have been writing 2 lines of codes that are separate until I can figure out how to connect them together.               for i in `echo server1; echo server2; echo server 3; echo server4; echo server5; echo server6; echo server7; echo server8`; do     echo $i     /remcmd $i username password 'superuser /reboot'     echo     done      Then my second command would be               for i in `echo node1; echo node2; echo node3; echo node4; echo node5; echo node6; echo node7; echo node8; echo node9; echo node10; echo node11; echo node12; echo node13; echo node14; echo node15; echo node16     /remcmd $i username password 'superuser /reboot'      Is there a way to reboot the servers then wait for 9 minutes then to reboot the nodes. I have tried piping but did some research and it doesn't like it. Any help anyone could give, I would appreciate it.


Is there a limit of GPIOs that can be used in Linux?

When it comes to use GPIOs, is there a limited number that can be used in Linux (except through the limitation of the physical availability/amount of the ports/pins) or is it theoretically possible to use an infinite number of GPIOs in my program(s)?


Linux iptables DNAT 53306 to 127.0.0.1 3306

mysql real port is `3306`。 I want public network using `53306` to visit mysql, and `3306` is not allowed access from public network. How to write the iptables rules `DNAT 53306 to 127.0.0.1 3306`?


In meminfo, sometimes Mapped more than Cached

In `/proc/meminfo`, AFAIK > Cached >= Mapped But after `/proc/sys/vm/drop_caches`, it goes to > Cached < Mapped               Cached:            66132 kB     Mapped:            67792 kB      `/proc/meminfo` contents after:               MemTotal:         369020 kB     MemFree:           34588 kB     Buffers:             184 kB     Cached:            66132 kB     SwapCached:            0 kB     Active:           246624 kB     Inactive:          29688 kB     Active(anon):     209728 kB     Inactive(anon):     9920 kB     Active(file):      36896 kB     Inactive(file):    19768 kB     Unevictable:          12 kB     Mlocked:              12 kB     HighTotal:             0 kB     HighFree:              0 kB     LowTotal:         369020 kB     LowFree:           34588 kB     SwapTotal:             0 kB     SwapFree:              0 kB     Dirty:                 4 kB     Writeback:             0 kB     AnonPages:        210040 kB     Mapped:            67792 kB     Shmem:              9644 kB     Slab:              27520 kB     SReclaimable:       7500 kB     SUnreclaim:        20020 kB     KernelStack:        3160 kB     PageTables:         5004 kB     NFS_Unstable:          0 kB     Bounce:                0 kB     WritebackTmp:          0 kB     CommitLimit:      184508 kB     Committed_AS:    1832660 kB     VmallocTotal:     499712 kB     VmallocUsed:        2708 kB     VmallocChunk:     417128 kB      Anyone know this issue?


UNIX: Submit job only after previous job completes?

I would like to submit the same .sas job iterating over an argument, but I would like job only to be submitted after the previous is completed. Here is my attempt:                   #!/bin/ksh              export weeks="1 2 3"         for week in $weeks         do              sas -log job$week.log job.sas > /dev/null & pid_ind=$!         wait $pid_ind              echo "job complete for week $week"         done      This results in all the jobs being submitted almost at once, and then they sit in the queue. Can anyone elaborate on the 'wait' command? I am trying to hold off submission until the previous SAS job was _completed_ , not submitted.


Should apache still be making error_log files?

I have a VirtualHost set up like this               <VirtualHost my.ip.address.here:80>        DocumentRoot /home/todieama/public_html/dev/hop/public_html/        ServerName dev.example.com        ServerAlias dev.example.com        ErrorLog /home/todieama/public_html/dev/hop/public_html/application/logs/apache.log        ServerAdmin some@example.com        UserDir enabled todieama        <IfModule mod_suphp.c>          suPHP_UserGroup todieama todieama        </IfModule>     </VirtualHost>      When a PHP error is caught, it gets logged in the apache.log file defined above, and also in error_log in dev/hop/public_html. Should it still be logging here? I'd like to stop if it's possible.


Nginx with ngx_pagespeed (Ubuntu)

I need to install nginx with ngx_pagespeed. I use this instruction: https://github.com/pagespeed/ngx_pagespeed#how-to-build But when I finish installation, nginx file here:               /usr/local/nginx/sbin/nginx     /usr/local/nginx/conf/nginx.conf     /usr/local/nginx/logs/nginx.pid      And I've no nginx start script here:               /etc/init.d      And I can't run nginx like this:               service nginx start      And no nginx autorun. If I install nginx like this:               sudo apt-get install nginx      Nginx location:               /usr/sbin/nginx     /etc/nginx/nginx.conf     /run/nginx.pid      I can start nginx like this:               service nginx start      And nginx autostart after server rebooting and nginx process owner www-data. My question. Is it possible to install nginx with ngx_pagespeed but like standard configuration?:   1. Locations: /usr/sbin/, /etc/nginx/, /run/   2. Starting "service nginx start/restart/stop"   3. Autoload process after server rebooting   4. Use process owner www-data


Moving Older Version Files to another folder via a script

I am trying to find a way of getting my cmd script to look through my folder, find the older versions of the pdf docs in the folder and move them to another folder called older versions. Problem I am having is the name of the file changes with the version. IE DE-321-DLS-R04.pdf has become DE-321-DLS-R05.pdf I am not to sure where to start. I have seen scripts that use the date but filenames are different. Please help.


telnet :pressed Enter key, there were two carriage returns in the text

When using Putty to connect to the router using telnet protocols, and then I pressed Enter key, there were two carriage returns in the text, how do I get rid of one of them?


Putty use local internet proxy for remote machine

Is there a way you can use your local internet proxy for remote computer with tunneling via SSH. My machine has access to internet via proxy. But the remote computer does not. I don't have admin rights there. Here is the schematic :               Internet   Internet        /\         /\        ||         ||       proxy       XX        ||         ||        \/         \/        A<---SSH--->B      What I think I need to do is I have to remote port forward to a local port then forward that port to my proxyurl. What settings should be done in putty to make this work. Can anyone help.


Upgrading dpkg on 64-bit debian

Recently I tried to install Steam on my debian, but I ran into a problem. It requires `dpkg` version `1.16.2` (for multiarch) but the one installed on the system is `1.15.8.13` The problem is that running `apt-get install dpkg` tells me that `dpkg` is the newest version. My searches yielded absolutely nothing about this issue My machine:               Linux xel 2.6.32-5-amd64 #1 SMP Fri Feb 15 15:39:52 UTC 2013 x86_64 GNU/Linux      My sources.list:               # deb cdrom:[Debian GNU/Linux 6.0.6 _Squeeze_ - Official amd64 NETINST Binary-1 20120930-15:53]/ squeeze main          # deb cdrom:[Debian GNU/Linux 6.0.6 _Squeeze_ - Official amd64 NETINST Binary-1 20120930-15:53]/ squeeze main          #deb http://http.us.debian.org/debian/ squeeze main non-free contrib     #deb-src http://http.us.debian.org/debian/ squeeze main non-free contrib          #deb http://security.debian.org/ squeeze/updates contrib non-free     #deb-src http://security.debian.org/ squeeze/updates contrib non-free #Added by software-properties     #deb-src http://http.us.debian.org/debian/ squeeze/updates main contrib non-free          ## squeeze-updates, previously known as 'volatile'     #deb http://ftp.sk.debian.org/debian/ squeeze-updates main contrib non-free     #deb http://ftp.sk.debian.org/debian/ squeeze main contrib non-free     #deb-src http://ftp.sk.debian.org/debian/ squeeze main contrib non-free #Added by software-properties     #deb-src http://ftp.sk.debian.org/debian/ squeeze-updates main contrib non-free          deb http://ftp.sk.debian.org/debian stable main contrib non-free     deb-src http://ftp.sk.debian.org/debian stable main contrib non-free          deb http://ftp.debian.org/debian/ squeeze-updates main contrib non-free     deb-src http://ftp.debian.org/debian/ squeeze-updates main contrib non-free          deb http://security.debian.org/ squeeze/updates main contrib non-free     deb-src http://security.debian.org/ squeeze/updates main contrib non-free


"emacs: standard input is not a tty" when starting Emacs at login

I have Fedora 20 and Gnome3 classic, and I am trying to use the CTRL/ALT/Fn terminal windows. When I want to edit a file with emacs I use the following script so that my Hints file is automatically displayed and emacs is run as a backgound job. This works fine in the non-login terminal from Gnome desktop applications, but in the log-in terminal I get error messages: (obtained by redirection with '&> e' in the CTL/ALT/F2 window)                   home/Harry/bin/emx: line 4: t: Permission denied           +---------------------------------------------------+           | EmacsHints.txt found and displayed                |           | Usage: ./emx <filename> ..                        |           |   .. Opens EmacsHints.txt and <filename> in emacs |           +---------------------------------------------------+         emacs: standard input is not a tty      Please can someone explain these, and tell me how to avoid them and use the emx script (no doubt modified) successfully in both log-in and non log-in terminals? Revised version of my emx script, I have include my notes and debugging stuff:               #!/bin/sh     emxhn="EmacsHints.txt"     emxhf="/home/Harry/emacs/$emxhn"     ps aux | grep $emxhn > t     T=`wc -l t` # no spaces allowed between T and = and value     # echo $T     wc -l t > t1     T=`awk '$1' t1`     # echo $T          echo "+---------------------------------------------------+"          # In the test "" needed round $T else it is split into two commands ..     # .. so are the spaces after [ and before ]     # could be if ( [...] ) then or if [...] ; then      if [ "$T" = "2 t" ]; then      #  echo "+----------------------------------------------+"      echo "| $emxhn already present"\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \  "|"     else      emacs $emxhf &      echo "| $emxhn found and displayed"\ \ \ \ \ \ \ \ \ \ \ \ \ \ \  "|"     fi          if [ "$#" = "1" ]; then      emacs $1 &     else      echo "| Usage: ./emx <filename> .." \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \  "|"      echo "|" \   ".. Opens $emxhn and <filename> in emacs" "|"     fi            echo "+---------------------------------------------------+"      Yes, I see, I have fallen into the X-Y trap, asking X when I should have asked Y, so here's Y I use emacs a lot but not all the time, and I also have a Hints file, in which I note how to do the tasks I encounter, and I like to have these Hints available while I am using emacs. I tried to automate this so that whenever I start emacs, if the Hints are not already there, then the file is opened as well. That script was my attempt to do so, and has been ok while I have run emacs from a non-login terminal within my Gnome3 classic style GUI. Trying it in a log-in terminal with CTL/ALT/F2 gave the error messages quoted. I have used and loved Unix and Fedora Linux for many years, but obviously there's still an awful lot more to learn.


Linux command line. Move all files and directories in directory, except some files and directories

I have a folder `A` which has files and directories, I want to move all those files and directories to another folder `B`, except `file`, `file2`, `directory`, and `directory2`. How can this be done?


Cannot open GUI after ssh -X and chroot

I ssh ( with -X option ) to another computer then I I do a chroot. I then encounter problems running X11 apps. As one example, after the ssh I would run emacs and it would open a new window as a X11 app. After running the chroot and doing ssh I would see emacs running as a console app. I don't get errors since emacs can be run it as an X11 app or a console app, but with other GUI apps I get the error message:               "cannot open display: localhost:10.0"      PS: Just to head off anyone who wants to suggest checking $DISPLAY, that is set correctly. I was wondering if there are any logs to check to see if I can identify the problem.


Disk Partitioning - Can't create partition

I've been following this example to restore capacity to my microSD --> SD card corrupt and stuck at 32MB, any way to fix it? Everything seems to work until I get to               mkfs /dev/sdx1      It tells me there no such file or directory. If I go to my /dev directory it never created sdx1. I've tried several methods but nothing worked. Any suggestions?


Shell function definition: why is there a space after the opening brace?

You probably know of that fork bomb:                :(){ :|:&};: #WARNING: harmful code      I wonder why it is necessary, for it to parse, to include a space after the opening curly brace.


How to make `xargs` ignore child's exit and keep processing further

I sometimes run long `xargs` jobs overnight and it is really annoying to discover in the morning that `xargs` died somewhere in the middle, for example because of a segmentation fault in one single special case, as happened this night. If even one `xargs` child is killed, it does not process any more input: Console 1:               [09:35:48] % seq 40 | xargs -i --max-procs=4 bash -c 'sleep 10; date +"%H:%M:%S {}";'     xargs: bash: terminated by signal 15     09:35:58 3     09:35:58 4     09:35:58 2     <Exit with code 125>      Console 2:               [09:35:54] kill 5601      Can I somehow prevent `xargs` from stopping to process any more input once a child process dies and instead continue processing?


Make RPM Satisfy Dependency Requirements of Other Installed Packages

So, I am installing a java app that I wrote which uses jnetpcap. This requires libpcap of at least v1.0.0. My CentOS 5.8 only has libpcap 0.9.4, which is required by other installed packages. I've got the RPM for libpcap 1.4.0 built but when I try to install it, I get the following:               # rpm -Uvh /root/rpmbuild/RPMS/i386/libpcap-1.4.0-1.i386.rpm     error: Failed dependencies:             libpcap.so.0.9.4 is needed by (installed) ppp-2.4.4-2.el5.i386             libpcap.so.0.9.4 is needed by (installed) isdn4k-utils-3.2-56.el5.i386             libpcap >= 14:0.8.3-6 is needed by (installed) ppp-2.4.4-2.el5.i386      and checking the dependencies of one of those:               # rpm -qR ppp-2.4.4-2.el5.i386     ...     libpcap >= 14:0.8.3-6     libpcap.so.0.9.4      Updating the OS is a non-starter, plus, it's a closed system, never net connected, so it matters little. Now, I _may_ be able to remove the packages which are stalling things, but, assuming I cannot, how can I force the install of this package, such that it will satisfy the older dependency requirements? ie: have it "provide" libpcap 0.9.4 soas to satisfy the requirements of already installed software.


how to get string between braces along with string without braces using awk

My input is:               ABC_DFG_FRE     s(DFR_GHY_JUY)     BGR_KIU_PLO     s(VFR_KJU_MKJ)      output sholud be:               ABC_DFG_FRE     DFR_GHY_JUY        BGR_KIU_PLO       VFR_KJU_MKJ


Linux Mint 13 not installing

I just decided to move to Linux. I downloaded the Mint 13 iso and wrote it to a DVD. I installed it on my Win7 laptop with VMware workstation to test and all worked fine. So I decided to reboot my laptop so I can format and install Mint... But, it reboots and starts the loading process then hangs with this:               ISOLINUX 4.04 20110711 ETCD Copyright (c) 1994-2011 H. Peter Anvin et al      It does not start the installation or Live CD. I tested on my work laptop and it starts the proccess without delay. Can my old laptop be too old? 1.8ghz, 1gbram 120gb hdd.


KDE Kubuntu System Monitor ProcessTable.sgrd and SystemLoad2.sgrd malformed XML

When trying to open the System Monitor, I received an error saying that the files `ProcessTable.sgrd` and `SystemLoad2.sgrd` contain malformed XML. The resource graphs no longer appeared after the program loaded. How can I fix that?


How to invoke Gnome 3 activity screen using command line?

### What I'm trying to do I'm using a Logitech MX Revolution mouse, which has a button below the scroll wheel mapped to search, which I remapped to middle click. For doing so, I had to remap `XF86Search` to middle click using `xbindkeys`, which works fine – when I change the "Search" hotkey to something else, for example `Ctrl`+`XF86Search` in the Gnome Settings. Now I want another mouse button to invoke the Gnome Activity screen (the one with the overview of open windows). `Alt`+`F1` also opens this view (or `Ctrl`+`XF86Search` now would do it, and even just pressing the super key). ### Invoking the Gnome Activity screen I try to send `Alt`+`F1` using               /usr/bin/xvkbd -text "\[Alt_l]\[F1]"      but it seems Gnome 3 does not fetch this key (which is not totally unexpected, as `xvkbd -text` sends it to the focussed window). What choices do I have do invoke the Gnome Activity screen?


Searching for a specific file with testdisk

Is there a way to recover just `.webm` files from a formatted partition using `testdisk` or `photorec`? I have not enough space to recover all files and then find `.webm` files afterwards.


Date computations without GNU tools

I have to perform some date calculations and conversion in a shell script. For example computing the difference in day between a date formatted as `Nov 28 20:27:19 2012 GMT` and today. There are several possibilities (GNU `date`, `gawk`, `perl`, etc.) but I would like to be able to run it on systems without GNU tools (e.g., BSDs, Solaris, etc.) At the moment the most portable solution I have is perl but it could require the installation of additional modules for the date conversion. What should I choose? **Edit** : looking at the comments I realized that I need to clarify that the tool I am writing will be publicly distributed. I am not looking on a way to perform computations on my machine r on how to install GNU tools. I want to use tools that are likely to be found on the majority of the machines.


Keep xscreensaver running

Every now and then, xscreensaver dies. When it does, my session unlocks and won't lock until I restart it. Is there a way to automatically detect that xscreensaver has died, restart it, and lock the session?


performance monitoring

Is there some performace monitoring tool which would run in background gathering info about all system activity? Somethimes my system (Arch linux, 32 bit) slows down terribly and the `top` utility doesn't show anything. I imagine some daemon which would gather info and log it, so when the slowdown pass away I would be able to find what was the problem.


Diskless workstations

For various reasons I need a setup with one server, and two diskless workstations. The workstations are to be "fat clients", which means I want to enable them to use their own CPU, memory, etc, for everything. Ideally, the workstation users should not have to notice that they are running diskless at all (except for the PXE booting, obviously...). The workstations should run OpenSuse (some version between and including 11.2 and 11.4) since that is what we use. They don't necessarily have to run a vanilla openSuse install, but as close as possible. The general idea is to PXE boot the workstations, and then let them mount their (root) filesystems on the server via NFS. I tried simply copying an existing OpenSuse 11.4 installation to a directory which I then exported via NFS. The kernel and initrd were then exposed via PXE/TFTP. The problem is that the initrd from the install is tailored to the machine it was installed on, so using it as is did not work. I have made some attempts to use LTSP (KIWI-LTSP for OpenSuse) with very limited success. So, now to my actual question(s): **1) Apart from modifying the initrd by hand to work with the diskless workstations, is there anything else I could use to aid me?** **2) One idea I had was to use the same root ("/") for both workstations, and then mount stuff like /var and /tmp as tmpfs. Are there any pitfalls to avoid here?** **3) Any other ideas on how to accomplish this setup? All ideas are very welcome!**


How do you use the command coproc in Bash?

Can someone provide a couple of examples on how to use `coproc`?


At what point did the /home directory appear?

Originally in Unix, `/usr` was used for user (home) directories. So if I had a user named `alex`, my home directory would be `/usr/alex`. (Interestingly, Plan 9, the successor to Unix, still has user directories in `/usr`.) Nowadays, of course, we store home directories in `/home`. (At least on GNU/Linux. I don't know about other Unices, but OS X doesn't count.) At what point did this become standard practice? What Unix flavor did it appear in? How long did adoption by other Unices take? Has `/home` been adopted by everyone? I've done some searching on here, but turned up nothing.


How can I set up a usb printer as a network printer using a linux server?

Basically right now I have a USB only printer, it's very nice. There are 5 people in my household and we all are constantly wanting to use the printer. Windows has a built in way to share the printer, but this only works when the computer is on. I have several low power small machines that I use to run Ubuntu Server Edition. Is there an existing Linux application that would allow me to basically use the USB printer as if it were a networked printer? Also I don't know how possible this would be but if there were a way to run the Apple AirPrint server on the Linux box too that would be awesome, then we could all print from our iDevices as well.