title: Pretty print in VIM?

text: I have few lines that each of them are colon separated values, `abc:def:3` Now I could do the reformat with printf plus IFS variable, `while read line; do IFS=":" printf "%-20s %-16s %5d\n" ${line[0]} ${line[1]} ${line[2]}; done < XX` but is it possible to do it within VIM?


title: Can Linux programs be sent a SIGXXX command they can respond to in the UI?

text: I am trying out the timeout command and would like to know if there is a kill signal that a GUI program, whether a graphics desktop or a terminal program will treat as the user terminating the program from the UI, like a `File| Exit` command or clicking the `X` button on the window, thus prompting the use to save any open files. `kill -l` displays over 64 options. Are any of them either alone in combination equivalent to a GUI option to terminate? I have tried with `nano` as an example, but the options I have tried so far don't work except SIGTERM.


title: Fix terminal title after SSH remote logging to another machine

text: right now I am using an one-line perl code to change titles of my terminal bars,               print("\e]0;@ARGV\7");      but every time after I ssh to another remote machine, the title will be modified by the host (by which I'm not particularly bothered). But after I exit from the connection, the modified title remains. Is there a way to fix this? essentially I want a fixed title for my terminals when operating locally. I primarily use xfce terminal and terminator under either CentOS or Debian. Thanks. **EDIT** Another subtlety is that, rather having all terminals the same name, I would prefer to have the freedom to edit their titles on-the-fly but only forbid SSH session from modifying what I edited.


title: Linux error:No such file or directory

text: I have written a script `abc.sh` and saved it in a place called `generallstuff`. I navigate to this folder with:               cd ~ /generallstuff      when i try to run the script with:               chmod 755 abc.sh      i get the error `"no such file or directory"` But the script is in this place, why is this. Previously i had no problem running scripts


title: Bash Linux random CLI Password generator and `<`

text: I recently discovered this method for generating a 9 character password from the linux prompt in bash:               < /dev/urandom tr -dc A-Za-z0-9_ | head -c9      What is `<` doing?


title: How to monitor only the last n lines of a log file?

text: I have a growing log file for which I want to display **only** the last 15 lines. Here is what I know I can do:               tail -n 15 -F mylogfile.txt      As the log file is filled, `tail` appends the last lines to the display. I am looking for a solution that only displays the last 15 lines and get rid of the lines before the last 15 after it has been updated. Would you have an idea?


title: BIOS Update within Linux

text: I want to enable PXE boot of current system's BIOS from Linux. If modifying the BIOS content is not possible then is there any way to take the back up of current BIOS setting and dump it on identical other machine ? So that changes made on first machine's BIOS settings will be effective on Second identical machine's BIOS Settings EDIT: I came across an utility flashrom, which is allowing me dump the previously recorded file. But is there any way to modify only single option of BIOS (without dumping)


title: How to create an initrd image on OpenSuSE linux?

text: /usr/src/linux-3.2.1 # make install     scripts/kconfig/conf --silentoldconfig Kconfig     sh /usr/src/linux-3.2.1/arch/x86/boot/install.sh 3.2.1-12-desktop arch/x86/boot/bzImage \                     System.map "/boot"     You may need to create an initial ramdisk now.      --               /boot # mkinitrd initrd-3.2.1-12-desktop.img 3.2.1-12-desktop          Kernel image:   /boot/vmlinuz-2.6.34-12-desktop     Initrd image:   /boot/initrd-2.6.34-12-desktop     Kernel Modules: <not available>     Could not find map initrd-3.2.1-12-desktop.img/boot/System.map, please specify a correct file with -M.     There was an error generating the initrd (9)      **See the error during mkinitrd command. What's the point that I am missing?**   What does this mean? `Kernel Modules: <not available>` **OpenSuse 11.3 64 bit** ## EDIT1: I did "make modules".   I copied the `System.map` file from the `/usr/src/linux-3.2.1` directory to `/boot`, now running `initrd` command gives the following error:               linux-dopx:/boot # mkinitrd initrd-3.2.1.img 3.2.1-desktop          Kernel image:   /boot/vmlinuz-2.6.34-12-desktop     Initrd image:   /boot/initrd-2.6.34-12-desktop     Kernel Modules: <not available>     Could not find map initrd-3.2.1.img/boot/System.map, please specify a correct file with -M.          Kernel image:   /boot/vmlinuz-3.2.1-12-desktop     Initrd image:   /boot/initrd-3.2.1-12-desktop     Kernel Modules: <not available>     Could not find map initrd-3.2.1.img/boot/System.map, please specify a correct file with -M.          Kernel image:   /boot/vmlinuz-3.2.1-12-desktop.old     Initrd image:   /boot/initrd-3.2.1-12-desktop.old     Kernel Modules: <not available>     Could not find map initrd-3.2.1.img/boot/System.map, please specify a correct file with -M.     There was an error generating the initrd (9)


title: Move to the beginning of a line in screen

text: > **Possible Duplicate:**   >  Shell: how to go to the beginning of line when you are inside a screen? Normally to get to the beginning of a line in a terminal the command is `Ctrl`+`a`. While using GNU screen the `Ctrl`+`a` is the escape sequence to enter a screen command. Is there a default way to move to the beginning of a line while in screen?


title: What is going wrong with this theme when running Eclipse?

text: Please see this video to understand what I'm describing: Weirdness in Eclipse - YouTube. Essentially, when I use the "Ambiance Evolution" theme with Eclipse, it starts wiggling and doesn't stop, as weird as that sounds. I really like the theme, so I'd like to be able to use it, but this is kind of unacceptable. How can I fix this strange issue?


title: Using ABI_X86 in Gentoo

text: For one reason or another (I've been busy, I guess), it's been months since I've updated my Gentoo system. And, as you can imagine, this means there's a lot of packages (and USE changes) I need to go over. My system is "amd64" (multilib), but I have a lot of (manually keyworded) packages from "~amd64". Anyway, in this update, I keep seeing "ABI_X86" USE flags. What is this? This is new. There's nothing in "eselect news list" about it. Being the Gentooer I am, I did my research, and found this topic: http://forums.gentoo.org/viewtopic-t-953900-start-0.html. That seemed to show how to use it, but, are there any "real" docs for this? What does it do? What am I _supposed_ to set "ABI_X86" to? I have a multilib system. I assume I want "64", but then what are "32" and "x32"? I'm confused at what I need to do here. Emerge is yelling a lot about slot conflicts, and they seem to be related to "ABI_X86" (I forget the errors exactly, but I remember one was zlib). So, is there any "official" docs about what "ABI_X86" is and how to use it? From the thread I linked, I found this page: http://kicherer.org/joomla/index.php/en/blog/liste/29-transition-of-emul- packages-to-true-multilib, but I want to know what I'm doing before I go keyword a bunch of stuff and edit my make.conf. P.S. I have most of the "app-emulation/emul-linux-x86" packages (the ones I seemed to need at the time) in my "package.keywords" file.


title: How to add a line in many files

text: I have many **.html** files and I need to add a meta tag after < **head** >'s start tag in each file. How I can do that? Can `vim` help me?


title: How can I confirm the identity of the remote SSH host I'm trying to connect to?

text: I'm trying to debug a problem I have when trying to connect to an SSH host over WAN. I'm looking for a way to confirm that my client is reaching the correct host, and is not routed somewhere else along the way. I have access to both the client and he host. Maybe there a way to monitor every SSH connection request on the host's side to confirm that my request is actually reaching it? The host is a Raspberry Pi running Raspbian, SSH version is OpenSSH_6.0p1 Debian-4, OpenSSL 1.0.1e 11 Feb 2013.


title: ncmpcpp character problem

text: This was really wired! All `=` became `q` on my xfce4-terminal app, what's wrong with it? Any ideas? ![enter image description here](http://i.stack.imgur.com/69N3x.png)               %> set | grep LANG     LANG=en_US.utf8     LANGUAGE=en_US.utf8


title: How to create themes for MATE?

text: I'm looking for information on the basic structure of a theme for MATE (in order to build my own). I took an existing theme and renamed it, but I have been unable to get it to show up in Appearance Preferences. (It claimed to have imported but does not show in the theme chooser). Is there some guide or documentation that covers the basic structure of a theme? A. Can you edit it live in `~/.themes` or do you have to repackage and import to test changes? B. How does it get it's name? C. What files are required for it to work? D. How do you set a screen shot? E. Many themes have gtk-2.0,gtk-3.0,metacity-1,xfwm4, etc subfolders. How do I know which one I'm using? F. I'm not even sure what type of theme MATE uses. Is it metacity? GTK? It's own format? Also, documentation on the structure of the file(s) would be good. It appears similar too, but not the same as, css. It should go without saying, but I already tried Googleing for this, and found next to nothing in the way of a simple "My First MATE Theme" tutorial.


title: Using notify-send with a non-interactive ssh connection

text: I want to be able to use `notify-send` to send popup messages from one server to be displayed on another. I'm sure this is possible with SSH, but how can I automate it to a one-line command that doesn't ask me for a password so I can include it into a script?


title: how to change partitioning?

text: I have a hdd with /, /home. I just got new SSD and I need to change my partitions without any reinstalling. I would like to create a separate /var partition (which is currently under /) and leave it on hdd. Rest of the / (including /boot) I would like to move to ssd. How should I do it in ubuntu 12.04?               cat /etc/fstab     proc            /proc           proc    nodev,noexec,nosuid 0       0     UUID=4f614ad4-8b21-4e21-b6fc-13ba7f489a88 /               ext4    errors=remount-ro 0       1     UUID=dba112c1-1647-4e73-b907-0117ad3a058e /home           ext3    defaults        0       2     UUID=01CB6A18FD7DF1C0 /windows/c      ntfs    defaults,umask=007,gid=46 0       0     UUID=01CB6A18E6F42370 /windows/d      ntfs    defaults,umask=007,gid=46 0       0     UUID=48d5b437-91c9-4304-9bde-ee661779089d none            swap    sw              0       0      I have also some lvm partitions but they are irrelevant for this problem


title: How to request a specific IP address from DHCP server?

text: I'm running Angstrom Linux on an embedded device (BeagleBoard-xM). I managed wireless connection via a Wi-Fi adapter. When I load its driver using `modprobe`, BB-xM requests an IP address from router running DHCP server. The IP address assignment varies from 192.168.1.100-192.168.1.200. Can BB-xM request a specific IP address? _**Attention:_** _The solutions I found, are referring to settings on the router. However, I'm looking if this is possible on the BB-xM side._ Any ideas? `wpa_supplicant.conf`               ctrl_interface=/var/run/wpa_supplicant     eapol_version=1     network={             ssid="SSID"             scan_ssid=1             proto=RSN             pairwise=CCMP TKIP             key_mgmt=WPA-PSK             psk="password"     }


title: Which directory MUST exist in / to qualify an OS as Linux

text: Studying the lpic wikibook for the lpic exam 1, I encountered the following question.                Which directory MUST exist in / to qualify this OS as Linux      I've searched google and the wikibook but can't find which folder in / makes a 'unix' classified as a 'linux'. Here is the output of a linux box               vagrant@precise64:~$ ls /     bin              boot        dev        etc             home        initrd.img       initrd.img.old   lib         lib64      lost+found      media       mnt       opt              proc        root       run             sbin        selinux       srv              sys         tmp        usr             vagrant     var      vmlinuz          vmlinuz.old      Here is the output of / in Mac OSX               ls /     Applications Network      Users        bin          dev          home          net          sbin         usr          Library      System       Volumes           cores        etc          mach_kernel  private      tmp          var      Any other information about what makes a unix into linux is appreciated.


title: GPS Device Attached to Linux Mint 15

text: I purchased a Silvercrest GPS device from Lidl recently, but the software that came with it is a tad "underpowered" to say the very least and has no Linux support. I'm attempting to get at the raw data on the device myself to write something which I can use in Linux and not have to rely on my Windows machine and the exe that came with it, but I'm not too sure where to start to get access to the device. As far as I can see it's a rebranded Targa device but can't find any more information on the web. (It's not a laptop GPS module or anything, its a simple outdoor GPS unit that I need to get the data off via USB after a trip out with it). When I plug it in I get the following from `dmesg`, I hope someone can point me in the right direction as to how to interact with this thing.               [ 156.076046] usb 2-1: new high-speed USB device number 3 using ehci-pci     [ 156.208903] usb 2-1: New USB device found, idVendor=10d6, idProduct=1101     [ 156.208907] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3     [ 156.208910] usb 2-1: Product: Media Player     [ 156.208912] usb 2-1: Manufacturer: USB      [ 156.208913] usb 2-1: SerialNumber: \xffffffe8\xffffffa7\xffffff9b\xffffffa7\xffffff9b \xffffffe8\xffffffbf\xffffffa6\xffffffbf\xffffffa6 \xffffffe7\xffffff83\xffffffb6\xffffff83\xffffffb6 \xffffffe8\xffffffa7\xffffff93\xffffffa7\xffffff93 \xffffffec\xffffff87\xffffff8d\xffffff87\xffffff8d \xffffffe2\xffffff88\xffffff8f\xffffff88\xffffff8f \xffffffe1\xffffff84\xffffffa4\xffffff84\xffffffa4 \xffffffe2\xffffffac\xffffffa2\xffffffac\xffffffa2 \xffffffee\xffffffb4\xffffff91\xffffffb4\xffffff91 \xffffffe4\xffffffb9\xffffff93\xffffffb9\xffffff93 \xffffffee\xffffffb4\xffffff91\xffffffb4\xffffff91 \xffffffe5\xffffff95\xffffff93\xffffff95\xffffff93 \xffffffe3\xffffffa8\xffffff91\xffffffa8\xffffff91 \xffffffe2\xffffff94\xffffff9c\xffffff94\xffffff9c \xffffffec\xffffff8a\xffffffb7\xffffff8a\xffffffb7 \xffffffe2\xffffff91\xffffffb8\xffffff91\xffffffb8     [ 156.212270] scsi5 : usb-storage 2-1:1.0     [ 157.213333] scsi 5:0:0:0: Direct-Access USB Media Player 2.00 PQ: 0 ANSI: 0 CCS     [ 157.214101] sd 5:0:0:0: Attached scsi generic sg2 type 0     [ 157.226457] sd 5:0:0:0: [sdc] Attached SCSI removable disk


title: wget failing when I enter variable name in command

text: I have a small bash script to download a file from my webserver. I pass the $File variable through the command line and then insert it into the wget command as follows:               File=${1}          wget -a /home/wgetlog.txt -nH -nd --accept=txt "http://192.168.1.21/files/$File/$File.txt"      If I run the command ./download.sh media - It gives the following in the log file:               --2014-04-07 17:44:36--  http://192.168.1.21/files//.txt     HTTP request sent, awaiting response... 404 Not Found      Is it due to me passing the variable side by side? Is the syntax correct? Or is there a better way of doing this :)


title: Difference between the sshd open & close entries in /var/log/secure and the log in & out entries in /var/log/wtmp

text: I have been trying to write a program to execute many commands during one ssh connection. My current way is (1) create SSH connection; (2) create SSH command tunnel/channel whenever needed; (3) close SSH connection. As expected, I see only two entries in /var/log/secure, corresponding to the ssh open & close event. My problem is that there are many entries in /var/log/wtmp, corresponding to the log in & out event. Could you help to comment on the relationships between these two file, in the context of recording SSH connections? Any insight is appreciated! Sorry for the trouble if the terminology is not appropriate!


title: Bash script : help file inside the script or in a different file?

text: I'm writing a script that has the vocation to be a fully featured program at the end. As far as I know, BASH is enough for his purpose (manage PPA's, kinda like Y-PPA). I would like to know how to output the help `myscript --help`. Currently, help is written with `echo -e` directly inside the script and called with a `if [ "$1" == "--help" ] || [ "$1" == "-h" ]` (I plan on switching that to getopts soon). But what's better ? To leave the `help` section inside the script or to just write a line to call another file containing the help ? In my opinion, leaving it inside the script could be better because :   * My program will remain a one text-file script   * It saves space on the hard-drive   * It avoids having an error with displaying another file that could be corrupted or in a different location But having a different text-file containing the help could also be better because :   * The main script called with `myscript` command would be lighter   * It simplifies the human-reading of the script   * It allows to update the help page separately if needed   * It could even allow to display only the help page with a GUI, and/or print it. So you see, I don't know what's the "usual" way of doing this. Thank you ! _PS : please also note that since I'm planning to release a complete program, a man-page would be great so I would anyway have to provide more than 1 file, maybe simply a .deb_


title: reset Ethernet bonding without rebooting

text: I have the following Ethernet bonding configuration: old configuration:               bond0       eth0       eth1     bond1       eth2       eth3      new configuration :               bond0       eth0       eth2     bond1       eth1       eth3      I have made the change and restart `service network restart` but `cat /proc/net/bonding/bond0` and `cat /proc/net/bonding/bond1` still shows the old configuration. I had to reboot the system to be able to see the new configuration. Is there a way to do this without reboot? I am using RHEL6.5


title: Color of emacs margins

text: With the following in my .emacs I get narrow margins in text-mode buffers:               (defun my-set-margins ()       "Set margins in current buffer."       (setq left-margin-width 30)       (setq right-margin-width 30))          (add-hook 'text-mode-hook 'my-set-margins)      How can I change the color of the lines that appear to delimit these margins so that it's the same as my background color and not black like they are now? ![Current margins with black lines](http://i.stack.imgur.com/BYqNJ.png) **EDIT** I know more now and this is my question: How do I add a hook to turn of the fringes in text-mode?


title: Dynamic text wrapping of terminal output

text: I am specifically looking for is dynamic formatting of output. In every terminal emulator I can remember having used in Linux, when some program prints to the screen, the output gets formatted to fit to the terminal window so that longer lines will wrap around. If I then change the width of the window, the previous wrapped around formatting still remains. On OSX, Terminal.app acts differently. The text is still formatted for the current size of window just as on Linux terminal emulators. However if I re- size the window, the text is automatically reformatted to match the new dimensions. This is super useful when, after the running a utility, I realize that I didn't make the window wide enough to show all the output clearly. On an especially slow running utility, it can be frustrating to need to run everything all over again only to get better formatting. I could redirect the output to a program like `less`, `view` or `gview`. However this just feels like too much work to do every time I run a utility that _might_ not format well with the current window dimensions. Also, as far as I know `less` doesn't support bash style text coloration. Does anyone know of a Linux terminal emulator that has this behavior? It doesn't need to be out of the box behavior; I am willing to monkey with configuration settings to get something like this working. I have already poked around a number of terminal emulators on Linux to see if they support this, but I don't really have the time to try every single one of them. There are just too many! If truly no program exists that does this, is it because no one is trying to create this behavior? Is there some technical limitation on Linux in specific that does not allow this (don't see how this could be the case)?


title: replace control characters in Emacs?

text: This is a small text: > What\222s with All the Parentheses? In Emacs `\222` above is shown as a control character (in red). It is supposed to be `'`, but I don't understand why it is `\222` instead, even though I know the text was probably generated from OCR? I can search for the control character `\222` by               C-s C-q 2 2 2      But I can't when I try to replace it with `'` in a similar way:               M-%      C-q 2 2 2     '      So I wonder how to do the replacement? Is it unnecessary to do the replace? Thanks.


title: Gedit highlight shortcut

text: When I open Gedit in my Linux Mint 17 Cinnamon 64-bit, the syntax highlight is off by default. I can then activate it via the menu, or by saving my file with the correct file extension (e.g., every *.f95 file will automatically be shown with the Fortran 95 sytnax highlight). My question is: since I am programming in Fortran most of the time, would it be possible for me to create a new Gedit shortcut named "Gedit-Fortran" in my menu that would open it with Fortran's syntax highlight already activated? Just note that I don't want this to be the default behaviour of Gedit though: I still want to have the standard shortcut to open a blank file without any syntax highlighting. Would this be possible, maybe via some terminal command, so I can create such shortcut?


title: Why is 'kill -9' killing browser as well as server?

text: I sometimes have to use `kill -9` as a last resort to kill my rails server. Unfortunately, I have to do that often enough that I wrote a helper function in my bash_profile to do it. If I do it manually -- `ps aux | grep '[r]ails]`, grab the pid (eg. `12345`), and `kill -9 12345` -- it kills the server and leaves the browser intact. But my function kills the browser too, which I don't want to do:               function running {       ps -p $(lsof -i :3000 -t) &> /dev/null     }          function k9 {       if running       then         kill -9 $(lsof -i :3000 -t)       else         echo "Rails server is not running"       fi     }      I've confirmed that `lsof -i :3000 -t` grabs the same pid as I'm getting from `ps aux`, so what am I doing wrong?


title: can not create /dev/shm

text: I need to create `/dev/shm` on an embedded ARM system. From "Installed The Latest Changes to Current and......". I see that it can be created with `mkdir /lib/udev/devices/shm`, but I'm wondering what is supposed to be at that location? The only directory I have at that location is `/lib/modules/`, there's no `devices/` or anything. So I went ahead and just created them, empty directories. I then added:               tmpfs                   /dev/shm                tmpfs   defaults       0 0      to my `/etc/fstab` and I didn't add an `mtab` entry, since I don't have an `/etc/mtab`. I then rebooted and now, there's still no `/dev/shm` device. Any ideas how I get that device? ### EDIT #1 Oh, and a `mount -a` (after a reboot) results in:               # mount -a     mount: mounting tmpfs on /dev/shm failed: No such file or directory`


title: Why can't root on one machine change nfs mounted content from another machine?

text: On my NFS server, I have the following export defined:               #NFS exports Database     /shared -alldirs -network=192.168.1 -mask=255.255.255.0      On my NFS client:               192.168.1.7:/shared /shared nfs rw 0 0      Obviously, as root on the server, I can do whatever I want. On the client however, my regular user 'gabe' can make changes to the nfs mount (assuming I have permissions to), but root cannot. As my regular user:               gabe@client$ cd /shared     gabe@client$ ls -l     total 8     drwxrwxrwx  4 gabe  wheel   512 Mar 20 19:20 tmp     gabe@client$ cd tmp     gabe@client$ touch test.txt     gabe@client$ rm test.txt      As root:               # cd /shared/tmp     # touch test.txt     touch: test.txt: Permission denied      Again, this is all on the NFS _client_ side of things, and I suspect perhaps it has something to do with the -maproot option, but I'm too much of an NFS noob to understand exactly what. This is the first time I'm setting up NFS and I just noticed this peculiarity. I'm going to do some reading now, to see if I can figure this out, but if anyone has any insight, I would appreciate it.


title: How to make a btrfs snapshot writable?

text: According to the btrfs Readonly snapshots patch it's possible to "set a snapshot readonly/writable on the fly." So I should be able to turn my readonly snapshot (created with `btrfs snapshot -r`) writable, somehow. But neither the btrfs subvolume manpage nor any other part of that manpage seems to give a way to do that.


title: What happens if I do an improper shutdown of Lubuntu 13.10?

text: I have Lubuntu on my 7 year old PC with 512 MB RAM and and Intel Dual Pentium Processor running at 3.00 GHz. I sometimes unplug it from the electrical mains in an emergency. Please tell me if something bad will happen if I do this.


title: Cycle through clients on both screens in awesomewm

text: I am using awesomewm and have two monitors, so `Mod4+j` and `Mod4+k` cycle through windows on current screen only. Is there a way to cycle through all windows/clients on all screens to make it work like ordinary `Alt+Tab`?


title: OpenJDK update in RHEL 6

text: We need to apply the JDK updates to one of the RHEL 6 servers. How do I apply the patch if I have the RPM package available, which I have downloaded from the internet. Searched a lot on the internet but couldn't find any steps on how to apply the JDK patch. Also, what precautions should be taken before applying the new RPM update, so that the current functionality is not disturbed? The package installed in the server is: `java-1.6.0-openjdk-1.6.0.0-3.1.13.1.el6_5` I want to update it to: `java-1.6.0-openjdk-1.6.0.0-5.1.13.3.el6_5`


title: Transform custom tags with arguments

text: I want to write my diploma theses with markdown. Sadly, there is no perfect editor and so I have to improvise. For bibtex citations I want to transform my own definition with some sort of bash-filter right before I handle the input to pandoc:               <@BIBTEX_ID[|OPTIONAL_PAGE_OR_CHAPTER_NUM[|OPTIONAL_UNIT_DEFINITION]]>      to something like:               \autocite[OPTIONAL_UNIT_DEFINITION][OPTIONAL_PAGE_OR_CHAPTER_NUM]{BIBTEX_ID}      example:               <@sample>       ---> \autocite{sample}     <@sample|12>    ---> \autocite[12]{sample}     <@sample|12|c.> ---> \autocite[12][c.]{sample}      which bash/unix tool can do this job? Would it be possible to do it with sed or awk?


title: How can I make C-m1 emulate a right click?

text: On Mac OS X, you can right click by holding down control and clicking. I swapped the command and control keys with `setxkbmap -option altwin:ctrl_win`, but how do I make it right click by holding down control and clicking? I am on a Powerbook G4 with Debian XFCE. UPDATE: Chris Down's answer requires you to press control and click at _exactly_ the same time. On Mac you can **hold down** control and click.


title: Redirect and pipe output

text: `rpm -qa > file | wc -l` returns 0. What am I doing wrong? I think it is clear what my goal is, but it isn't working. Is this a job for `xargs` or `tee`?


title: Advice on running a headless laptop

text: My current laptop is falling apart, specifically the screen hinges. Once (or ideally before) they break, I'd like to run the machine as a storage device. I strongly prefer using GUIs over CLI. Any recommendations on a distro/useful tools to install before turning it into a box? Any cautionary tales about running a laptop without a screen? So far I imagine installing Ubuntu (not Server) and running Remmina to remoting in via VNC/etc.


title: Why does Linux purge the memory cache when it is nearly full?

text: Here's what the memory graph looks like on a VPS running CentOS with 512MB of RAM and nginx/php-fpm/mysqld serving (mostly static) content to a couple thousand visitors per day. ![Weekly memory graph](http://i49.tinypic.com/qnk4ef.png) (those are days on the x-axis) As you can see, it's quite jumpy in the cache and buffer area. The memory cache is purged at irregular intervals (ruling out a responsible cron job). It's usually, but not always, purged at the point where it can grow no larger. Sometimes it clears almost entirely, at other times only halfway down. I'm trying to understand the logic behind these purges. I would expect file data to be cached much longer & don't see any other programs using more memory than usual when the memory cache is cleared. Is this normal behavior, or am I missing something? UPDATE: A memory upgrade seems to have stabilized the graph. Still seeing small drops, but nowhere as significant as it was prior to the upgrade. ![After memory upgrade](http://i41.tinypic.com/30c6cuq.jpg)


title: What does a "OVM reboot" mean?

text: What does this term mean?


title: Distribution recommendation for USB flash disks

text: I'm a linux system administrator and dealing with big iron distributions like debian and redhat for a long time. I need a recommendation for a small distribution which I can install to USB flash disk. I need a general purpose distribution with an up-to-date kernel (especially ext4 / GPT support is needed) to carry some filesystem operations. Desktop environment is optional. In-Place updates like a real installation is a huge plus (I just don't want to reinstall it with every major version).


title: How to remove GNOME to run only Compiz

text: Regarding this question, I really like the idea of running Compiz without a desktop environment. I currently have Ubuntu 10.04 (with GNOME and Compiz) and want to give it a try. Now how can I configure my system to enable compiz running without GNOME (then I can remove it completely)?


title: How is Ubuntu based on Debian?

text: Linux Mint is based on Ubuntu. Ubuntu is based on Debian. Like this, there are several other linux distributions that are based on Ubuntu, Debian, Slackware, etc. What confuses me is what does this mean i.e one Linux distro based on some other. How they are made?


title: How to recover a file from a tcpdump?

text: I use               tcpdump -i wlan0 -s 0 dst 192.168.1.200 or src 192.168.1.200 -w output.pcap      to monitor for ex.: my HTTP traffic. I upload a .zip file through HTTP. How can I retrieve the .zip file from the output.pcap file? Is it possible to recover it from there?


title: Variable assignment in .bash_profile has no effect

text: I added the following to my `.bash_profile`:               JAVA_HOME=$JAVA_HOME:/usr/java/jdk1.7.0     export JAVA_HOME      However, when I `echo $JAVA_HOME` it outputs an empty string. Why weren't my changes to `.bash_profile` reflected in the shell?


title: How to connect to a serial port as simple as using SSH?

text: Is there a way to connect to a serial terminal just as you would do with SSH? There must be a simpler way than tools such as Minicom, like this               $ serial /dev/ttyS0       I know I can `cat` the output from `/dev/ttyS0` but only one way communication is possible that way, from the port to the console. And `echo` out to the port is just the same but the other way around, to the port. How can I realize two way communication with a serial port the simplest possible way on Unix/Linux?


title: What tool(s) should I use to test my hardware for errors?

text: Are there any Linux tools (command line, or Live CD) that will test hardware components for errors (hard drive, RAM, CPU, graphics card, buses) and show me some detailed output with wrong parts etc.?


title: Count number of lines of output from previous program

text: I'm trying to count the number of lines of output a certain program produces. The problem is, the program takes a long time to run, and I want to display the output to the user. **Is there a way to count the number of lines the last command outputted?** I could do `program | wc -l` but that wouldn't show the output to the user. So as far as I know, I have to do `program; program | wc -l` - but the program takes at least a minute to run, so I don't want to have to do it more than once just to show a line count at the bottom. **EDIT:**   * **Is there a way of showing the output as it happens (line by line) and then returning a count at the end?**


title: Possible to convert a linux installation to .VDI or ISO format?

text: I have an Oracle Peoplesoft installation set up on some virtual machines (they were in OVM format). I'd like to copy them over so they work in VirtualBox… would it be possible to convert them to a format VirtualBox can understand? I found a guide that lets you convert a single hard drive in Linux to ISO and then convert that to VDI, but the problem with that is that it only works on a single drive--I'd like to convert the whole filesystem. Any ideas on how to accomplish this?


title: What are the books about creating own *nix OS?

text: I want to create my own Unix OS. Is there any book that I can learn from, from start?


title: Access the last file (alphabetically) in a directory

text: I'm trying to open a file with vim from the command line, the file is in a directory filled with automatically generated files that are prepended with a time stamp. Since I don't know the time stamps off the top of my head, I would just like to open the most recent one in the directory (also the last one in the list alphabetically).               vim ./my_dir/<last_item>      Is there a way to do this?


title: Confusing Directory Permissions

text: **Environment**   * Ubuntu 14.04 LTS Desktop **Permissions**               /media/gal_db$ ls -al     drwxrwx--- 6 admin     shared_disk  4096 Aug 15 13:31 .     drwxr-xr-x 6 root      root         4096 Aug 13 12:54 ..     drwx------ 3 postgres  shared_disk  4096 Aug 15 14:28 database          /media/gal_db$ members shared_disk     gal  admin  postgres      **Remove postgres from shared_disk to limit access to filesystem**               sudo deluser postgres shared_disk      **Try logging into database as user gal**               psql -U gal         Password for user gal:         psql: FATAL:  could not access directory "pg_tblspc/16399/PG_9.3_201306121/16401": Permission denied      **Re-add postgres user to shared_disk**               sudo adduser postgres shared_disk      **Try logging into database as user gal again**               psql -U gal         Password for user gal:         psql (9.3.5)         Type "help" for help.         gal=>      Success. And confusion. **Questions**   1. Why does postgres need to be a member of shared_disk to access the database directory?   2. Isn't it enough that postgres is the owner of the database directory?


title: Set and Shopt - Why Two?

text: `set` and `shopt` are both shell builtins that control various options. I often forget which options are set by which command, and occasionally which option sets/unsets (`set +o/-o`, `shopt -s/-u`). Why are there two different commands that seemingly do the same thing (and have different arguments to do so)? Is there any easy way/mnemonic to remember which options go with which command?


title: Oracle Linux R6 Install Error

text: My Oracle Linux R6 x64 won't install. After normal install it's just blank screen. After basic video driver options install stuck on "Waiting for hardware to initialize...". Tried with different options runs only with noprobe but no drivers at all (understandably). Is there any way to run it normally? Spcecs: Asus Rampage Extreme IV Extreme - Newest BIOS, Intel i7 4930K, Graphics: Geforce 210


title: Options to show images when on the console

text: When I am on the console (the tty, the virtual terminal, which you reach with `Ctrl`+`Alt`+`F1-6`, not a terminal emulator), what options do I have to view images, tiff, whatever that's not text?


title: LDAP on openSUSE

text: I'm trying to run an LDAP server on a openSUSE 12. But I have a couple of doubts. What I whant is this: _testing.com_ with 2 OU ( _Info_ and _People_ ). So the right way would be `ou=Info,dc=testing,dc=com`. I use this http://www.padl.com/OSS/MigrationTools.html to generate a ldif file named user `user_ldap.ldif`, with a few users (this is an example =D). After I edit the `migrate_common.ph` I create the `user_lda.ldif` file                ~ # cat user_ldap.ldif      dn: uid=inxs,ou=People,dc=testing,dc=com     uid: inxs     cn: INXS     objectClass: account     objectClass: posixAccount     objectClass: top     objectClass: shadowAccount     userPassword: {crypt}$1$yQbmUggV$fNUvBGuOXru0DHQjtlu9h1     shadowLastChange: 15392     shadowMax: 99999     shadowWarning: 7     loginShell: /bin/bash     uidNumber: 1001     gidNumber: 100     homeDirectory: /home/inxs     gecos: INXS          dn: uid=nofx,ou=People,dc=testing,dc=com     uid: nofx     cn: NOFX     objectClass: account     objectClass: posixAccount     objectClass: top     objectClass: shadowAccount     userPassword: {crypt}$1$vxU/f4tt$LRHuHhLgPhqcGVA2yLUKk/     shadowLastChange: 15392     shadowMax: 99999     shadowWarning: 7     loginShell: /bin/bash     uidNumber: 1002     gidNumber: 100     homeDirectory: /home/nofx     gecos: NOFX      So I try to do this:               :~ # ldapadd -f user_ldap.ldif      SASL/DIGEST-MD5 authentication started     Please enter your password:      ldap_sasl_interactive_bind_s: Invalid credentials (49)             additional info: SASL(-13): user not found: no secret in database      When I installed the ldap-server, I created the `dn=root` with his password, so I asumed that is the password that this asking. I do not create the directory tree I was told that was created automatically from the ldapadd. Or it's false? I have a lot to learn, but need a guide or a small synthesis.


title: Diff command. Basic explanation

text: Just started with diff command. Can you please explain me,               diff thin_provisionings_controller.rb thin_provisionings_controller.rb[211]          512,513d511             include ThinProvisioningsGraphModule           So does that says to delete lines 512, 513 and add 511? As described by this article http://lowfatlinux.com/linux-compare-files-diff.html


title: What distro is the most similar to RHEL 5?

text: I'm trying to get used to work with linux for a new job, where I will be using RHEL 5, but right now don't have $179 to buy the workstation version from Red Hat store. What free distro would be the best for me to start with while I get the money for my RHEL license?


title: Extract files from FreeBSD 9 ISO

text: With FreeBSD 8 you could manually install by doing something like:               # mdconfig -f /FreeBSD-8.2-RELEASE-amd64-disc1.iso     # mount -t cd9660 /dev/md0 /cdrom     # cd /cdrom/8.*     # export DESTDIR=/mnt     # cd base; sh install.sh; cd ..     # cd catpages; sh install.sh; cd ..     # cd manpages; sh install.sh; cd ..     # cd src; sh install.sh all; cd ..     # cd kernels; sh install.sh generic; cd ..      etc.. This was very handy for remote installs and other special circumstances. FreeBSD 9 install has changed a lot and the CD directory structure is totally different so I'm wondering if anyone knows of a similar way of doing this with FreeBSD 9? Appreciate any help.


title: zsh: excluding files from a pattern

text: Say I have the following files: > >     |-- bar >     `-- foo >         |-- type_A_1 >         |-- type_A_2 >         |-- type_B_1 >         |-- type_B_2 >         |-- type_B_xx >         |-- type_B_xx >         `-- something_else >   I thought the following command               print -l foo/*~{type_B*}      would print **everything** under `foo` **except** things that start with `type_B` but it doesn't, instead it prints everything under foo:               foo/type_A_1     foo/type_A_2     foo/type_B_1     foo/type_B_2     foo/type_B_xx     foo/something_else      I also tried `print -l foo/*~type_B` and got the same thing. How does the exception wildcard `~` work in zsh?


title: what is "play" command/package available by default in Linux Mint and how to remove it

text: I'm trying install play framework on Linux Mint and setup its variable:               export PATH=$PATH:/relativePath/to/play      But command can't run because it's being overlapped by another **play** command which was installed in the system by default.               $ which play     /usr/bin/play     $ play --version     play:      SoX v14.4.1      These are definitely are not play framework related and I can't figure out how to remove this.               $ sudo apt-get remove play     Reading package lists... Done     Building dependency tree            Reading state information... Done     E: Unable to locate package play      It seems this command belongs to some package...


I have the latest stable versions of Emacs (24.3) and of Zsh (5.0.2). I can run Zsh without problem from a terminal (e.g. ITerm2), but if I try to run it from `M-x ansi-term` I get the error: `Emacs ansi-term with zsh: error in process filter. Invalid face: unspecified` This is the case even if I start `M-x ansi-term` with `bash` and then I try to switch to `zsh`. This is all on Mac OS X. Any thoughts on what may be causing this and how to overcome it?


title: How to find difference between two timestamps up to milliseconds?

text: I am new to shell scripting. The heart of my script is to find the difference between two timestamps up to milliseconds. With me I have a file with content of timestamps only as               2012-09-13 15:00:29,290 2012-09-13 15:00:29,297     2012-09-13 15:00:29,428 2012-09-13 15:00:29,447      Like this I have around 30k records, where I should not face any performance issue when I execute script. Many factors like leap year, months with 31 days etc come into picture when I am trying to write script for this. Can anyone help me on this please?


title: Progressbar in bash to visualize the time to wait

text: In a bash script sometimes you need the user to wait some seconds for a background process to finish. I usually use for example:               sleep 10      How can I add a kind of progressbar to the script, so the user knows how long to wait? I installed the command `bar` but I don't understand the manual.


title: Force title on GNU screen

text: By default, the title of a screen session is the name of the last command entered, which is fine for me, but in some cases I'd like to change it. I know the command `Ctrl`-`A` `A`, but it only changes the title until the next command, and I'd like it to stay there until I decide otherwise. **EDIT:** Here's the `preexec` function I found in my `.zshrc`               if [[ "$TERM" == "screen" ]]; then        local CMD=${1[(wr)^(*=*|sudo|-*)]}        echo -n "\ek$CMD\e\\"     fi


title: Implement Java/JavaFX on ARM

text: I am working on ARM Linux. I have found this link that says that JavaFX could work on ARM. I am confused about Embedded Java SE and JavaFx ARM. Do I need to setup a JVM for those or not? I have compiled my own kernel and built a functional root file system with **busybox** , **glibc library** and **ARM cross compiler toolchains**. Should I need to implement a JVM to get the J2SE and JavaFX platform? I just want to build a small Java based OS especially using JavaFX. I have the `glibc-2.9` library to run the framework as said by the requirement to run Embedded J2SE. But there is no tutorial about how to install or set it up to work. Can anyone help me?


title: Read Usenet comp.unix and more with back-then software (trn)

text: Is there a way to read the comp.unix Usenet discussions (and others) using the software that was used then? I'd like to read it to learn, but I can do a bit of escapism at the same time. Besides, as Usenet was so immense in popularity, probably that software wasn't bad at all. I found `trn` ("threaded read news program"), and, with `export NNTPSERVER=Aioe.org`, I get something, but not anything sensible to read. It seems, you should put newsgroups in a `.newsrc` file. Does anyone know how to do this if it is indeed possible?


title: How to make Cron run

text: I am trying to set up `cron` to run the `mysqlauditgrep` command (its the MySQL 5.6 Utilities package). The `mysqlauditgrep` command is in bash. The command I am looking to run is:               mysqlauditgrep --format=GRID /var/lib/mysql/audit.log      This command will make my audit log that has been created by mysql to be viewed in a Grid format. It is not run in the mysql shell. So I just installed Cron and set up the crontab by setting this:               00 11 * * fri root usr/bin/mysqlauditgrep mysqlauditgrep --format=GRID /var/lib/mysql/audit.log      I am new to cron so maybe I set it up wrong. I did run /sbin/service crond start after I nanoed into the crontab file. I am unable to see if the action has taken place though.


title: Send command to detached screen and get the output

text: I've been searching to find a way to send a command to a detached screen session. So far, so good. This is what I've come up with:               $ screen -S test -p 0 -X stuff 'command\n'      This command works as it should. But, I would like the output from it too, echoed straight in front of my eyes (no need for a `.log` file or something, I just want the output). Using the `screen -L` command, is not an option.


title: How to Find the Cause of Too Many Dropped SSH Connections?

text: Overview: I have a home setup, behind a home router, on which there is Proxmox Hypervisor running over 10 VMs. One of those VMs is the first point of entry after router. It is just a jump host Centos 64bit. On the router all port 22 requests are forwarded to that VM. Then through that VM I control the rest of the VMs. Problem: For the last 3 days I have been experiencing a high number of random SSH disconnects. Minutes after I ssh to the jump host or other VMs through the jump host, I get disconnected for no apparent reason. Sometimes it is after 20 minutes, sometimes 5. It seems like using vi makes it worse. I really cannot figure out what is causing it. The system is very stable most of the time. Question: I started checking the logs. I don't see anything other than disconnect received and so on. So how exactly should I proceed to check for this issue? Should I check client side logs first? `/var/log/secure` on the jump host VM? logs on hypervisor level?


title: shell script - reading from standard input versus a file

text: I have the following input file in.txt: a   b   c   a   b   c I have the following script test.sh:               # display unique rows     while read line     do        echo $line     done < $(cat "$@" | sort | uniq)           # display all rows     while read line     do        echo $line     done < $(cat "$@")       I know I can run the script using: sh test.sh in.txt I also know I can run it using standard input instead of a file. However, this only supplies input to the first while loop. How can I supply the input to both loops without typing the input twice?


title: How do I install GCC and make on a mac without administrator access or using Xcode?

text: I'd like to install gcc and make on my Macbook Air, but I don't have root access on it. I found this link through searching on google, but I have no idea how to set up the prefix's so that the actual `gcc` executable can find the libraries. I have a directory set up with node.js and git installed at `~/usr/local` and I'd like to install GCC there also. I have no idea where to start with make. Can anyone help? :D


title: MIC not working due to USB bandwidth

text: Using debian and centos, i get the same error when plugging my USB mic in. In Windows (xp thru 8.1) it works fine.               [ 304.237543] usb 2-1.6.2: USB disconnect, device number 6     [ 305.220785] usb 2-1.6.2: new full-speed USB device number 9 using ehci-pci     [ 305.331189] usb 2-1.6.2: New USB device found, idVendor=a012, idProduct=b012     [ 305.331195] usb 2-1.6.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3     [ 305.331198] usb 2-1.6.2: Product: DYNEX USB MIC Device     [ 305.331201] usb 2-1.6.2: Manufacturer: DYNEX     [ 305.331204] usb 2-1.6.2: SerialNumber: 12000002     [ 305.338744] input: DYNEX DYNEX USB MIC Device as /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.6/2-1.6.2/2-1.6.2:1.2/input/input21     [ 305.338893] hid-generic 0003:A012:B012.000A: input,hidraw3: USB HID v1.00 Device [DYNEX DYNEX USB MIC Device] on usb-0000:00:1d.0-1.6.2/input2     [ 305.366189] cannot submit urb 0, error -28: not enough bandwidth               [ 304.237543] usb 2-1.6.2: USB disconnect, device number 6     [ 305.220785] usb 2-1.6.2: new full-speed USB device number 9 using ehci-pci     [ 305.331189] usb 2-1.6.2: New USB device found, idVendor=a012, idProduct=b012     [ 305.331195] usb 2-1.6.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3     [ 305.331198] usb 2-1.6.2: Product: DYNEX USB MIC Device     [ 305.331201] usb 2-1.6.2: Manufacturer: DYNEX     [ 305.331204] usb 2-1.6.2: SerialNumber: 12000002     [ 305.338744] input: DYNEX DYNEX USB MIC Device as /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.6/2-1.6.2/2-1.6.2:1.2/input/input21     [ 305.338893] hid-generic 0003:A012:B012.000A: input,hidraw3: USB HID v1.00 Device [DYNEX DYNEX USB MIC Device] on usb-0000:00:1d.0-1.6.2/input2     [ 305.366189] cannot submit urb 0, error -28: not enough bandwidth      What i noticed is that with centos, the issue existed from the start, with debian, the mic initially worked until i allowed the update process to continue. after rebooting, i began to see this issue. I assume due to the output that this is due to a kernel change, possibly with the ehci/uhci but i'm not positive. The MIC on my webcam works (although a little delayed due to some other errors) and a line in mic works, im only having this issue with this particular USB mic. Attempting some other solutions, i completely removed pulseaudio as many blame world hunger on pulse, but even with just Alsa, the problem still remained. This furthers my belief that the issue is with the kernel and/or modules as opposed to other software. Does anyone have any thoughts?


title: Separate SSHD Authpriv logs into /var/log/sshd, all other authpriv logging goes to messages

text: Right now, sshd is using the `authpriv` facility. The level of logging is fine, but I don't want it in the syslog, I want it to go to `/var/log/sshd` (which doesn't yet exist) on Red Hat Linux/Enterprise Linux. `authpriv` is configured to go to syslog by `syslogd.conf`. Do I need to change the facility on sshd to `local2` (or any other unused local) for instance, and then direct `local2` to `/var/log/sshd` or is there a better way?


title: "Northbridge Error (node 0): ECC Error in the Probe Filter directory"

text: I've received an e-mail from a user worried that the following errors on one of his servers is indicative of a serious problem. The trouble is, the errors below are _all_ that I have to go on. I usually consider myself a decent Googler, but in this case I can only find _one_ other incident where the users encountered this error regarding "Probe Filter directory":               [1044 snapshots @ abc]$     Message from syslogd@abc at Sep  8 02:51:51 ...       kernel:[Hardware Error]: CPU:0      MC4_STATUS[Over|CE|MiscV|-|AddrV|-|Poison|CECC]: 0xdc0248d0001f010b          Message from syslogd@abc at Sep  8 02:51:51 ...       kernel:[Hardware Error]:       MC4_ADDR: 0x0000000000010f40          Message from syslogd@abc at Sep  8 02:51:51 ...       kernel:[Hardware Error]: Northbridge Error (node 0): ECC Error in the      Probe Filter directory.          Message from syslogd@abc at Sep  8 02:51:51 ...       kernel:[Hardware Error]: cache level: L3/GEN, tx: GEN, mem-tx: GEN      From what I can tell, this only happened once. Grepping around the logs for other hardware errors turns up nothing other than this one incident. The forum post which I reference above simply ends with basically telling the user not to worry about it if it only happened once and didn't cause any fatal issues. This is the same advice I got from my colleagues, who also mentioned that there are too many variables (i.e. what was running at 2:50am on September 8th?). However this user wants to be reassured that something isn't wrong with their system. What can the above errors indicate or be related to? What is the "Probe Filter directory?" What tests can I run to put the user at ease that this doesn't flag their machine for impending doom? The Linux distribution of the machine is Red Hat Enterprise Linux Server release 6.4 (Santiago).


title: What is the difference between shell, eshell, and term in Emacs?

text: In Emacs I can run a shell using following commands -               M-x term          M-x shell          M-x eshell      What is the difference between these three?


title: How to avoid sending EOF from a script parsing requests from and sending answers to netcat

text: I made a simple server using netcat and backpipe:               mkfifo backpipe     nc -l 8080 < backpipe | parseRequests.sh > backpipe      The contents of "parseRequests.sh" is just:               #!/bin/sh     if [ "$1" = "1+1" ]; then echo "2"; else echo "0"; fi      When I connected to this server in another machine using               nc 10.0.0.2 8080      The connection ended immediately with "0" returned. My question is, how can I keep the connection so that I can type many requests in the client side? If I use 'tee log.txt' instead of 'parseRequests.sh', the connection can be kept alive. I guess the 'echo' command in the "parseRequests.sh" sent an EOF signal to nc, which caused nc to quit immediately. How can I avoid this? I know I can listen to requests on one port and send answers back using another port in a loop. But I prefer to keep the same port alive for both requests and answers.


title: Tool to show PID and file I/O in realtime

text: I need to watch a program which modifies some files. I don't know which files the process is modifying_. So I'm looking for a tool that basically outputs a PID, and lista the files being accessed/modified, and what's being done to them (both read and write). The closest thing I've found so far is iotop, which is definitely on the right track.               iotop -o -b -qqq      That gets me the process and the read/write, but it _doesn't indicate the file being accessed_. Alternately, I think I could try something like               inotifywatch -r /      but that just runs out of allowed inotify watches. What is the magic tool I'm looking for?


title: I always need to ifdown/ifup wlan0 after reboot

text: I'm trying to create an ad-hoc wifi made of 5 computers (one windows pc and 4 raspberry pi loaded with a raspbian) the raspberry pi will talk through mqtt, but tha'ts not the point. The problem I have is that I always need to do the following in order to have the `wlan0` interface after each reboot:               sudo ifdown wlan0     sudo ifup wlan0      Do you know why? Here is my conf (the same on each pi except the ip adress obviously!)               ~ % ifconfig                      eth0      Link encap:Ethernet  HWaddr b8:27:eb:ff:88:99                 inet addr:192.168.1.41  Bcast:192.168.1.255  Mask:255.255.255.0               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:951 errors:0 dropped:0 overruns:0 frame:0               TX packets:266 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:66321 (64.7 KiB)  TX bytes:43663 (42.6 KiB)          wlan0     Link encap:Ethernet  HWaddr 00:0f:13:51:05:8c                 inet addr:192.168.0.2  Bcast:192.168.0.255  Mask:255.255.255.0               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:0 errors:0 dropped:0 overruns:0 frame:0               TX packets:42 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:0 (0.0 B)  TX bytes:2520 (2.4 KiB)          ~ % iwconfig     wlan0     IEEE 802.11bgn  ESSID:"mirroir"                 Mode:Ad-Hoc  Frequency:2.412 GHz  Cell: 42:B1:44:EB:D2:C1                  Tx-Power=20 dBm                  Retry  long limit:7   RTS thr:off   Fragment thr:off               Power Management:on          lo        no wireless extensions.          eth0      no wireless extensions.               ~ % more /etc/network/interfaces      auto lo     iface lo inet loopback     iface eth0 inet dhcp     allow-hotplug wlan0     auto wlan0     iface wlan0 inet static         address 192.168.0.2         netmask 255.255.255.0         wireless-channel 1         wireless-essid mirroir         wireless-mode ad-hoc         wireless-key 967136deac          ~ % sudo route add -net 192.168.0.0 netmask 255.255.255.0 wlan0          ~ % netstat -r     Kernel IP routing table     Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface     default         192.168.1.254   0.0.0.0         UG        0 0          0 eth0     192.168.0.0     *               255.255.255.0   U         0 0          0 wlan0     192.168.1.0     *               255.255.255.0   U         0 0          0 eth0      Any idea? **UPDATE:** it seems to work but not always, like 1 boot out of 10, really weird?! Regards


title: How to perform a multi line grep

text: How would you perform a grep for text that appears on two lines? For example: `pbsnodes` is a command I use that returns the utilization of a linux cluster               root$ pbsnodes     node1         state = free         procs = 2         bar = foobar          node2         state = free         procs = 4         bar = foobar          node3         state = busy         procs = 8         bar = foobar      I want to determine the number of procs that match nodes that are in state 'free'. So far I have been able to determine the "number of procs" and "the nodes in free state", but I want to combine them into one command that shows all free procs. In the above example, the correct answer would be 6 (2+4). What I have               root$ NUMBEROFNODES=`pbsnodes|grep 'state = free'|wc -l`     root$ echo $NUMBEROFNODES     2          root$ NUMBEROFPROCS=`pbsnodes |grep "procs = "|awk  '{ print $3 }' | awk '{ sum+=$1 } END { print sum }'`     root$ echo $NUMBEROFPROCS     14      How can I search for every line that reads 'procs = x', but only if the line above it reads 'state = free?


title: Why I can't connect to VPS after changing OS from CentOS to Ubuntu?

text: Recently, I've changed my VPS operating system from CentOS to Ubuntu. Unfortunately since then I can't connect to my VPS. The following message comes again and again (screenshot attached). ![enter image description here](http://i.stack.imgur.com/MZYhk.png) Why this is happening and how can I solve that?


title: Flash plugin of debian vulnerable?

text: I run Debian wheezy with Iceweasel as browser and have installed the Flash plugin similar to this description. Today I read that not only Flash on Windows and Mac also Adobe Flash Player 11.2.202.350 and earlier versions for Linux are vulnerable to exploitation. When checking my version in Iceweasel > Tools > Add-ons I was surprised to see that it is an older version, even though I did all upgrades with `apt-get`. Does Debian provide updates for the Iceweasel plugin Flash at all? Are they not automatically provided? Do I always have to manually update the plugin?


title: Remove GPT - Default back to MBR

text: I keep receiving this error: > Warning!! Unsupported GPT (GUID Partition Table) detected. Use GNU Parted I want to go back to the normal MBR. I found some advice here and did:               parted /dev/sda     mklabel msdos     quit      But when I get to the `mklabel` option it spits out a warning that I will lose all data on `/dev/sda`. Is there a way to get the normal MBR back without formatting the disk?


title: How can you determine which process scheduler is being used?

text: I.e. is it the O(1) scheduler, the CFS scheduler, or an older one?


title: Which process scheduler is my linux system using?

text: I'm not quite sure if stackoverflow or serverfault is the forum to use for this question, but ill try here. Is there some command i can use or a file i can check in order to find out which process scheduler im using on my linux system ? I am _not_ looking for the I/O scheduler, but the process scheduler, and please, do not refer to guides or howtos for what a scheduler is, what im simply asking is if there is a command or file i can run/check to see this. I could check the doc for my kernel but again im just wondering if there is a command or file i can check. I might have been a little redundant above but thats because the posts ive seen people seem to confuse process scheduler with the i/o scheduler, and they dont seem to answer the actual question, just provide links to what a scheduler is which is not what im after here, so apologies if the above comments sounded rude.


title: Ensure that loopback root and host are unmounted on shutdown

text: I'm trying to setup a Linux system that runs from an LVM-formatted image file. After some tinkering with the initramfs and boot options I managed to make it up and running by mounting the host file system to `/run/initramfs/host`, `losetup`ing the image to `/dev/loop0` and making sure the kernel and udev detect the LVM (and the root LV) in there. So far so good. The problem is that when shutting down (or rebooting, or …) the system neither the root file system nor the host are unmounted properly, because of a chicken-and-egg scenario: the root (or `/oldroot`, as it's referred to by the shutdown script) cannot be unmounted, because `/oldroot/run/initramfs/host` is still mounted, and the host cannot be unmounted, because doing so would make `/oldroot` inaccessible. Unclean shutdowns aren't the end of the world, because both file systems are journaled, so during the next boot `fsck` simply replays the journals, but obviously clean shutdowns would be better. So the question is: is it somehow possible to arrange the shutdown sequence (I _can_ modify the shutdown script), _or_ the bootup sequence (perhaps by moving the host mount point to a different place) so that both file systems can be cleanly unmounted?


title: How to configure pppoe client on OpenBSD?

text: I have an OpenBSD 5.1 installed + a cable from my ISP. I have the username/password for the PPPoE connection, but how can I configure the connection to be permanent? (I have 1 interface on the machine.) UPDATE: according to google I will need to fill out the /etc/ppp/ppp.conf file..


title: Knowing if a directory is modified

text: I have a server online and I am wondering if there's a way to know if some file on the server is modified or a new file is added to certain directories. For example, I have this public_html/myblog/files this directory contains several files. What I want is to be notified by email if one of the current files inside that directory is modified or if a new file is added to that directory. If possible to receiving a message telling me what files are new or were modified. Is this possible? I am using CentOS 6.8 thanks.


title: How to select optional components during FreeBSD 9.0 Install?

text: I am installing FreeBSD 9.0 on VMWare Player. In section 2.5.3 of the installation guide it shows that one can choose which components to install. What keys on the keyboard do I need to use to (de)select those options? I cannot seem to figure it out.


title: How to determine how many bytes / hr are being written to my SD card

text: I have a Debian embedded Linux system that uses an SD card as the RFS. What is a reliable way to determine how many bytes / hr are being written to the SD card?


title: Processing a Yes/No Response from Bash User

text: This very well may be stupidity on my part. I would like to accept Yes/No, True/False responses within my Bash script: _test.sh_               #!/bin/bash          ARGUMENT=$1          echo User passed in $ARGUMENT          OPTARG=${ARGUMENT:0:1}          if [[ "$OPTARG" -eq 0 ]] || [[ "${OPTARG^^}" == "N" ]]; then         echo Decline     elif [[ "$OPTARG" -eq 1 ]] || [[ "${OPTARG^^}" == "Y" ]]; then         echo Accept     else         echo Invalid argument     fi      Here are some sample results: **./test.sh 0**               User passed in 0     Decline      **./test.sh 1**               User passed in 1     Accept      **./test.sh 2**               User passed in 2     Invalid argument      **./test.sh No**               User passed in No     Decline      * * * Now the stumper. Why is `[[ "${OPTARG^^}" == "N" ]]` returning true for any string!? **./test.sh Yes**               User passed in Yes     Decline      **./test.sh ThisShouldNotMatch**               User passed in ThisShouldNotMatch     Decline


title: How to execute a command repeatedly with different arguments?

text: I'm on Ubuntu. I copied some arguments (separated by newline) and I can use xsel to print them out like this               $ xsel     arg1     arg2     arg3     arg4     ...      Now, I want to use each of these arguments for another command and execute that command as many times as there are arguments. So I tried               $ xsel | mycommand "constantArgument" $1      However, this executed `mycommand` only for the first argument. How can I execute it for every argument?


title: ext4 inode size, shown by dumpe2fs

text: Manpage about `mke2fs` says "mke2fs creates 256-byte inodes by default". I've formatted my small (320MB) test partition with command:               sudo mkfs -t ext4 /dev/sdc1      The defaults for the `mke2fs` are below:               [defaults]       base_features = sparse_super,filetype,resize_inode,dir_index,ext_attr       default_mntopts = acl,user_xattr       enable_periodic_fsck = 0       blocksize = 4096       inode_size = 256       inode_ratio = 16384          [fs_types]     ...       ext4 = {                features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize                auto_64-bit_support = 1                inode_size = 256       }     ...      Then I ran `dumpe2fs` and it showed me:               ...     Inode size:           128     ...      The program version is below:               dumpe2fs 1.42.8 (20-Jun-2013)         Using EXT2FS Library version 1.42.8      Also, the superblock field `s_inode_size` = 128 (I read the superblock directly by `pread64`). So, what would be the actual inode size in my case? (I'm on Ubuntu 3.11, which runs as a guest VM in VMWare Fusion)


title: Samba: mount error: could not resolve address for XXX: Unknown error

text: I've read several guides on mounting samba shares, but no luck yet. I'm able to "login" to my samba share with the following command:               smbclient //vvlaptop/Documents      It asks for password, but there is no password so I just press Enter. It then successfully logs me in with the prompt `smb: \>`. For some reason I'm unable to mount the share. This is the command I'm using:               mount -t cifs //vvlaptop/Documents /mnt/virginia     mount error: could not resolve address for vvlaptop: Unknown error      How can I mount this device successfully?


title: how to install bumblebee in linux mint 17 ?

text: I Found Nvidia Drivers Freezes In Cinnamon or Their Cinnamon Crash or Run in Fall-back mode. As bumblebee works better, how can I install bumblebee in Linux mint 17


title: Checking the type of NAT

text: I have read that there are many types of NATs available like symmetric NAT, full-cone NAT, etc. If I am behind a NAT, is there any way to find out the type of NAT behind which I am currently working on? I setup my own Ubuntu desktop as a NAT machine using the basic iptables rules and by adding one more NIC card. I used the following rules:               $ iptables -t nat -A POSTROUTING --out-interface eth0 -j MASQUERADE     $ iptables -t filter -A FORWARD --in-interface eth1 -j ACCEPT      Is there any way I can see my NAT table?


title: Make errors when compiling hulahop

text: When I cloned hulahop I had a few possibilities to install it. I have chosen the path with `autogen.sh` I used commands:               $ sh autogen.sh # -> OK     $ ./configure   # -> OK      But `make` fails:               $ sudo make 2> errors.txt     $ cat errors.txt     hulahop.cpp:28:29: error: pyxpcom/PyXPCOM.h: No such file or directory     In file included from /usr/include/python2.6/Python.h:8,                      from hulahop-web-view.h:23,                      from hulahop.h:23,                      from hulahop.cpp:31:     /usr/include/python2.6/pyconfig.h:395:1: warning: "HAVE_LONG_LONG" redefined     In file included from /usr/include/xulrunner-1.9.2.24/nspr/prtypes.h:58,                      from /usr/include/xulrunner-1.9.2.24/nscore.h:51,                      from /usr/include/xulrunner-1.9.2.24/nsDebug.h:42,                      from /usr/include/xulrunner-1.9.2.24/nsCOMPtr.h:59,                      from hulahop.cpp:20:     /usr/include/xulrunner-1.9.2.24/nspr/prcpucfg.h:807:1: warning: this is the location of the previous definition     In file included from /usr/include/python2.6/Python.h:8,                      from hulahop-web-view.h:23,                      from hulahop.h:23,                      from hulahop.cpp:31:     /usr/include/python2.6/pyconfig.h:1031:1: warning: "_POSIX_C_SOURCE" redefined     In file included from /usr/include/sys/types.h:27,                      from /usr/include/xulrunner-1.9.2.24/nspr/obsolete/protypes.h:79,                      from /usr/include/xulrunner-1.9.2.24/nspr/prtypes.h:517,                      from /usr/include/xulrunner-1.9.2.24/nscore.h:51,                      from /usr/include/xulrunner-1.9.2.24/nsDebug.h:42,                      from /usr/include/xulrunner-1.9.2.24/nsCOMPtr.h:59,                      from hulahop.cpp:20:     /usr/include/features.h:158:1: warning: this is the location of the previous definition     In file included from /usr/include/python2.6/Python.h:8,                      from hulahop-web-view.h:23,                      from hulahop.h:23,                      from hulahop.cpp:31:     /usr/include/python2.6/pyconfig.h:1040:1: warning: "_XOPEN_SOURCE" redefined     In file included from /usr/include/sys/types.h:27,                      from /usr/include/xulrunner-1.9.2.24/nspr/obsolete/protypes.h:79,                      from /usr/include/xulrunner-1.9.2.24/nspr/prtypes.h:517,                      from /usr/include/xulrunner-1.9.2.24/nscore.h:51,                      from /usr/include/xulrunner-1.9.2.24/nsDebug.h:42,                      from /usr/include/xulrunner-1.9.2.24/nsCOMPtr.h:59,                      from hulahop.cpp:20:     /usr/include/features.h:160:1: warning: this is the location of the previous definition     hulahop.cpp: In function ‘HulahopWebView* hulahop_get_view_for_window(PyObject*)’:     hulahop.cpp:101: error: ‘Py_nsISupports’ has not been declared     hulahop.cpp:112: error: ‘do_GetService’ was not declared in this scope     make[1]: *** [hulahop.lo] Error 1     make: *** [all-recursive] Error 1      Could you help me with compilation?


title: Why does Eclipse think I'm typing "ctrl+a" when I'm only typing "a"?

text: I currently using Eclipse with Fedora 16, everything is perfect before I use `Ctrl`+`H` to search a file. In the file search tab:   * When I type 'a' Eclipse seems to get a 'ctrl + a'   * So I cannot type an 'a' for searching But in the editor everything is ok! Before I type 'a': ![befor i type 'a'](http://i.stack.imgur.com/hzaQ0.png) After I type 'a': ![after i type 'a'](http://i.stack.imgur.com/6zotL.png) But when I click the file search in toolbar, I can type everything. What's going on?


title: How to copy someone's else folders from public.me.com with a wget-like tool?

text: How can I copy a folder from http://public.me.com/ (a service related to iDisk, or MobileMe) to my local filesystem with a Unix tool (like _wget_ , **a command-line non-interactive tool** )? The problem is that the web interface is actually a complex Javascript-based thing rather than simply exposing the files. (Even _w3m_ can't browse, e.g., https://public.me.com/rudchenko.) My goal is to update the local copy from time to time non-interactively, and to put the command to download the files to a script, so that other people can run the script and download the files. A _wget_ -like ( _rsync_ -like, _git pull_ -like) tool will suit me, or a combination of mounting a network filesystem via FUSE and then using standard Unix commands to copy the directories will do. I've read in the Wikipedia articles (which I refer to above) that Apple provides WebDAV access to these services, and I've also read about _cadaver_ , a _wget_ -like WebDAV client, but I can't figure out which address I should use to access the folders at http://public.me.com/ read-only (anonymously). Perhaps Gilles' comment (that WebDAV isn't currently used) is true, but still there seems to be some WebDAV stuff behind the scene: the URL passed to the browser for downloading an archive with a directory (after pressing the "download selected files" button at the top of the web interface) looks like this:               https://public.me.com/ix/rudchenko/SEM%20Sep21%201%20TO%20PRINT.zip?webdav-method=ZIPGET&token=1g3s18hn-363p-13fryl0a20-17ial2zeu00&disposition=download      -- note that it mentions "WebDAV". (If you are curious, I tried to re-use this URL as an argument for _wget_ , but it failed:               $ LC_ALL=C wget 'https://public.me.com/ix/rudchenko/SEM%20Sep21%201%20TO%20PRINT.zip?webdav-method=ZIPGET&token=1g3s18hn-363p-13fryl0a20-17ial2zeu00&disposition=download'     --2011-11-21 01:21:48--  https://public.me.com/ix/rudchenko/SEM%20Sep21%201%20TO%20PRINT.zip?webdav-method=ZIPGET&token=1g3s18hn-363p-13fryl0a20-17ial2zeu00&disposition=download     Resolving public.me.com... 23.32.106.105     Connecting to public.me.com|23.32.106.105|:443... connected.     HTTP request sent, awaiting response... 404 Not Found     2011-11-21 01:21:48 ERROR 404: Not Found.     $       ) (I'm using a GNU/Linux system.)


title: How to know user type in LINUX machine

text: My account has been created on a LINUX machine. But, I don't know which type of user I am ( root user or normal user) and which type of access I have. Is there any command through which I can check whether I have **sudo** access or not in a linux machine if I already have an account.


title: Resource friendly way to indicate to user program is not hanging

text: I have a Perl script on a *nix system which, at one point, is processing 50,000 + lines of text. This takes some time. I am trying to find a resource friendly way to let the user know the program is not hanging while it is processing all of this text. Currently I am printing output in realtime as the text is being processed . I am flushing the output buffer then printing the output on one line with `\r`. This seems to be an unnecessary use of resources because it takes almost twice as long than when I print nothing, but as I have said, when printing nothing it looks like the program is hanging. So my question: Is there a standard or simple way to let the user know the program is indeed running while performing long running tasks?


title: X11 fonts have gone - applications fall back to typewriter

text: After removing several packages, updating within Debian/Jessie, and rebooting, several applications (windows manager, Xfce4 panel, mail client, browser) fall back to typewriter; Sans/Regular seems to have disappeared from my system. I have the list of removed packages; I can find none that is plausibly related to X11 fonts.


title: Merge source files with destination, replacing older ones

text: I'm looking for the linux equivalent of the DOS command:               xcopy from/* to/* /s/e/d/y      Which copies over all new files and only replaces old ones. I'll be running this from the terminal of a Mac OSX computer.


title: scripted pdf code review

text: ## What I try to achieve I need to review a bunch of C source code spread out into dozen of directories. I already have a bash script which does the following: It searches for all source codes in the directory I'm interested in. For each code found, it generates a pdf (where the source file is) using the following command:               a2ps $source -R --columns=1 --prologue='color' --line-numbers=1 -T2 -M A4 \       --chars-per-line=100 --borders=no --encoding=iso1 -o - | \       ps2pdf -sPAPERSIZE=a4 - $dest      Then it opens this generated pdf with a PDF viewer to let me review it using sticky notes. I then save it, close it and the script do the same for the next c source code, etc. This way I can review all the source codes in an automatic way and distribute the review back in a handy pdf format. ## Where it fails I can't find a proper PDF reader which allows me to do exactly what I've mentioned above. Basically what I've tried : ### Evince Don't allow to save the sticky notes in the same file, I need to "Save as..." and evince then open the previous location used and not the location of the current pdf. This force me to manually navigates trought the directories to find the source pdf to override it. ### Xournal It don't have sticky notes and this is mandatory for me. ### Okular The sticky notes are not visible into Adobe Reader which is mandatory for me too. ### Adobe Reader 9 This old version for Linux (thanks Adobe) don't support sticky notes. ## Therefore what I need To summarize what I've said above, I need a PDF reader that is :   * able to _save_ the annotated pdf directly or at least _save as_ it in the same directory directly   * using official pdf sticky notes   * creates sticky notes that are visible into, at least, _Adobe Reader_ and _evince_ Your help is much appreciated has it could save me a lot of time! Also feel free to suggest a whole different workflow idea if it's matching my requirement.


title: Installing Linux over Windows 7

text: I have a computer with three hard drives:   1. SSD with Windows 7 installed   2. HDD with Linux Mint installed   3. HDD with no OS, formatted as NTFS drive for storing files. I have been using EasyBCD to dual boot, and when I am in Windows 7, I can only see drives 1 and 3. When I am in Linux Mint, I can only see drives 2 and 3. I got a new computer, and want to install Linux Mint on the SSD, but I am having an issue. I put Mint on a thumb drive with Universal USB Installer, and when I boot to the thumb drive, it can only see drives 2 and 3. I checked the 'DYI' partitioning section and drive 1 does not show up there either. So, my question is, how can I make drive 1 visible when I am booting to the other drives so that I can install Mint over it? edit: Here is where it gets really weird. When I try to wipe drive 1 (the SSD with Windows 7) DBAN doesn't register it


title: SSH not working from one specific computer

text: I can connect from every other computer on the LAN, as well as externally. It connects fine to other machines running SSHD. When trying ssh with verbosity, I get the following readout:               $ ssh -vvv 192.168.1.9     OpenSSH_6.2p2, OpenSSL 1.0.1e 11 Feb 2013     debug2: ssh_connect: needpriv 0     debug1: Connecting to 192.168.1.9 [192.168.1.9] port 22.     debug1: Connection established.     debug1: identity file /home/Steven/.ssh/id_rsa type -1     debug1: identity file /home/Steven/.ssh/id_rsa-cert type -1     debug3: Incorrect RSA1 identifier     debug3: Could not load "/home/Steven/.ssh/id_dsa" as a RSA1 public key     debug1: identity file /home/Steven/.ssh/id_dsa type 2     debug1: identity file /home/Steven/.ssh/id_dsa-cert type -1     debug1: identity file /home/Steven/.ssh/id_ecdsa type -1     debug1: identity file /home/Steven/.ssh/id_ecdsa-cert type -1     debug1: Enabling compatibility mode for protocol 2.0     debug1: Local version string SSH-2.0-OpenSSH_6.2     ssh_exchange_identification: read: Connection reset by peer      Any idea what I might have messed up? I don't recall changing in the SSH config files, only adding some users to groups to experiment with permissions. Even when I try not specifying an account (as above) it still hangs at "Local version string SSH-2.0-OpenSSH_6.2" for a minute before giving the final error. I'm running Ubuntu Server 12.04 x86, for what it's worth.


title: Is there a grep switch that reads a file for filter terms?

text: Assuming file a.txt has:               1a     2b     3c     4d      so               grep "1" a.txt      would return:               1a      and               grep "3" a.txt       would return:               3c      what if i want to put a criteria file named crit.txt with the following content:               1     3      is there a switch in grep say -cf for criteria file where i could do               grep -cf crit.txt a.txt      that would return:               1a     3c      or is there other tool that does the same thing, and provide me with an example on how to use the tool. The tool should be a one liner command.


title: Define custom DNS server when looking up host

text: I'm having trouble with my current web host's DNS server which doesn't correctly resolve IP addresses for Baidu.               shell_exec('host -W 2 180.76.5.168');     shell_exec('nslookup 180.76.5.168');      Is there a way I can define my own DNS server address when trying to resolve the host? Quoted output of my localhost result... > host: baiduspider-180-76-5-168.crawl.baidu.com > > Server: Wireless_Broadband_Router.home Address: 192.168.1.1 Name: > baiduspider-180-76-5-168.crawl.baidu.com Address: 180.76.5.168


title: USB booting to installing Linux on a new Lenovo laptop

text: I recently got a Thinkpad T440s with Windows 8.1 for my job, and since most of my work is done under Linux I am going to install Ubuntu on it, so that I can dual boot. The problem is that it won't boot from USB. In the BIOS, the Boot Priority Order only has the Windows Boot Manager and LAN, with USB devices appearing under "Excluded from boot priority order" lower down. After preparing a USB flash drive as a Ubuntu installer, I thought I can get the computer to boot from USB at least once by going through the PC Settings window, then Update and Recovery -> Recovery -> Advanced Start Up -> Use a Device and picking one of the USB devices, but the computer just ignores the flash drive and boots straight into Windows. On older computers I just use GRUB to pick what operating system to boot into, but with this computer I'm not sure how to best configure the start up - is Windows Boot Manager going to interfere? I tried to search on Google but nothing I could find was really of help. The techs here _won't_ help or support me, although installing Linux is allowed - and even necessary, in my case.


title: SSH to untrusted machine

text: If I SSH to a remote server, is it be possible for the admins of that machine to use my SSH session to send data back down the connection and do something to my local PC? I use DSA keys and do not allow password logins to my SSH server, and I do not allow root access. If it would still be possible despite these precautions, could you explain how it is done with code/links so I can understand? Another thing I am worried about is that if I connect to the remote server, the admins may be able to hijack my pts session and simply type `exit` to get to my PC. Again, please let me know if this is possible and if so please provide code/links I've done a bit of googling and turned up nothing so far.


title: Initrd : Were can I found the code for real-root-dev

text: I'm trying to customize my initrd on kernel 2.4. At some point, inside the file linuxrc, I have the opportunity to set my root device setting the /proc/sys/kernel/real-root-dev variable The example on docs is the one belowe:               echo 0x301 > /proc/sys/kernel/real-root-dev      > where 0x301 is for /dev/hda1 What I'm looking for is the code needed for device different form hda1. I had searched throug the web by I didn't find an answer, so I hope some of you can help me.


title: Apache2 not reading sites-enabled/*.conf

text: So I'm trying to set up my site with Apache on Ubuntu 14.04. I have created a `mydomain.com.conf` file in `sites-available/`. It looks like this; **mydomain.com.conf**               <VirtualHost *:80>         ServerName mydomain.com         ServerAlias www.mydomain.com         ServerAdmin admin@mydomain.com              DocumentRoot /var/www/mydomain.com/public_html              ErrorLog ${APACHE_LOG_DIR}/mydomain.com/error.log         CustomLog ${APACHE_LOG_DIR}/mydomain.com/access.log combined     </VirtualHost>      **000-default.conf**               <VirtualHost *:80>         ServerAdmin webmaster@localhost         #DocumentRoot /var/www              ErrorLog ${APACHE_LOG_DIR}/error.log         CustomLog ${APACHE_LOG_DIR}/access.log combined     </VirtualHost>      For some reason apache doesn't seem to read `mydomain.com.conf` at all, it will always default to the configuration in `000-default.conf`. When visting my site I get a 403 Forbidden response.   1. I've enabled the site by `a2ensite mydomain.com` and reloaded Apache.   2. `apachectl configtest` returns `Syntax OK` The `error.log` file for **`000-default.conf`** says               [Wed Sep 03 11:01:48.717652 2014] [autoindex:error] [pid 5869] [client 2.71.93.10:55718] AH01276: Cannot serve directory /var/www/: No matching DirectoryIndex (index.php,index.html,index.cgi,index.pl,index.xhtml,index.htm) found, and server-generated directory index forbidden by Options directive      while the error log & access log for `mydomain.com` is empty. My `apache2.conf` does a `IncludeOptional sites-enabled/*.conf`. The security model in `apache2.conf` looks like this;               <Directory />             Options FollowSymLinks             AllowOverride None             Require all denied     </Directory>          <Directory /var/www/>             DirectoryIndex index.php, index.html             AllowOverride None             Require all granted     </Directory>      What's wrong?


title: "Links" to dirs that have features of both hard and soft links?

text: It is not allowed to create a hard link for a dir. But the soft like will not work, if I later change the name of the dir. How would you solve the dilemma? Are there applications which can   * make soft links work after changing the dir's name? Or   * make hard links work for dirs?


title: what interface does lpsched provide that cups does not?

text: Work has a Linux stock/erp custom system that uses the Unix System V (Solaris, SCO, HP-UX) lpsched program that someone who used to work here compiled for RHEL/CentOS 5 i686 (I have no idea why or how). From a system admin point of view this is pain in the neck to install, and support on new CentOS 6+ x86_64 systems as it requires copying old binaries from old systems, and just putting up with the bugs. I see that cups provides the commands   * lp   * lpadmin   * lpc   * lpoptions   * lpq   * lpr   * lprm   * lpstat   * cancel What way can a program use lpsched that is not already provided by cups? Note that large parts of the custom software we run rely on the ability to send printer language (Kyocera prescribe) as is to the printer over the network to the printer's print queue. Essentially I'd like to remove our reliance on this messed up situation and just be able to use cups for all printing.


title: How to avoid emerge recalculating dependencies after adding required keywords/uses?

text: While `emerge --autounmask-writes` followed by a `etc-update` basically automates adding additional keywords and use flags, running `emerge` afterwards (without any other modifications) will _again_ calculate the very same dependencies, which on a slower machine may waste several redundant minutes - how can this be avoided?


title: tee / sudo password cache conflict?

text: I have a large bash script (Ubuntu 12.04). The script is designed to be invoked by a regular user; only certain commands within the script run with sudo. It is not an option to run the entire script as root. Within the script I have a lot of statements similar to these:               echo "blah blah" | sudo tee /path/to/file      and               sudo tee /path/to/file > /dev/null << 'END'     blah blah     END      The form of those statements is largely due to the script being designed to not run as root. I put a lot of work into getting those statements right. (It was a learning experience for me.) The script works well and I do not want to massively change it. In fact, I don't want to change it _at all_ because it is debugged and working in a production (sort of) environment. However, I do want to add better logging. So I added the following lines to the beginning of my bash script as per http://stackoverflow.com/a/11886837/463994               #!/bin/bash          >foo.log     exec >  >(tee -a foo.log)     exec 2> >(tee -a foo.log >&2)      However, now when I run the script it asks me for my password for every instance of the sudo/tee command examples shown above (about 50 of them!). Is there a solution for this that does not require me to significantly change the existing code? I just want to log the output of the script without changing how it runs (including without requiring password entry many times within a short span of time). Here is code showing the problem:               #!/bin/bash          sudo -k          >foo.log #truncate log file to start fresh     exec >  >(tee -a foo.log)     exec 2> >(tee -a foo.log >&2)          if [ -f fileone.txt ] ; then         echo "sudo rm fileone.txt"         sudo rm fileone.txt     fi          echo "sudo touch fileone.txt"     sudo touch fileone.txt          echo "sudo touch filetwo.txt"     sudo touch filetwo.txt          sudo touch /opt/file3.txt     echo "blah blah" | sudo tee /opt/file3.txt     sudo rm /opt/file3.txt          exit      _Expected result:_ enter password once and whole script runs _Actual result:_ have to enter password again for `echo "blah blah" | sudo tee /opt/file3.txt` and any similar statements of the form given at the top of this question. But only if the logging code at the top of the script is used. Without the logging, there is no problem.


title: mod_qos not loading in apache on solaris

text: I have installed and configured the mod_qos in my Apache 2.2.24. However, Apache passes the configtest. But when starting the server, It starts with a single process that crashes in a minute. Even after enabling debug mode, There are no errors that are logged in the log. Kindly suggest if we can add a debug mode only for qos module to see why the server is crashing?


$ curl -v https://dl.google.com/dl/cloudsdk/release/install_google_cloud_sdk.bash | bash     * STATE: INIT => CONNECT handle 0x2001f130; line 1011 (connection #-5000)     * Hostname was NOT found in DNS cache     *   Trying 74.125.236.168...     * Adding handle: conn: 0x20059b98     * Adding handle: send: 0     * Adding handle: recv: 0     * Curl_addHandleToPipeline: length: 1     * 0x2001f130 is at send pipe head!     * - Conn 0 (0x20059b98) send_pipe: 1, recv_pipe: 0     * STATE: CONNECT => WAITCONNECT handle 0x2001f130; line 1058 (connection #0)       % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current                                      Dload  Upload   Total   Spent    Left  Speed       0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying 2404:6800:4001:c01::be...     * Connection failed     * connect to 2404:6800:4001:c01::be port 443 failed: Network is unreachable     * Failed to connect to dl.google.com port 443: Network is unreachable     * Closing connection 0     * The cache now contains 0 members     * Expire cleared     **curl: (7) Failed to connect to dl.google.com port 443: Network is unreachable**      I'm trying to install google cloud sdk using curl from cygwin. Any help is appreciated.


title: ALSAEQUAL runs, but sliders do not seem to affect audio

text: I want to have an equalizer that lets me easily adjust sound for listening to music on my laptop with headphones. I'm trying to install ALSAEQUAL since it seems that this is the preferred tool for what I need. (If I'm wrong, please let me know). I'd like to be able to adjust equalizer levels to a preferred state and have my system remember this EQ state across various applications (including web browser, MPD, VLC), as well as across reboots. When I run `alsamixer -D equal`, the ncurses equalizer interface appears, but it seems that my audio is not respondning---the sliders move, but the playback EQ levels don't seem to change at all when I adjust the sliders. (I've tried with audio playing in both VLC and MPD). How can I configure ALSAEQUAL to work properly? My `.asoundrc` file is:               pcm.!default {             type plug;             slave.pcm "plugequal";     }     ctl.equal {         type equal;     }     pcm.plugequal {         type equal;         slave.pcm "plug:dmix";     }      I am running Linux Mint 16 Cinnamon on a Lenovo Thinkpad e420.


title: Can I use two sets of I/O devices for two user sessions on one computer?

text: I want to connect a second monitor, keyboard and mouse to my PC (running Ubuntu) and let somebody else (e.g. my son) use the a different TTY while I am working. I know I can switch between TTYs using `Alt`+`F[1-6]`, and that I could potentially start several X sessions (`Alt`+`F[7-12]`), but is it possible to use them at the same time with different I/O devices? In a way I'd like to emulate the way computers used to work in the old days, when you'd have a central machine with several "terminals" attached. Linux (and Unix style OSs) are generally designed for that, so it should be possible, right?


title: List the commands run by rpm package

text: Sorry for the very basic question, maybe my Google grammar is not the best tonight. I am trying to break down an rpm package into a list of commands (not just its file contents). I would like to know what all and in which order gets executed when you run               yum install --nogpgcheck mypackage.rpm      I get the file contents by running:               rpm -q -filesbypkg -p mypackage.rpm


title: Parallel pausing and resuming?

text: I have a pretty strange thing I'm seeing as I run 8 GPG encryption jobs with GNU parallel: ![](http://i.imgur.com/1C7e1Hh.png) The command I've run is this:               find . -type f -not -iname "*.gpg" | sort |parallel --gnu -j 8 --workdir "$PWD" '         echo "Encrypting {}..." ;          gpg --encrypt --recipient "me@mail.com" "{}"     '      Why do the jobs seem to start and stop and start and stop rather than simply occupying all of the CPU time?


title: Editing Spec file in RPM

text: I'm trying to edit a spec file which always fails when I try to install it on other computer using RPM. I'm using CentOS. Here is the error.               error: Failed dependencies:     perl(ActsUtil) is needed by my_program     perl(ParseBishop) is needed by my_program      Both these 2 files are dependencies for the RPM. The thing is, these 2 files are actually provided inside the RPM package. Both these files are .pm file and located inside `/opt/mysoftware/bin`. I know it can be solved using `rpm - ivh --nodeps mysoftware`. But I dont prefer to use that method. So, I tried fixing the spec file. Here are some of the code that I've tried. 1st try               Summary:....     Name:..     Version:..     ....     ....     Provides: perl(ParseBishop), perl(ActsUtil)     ...     ...     %install     ...     ...     %changelog      2nd try               Summary:....     Name:..     Version:..     ....     ....     Provides: ParseBishop, ActsUtil     ...     ...     %install     ...     ...     %changelog      3rd try               Summary:....     Name:..     Version:..     ....     ....     Provides: ParseBishop.pm, ActsUtil.pm     ...     ...     %install     ...     ...     %changelog      4th try               Summary:....     Name:..     Version:..     ....     ....     Provides: /opt/mysoftware/bin/ParseBishop, /opt/mysoftware/bin/ActsUtil     ...     ...     %install     ...     ...     %changelog      Am I doing the "Provides" command wrong? Or my approach in solving the issue is already wrong? All guide and help are really appreciated.


title: Terminal editor with "project pane"

text: Most GUI text editors have a "project pane" that's just a directory tree that you use to choose what file you're currently editing. What's a terminal text editor (or a VIM/emacs plugin) with this feature?


title: Keyboard shortcut glossary for terminal apps

text: I would like to be able to fire up any terminal app (including ones I've never used) and see, on my second monitor (which is actually a second iPad running a terminal emulator) a glossary of keyboard shortcuts that I invoke on the terminal app I'm currently looking at. The main part of this vision is just showing a keyboard shortcut glossary for every terminal app in the universe. Does this exist? It would be just like `man` but just outputs a nicely readable keyboard shortcut glossary.