title: How do I mount a Windows folder with cifs on Raspian

text: I'd like to access the music library from my desktop with my Raspberry Pi, and I'd like to do this via Samba/cifs. I did the following: Set the folder `Q:\musik` as a shared folder on my Windows machine (which has a local IP of `192.168.1.2`), accessible (read, execute and show folder contents) to any user. It appears as `musik` when I look at the network panel and look at the name of the windows machine. Open a terminal and type the following:               mkdir mountmusik     sudo mount -t cifs //192.168.1.2 mountmusik      This results in the contents of `musik`being shown in `mountmusik`. However, there are things which don't work as I'd like to: Plain txt files appear to consist of whitespace, with the exception of theer unreadable characters at the start of the file. I'm not sure if I omitted vital information when I tried to mount, or if I should have granted a broader access on the windows machine. **Edit:** It turned out that there were several issues at work. The mp3 files did not play because I was using a non-functional mp3 player program. Now, playing mp3 files works like a charm since I swapped to VLC after installing `mpg123`. This was my main issue, but I'm keeping up the question because the txt files are still not able to be read properly and jpg files are not able to be opened.


title: Is there a third-party application that can communicate over Skype's network?

text: Is there a program in the official Scientific Linux repositories that can communicate with people over Skype? I'm worried about Skype's security, but I want to be able to log in to my Skype account and call/chat with my Skype friends.


title: Is it dangerous to use Fedora 14 until 2012.01.01?

text: I have three PC's running Fedora 14 at home, and I'm far away from home until 2012.01.01. When I get home, I plan to migrate them to Scientific Linux 6.1, which has longer support time. Since Fedora 14 isn't maintained after 2011.12.08, is it a security threat to use it after that? The PC's are only used for simple purposes, e.g. web browsing, email, etc. The web browser is Google Chrome, and I installed the Web of Trust plugin a long time ago to add a small amount of browsing security. Should I find a way to install Scientific Linux 6.1, or is using an unsupported distro for 24 days not a major security problem? I don't want to run `dist-upgrade` via SSH because it could kill the OS.


title: Wireless WAP Roaming on Ubuntu Server

text: I have an Ubuntu server that connects to the network over wireless. Since it obviously doesn't have Gnome's NetworkManager I have to configure everthing manually. I've got it sucessfully connecting to the network but when the connection gets interupted instead of roaming to a different WAP it just disconnects. This is obviously bad but I have no idea how to make it roam. Self-Help thorugh googling has been difficult since no one does this (for good reasons), everything I've found has been for a full desktop, not a server. While I'm totally against installing Gnome, I would prefer not to. Is there any "command line" equivelent to NetworkManager that roams WAPs when the one its connected to times out? **Note: I'm not interested in "Do not use wireless" answers.** I would normally never do this but this is a unique case. Just please answer the given question


title: parallel-ssh with Passphrase Protected SSH Key

text: I'd like to use my passphrase protected SSH key when performing tasks with `parallel-ssh` (and related tools). However, I can't get this to work. All the documentation, regarding `parallel-ssh`, show that I should be able to use `\--askpass` or `-A` to do this:               -A     --askpass           Prompt  for  a  password  and pass it to ssh.  The password may be            used for either to unlock a key or for password authentication.  The            password is transferred in a fairly secure manner (e.g., it will not            show up in argument lists).  However, be aware that a root user on            your system could potentially intercept the password.      However, when I enter the passphrase of my key, it doesn't work:               $ parallel-ssh --hosts=machines --user=my_user --askpass \         --timeout=0 --inline -v 'sudo apt-get update'     Warning: do not enter your password if anyone else has superuser     privileges or access to your account.     Password:      [1] 09:59:36 [FAILURE] amritiii Exited with error code 255     Stderr: Enter passphrase for key '/home/nhaigh/.ssh/id_rsa':      Permission denied (publickey,password).     [2] 09:59:37 [FAILURE] gbdev Exited with error code 255     Stderr: Enter passphrase for key '/home/nhaigh/.ssh/id_rsa':      Permission denied (publickey,password).     [3] 09:59:37 [FAILURE] code Exited with error code 255     Stderr: Enter passphrase for key '/home/nhaigh/.ssh/id_rsa':      Permission denied (publickey,password).     [4] 09:59:37 [FAILURE] apollo Exited with error code 255     Stderr: Enter passphrase for key '/home/nhaigh/.ssh/id_rsa':      Permission denied (publickey,password).     [5] 09:59:37 [FAILURE] odin Exited with error code 255     Stderr: Enter passphrase for key '/home/nhaigh/.ssh/id_rsa':      Permission denied (publickey,password).     [6] 09:59:37 [FAILURE] hathor Exited with error code 255     Stderr: Enter passphrase for key '/home/nhaigh/.ssh/id_rsa':      Permission denied (publickey,password).     [7] 09:59:37 [FAILURE] ldap Exited with error code 255     Stderr: Enter passphrase for key '/home/nhaigh/.ssh/id_rsa':      Permission denied (publickey,password).     [8] 09:59:37 [FAILURE] thor Exited with error code 255     Stderr: Enter passphrase for key '/home/nhaigh/.ssh/id_rsa':      Permission denied (publickey,password).     [9] 09:59:37 [FAILURE] bioserver Exited with error code 255     Stderr: Enter passphrase for key '/home/nhaigh/.ssh/id_rsa':      Permission denied (publickey,password).      I've confirmed that my SSH key and passphrase work on each of the machines so I have no idea how to get this working.


title: How to check if there are no parameters provided to a command?

text: How do you check if `$*` is empty? In other words, how to check if there were no arguments provided to a command?


title: sudo missing on Palm WebOS - can I add it?

text: I've rooted my Palm Pre (WebOS 1.4.5) and installed a SSH server on it. Now I'd like to SSH into it with an unprivileged user and use sudo for elevated commands. However: There is no sudo on the system. Can I add it somehow?


title: Good graphics card for TV-Out

text: I am looking for a graphics card (AGP) with a TV-Out (SVideo or Composite) that is not a PITA with X. I guess it depends on the driver/X-Server. The card needs to be small and should not have a huge cooler mounted beause it is supposed to be plugged into a shuttle case. The on board VIA UniChrome chipsets TV-Out is supposed to play well with Linux with the openChrome-Driver (www.openchrome.org seems to be down), but I could not get it to work. So this are the conditions:   * Linux (current Ubuntu?)   * AGP   * short card   * small cooler (possibly passive or really quiet)   * TV-Out playing well with Linux and X   * card should still be available through second hand sources (eBay?) Do you have any recommendations and/or experiences to share?


title: In bash is if [ -z "$1" ] and if [ "$1" = "" ] the same?

text: What is the difference between               if [ -z "$1" ]       and               if [ "$1" = "" ]       or are they the same? I have found my self writing the second one in some scripts, but then I read here that the -z flag is does the same. If there are some problems using the second one, should we ignore that the first one looks a little better?


title: Is it possible to simulate installation of Debian packages, still marking them installed?

text: Here's what I would like. Start with a virtual system with no installed packages. Then I invoke a tool similar to `apt-get` to ask it to compute the dependencies and mark all the packages that would be installed as installed. Let this be clear: it says the packages are installed, but they are no files actually installed. Then if I ask for more packages to be "installed", it may propose to add or remove other packages. It wouldn't actually remove packages, but obviously just mark them removed. Now, how would this be useful? I would like to be able to test the installation of packages on a bare Debian or Ubuntu system. I want to know if a package is installable given a certain scenario. To do this with actual installation would take a lot of disk space and time. APT has a "simulate" option, but it does not mark packages as installed.


title: What is the difference between building from source and using an install package?

text: It was wondering: when installing something, there's an easy way of double clicking an install executable file, and on the other hand, there is a way of building it from source. The latter one, downloading a source bundle, is really cumbersome. But what is the fundamental difference between these two methods?


title: Rebuild auto-complete index (or whatever it's called) and binaries in $PATH cache in zsh

text: After installing new software, an already opened terminal with zsh won't know about the new commands and cannot generate auto-complete for those. Apparently opening a new terminal fix the problem, but can the index (or whatever you call it) be rebuilt so that auto-complete will work on the old terminal? I tried with `compinit` but that didn't help. Also, is there a way that is not shell-dependent? It's nice to have a way to verify the answer as well (except for uninstalling something and reinstalling it). UPDATE: what I mean is after typing a few characters of a command's name, I can press `Tab`, and `zsh` should do the rest to pull up the full name.


title: Fedora 15 doesn't find wireless connection

text: I have Fedora 15 installed on a partition in a Dell laptop. The laptop reports wireless capability in a certain Intel Centrino family, and the drivers for all of these should be in the kernel, according to Intel. The wireless is available to other systems (including the same laptop while booted in Windows 7), but I'm getting nothing showing up. I specified the access in Network Manager, with the "connect automatically" box checked, and nothing. I have one of those little function key traps that turns wireless on and off; neither making sure it's on in Windows 7 and rebooting into Fedora, nor pressing the key while in Fedora, works. Any ideas on how I can get the wireless working? (I'm open to trying another distro if necessary.) **Additional information** Computer is a Dell Inspiron N7110, Intel Centrino Wireless-N 1030. The network controller info on `lspci -v` is:               02:00.0 Network controller: Intel Corporation Device 008a (rev 34)         Subsystem: Intel Corporation Device 5325         Flags: fast devsel, IRQ 16         Memory at f1a00000 (64-bit, non-prefetchable) [size=8K]         Capabilities: <access denied>         Kernel modules: iwlagn When I try to turn the wireless on and off, I get this in /var/log/messages:               Oct 30 14:03:50 Yog-Sothoth kernel: [  791.627815] keyboard: can't emulate rawmode for keycode 240     Oct 30 14:03:50 Yog-Sothoth kernel: [  791.627847] keyboard: can't emulate rawmode for keycode 240     Oct 30 14:03:50 Yog-Sothoth NetworkManager[797]:  WiFi now disabled by radio killswitch     Oct 30 14:03:51 Yog-Sothoth kernel: [  791.856562] usb 2-1.5: USB disconnect, address 4     Oct 30 14:03:51 Yog-Sothoth systemd[1]: Service bluetooth.target is not needed anymore. Stopping.     Oct 30 14:03:52 Yog-Sothoth kernel: [  793.517232] keyboard: can't emulate rawmode for keycode 240     Oct 30 14:03:52 Yog-Sothoth kernel: [  793.517260] keyboard: can't emulate rawmode for keycode 240     Oct 30 14:03:52 Yog-Sothoth NetworkManager[797]:  WiFi now enabled by radio killswitch     Oct 30 14:03:53 Yog-Sothoth kernel: [  793.822596] usb 2-1.5: new full speed USB device using ehci_hcd and address 5     Oct 30 14:03:53 Yog-Sothoth kernel: [  793.943924] usb 2-1.5: New USB device found, idVendor=8086, idProduct=0189     Oct 30 14:03:53 Yog-Sothoth kernel: [  793.943935] usb 2-1.5: New USB device strings: Mfr=0, Product=0, SerialNumber=0


title: How do pdflush, kjournald, swapd, etc interoperate?

text: Recently saw a question that sparked this thought. Couldn't really find an answer here or via the Google machine. Basically, I'm interested in knowing how the kernel I/O architecture is layered. For example, does `kjournald` dispatch to `pdflush` or the other way around? My assumption is that `pdflush` (being more generic to mass storage I/O) would sit at a lower level and trigger the SCSI/ATA/whatever commands necessary to actually perform the writes, and `kjournald` handles higher level filesystem data structures before writing. I could see it the other way around as well, though, with `kjournald` directly interfacing with the filesystem data structures and `pdflush` waking up every now and then to write dirty pagecache pages to the device through `kjournald`. It's also possible that the two don't interact at all for some other reason. **Basically:** I need some way to visualize (graph or just an explanation) the basic architecture used for dispatching I/O to mass storage within the Linux kernel.


title: [drm:intel_enable_lvds]*ERROR* timed out waiting for panel to power on

text: I get this error when I start mystem. I have been using a multi-boot system. Ubuntu, Win7, Arch. I deleted everything, and try to install Arch, without susccess. I just deleted the MBR with dd. Is there any association? May be due to grub? Would syslinux be better? Do I really need a bootloader, as I have only one OS?


title: how to fix EXT2-fs (sda1): error: ext2_lookup deleted inode referenced XXXX

text: Some time ago I installed Kubuntu 12.10 on Acer TravelMate 8572G which has Linpus LiveCD Editon v9.2 installed. When I tried to remove Kubuntu, something went wrong and I ended up with a broken Grub. Then I repaired it with Boot Disk Repair but before Linpus loads, I can see plenty of lines of errors like this: `EXT2-fs (sda1): error: ext2_lookup deleted inode referenced XXXX` How can I get rid of them? I don't want to install any other system, just left the laptop as it is with Linpus (I borrowed the laptop to do some things)


title: Why my linux does not detect USB storages at runtime?

text: I have an embedded system with Linux kernel v3.0.35 and Busybox v1.20.2. If I plug a USB flash drive in before starting the operating system the boot process mounts it to the proper place, with the proper file system (/mnt/sdaX). So, it works.   But! If I plug a device in meanwhile Linux is running, nothing happens. lsusb does not shows the device,   /proc/bus/usb/devices is empty,   /var/log/messages and dmesg don't show new informations. Why my linux won't detect USB connection changes?


title: In which situation is a file written to the block-device during the umount?

text: I have a compact-flash memory card detected as a block device `/dev/sdb`. It has a single FAT16 partition. Now if I mount the FAT16 file-system, write something to the file system and `umount` the file system, then actual writing of the file takes place during the `umount`:               # mount | grep sdb     /dev/sdb1 on /media type vfat (rw)     # time cp image.bin /media/          real    0m0.179s     user    0m0.000s     sys 0m0.104s     # time umount /media           real    0m18.185s     user    0m0.004s     sys 0m0.032s     #       I have seen similar behavior with USB flash-memory. What determines if the file is written to the file system right away or during the file system detaching?


title: Terminal-based (non GUI) virtual-computer program?

text: Are there any terminal-based (ie. non-GUI) virtual-computer programs out there? I've been using programs like VirtualBox and QEMU, but they're obviously GUI-based... I was hoping for a virtual PC program where I can do everything - create a new virtual machine, create it's disk, install OS (assuming a text-based installer is available) and start the VM on a terminal (thus replacing the host's shell with the VM's boot-message, log-in prompt and shell) - from a virtual- terminal/xterm-window/ssh/screen-session, instead of in a window under X. The reason I ask, is that I often use ssh at work to connect to my home- computer, and the network is too slow for X or VNC. Still I'd like to tinker with VMs...


title: bash script user promt for prefered directory

text: hey all i am attempting my first bash script. so i would like to prompt the user to find out where they would like a cloned repo to be saved currently i am assigning it like this `warpToLocation="${HOME}/apps/"` is there some way to do it like this `read -e -p "Enter the path to the file: " -i "${HOME}/apps/" FILEPATH` but save the result as `warpToLocation` sorry if this is a noobish question its brand new to me EDIT:               #!/bin/bash          echo "where would you like to install your repos?"          read -p "Enter the path to the file: " temp     warpToLocation="${HOME}/$temp/"          warpInLocations=("git@github.com:cca/toolkit.git" "git@github.com:cca/sms.git" "git@github.com:cca/boogle.git" "git@github.com:cca/cairo.git")                    echo "warping in toolkit, sms, boogle and cairo"     for repo in "${warpInLocations[@]}"     do       warpInDir=$repo       warpInDir=${warpInDir#*/}       warpInDir=${warpInDir%.*}       if [ -d "$warpToLocation"]; then         echo "somethings in the way.. $warpInDir all ready exists"       else         git clone $repo $warpInDir     fi          done      what i had done to get that error was add the code you gave me. the issue with that is that -e(which allows you to edit the input with arrows) and -i(a preview/optional answer) runs on bash version 4 and higher and i am running version `GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin12)`. so remove it. sorry i wasted all your time those who came to help me. i should have done some homework before coming to you.


title: `crontab -e` sometimes fails with "Creation of temporary crontab file failed"

text: _From time to time_ `crontab -e` fails on me on a Ubuntu box. It is the same for all users including the root and `crontab -eu <user>` under the root. Goes like this on a regular basis, a success here and there:               $ crontab -e     /tmp/crontab.SHw8Ge: Input/output error     Creation of temporary crontab file failed - aborting          $ crontab -e     /tmp/crontab.L8gEG4: Input/output error     Creation of temporary crontab file failed - aborting          $ crontab -e     crontab: installing new crontab          $ crontab -e     /tmp/crontab.Vvp59T: Input/output error     Creation of temporary crontab file failed - aborting          $ crontab -e     crontab: installing new crontab      I don't seem to be having problems creating files there by hand or script repeatedly:               $ vim /tmp/crontab.Vvp59T     $ ls -la /tmp/crontab.Vvp59T     -rw-r--r-- 1 <user> <user> 6 2014-07-01 04:17 /tmp/crontab.Vvp59T      `/tmp` permissions:               $ ls -la /     ...     drwxrwxrwt  92 root root 20480 2014-07-01 04:24 tmp     ...      Looks like a storage issue to me, no clue how to prove or rule that out. Any ideas what could be causing this and how to test?               $ lsb_release -dc     Description:    Ubuntu 9.10     Codename:       karmic      **Update regarding comments:** `/tmp` disk space use is 5%, inode use 1%. Crontab file size is 13K, ~200 lines. All this seems okay.


title: Searching strings on files

text: I've got a bunch on strings which I need to find in a couple of files, for example:               string1     string2     stringn          file1.txt     file2.txt     filen.txt      Is there an (easy) way to do that in bash? I need to know, if a string was found, in which file is it.


title: Does pgrep output ever include the parameters supplied to the process?

text: The snippet below (from an existing script) is used to check the `xvfb` processes and whether they are listening on a specific port:                 my_list=`pgrep -u $CurrentUserID -fl Xvfb | grep :${XVFBPORT}`       process_list=`pgrep -fl Xvfb | grep :${XVFBPORT}`      The Xvfb process is started in the following format:                 Xvfb :619  -fp /usr/share/fonts/X11/misc # i.e. in this case XVFBPORT is 619      Apparently this does not work as intended on Ubuntu since the output of `pgrep -fl Xvfb` would give something like:                 4812 Xvfb      , without the ":619" at the end. Clearly, with some additional piping to `ps` this can be easily fixed. Is there some other distro or configuration where `pgrep` would give the output as expected by the script?


title: Error when trying to mount Xen LVM2 volumes

text: I have a hard drive which used to be part of a server running Citrix XenServer 5.6.100 SP2 with a Software RAID1 (I only have one of both hard drives). This hard drive is now physically attached to a computer running Ubuntu and I want to mount the LVM2 volumes to be able to recover the data stored on the VDIs. I got the RAID setup recognized using `mdadm` and then I was able to activate all the logical volumes with `vgchange -ay`. My volume group is named 'test' and I can see all my logical volumes under `/dev/test`. I then ran `kpartx -a` on each of these volumes. Only the last step fails, when I actually try to mount a volume :               root@web:/dev# mount /dev/test/VHD-ea41e612-dce1-4198-a079-091b2ba67c26 /mnt     mount: you must specify the filesystem type      Does someone know how to solve this ? Here is some more information:               root@web:/dev# lvscan       ACTIVE            '/dev/test/MGT' [4,00 MiB] inherit       ACTIVE            '/dev/test/VHD-964f83dc-1eeb-4c8d-9e19-1895ba41ae8e' [16,00 MiB] inherit       ACTIVE            '/dev/test/VHD-1d4f63e6-edcc-4b60-99b3-32fe83fedec6' [26,91 GiB] inherit       ACTIVE            '/dev/test/VHD-98835c17-5356-41a0-8b78-46fa0e6fbc55' [47,98 GiB] inherit       ACTIVE            '/dev/test/VHD-aab989a2-3020-4c0a-8af6-f22018af5ae6' [105,07 GiB] inherit       ACTIVE            '/dev/test/VHD-b0859a30-59c5-47fb-a9a6-2599a37aac29' [180,68 GiB] inherit       ACTIVE            '/dev/test/VHD-9e2d89bc-9ffa-4641-a438-bfee3b478819' [342,47 GiB] inherit       ACTIVE            '/dev/test/VHD-be174334-9df7-4c8c-9172-a0578c418909' [121,30 GiB] inherit       ACTIVE            '/dev/test/VHD-4167a41d-12a3-4e1d-b161-66cc44eccbcd' [1,30 GiB] inherit       ACTIVE            '/dev/test/VHD-134f8221-28ca-42f2-80c0-6266d1288d85' [1,23 GiB] inherit       ACTIVE            '/dev/test/VHD-a9203142-6d98-423f-841f-f4d6ab2ca2bc' [904,00 MiB] inherit       ACTIVE            '/dev/test/VHD-6e403a8c-9b39-4a62-be11-2833a75e03ce' [3,82 GiB] inherit       ACTIVE            '/dev/test/VHD-a38dba14-0cd5-4d73-9eaa-b996a12474be' [119,20 GiB] inherit       ACTIVE            '/dev/test/VHD-8abb0101-e3b6-4ba6-9f34-7fa59e16604d' [3,64 GiB] inherit       ACTIVE            '/dev/test/VHD-a8ce4d2d-9c2d-49ef-8a0a-aa172a9a5d99' [48,93 GiB] inherit       ACTIVE            '/dev/test/relink_134f8221-28ca-42f2-80c0-6266d1288d85_1' [4,00 MiB] inherit       ACTIVE            '/dev/test/VHD-ea41e612-dce1-4198-a079-091b2ba67c26' [370,73 GiB] inherit       ACTIVE            '/dev/test/coalesce_134f8221-28ca-42f2-80c0-6266d1288d85_1' [4,00 MiB] inherit                         web# guestfish --ro -a /dev/md2              Welcome to guestfish, the libguestfs filesystem interactive shell for         editing virtual machine filesystems.         ><fs> run          100% ⟦▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓⟧ 00:00         ><fs> list-filesystems         /dev/test/MGT: unknown         /dev/test/VHD-134f8221-28ca-42f2-80c0-6266d1288d85: unknown         /dev/test/VHD-1d4f63e6-edcc-4b60-99b3-32fe83fedec6: unknown         ....         /dev/test/VHD-964f83dc-1eeb-4c8d-9e19-1895ba41ae8e: unknown         ...         /dev/test/VHD-ea41e612-dce1-4198-a079-091b2ba67c26: unknown         /dev/test/coalesce_134f8221-28ca-42f2-80c0-6266d1288d85_1: unknown         /dev/test/relink_134f8221-28ca-42f2-80c0-6266d1288d85_1: unknown                    root@web:/dev# file -Ls /dev/test/VHD-ea41e612-dce1-4198-a079-091b2ba67c26     /dev/test/VHD-ea41e612-dce1-4198-a079-091b2ba67c26: Microsoft Disk Image, Virtual Server or Virtual PC          root@web:/dev# kpartx -av /dev/test/VHD-ea41e612-dce1-4198-a079-091b2ba67c26     root@web:/dev#     root@web:/dev# kpartx -l /dev/test/VHD-ea41e612-dce1-4198-a079-091b2ba67c26     root@web:/dev#


title: grep for string like xxx12345

text: I have 64 processes running that have the following string               pbs_mom -m -M 1234 -R 5678 -A foo12345 -c /var/spool/torque/mom_priv/login_config       I need to search and extract just foo12345   * always starts with 3 lowercase letters   * followed by 5 digits Here is what I am trying but I am getting the entire line in return               ps aux |grep foo| grep 'foo[0-9]\+'      How can I strip off all text except foo12345.


title: Recompile Apache22 with threading seamlessly?

text: I just found out today that our apache installation was installed without threading support (we need this for mod_wsgi). Will the following in the apache22 ports folder reinstall our apache with threading support? More importantly, will it do it seamlessly (leaving mod_wsgi working, http_root in tact etc?).               make configure      // Select thread support     make     make deinstall     make reinstall      Thanks


title: How should I start X after ssh'ing into a remote box?

text: I am trying to syncronize my clipboard with a remote machine using `XQuartz` and `xsel`. It works, but only after I run an X windows program: connecting from Mac OS X with Quartz running and the pasteboard options selected: ![](http://img41.imageshack.us/img41/6913/picturehsv.png)               ssh user@host -X     ls | xsel -b          (local clipboard is not affected)          xeyes          (close xeyes)          ls | xcel -b          (now local system's clipboard works as you would expect)      it seems that starting any x program, like `xeyes` or `gvim` somehow completes the connection. `xsel` has an option to specify display - would that affect thing? I don't have `startx` or `xinit` installed (and I don't really want to install those) and this works fine after starting one of these x programs. I also installed `xsm` to try and debug or figure out the display name, but running it just tells me:               sh: iceauth: not found     sh: twm: not found     sh: xterm: not found     smproxy: unable to connect to session manager      How can I do whatever xeyes or gvim does so that my X connection 'completes' and the keyboard starts working? ps: My apologies as I know this is a rather specialized subset of linux knowledge, I've tried to do my best in asking the question though, and I have ordered a book on X.


title: Shredding everything: files/folders and corresponding filenames

text: Using `find`, it is easy to shred a directory's contents recursively (as discussed in this question). However, sometimes the filenames on their own carry sensitive information already. Is there a way to shred _everything_ associated with some file/directory, i.e. it overwrites both file contents and file/directory names in each cycle?


title: What is the fastest way to view images from the terminal?

text: The terminal is very fast and convenient way to quickly access directories and files (faster than find and click on the directory). One thing that it cannot show in text-mode is "pictures". What is a best way to view pictures (like you see images thumbnail in Nautilus) when you are working in the terminal (e.g. command `nautilus` or any program - but should be fast and convenient)?


title: dual boot windows XP/debian, I can't boot windows

text: I tried to set up a dual boot windows xp/debian. I installed Debian after windows, and now I can't boot windows xp. I have grub2. I tried to directly modify /boot/grub/grub.cfg with               menuentry 'WinXP'  {         insmod part_msdos         set root='(hd0,msdos4)'         insmod chain         chainloader +1     }      but I can't make that work. When I select winXP in the grub menu, I get a black screen and the system restarts. Please, any hint? * * * Output of `df -h`               Filesystem                                              Size  Used Avail Use% Mounted on     rootfs                                                   30G  8.3G   20G  30% /     udev                                                     10M     0   10M   0% /dev     tmpfs                                                   177M  628K  177M   1% /run     /dev/disk/by-uuid/4eba1bb8-14f7-4920-a9c3-2fb8894626d3   30G  8.3G   20G  30% /     tmpfs                                                   5.0M     0  5.0M   0% /run/lock     tmpfs                                                   764M  232K  764M   1% /run/shm     /dev/sda6                                                92G  2.3G   85G   3% /data     /dev/sda5                                               9.9G  258M  9.1G   3% /home      * * * output of `sudo fdisk -l`               Disk /dev/sda: 250.1 GB, 250059350016 bytes     255 heads, 63 sectors/track, 30401 cylinders, total 488397168 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x00089f15             Device Boot      Start         End      Blocks   Id  System     /dev/sda1   *   204796620   267710463    31456922   83  Linux     /dev/sda2       267710464   271904767     2097152   82  Linux swap / Solaris     /dev/sda3       271906814   488397167   108245177    5  Extended     /dev/sda4           16128   204796619   102390246    7  HPFS/NTFS/exFAT     /dev/sda5       271906816   292878335    10485760   83  Linux     /dev/sda6       292880384   488397167    97758392   83  Linux          Partition table entries are not in disk order      * * * Output of `/boot/grub/grub.cfg`               #     # DO NOT EDIT THIS FILE     #     # It is automatically generated by grub-mkconfig using templates     # from /etc/grub.d and settings from /etc/default/grub     #          ### BEGIN /etc/grub.d/00_header ###     if [ -s $prefix/grubenv ]; then       load_env     fi     set default="0"     if [ "${prev_saved_entry}" ]; then       set saved_entry="${prev_saved_entry}"       save_env saved_entry       set prev_saved_entry=       save_env prev_saved_entry       set boot_once=true     fi          function savedefault {       if [ -z "${boot_once}" ]; then         saved_entry="${chosen}"         save_env saved_entry       fi     }          function load_video {       insmod vbe       insmod vga       insmod video_bochs       insmod video_cirrus     }          insmod part_msdos     insmod ext2     set root='(hd0,msdos1)'     search --no-floppy --fs-uuid --set=root 4eba1bb8-14f7-4920-a9c3-2fb8894626d3     if loadfont /usr/share/grub/unicode.pf2 ; then       set gfxmode=640x480       load_video       insmod gfxterm       insmod part_msdos       insmod ext2       set root='(hd0,msdos1)'       search --no-floppy --fs-uuid --set=root 4eba1bb8-14f7-4920-a9c3-2fb8894626d3       set locale_dir=($root)/boot/grub/locale       set lang=en_US       insmod gettext     fi     terminal_output gfxterm     set timeout=5     ### END /etc/grub.d/00_header ###          ### BEGIN /etc/grub.d/05_debian_theme ###     insmod part_msdos     insmod ext2     set root='(hd0,msdos1)'     search --no-floppy --fs-uuid --set=root 4eba1bb8-14f7-4920-a9c3-2fb8894626d3     insmod png     if background_image /usr/share/images/desktop-base/joy-grub.png; then       set color_normal=white/black       set color_highlight=black/white     else       set menu_color_normal=cyan/blue       set menu_color_highlight=white/blue     fi     ### END /etc/grub.d/05_debian_theme ###          ### BEGIN /etc/grub.d/10_linux ###     menuentry 'Debian GNU/Linux, with Linux 3.2.0-4-686-pae' --class debian --class gnu-linux --class gnu --class os {         load_video         insmod gzio         insmod part_msdos         insmod ext2         set root='(hd0,msdos1)'         search --no-floppy --fs-uuid --set=root 4eba1bb8-14f7-4920-a9c3-2fb8894626d3         echo    'Loading Linux 3.2.0-4-686-pae ...'         linux   /boot/vmlinuz-3.2.0-4-686-pae root=UUID=4eba1bb8-14f7-4920-a9c3-2fb8894626d3 ro  noapic nolapic         echo    'Loading initial ramdisk ...'         initrd  /boot/initrd.img-3.2.0-4-686-pae     }     menuentry 'Debian GNU/Linux, with Linux 3.2.0-4-686-pae (recovery mode)' --class debian --class gnu-linux --class gnu --class os {         load_video         insmod gzio         insmod part_msdos         insmod ext2         set root='(hd0,msdos1)'         search --no-floppy --fs-uuid --set=root 4eba1bb8-14f7-4920-a9c3-2fb8894626d3         echo    'Loading Linux 3.2.0-4-686-pae ...'         linux   /boot/vmlinuz-3.2.0-4-686-pae root=UUID=4eba1bb8-14f7-4920-a9c3-2fb8894626d3 ro single          echo    'Loading initial ramdisk ...'         initrd  /boot/initrd.img-3.2.0-4-686-pae     }          ### END /etc/grub.d/10_linux ###          ### BEGIN /etc/grub.d/20_linux_xen ###     ### END /etc/grub.d/20_linux_xen ###          ### BEGIN /etc/grub.d/30_os-prober ###     ### END /etc/grub.d/30_os-prober ###          ### BEGIN /etc/grub.d/40_custom ###     # This file provides an easy way to add custom menu entries.  Simply type the     # menu entries you want to add after this comment.  Be careful not to change     # the 'exec tail' line above.     ### END /etc/grub.d/40_custom ###          ### BEGIN /etc/grub.d/41_custom ###     if [ -f  $prefix/custom.cfg ]; then       source $prefix/custom.cfg;     fi     ### END /etc/grub.d/41_custom ###


title: emulate tail with sed

text: I have a mini-system with only limited number of binaries (`bash`,`cp`,`cat`,`sed`, ...). I don't have `tail` command, and I am wondering if I could emulate tail functionality with `sed`               cat foo.txt | tail -n 10      I know that I can print lines 1-10 with sed `cat foo.txt | sed -n '1,10p'`, but how would I print the last 10 lines?


title: Effectivity of shred on different file systems

text: `man shred` warns that the command is not useful on file systems that don't overwrite in-place. I don't have much knowledge about the current and upcoming file systems, but I would suspect that many of them support some special in- place write mode for this purpose, which is used by shred. Am I right with this assumption? Is it already implemented in `shred`? Is there some way of telling without too much trouble (e.g. when a new file system is announced)?


title: yaourt -Syu is not working in arch linux

text: I tried `yaourt -Syu` and got this error: `error: failed to prepare transaction (could not satisfy dependencies)` `:: Starting full system upgrade...` `:: nvidia: requires linux<3.11` how could I solve this problem?


title: Difference between sudo su - user and sudo -iu user

text: I was wondering if there were any difference (in environment ?) between doing               sudo su - user      and               sudo -iu user      From what I know: By using sudo su - user I open a new shell as user, and the dash gives user's environment variables (while sudo su user does not) and using sudo -iu user as well (-u for precising user, -i for "simulating initial login"). So, is there any difference? Except the fact that the first one needs the user to be able to execute su as root, and the second one to execute bash as user Thanks !


title: Difference between sudo -i and sudo su

text: I was wondering what the difference is between `sudo -i` and `sudo su`?


title: How to start the keyring daemon after a gnome-shell crash?

text: When `gnome-shell` crashes on Linux Mint 12 it usually comes up again within a couple seconds. When it doesn't, it seems that it takes the keyring daemon with it, because after restarting with               while true; do DISPLAY=:0 gnome-shell --replace; done &      it asks for the key passphrase every time I run commands like `git pull`. How do I restart the keyring daemon (if that's what the problem is here) when restarting `gnome-shell`?


title: Mplayer controls when using stdin playlists

text: I ran across this post: How can I retain the console input in mplayer when reading from stdin? But the answer there doesn't work for me. (and I can't comment due to not enough rep) I'm running the following command:               ls -l | grep -e mp3 -e wav | awk '{i=index($0,$9); $0=substr($0,i); printf "./"$0"\n"}' | grep " " | mplayer -playlist -      and this works fine. (minus controls) I try this: (as proposed in the above question)               ls -l | grep -e mp3 -e wav | awk '{i=index($0,$9); $0=substr($0,i); printf "./"$0"\n"}' | grep " " | mplayer -playlist /dev/fd/3 3<&0 </dev/tty      and it gives me this:               Playing /dev/fd/./Pink Floyd - Another Brick in the Wall.mp3.     File not found: '/dev/fd/./Pink Floyd - Another Brick in the Wall.mp3'     Failed to open /dev/fd/./Pink Floyd - Another Brick in the Wall.mp3.      can someone explain what I am doing wrong (and how to fix it?) Currently running ubuntu 12.10 using sh.


title: Finding a number of occurrences of a certain character in tcsh

text: I am trying to find the number of certain types of files that have a '_' in the filename. I'm a massive beginner so my syntax looks like this at the moment;               foreach txt ( 'ls *.txt')     set n=0     if(grep _ txt) then     @ n = n+1     endif     end      It doesn't work as my if statement isn't correct, but I'm not sure how to define saying if the txt file has a '_' within the filename then increment n by 1.


title: How can Solaris sub-partitions be accessed in FreeBSD?

text: First of all, Linux detects the partitions:               sdg1: <solaris: [s0] sdg5 [s1] sdg6 [s2] sdg7 [s8] sdg8 >      However, FreeBSD 9.0 shows only the main partition. Is it possible that only Solaris labels for sparc64 are supported?


title: Configure kbd and immediately profit of the changes without rebooting

text: I want to disable consoleblank and activates console clock `vcstime` which are obviously managed by `kbd` on my Debian 6. So I've changed the following in `/etc/kbd/config` file:   * POWERDOWN_TIME=1   * BLANK_TIME=1   * DO_VCSTIME=yes But theses settings aren't taken into account (knows it because the clock doesn't appears) after a:               # /etc/init.d/kbd restart     Setting console screen modes.     Skipping font and keymap setup (handled by console-setup).     # /etc/init.d/console-setup restart      What is the correct way of changing `kbd` configuration and activates it without rebooting? Edit: Indicates version used :   * Debian 6 "Squeeze" v6.0.6   * `kbd` package v1.15.2-2   * `console-setup` package v1.68+squeeze2


title: unzip two different kind of file extensions

text: Note here, .zip and .jar is just an example, my file extensions are different. Suppose I have a directory which can contain number of zip files               a.zip b.zip c.zip      AND/OR               z.jar x.jar y.jar      along with other contents. I want to unzip them all. I tried               unzip -q *.zip      and               unzip -q *.jar      But when the folder does not contain .jar files, the second command would fail               unzip:  cannot find or open *.jar, *.jar.zip or *.jar.ZIP.          No zipfiles found.      This is problematic for me as it an error my script would exit. I want to silently unzip the *.zip and *.jar without errors. Is there anyway to accomplish this?


I've been following this tutorial, and I've found myself needing to compile makedev. However, when I try               ROOT=/mnt make install      in the source directory (makedev-20110824), I get:               gimptool-2.0 --install-script misc/xcf-png.scm     make: gimptool-2.0: Command not found     make: *** [misc/icon.png] Error 127      As I understand it, makedev is a utility that automatically populates the /dev directory, whereas gimptools are used for image manipulation. Why do I need gimptools to build makedev? Is there a way I can build it without gimptools and still expect to make it through the tutorial without much trouble? P.S. Also in case it is relevant, I'm running a reasonably minimal Debian install on VirtualBox.


title: xorg performance in openoffice

text: I've just been monitoring my cpu usage in openoffice calc when cells have been copied vs when they haven't and seen a dramatic increase in cpu usage for the Xorg process. The additional rendering required is a box with scrolling dashed lines around the cells that have been copied. The issue stands regardless of whether the window is minimised. Obviously it takes /some/ cpu power to render, but to increase an i7 by a more or less constant 7% usage seems slightly overkill. If anything surely this should impact on the gpu?


title: ant script stops, waiting for input when run in background

text: I'm running an ant (Java build tool) script on CentOS 5.5 that execs another java process. When I run the ant script in the background:               ant -f myfile.xml &> foo.out &      The forked process' state changes to stop and waits for input. As soon as I bring the process to the foreground it starts again (no input required on my part) This does not occur on other machines running the same OS, CentOS 5.5.


title: CPU usage monitoring in AIX servers

text: In order to monitor the CPU usage in an AIX server I'm using the following script that is executed every 10 mins.               lparstat 2 10 > cpu     usage=$(tail -10 cpu | awk 'BEGIN {sum=0;} {sum+=$4} END{print int(100-sum/10)}')               if [[ $usage -ge 90 ]]; then     # mail the error and cpu file to admin     # displaying this for testing purposes     echo "CPU usage off the charts!!!"     cat cpu     fi      However, incase the CPU usage is above 90% I need to list the top 5 Processes that are using the CPU. How do I achieve this?


title: Return status of `cd` is always 0

text: I am executing following command.               cd dirname; echo $?      This always return `0` whether of not cd is successful. This is giving me incredible headache. How to check if cd was successful without reading its error message.


title: How to prevent the termination of Anacron jobs after battery mode commences?

text: I have a backup script which is run daily by Anacron. It can take around 3 hours to complete. I'm happy for Anacron not to commence the script if the laptop is running on batteries, but once started, I don't want it to be terminated if battery mode commences, since doing so leaves me with an incomplete backup and a false sense of security. The backup uses rsnapshot, which rotates the backups. How can I disable Anacron's monitoring of power mode for running jobs (or otherwise work around this behaviour)? I'm running Kubuntu 12.04.2.


title: Falling to git checkout on non-found bash commands

text: When I type (in `bash`) a command which linux does not find, it usually does something like this:               $ x     x: command not found      but when I type a command which is not found but which is similar in some sense to other possible commands, the reply may look like this:               $ pyp     No command 'pyp' found, did you mean:      Command 'pcp' from package 'pcp' (universe)      Command 'pype' from package 'pype' (universe)      Command 'pgp' from package 'pgpgpg' (universe)      Command 'pp' from package 'libpar-packer-perl' (universe)      Command 'php' from package 'php5-cli' (main)      Command 'gyp' from package 'gyp' (universe)      Command 'pip' from package 'python-pip' (universe)      Command 'pap' from package 'netatalk' (universe)     pyp: command not found      That means that some hook checked `pyp` before it let `bash` reply with `pyp: command not found`. I'd like to write a hook like that, that will check if the "command" is a name of a branch in a current repository (if we're indeed in a repository), and will try to checkout into it before replying with `command not found`, but only if the command was really not found. To this end, I need to understand something about the flow; when I type the command (and press enter), where does it go to? What is the program which replies with "did you mean", and how does it get the command string from bash?


title: No xauth data; using fake authentication. Unable to display remote windows

text: Whenever I try to `ssh -X` or `-Y` into a remote Linux server from my Mac (OSX Mavericks) machine, I get the same message: > "Warning: No xauth data; using fake authentication data for X11 forwarding." I have tried several ideas that I found on SO threads, e.g. adding the following               Host *     ForwardX11 yes     ForwardX11Trusted yes      in my `.ssh/config` file (which is equivalent to always doing `ssh -Y`), deleting the `.Xauthority` file in the server, etc. Why does this happen? Most importantly, when I try to open a remote window (e.g. using `ssh -Y`, and then opening a plot in Python), I get the following message:               Could not find ':' in DISPLAY: xxx.yyy.net     : Fatal IO error: client killed


title: Networking starts up but interface has no IP

text: I have a box that is supposed to run headless. When I boot and manually run `/etc/init.d/networking` everything starts fine. When I add it to my startup scripts (`/etc/rcS.d`) as placed by `sysv-rc-conf` the network starts up OK. `ifconfig` shows everything is working right, except for some reason there is no IP assigned to the interface. PS: These are statically assigned addresses.


title: run shell scripts in a sequencing way?

text: I have 4 shell scripts and I want to run them in a sequencing way: script1 -> script2 -> script3 ->script4 in a local machine can I ensure this by make the scripts executable and creating a new shell script like this:               #!/bin/bash     . script1.sh     . script2.sh     . script3.sh     . script4.sh      and if one of the scripts is in a remote machine, (for example script2.sh) how can I:   1. run the shell script remotely   2. ensure the sequencing.  Note : all of the scripts have an infinite loop.


title: What is the alternative or equivalent to Windows services on Gnu/Linux?

text: I was wondering what is the alternative or equivalent to Windows services on Gnu/Linux. Is it a sever like X or Pulseaudio but that wouldn't make any sense because the theme service on windows, a alternative to that on Gnu/Linux would be a WM, or a DE. Is it like the Windows registry when there isn't truly a alternative or a equivalent to it other then the your home user directory.


title: Windows 8 not showing in Grub

text: Windows 8 not showing in Grub `fdisk -l`               Device Boot      Start         End      Blocks   Id  System     /dev/sda1               1  1465149167   732574583+  ee  GPT        and here's what I see in gparted which the 290gb and 221gb partitions are my partitions I had in windows. ![enter image description here](http://i.stack.imgur.com/rAryy.png) I have already tried `sudo update-grub` and `update-grub2` but it doesn't show up.


title: Help with Setting up network connection in Debian 7.5.0

text: I'm a beginner using Debian. I've just installed Debian 7.5.0 amd netinst. When I execute `apt-get` update I get errors like: > Could not resolve 'http.debian.org' Thus I changed the mirrors several times in `/etc/apt/sources.list` but without any result. I deduced that it is because of the absence of internet connection. So I executed `ifconfig` and `ifconfig -a`, the output indicates only the loopback no eth0 interface. However the Ethernet card and WLAN card are pretty detected, I checked it through `lspci` and both cards appear. I edited `/etc/network/interfaces`l by adding DHCP but it was in vain. Please, could anybody help me?


title: How do I fix a patch

text: I am trying to fix a patch, and reviewed a couple of very interesting urls. One of which is this one: Handling Patch Rejects I like to make sure I am understanding the patch and the problem correctly. Here is the patch:               diff --git a/frameworks/base/telephony/java/com/android/internal/telephony /ITelephony.aidl b/frameworks/base/telephony/java/com/android/internal     index 584411b..ecd26f6 100644     --- a/frameworks/base/telephony/java/com/android/internal/telephony/ITelephony.aidl     +++ b/frameworks/base/telephony/java/com/android/internal/telephony/ITelephony.aidl     @@ -304,5 +304,40 @@ interface ITelephony {       * Sets minimum time in milli-seconds between onCellInfoChanged       */      void setCellInfoListRate(int rateInMillis);     +     +    /**     +     * Returns the response APDU for a command APDU sent to a logical channel     +     */     +    String transmitIccLogicalChannel(int cla, int command, int channel,     +            int p1, int p2, int p3, String data);     +     +    /**     +     * Returns the response APDU for a command APDU sent to the basic channel     +     */     +    String transmitIccBasicChannel(int cla, int command,     +            int p1, int p2, int p3, String data);     +     +    /**     +     * Returns the channel id of the logical channel,     +     * Returns 0 on error.     +     */     +    int openIccLogicalChannel(String AID);     +     +    /**     +     * Return true if logical channel was closed successfully     +     */     +    boolean closeIccLogicalChannel(int channel);     +     +    /**     +     * Returns the error code of the last error occured.     +     * Currently only used for openIccLogicalChannel     +     */     +    int getLastError();     +     +    /**     +     * Returns the response APDU for a command APDU sent through SIM_IO     +     */     +    byte[] transmitIccSimIO(int fileID, int command,     +                                      int p1, int p2, int p3, String filePath);      }      It seems to me, the patch looks for the first five lines of the method: setCellInfoListRate, and then adds the next 35 lines. But the patch fails for my version of the code, because my destination file does not have this method. Is this correct? So can I just past in the entire method in the destination file, without the plus signs, and be done with it? If this is the case, then this method existed in the previous version of the code; while it is just not there any more. Just to provide a little background, I am using the code set that the patches are not ready yet so I have to fix them.


title: Simplest way to comment/uncomment certain lines using command line

text: Is there a way to comment/uncomment a shell/config/ruby script using command line? for example:               $ comment 14-18 bla.conf     $ uncomment 14-18 bla.conf      this would add or remove `#` sign on `bla.conf` on line `14` to `18`. Normally I use `sed`, but I must know the contents of those lines and then do a find- replace operation, and that would give a wrong result when the there are more than one needle (and we're only want to replace the N-th one).


title: RHEL: Creating stable names for network interfaces

text: We have a RHEL 5.5 box with 8 interfaces. And the `eth` interface naming is flip flopping. Sometimes `eth0` comes up on physical port 7th, and sometimes on another physical port. We want the naming to be as per the sequence of PCI BUS. I did the research and found that               cat /sys/devices/pci0000\:00/0000\:00\:1e.0/0000\:07\:07.0/net\:eth0/address\      This locations have the mac address of the `eth` devices. So If I get "address" in sequence from this pci bus locations and put them in `ifconfig- eth0` to `ifconfig-eth7` in order of PCI BUS location, my `eth` naming will be stable. I tried:               find /sys/devices/ -name "address"      but it does not bring any results. I don't know why… Any help here?


title: Modify ulimit (open files) of a specific process

text: Is it possible to change the _soft -_ and _hard limit_ of a **specific** process? In my case, my process is `mongod` and a lot of web resources tell me to simply execute:               ulimit -n <my new value>      My current thoughts:   * How will the command know the limit of the **process** that I'll be modifying? Won't this modify the whole systems open file limit?   * I'm guessing that this command only changes the soft limit. So is there a way to increase the hard limit too?


title: What does \bi\b mean in a grep pattern?

text: What does this command do?               grep "\bi\b" linux.txt      What is it searching for?


title: Open file found with 'find' command

text: This is probably an easy one, but I can't figure it out and it's pretty much not searchable. In a folder hierarchy I have exactly one file of type xyz. I want to find that file and open it with a terminal command.               find . -name *.xyz      This will return the file I'm looking for. Now how do I open it automatically, without typing the name?               find . -name *xyz | open      This doesn't work. It says it doesn't found the open command.


title: Script to dripfeed files

text: I need to write a script that will check a directory for a given file type, say *.mov, and move up to, say, 50GB worth into another directory. The purpose being that we have a huge bunch of files that need to go through another automated system, but sending terabytes through at one time will cause a whole bunch of other processes to break. Is there a way to restrict `find` to displaying up to a given total size? If so, I could easily `find /path/to -iname "*.mov" [halt at 50GB] -exec mv {} /path/to \;` Or does anyone have any other suggestions as to how I can automate this? I suppose I could write a loop that added the size to a variable and halted if the variable got to a certain size, like (I'll worry about the syntax of the filesize test later):               TOTALSIZE=0     for x in /path/to/*.mov       do (print file size > $filesize) && TOTALSIZE=`expr $TOTALSIZE + $filesize`         if [ $TOTALSIZE > 50000000 ]           then exit 0         else mv $x /destination       done      Would that work?


title: How to uninstall nginx (installed from source)?

text: I want to switch from a development version to a stable one. I installed nginx from source with:               ./configure     make     sudo make install      I tried `sudo make uninstall` but it doesnt work. How can I uninstall nginx?


title: Bash script installing within multiple directories

text: I am attempting to write a bash script that will install rbenv from beginning to end. I am on a Mac for interest sake. But there are some things that are not working mainly i am changing the directory but only in the subshell.               #!/bin/bash     echo "installing rbenv ruby manager manager"     cd ~     git clone git://github.com/sstephenson/rbenv.git .rbenv     echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile     echo 'eval "$(rbenv init -)"' >> ~/.bash_profile     source .bash_profile          echo "installing ruby build for rbenv"     git clone https://github.com/sstephenson/ruby-build.git     cd ruby-build     sudo ./install.sh          echo "rbenv and ruby-build have been installed, installing ruby now.."     sleep 2          read -p "would you like chronospere to install ruby 1.9.3 [y/n]" RESP     if [ "$RESP" = "y" ]; then       rbenv install 1.9.3-p327       rbenv rehash       rbenv global 1.9.3-p327       ruby -v     else       echo "alrigt skipping.. vagrant has rbenv installed you can install ruby it at your leisure "       echo "hold cmd, and double clck https://github.com/sstephenson/rbenv for more info"     fi          cd ~      So it seems as if installing it works. But most of my code does not get run, or doesn't get run in the place I'd like it to.               vagrant@precise64:/vagrant$ ruby -v     ruby 1.8.7 (2012-02-08 patchlevel 358) [x86_64-linux]     vagrant@precise64:/vagrant$ rbenv     The program 'rbenv' is currently not installed.  You can install it by typing:     sudo apt-get install rbenv      As you can see its as if nothing was installed. The `source .bash_profile` never happened               vagrant@precise64:/vagrant$ cd           vagrant@precise64:~$ cd ~      vagrant@precise64:~$ source .bash_profile       After I manually source the bash_profile,               vagrant@precise64:~$ rbenv     rbenv 0.4.0-45-g060f141     vagrant@precise64:~$ rbenv versions       * system (set by /home/vagrant/.rbenv/version)       1.9.3-p327     vagrant@precise64:~$ rbenv global 1.9.3-p327     vagrant@precise64:~$ ruby -v     ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-linux]      So as you can see its as if the code is running just not moving from one directory to the next. I don't even know if this is possible with in a bash script. I move from `~ / (HOME)` to `/ruby-build` back to `~` then to `/vagrant`. Is this possible in a single bash script. this is weird because if I open the terminal and run that code line by line it works 100%.


title: add audio from playing file to microphone stream

text: I need to add a sound to what the microphone is capturing, is it possible? I started with               man aplay      and found that I can do               aplay -D PCMdevice filepath.wav      so then I listed the PCM devices with               ~$ aplay -L     null         Discard all samples (playback) or generate zero samples (capture)     default:CARD=Device         USB Advanced Audio Device, USB Audio         Default Audio Device     sysdefault:CARD=Device         USB Advanced Audio Device, USB Audio         Default Audio Device     front:CARD=Device,DEV=0         USB Advanced Audio Device, USB Audio         Front speakers     surround40:CARD=Device,DEV=0         USB Advanced Audio Device, USB Audio         4.0 Surround output to Front and Rear speakers     surround41:CARD=Device,DEV=0         USB Advanced Audio Device, USB Audio         4.1 Surround output to Front, Rear and Subwoofer speakers     surround50:CARD=Device,DEV=0         USB Advanced Audio Device, USB Audio         5.0 Surround output to Front, Center and Rear speakers     surround51:CARD=Device,DEV=0         USB Advanced Audio Device, USB Audio         5.1 Surround output to Front, Center, Rear and Subwoofer speakers     surround71:CARD=Device,DEV=0         USB Advanced Audio Device, USB Audio         7.1 Surround output to Front, Center, Side, Rear and Woofer speakers     iec958:CARD=Device,DEV=0         USB Advanced Audio Device, USB Audio         IEC958 (S/PDIF) Digital Audio Output     dmix:CARD=Device,DEV=0         USB Advanced Audio Device, USB Audio         Direct sample mixing device     dsnoop:CARD=Device,DEV=0         USB Advanced Audio Device, USB Audio         Direct sample snooping device     hw:CARD=Device,DEV=0         USB Advanced Audio Device, USB Audio         Direct hardware device without any conversions     plughw:CARD=Device,DEV=0         USB Advanced Audio Device, USB Audio         Hardware device with all software conversions      But I can't find any PCM device which includes the name mic or capturing or input, everything seems output so I think this is a bad lead. Has anybody found a way to obtain the result?


title: Why does exec file generate 4 processes in Linux?

text: I build my RTAI-model-source（generated by simulink） in CygWin with gcc- linux-4.1 (cross-compiler of CygWin) on Windows, and generate ELF successfully. and the ELF runs correctly on Ubuntu. After the ELF is running correctly on Ubuntu, there are four processes with the same name but different process-id in the system monitor. But if I build my source with `gcc` on Linux, it generates only 1 process, so I think `fork()` or `exec()` may not be called. How can one exec file make four processes? The `ps -elF` shows:               F S UID        PID  PPID  C PRI  NI ADDR SZ WCHAN  STIME TTY          TIME CMD     4 S root      3679  3314  0  57   - -  4362 hrtime 17:44 pts/1    00:00:00 /root/Test/test     5 S root      3680  3679  0  57   - -  4362 poll_s 17:44 pts/1    00:00:00 /root/Test/test     5 S root      3681  3680  0  56   - -  4362 rt_sch 17:44 pts/1    00:00:00 /root/Test/test     5 S root      3682  3680  0 -40   - -  4362 rt_sch 17:44 pts/1    00:00:00 /root/Test/test


title: .asoundrc, alsaequal as default breaks firefox MP3 playback

text: Alright, so the important thing to note here is that it (appears) to ONLY break MP3 playback, other formats work. Youtube html5 videos and .ogg playback work fine and use the equalizer as expected, mplayer and VLC mp3 playback also work. The firefox mp3 playback works if I comment out the !default redefinition.               pcm.!default {       type equal;       slave.pcm "plugequal";     }          ctl.equal {       type equal;     }          pcm.plugequal {       type equal;       slave.pcm "plug:dmix";     }      OS is a minimal Ubuntu install (all gstreamer1.0 and 0.10 plugins installed), firefox version 32, no pulseaudio I have no idea what's going on, for some reason whatever mp3 decoder firefox uses appears to be unable to use the new default device, while everything else on the system works just fine Edit: I just found out that manually setting VLC to the alsaequal plugin also breaks VLC mp3 playback:               vlc -v test.mp3 -A alsa --alsa-audio-device plugequal     ALSA lib dlmisc.c:252:(snd1_dlobj_cache_get) Cannot open shared library /usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_pcm_equal.so      works when using LD_Preload:               env LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libasound.so:/usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_pcm_equal.so      vlc -v test.mp3 -A alsa --alsa-audio-device default      Ugh


title: On Arch Linux Partitioning

text: I've been going through the Arch Linux beginner's guide and I'm a bit confused on partitioning the OS. It says I can either have just a root partition or a root and /home partition. What are the pros/cons of one versus the other? Also, if I have a windows 7 repair disk and I want to dual boot Win7 and Arch, can I safely delete the OEM partition and still be able to use the repair disk if I mess up?


title: Removing a specific line from a file

text: Somewhere in the middle of my CSV file is this line:               Products below this line are out of stockNumber, month, year, reference, store      Note:Number, month, year, reference and store are the CSV fields. How do I delete this line from the file using a command line command? Note the CSV is like this               Number, month, year, reference, store     1,1,2014,13322,main     2,2,2014,13322,main     3,3,2011,1322,main     4,4,2012,3322,main     5,4,2013,122,secondary     Products below this line are out of stockNumber, month, year, reference, store     12,411,2010,122,Albany     25,41,2009,122,Dallas     35,24,2008,122,New


title: How to use bash script to read binary file content?

text: I want to read a character and then a fixed length of string (the string is not null terminated in the file, and its length is given by the preceding character). How can I do this in a bash script? How to define the string variable so that I can do some post-processing on it. Great thanks! Amanda


title: facebook unable to load/work properly in linux

text: I am facing problem with a facebook on linux these days, but when i switch back to windows (windows 7)it works absolutely fine. I am using fedora 14, 64 bit machine with Mozilla Firefox 3.6.24. Even i tried to open facebook in opera browser the problem remains same. Problems seen yet are:   1. After login, the first page appears is not loading fully to see more stories.   2. chat window is not appearing   3. Any picture is not opening on clicking over it.   4. Whenever i click on like button, it does not work. I even tried : yum update firefox No Packages marked for Update Can anybody tell me what wrong is going on?


title: Set Ubuntu System Proxy Settings without Restart from commandline

text: I am using `Ubuntu 14.04` . I want to change the `http proxy` settings from the command line. This should be equivalent to changing in the GUI(All Settings->Network->Network Proxy) and clicking the button `Apply System Wide`. I don't want to restart/logout the system as I am planning to change the settings dynamically from a script(`bash`).


title: periodically can't access google

text: On a daily basis, at around the same time each day (early morning and early afternoon), my computer stops being able to access google or any sites that use google code (including sites that use google adsense, google api, blogspot, youtube, google itself). This persists until I reboot my computer. I have a laptop on the same network, using the same router, which is able to access these sites just fine, but it's an old laptop and can only access the web in elinks so I want to use the internet from this computer instead. Based on the output of mtr, I'm experiencing 50% packet loss, 16 hops in the direction of google. My best guess is that rebooting the computer causes it to take a different path to google, bypassing the node that's causing me trouble. Is there anyway to get it to do that without having to reboot? Output of mtr:                Host                                     Loss%   Snt   Last   Avg  Best  Wrst StDev      1. [my isp]                               0.0%    43   13.8  14.4  13.2  21.1   1.2      2. [my isp]                               0.0%    43   16.0  14.3  13.1  17.8   0.9      3. 81.183.2.17                            0.0%    43   15.9  16.2  15.1  22.0   1.1      4. 81.183.2.16                            0.0%    43   14.8  18.5  13.7  64.1  10.9      5. 81.183.0.217                           0.0%    43   15.1  25.2  14.9  60.4  15.4      6. 81.183.2.217                           0.0%    43   14.5  14.5  13.5  15.4   0.5      7. 209.85.243.121                         0.0%    43   16.8  17.9  16.7  26.9   1.5      8. 72.14.234.11                           0.0%    43   34.5  35.3  30.0  79.7  10.1      9. 72.14.235.17                           0.0%    43   40.5  43.2  39.1  75.3   7.9     10. 72.14.235.174                          0.0%    43   40.0  45.0  39.4  78.3   9.1         72.14.235.172     11. 216.239.43.4                           0.0%    43  112.0 116.5 111.2 135.7   7.1         216.239.46.218     12. 216.239.46.217                         0.0%    42  147.5 150.9 146.4 188.7   7.4         216.239.46.215     13. 72.14.232.141                          0.0%    42  155.5 161.4 155.2 203.8  12.5         209.85.241.22     14. 216.239.46.52                          0.0%    42  165.7 169.2 164.9 200.9   7.3         216.239.46.54     15. 216.239.46.241                         0.0%    42  245.8 195.5 190.6 245.8   8.2         216.239.46.213                                                                       16. 216.239.47.186                        51.2%    42  212.4 208.9 208.0 212.4   0.9     17. 72.14.233.140                          0.0%    42  210.6 479.9 209.0 11415 1728.         72.14.233.138                                                                        18. 64.233.174.97                          0.0%    42  213.0 477.7 208.5 11364 1720.     [cuts off here because my screen isn't big enough]      output of nslookup google.com:               Server:         208.67.222.222     Address:        208.67.222.222#53          Non-authoritative answer:     Name:   google.com     Address: 173.194.39.99     Name:   google.com     Address: 173.194.39.104     Name:   google.com     Address: 173.194.39.105     Name:   google.com     Address: 173.194.39.101     Name:   google.com     Address: 173.194.39.103     Name:   google.com     Address: 173.194.39.97     Name:   google.com     Address: 173.194.39.96     Name:   google.com     Address: 173.194.39.100     Name:   google.com     Address: 173.194.39.110     Name:   google.com     Address: 173.194.39.102     Name:   google.com     Address: 173.194.39.98      netstat -rn:               Kernel IP routing table     Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface     192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0     169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 eth0     0.0.0.0         192.168.1.1     0.0.0.0         UG        0 0          0 eth0      I had to reboot to ask this question because stackexchange uses google api too, but I'm sure I'll have the problem again later today, as I do every day. I looked at mtr again, and I'm getting no packet loss (as expected after reboot), and it doesn't take a path through 216.239.47.* which is the node that was giving me trouble.


title: How to exit bash history search mode?

text: In Ubuntu 12.04 I use `CTRL`-`R` to enter a reverse history search. If the command I want is not found (after repeated `CTRL`-`R`), how do I immediately exit back to the (empty) command prompt with no historical command entered or executed on the command line?


title: vsftpd for virtual users: login directory isn't world readable. Then what's the use?

text: To configure vsftpd for virtual users, I followed this link. Though I succeeded in making the virtual users log into the system but it didn't work exactly the way mentioned in the document I followed. The last section (i.e. comments) of the document mentioned in the link (I am posting it below for your ease) says that the login directory is not world readable and it's expected that way. My question is: if it's expected that way only, then what is the use as no user can read any directory and find if a file is there or not to download? The login directory is as below: drwx------ 3 virtual virtual 4096 Jul 30 00:39 /home/ftpsite               This example shows how to set up vsftpd / PAM with "virtual users". A virtual user is a user login which does not exist as a real login on the system. Virtual users can therefore be more secure than real users, beacuse a compromised account can only use the FTP server.          Virtual users are often used to serve content that should be accessible to untrusted users, but not generally accessible to the public.          Step 1) Create the virtual users database. We are going to use pam_userdb to authenticate the virtual users. This needs a username / password file in "db" format - a common database format. To create a "db" format file, first create a plain text files with the usernames and password on alternating lines. See example file "logins.txt" - this specifies "tom" with password "foo" and "fred" with password "bar". Whilst logged in as root, create the actual database file like this:          db_load -T -t hash -f logins.txt /etc/vsftpd_login.db (Requires the Berkeley db program installed). NOTE: Many systems have multiple versions of "db" installed, so you may need to use e.g. db3_load for correct operation. This is known to affect some Debian systems. The core issue is that pam_userdb expects its login database to be a specific db version (often db3, whereas db4 may be installed on your system).          This will create /etc/vsftpd_login.db. Obviously, you may want to make sure the permissions are restricted:          chmod 600 /etc/vsftpd_login.db          For more information on maintaing your login database, look around for documentation on "Berkeley DB", e.g. http://www.sleepycat.com/docs/utility/index.html               Step 2) Create a PAM file which uses your new database.          See the example file vsftpd.pam. It contains two lines:          auth required /lib/security/pam_userdb.so db=/etc/vsftpd_login account required /lib/security/pam_userdb.so db=/etc/vsftpd_login          This tells PAM to authenticate users using our new database. Copy this PAM file to the PAM directory - typically /etc/pam.d/          cp vsftpd.pam /etc/pam.d/ftp          (Note - if you set pam_service_name to e.g. vsftpd instead, you'll need to copy to /etc/pam.d/vsftpd).               Step 3) Set up the location of the files for the virtual users.          useradd -d /home/ftpsite virtual ls -ld /home/ftpsite (which should give): drwx------    3 virtual  virtual      4096 Jul 30 00:39 /home/ftpsite          We have created a user called "virtual" with a home directory "/home/ftpsite". Let's add some content to this download area:          cp /etc/hosts /home/ftpsite chown virtual.virtual /home/ftpsite/hosts               Step 4) Create your vsftpd.conf config file.          See the example in this directory. Let's go through it line by line:          anonymous_enable=NO local_enable=YES          This disables anonymous FTP for security, and enables non-anonymous FTP (which is what virtual users use).          write_enable=NO anon_upload_enable=NO anon_mkdir_write_enable=NO anon_other_write_enable=NO          These ensure that for security purposes, no write commands are allowed.          chroot_local_user=YES          This makes sure that the virtual user is restricted to the virtual FTP area /home/ftpsite we set up above.          guest_enable=YES guest_username=virtual          The guest_enable is very important - it activates virtual users! And guest_username says that all virtual users are mapped to the real user "virtual" that we set up above. This will also determine where on the filesystem the virtual users end up - the home directory of the user "virtual", /home/ftpsite.          listen=YES listen_port=10021          This puts vsftpd in "standalone" mode - i.e. not running from an inetd. This means you just run the vsftpd executable and it will start up. This also makes vsftpd listen for FTP requests on the non-standard port of 10021 (FTP is usually 21).          pasv_min_port=30000 pasv_max_port=30999          These put a port range on passive FTP incoming requests - very useful if you are configuring a firewall.          Copy the example vsftpd.conf file to /etc:          cp vsftpd.conf /etc/               Step 5) Start up vsftpd.          Go to the directory with the vsftpd binary in it, and:          ./vsftpd          If all is well, the command will sit there. If all is not well, you will likely see some error message.               Step 6) Test.          Launch another shell session (or background vsftpd with CTRL-Z and then "bg"). Here is an example of an FTP session:          ftp localhost 10021 Connected to localhost (127.0.0.1). 220 ready, dude (vsFTPd 1.1.0: beat me, break me) Name (localhost:chris): tom 331 Please specify the password. Password: 230 Login successful. Have fun. Remote system type is UNIX. Using binary mode to transfer files. ftp> pwd 257 "/" ftp> ls 227 Entering Passive Mode (127,0,0,1,117,135) 150 Here comes the directory listing. 226 Transfer done (but failed to open directory). ftp> size hosts 213 147 ftp>          Comments: The password we gave was "foo". Do not be alarmed by the "failed to open directory". That is because the directory /home/ftpsite is not world readable (we could change this behaviour if we wanted using anon_world_readable_only=NO but maybe we want it this way for security. We can see that we have access to the "hosts" file we copied into the virtual FTP area, via the size command.


title: How do you implement a login warning banner in Gnome 3?

text: This question documents how we used to inflict the mandatory login banners required on our Linux machines at work. Unfortunately, this procedure is no longer effective with Gnome 3 in Fedora 15, 16 or 17. Gnome 3 seems to ignore the banner_message fields in gconf-editor. Does Gnome 3 provide an equivalent procedure that allows us to present a warning message to users prior to login?


title: Why doesn't the ssh command follow RFC on URI?

text: The RFC:   * Uniform Resource Identifier (URI) Scheme for Secure File Transfer Protocol (SFTP) and Secure Shell (SSH) presents the SSH URI as:               ssh://[<user>[;fingerprint=<host-key fingerprint>]@]<host>[:<port>]      Are there any known reasons why the OpenSSH ssh command doesn't follow this standard with the hostname option? It does not accept a port after a colon. Example of a URI I was expecting to work:               $ ssh user@host:2222     ssh: Could not resolve hostname host:2222: Name or service not known


title: VirtualBox guest: 16 CPUs detected but only 1 online

text: I am running VirtualBox (using the Qiime image http://qiime.org/install/virtual_box.html) The physical hardware is a 32 core machine. The virtual machine in VirtualBox has been given 16 cores. When booting I get:               Ubuntu 10.04.1 LTS     Linux 2.6.38-15-server          # grep . /sys/devices/system/cpu/*     /sys/devices/system/cpu/kernel_max:255     /sys/devices/system/cpu/offline:1-15     /sys/devices/system/cpu/online:0     /sys/devices/system/cpu/possible:0-15     /sys/devices/system/cpu/present:0     /sys/devices/system/cpu/sched_mc_power_savings:0          # ls /sys/kernel/debug/tracing/per_cpu/     cpu0  cpu1  cpu10  cpu11  cpu12  cpu13  cpu14  cpu15  cpu2  cpu3  cpu4  cpu5  cpu6  cpu7  cpu8  cpu9          # ls /sys/devices/system/cpu/     cpu0  cpufreq  cpuidle  kernel_max  offline  online  possible  present  probe  release  sched_mc_power_savings          # echo 1 > /sys/devices/system/cpu/cpu6/online      -su: /sys/devices/system/cpu/cpu6/online: No such file or directory      So it seems it detects the resources for 16 CPUs, but it only sets one online. I have tested with another image that the VirtualBox host can run a guest with 16 cores. That works. So the problem is to trouble shoot the Qiime image to figure out why this guest image only detects 1 CPU.


title: Passing a bash command-line argument containing a dot

text: How can a command-line argument containing a dot (.) be passed? Are there any escape sequences for capturing characters like dot? The following invocation of a bash-script from the shell does not work:               # ./deploy.sh input.txt     ./deploy.sh: line 9: input.txt: syntax error in expression (error token is ".txt")      I have tried the following:   1. backslash   2. quote   3. double quotes   4. ./deploy.sh input (this works) **EDIT** Take this use-case:   1. I have 3 files: server.jar client.jar gui.jar   2. I need to scp them from a source to a dest   3. source dir: login1@host1:/home/xyz/deploy/   4. dest dir: login2@host2: /data/apps/env/software/binary/ Solution:   1. Read artifacts to be copied into an array from the command-line   2. create dest path and source path strings by using the correct directory prefixes   3. use a for loop to scp each artifact (having figured out the paths)  Here's the simple script which is doing 1 (read artifacts into an array):               #!/bin/bash     declare -a artifacts     for i     do     artifacts[i]=$i     echo ${artifacts[i]}     done      _Execution1_               -bash-3.00$ ./simple.sh arg1 arg2 arg3     arg1     arg2     arg3      _Execution2_               -bash-3.00$ ./simple.sh arg1.txt arg2.txt arg3.txt     ./simple.sh: line 7: arg1.txt: syntax error in expression (error token is ".txt")


title: Start Netbeans as super user as a shortcut with password embedded

text: For my work purposes, I need to start netbeans in super user mode. I find it quite irritating to have to type this : su then enter the password ./netbeans everytime I want to start netbeans. How can I avoid doing this? As in, do a 1-click on the desktop in Centos to start netbeans as a super user. Forgive me if this is a really easy question, quite noob to linux. Thanks!


title: Does kdenlive have a limit regarding the workable filesize?

text: Does kdenlive have a limit regarding the workable file-size?


title: Can AMD and NVIDIA display cards work together on linux?

text: I know that two AMD graphics cards/two NVIDIA graphics cards can work together ,e.g. in xinerama/crossfire/multi-view. But if I have one AMD graphics card and one NVIDIA graphics card, can I use them together on one platfrom simultaneously? How can I configure it? PS. I am asking about the closed source drivers. Not the open source drivers. Did anybody try and success?


title: Listing all my files modified more than X days ago, in long format

text: How can I list in long format all files (located in a directory) which belong to me (rights) and were modified more than 7 days ago?


title: "w | tail" chops text at right margin (78 characters)

text: **Summary:** `w | tail` chops rows after 78th column. When I run the "w" command, it works as expected. However, when I pipe the output to "tail", it chops the output to **78** columns wide (truncates anything after right margin). I've checked `set` and `env` for any values of 78 (or 79 or 80), as well as `TERM` (xterm|ansi|vt100), and `stty -a` settings, as well as `tail` and `w` (they look OK). `$COLUMNS` is set to 209 (but this doesn't matter...I set it to 100 with the same results). I'm running CentOS 5 (kernel - 2.6.18). The `tail` and `w` binaries look OK to me. > /usr/bin/w: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for > GNU/Linux 2.6.9, dynamically linked (uses shared libs), stripped               CentOS$ cat 80.txt               1         2         3         4         5         6         7         8     012345678901234567890123456789012345678901234567890123456789012345678901234567890     ----------+---------+---------+---------+---------+---------+---------+---------+     CentOS$ export COLUMNS=100     CentOS$ w | tail -5 | sed 's/./\./g'     .....................................................................     ...............................................................................     ...............................................................................     ...............................................................................     ...............................................................................


title: Why does the sudoers file contain IP addresses?

text: According to the documentation, modifications of this file may enable local users to execute sudo commands on remote machines:               user1 192.168.1.14=(user2:group1) ALL      According to what I read, this entry enables `user1` to execute all commands on the host with the IP `192.168.1.14`. How could this be possible? I also have problems understanding what does running commands as different users means?


title: Why did Debian create the DFSG?

text: I'm curious why Debian created the DFSG when the FSD already existed. There are some differences (conflicts) of course, but was that the main motivation?


title: What is a "loop device" when mounting?

text: I am doing a mounting of an iso file and looking at this tutorial. They use the command:               $ mount -o loop disk1.iso /mnt/disk      I'm trying to understand the use of `-o loop`. So I have two questions: When I look at the long man page for mount, it takes time to find that `-o` option. If I do `man mount | grep "-o"` I get and error, and when I look in the file I do not find info that "loop" is a command text for option `-o`. Where is that documented? Also, what is the "loop device" concept for mounting? Even a good link to an explanation would be appreciated.


title: FreeNX closes display immediately after successful connect in OpenSUSE 12.2

text: Upgrading from a OpenSUSE 12.1 installation with a working FreeNX server, I hit an issue with the FreeNX server on OpenSUSE 12.2, running Gnome 3. Whenever I connect, I pass the dreaded connection phase (where I've hit most of my issues with FreeNX), and see the client prepare the display, and even see a bit of the display load. But, immediately after this, the NX client will close and show me the error: > The connection with the remote server was shut down. Please check the state > of your network connection. Now, I know my connection, to the network, at least, doesn't have any problems. It seems like the initialization of the X session in the FreeNX connection crashes the display. The question: How do I successfully connect with an NX client to my FreeNX server?


title: How does one sort music in Rhythmbox?

text: I quite like Rythmbox and was thinking of keeping it as my default player, but as far as I can tell there's no **easy** way to sort an album in a playlist by track number, or a genre by artist, etc. Responses to this post seem to suggest that I have to create a "smart" playlist just to achieve this. I'm familiar with smart playlists from itunes but I'm not thrilled about the idea of creating one every time I want to listen to an album! Surely there's an easier way. Currently when I click on `Track` or `Title` in the playlist nothing happens. Is there some sort of setting or plugin that fixes this, or is it a design choice? (I wasn't particularly fond of Amarok and was hoping for a solution that let's me keep using Rhythmbox).


title: mutt: define which headers are displayed (in compose)

text: When composing a message in `mutt`, I see the following headers:                   From:            To:            Cc:          Bcc:      Subject:     Reply-To:          Fcc: ~/.mail/sent          Mix: <no chain defined>     Security: None      I don't know what the `Mix:` header is for, and I don't think I will ever need it. Similarly, I will not need to edit the `Reply-To:` header. These two useless lines are taking up valuable space. Is it possible to remove these headers entirely? Can I specify which headers are displayed in the compose menu?


title: How would I change file permissions if the file name has a space in it in linux

text: I would like to know how would I rename and change file permissions of a file that contains a space in the name on Linux. **Example** The name of my file is: **my file** I have tried `mv my%20file my_file` I have also tried `chown -R 755 my%20file` but both of these don't work!


title: I want a script to do following simple task?

text: My input is :               a     a     l     a     c     g     b     c      ... and so on rando alphabets. A command or a awk statement which will give me:               a-1     1-2     l-1     a-3     c-1     g-1     b-1     c-2      basically counter for all alphabets and initialization when a particular alphabet starts.


title: How do I draw a process tree from my shell to the kernel?

text: I can't understand this problem For each process in the tree, indicate the name of the process, the process's ID number, and the name of the owner of the process.


title: Where can i find any information about ancient doshell(8)?

text: I check the openvt manual by running "man openvt" command, and i found doshell(8) under "SEE ALSO" section: ![enter image description here](http://i.stack.imgur.com/QvtUN.png) But there's no manual if i do "man 8 doshell": ![enter image description here](http://i.stack.imgur.com/mrUUw.png) I checked the online manual at http://linux.about.com/library/cmd/blcmdl1_openvt.htm, the **doshell(8)** is not a link: ![enter image description here](http://i.stack.imgur.com/7SMNb.png) I found someone mentioned "(There is also the ancient doshell(8)", answered at https://stackoverflow.com/questions/21428158/how-to-send-broadcast-message-to- console-in-linux-from-c-program ![enter image description here](http://i.stack.imgur.com/DsYMj.png) Just a question out of my curiosity, is there any place i can find information about doshell(8)?


title: rsync move files, leave directories?

text: I'm using `rsync` to copy data between my internal and external hard drives. It's done what I need, but I'm running out of room on my internal hard drive. So, is there any way to get `rsync` to function like `mv` instead of `cp`, but also leave the "skeleton" of empty directories in the original location, only erasing the files, so that I can put more files into the directories and `rsync` it again to add the new files to the external drive, without erasing the old ones? Or, if there's a program other than `rsync` with Linux support that can accomplish this, that's fine too.


title: Replace a word after a significant line and white spaces (inline) using sed?

text: I have the following text:                 A       Hello       world       B       Hello       world       C       Hello       world      I know that I can replace `Hello` by `Hi` using `sed`:               sed 's/Hello/Hi/g' -i test      but this replace each `Hello` with `Hi`:                 A       Hi       world       B       Hi       world       C       Hi       world      what I really want is to replace only the `Hello` after `B`:                 A       Hello       world       B       Hi       world       C       Hello       world      so I have tried this:               sed 's/"B\nHello"/"B\nHi"/g' -i test      but nothing happened, How can I do this? Note: There are some white-spaces on the beginning of each line of the file.


title: How do I install plugins for collectd

text: I have installed collectd and got it running but also wanted to use the Ping plugin ( https://collectd.org/wiki/index.php/Plugin:Ping ) but it's not actually installed by default (i.e. not in the list of plugins in /opt/collectd/lib/collectd How do I install a plugin that doesn't come with collectd and where do I get the plugin itself? I have been Googling in circles for this but can't find anything. Thanks,


title: Block TTY echo to display

text: I have a minimal Ubuntu as a Linux server. It starts many scripts on startup that is ok but I want to disable tty1 to echo everything to display When I start this server a login promt is presented on tty1 and I want the display to be clear so nobody can see what is being typed into.


title: mbsync: Move subfolders to root

text: My mail provider (Fastmail) puts the folders I define in the webinterface inside the INBOX. Thus when I sync them using mbsync I obtain the following:               INBOX      - .Drafts      - .Foobar      But I would prefer having them one level above and parallel to the INBOX:               INBOX     Drafts     Foobar      How can I achieve this? I've tried the Flatten option but then I still have a `INBOX.` prefixed to every folder and I loose the hierarchy for subfolders:               INBOX     INBOX.Drafts     INBOX.Foobar     INBOX.Foobar.Foofoo      I could define a channel/renaming rule for every folder but there must be an easier way to do this.


title: Ext2 block structure: size of reserved GDT Blocks

text: In every publication I found about ext2, the structure of a block group is defined as following:   * Super Block: 1 block   * Group Descriptor: N blocks   * Data Bitmap: 1 block   * Inode Bitmap: 1 block   * Inode Table: N blocks   * Data Blocks: remaining blocks However in the ext2 kernel doc it is stated that versions >0 may not store copies of the super block and group descriptors in every block group. When I `fsstat` my ext2 partition, I get following output:               Group: 1:       Inode Range: 1977 - 3952       Block Range: 8193 - 16384       Layout:         Super Block: 8193 - 8193         Group Descriptor Table: 8194 - 8194         Data bitmap: 8451 - 8451         Inode bitmap: 8452 - 8452         Inode Table: 8453 - 8699         Data Blocks: 8700 - 16384       Free Inodes: 1976 (100%)       Free Blocks: 0 (0%)       Total Directories: 0          Group: 2:       Inode Range: 3953 - 5928       Block Range: 16385 - 24576       Layout:         Data bitmap: 16385 - 16385         Inode bitmap: 16386 - 16386         Inode Table: 16387 - 16633         Data Blocks: 16387 - 16386, 16634 - 24576       Free Inodes: 1976 (100%)       Free Blocks: 0 (0%)      There are two things about this output that confuse me:   1. In groups where the SB and group desc. are stored, there is a gap of 256 blocks between the group desc. and data bitmap. **EDIT: Using`dumpe2fs` I just found out that these are reserved GDT blocks, used for online resizing.** So the new question is, how is the size of these reserved GDT blocks determined?   2. What does `Data Blocks: 16387 - 16386` in Group 2 mean?


title: How to find the IP address of a KVM Virtual Machine, that I can SSH into it?

text: I have follow this guide (Virtualization With KVM On Ubuntu 11.10) to setup my KVM (Virtual Machines Software) on my Ubuntu 11.10 Server. However, I didn't setup my VM's IP address when creating the VM, instead of using: > vmbuilder kvm ubuntu --suite=oneiric --flavour=virtual --arch=amd64 > --mirror=http://de.archive.ubuntu.com/ubuntu -o --libvirt=qemu:///system > --ip=192.168.0.101 --gw=192.168.0.1 --part=vmbuilder.partition > --templates=mytemplates --user=administrator --name=Administrator > --pass=howtoforge --addpkg=vim-nox --addpkg=unattended-upgrades > --addpkg=acpid --firstboot=/var/lib/libvirt/images/vm1/boot.sh --mem=256 > --hostname=vm1 --bridge=br0 I used: (I deleted "--ip=192.168.0.101 --gw=192.168.0.1" from the command line) > vmbuilder kvm ubuntu --suite=oneiric --flavour=virtual --arch=amd64 > --mirror=http://de.archive.ubuntu.com/ubuntu -o --libvirt=qemu:///system > --part=vmbuilder.partition --templates=mytemplates --user=administrator > --name=Administrator --pass=howtoforge --addpkg=vim-nox --addpkg=unattended- > upgrades --addpkg=acpid --firstboot=/var/lib/libvirt/images/vm1/boot.sh > --mem=256 --hostname=vm1 --bridge=br0 I have set up the network bridge as the guide instructed and the new VM's interface is connected to the network bridge. I assume the KVM will assign my VM via DHCP but I don't have information on my new VM's IP address, where can I find the VM's IP address and SSH to the new VM? Thanks. [Notes: I have managed to login the VM without knowing the IP address of the VM. Using "Xming + SSH with X Graphic Forwarding" But there is no DHCP ip address assigned to my VM, Besides the above question, I have another question here: How to enable the DCHP on my VM so when I use Xming to login via "virt viewer" I can at least see my IP address is there.]


title: How can we rename a file with semi-colon as part of the filename?

text: I tried to rename all file with extension "XLS;1" to "XLS" but it just didn't work. I tried the following in cygwin in windows xp and they don't work:               mv *.XLS;1 *.XLS          mv *.XLS\;1 *.XLS          mv "*.XLS;1" *.XLS


title: Replace AAA for BBB in file

text: Given I have a file with several words, how can I do the following: How can I replace AAA for BBB in a file with Unix?


title: Why does this ssh command not work? (cat ./file | ssh <user@host> "cat | sudo -t -t 'cat > /root/location/file'")

text: I'm trying to do the following but it's not quite right.               cat ~/Desktop/blah.png | ssh -t -t trusktr@50.116.4.56 "cat | sudo -i 'cat | /path/to/blah.png'"      I have my public ssh key in the trusktr@50.116.4.56 user's .ssh folder, so no initial password is needed. When the `sudo -i` command finally starts, it prompts me for the root password, but immediately fails as if I had pressed enter but I didn't even touch the keyboard. I have a feeling maybe the `cat` command is being catted into the password prompt. The output looks like this:               trusktr@LENOVO-PC ~     $ cat ~/Desktop/win-8.1-missing-lockscreen-setting.png | ssh -t -t trusktr@50.116.4.56 "cat | sudo -i 'cat > /srv/http/default/htdocs/~/img/win-8.1-missing-lockscreen-setting.png'"     tcgetattr: Not a character device     [sudo] password for root:     You type like i drive.     [sudo] password for root:     Your mind just hasn't been the same since the electro-shock, has it?     [sudo] password for root:     Maybe if you used more than just two fingers...     sudo: 3 incorrect password attempts     Connection to 50.116.4.56 closed.      I don't have direct ssh access through the root user, only through a normal user with access to sudo using the root password. How might I cat the image through ssh, through the non-root user, into the root location all in a single command?


title: Can I configure XFCE terminal the way to open all the new terminals as tabs of one window?

text: I strongly prefer to have one terminal window with all the terminals being tabs in it, but the most usual way I open a terminal is calling it from another application (usually with "Open Terminal Here" option in Thunar). Can it be configured so that whenever XFCE terminal is being called, it would open a new tab in the existing window instead of a new window?


title: Joli OS on ARM devices

text: I didn't really know where to ask this question, so since Joli OS uses the linux kernel and they don't seem to have a forum here I go. All the official information I could gather says it doesn't work on ARM devices yet. But when I went to GitHub to look at the code I saw an arm subfolder in jolicloud-robby-kernel/arch. So is it possible with some tweaking to install on an ARM device? Maybe someone with some kernel knowledge can enlighten me. (GitHub link: https://github.com/jolicloud/jolicloud-robby-kernel)


title: USB 3G Modem for embedded Linux?

text: I am fairly new to Linux world, I have to develop an application on embedded Linux which sends data over internet. I have to choose a USB 3G modem with a SIM card holder. I would appreciate if anyone can help me choosing a USB 3G modem which works successfully or is supported on embedded Linux.


title: Is it okay to disable requiretty?

text: I'm trying to set up a deploy script using Capistrano At a step `cap deploy:setup` script is connecting to my server and trying to run commands that create directories. Then I see an error: `msudo: sorry, you must have a tty to run sudo` There is a suggested solution to disable requiretty on my server. http://unix.stackexchange.com/a/49078/26271 I'm wondering if it is safe to do?


title: Memory Stick Partially Corrupt

text: My memory stick has recently become partially corrupt and has slowly been getting worse. About a week ago or so I unzipped a Windows `.rar` archive and placed the contents unto the flash drive, I believe this to have caused the problem. Basically, at first I had simple I/O problems that were easily overcome. Over time though I was unable to access certain areas and now I am unable to access past the first 2GB of my 8GB drive. In `gparted` it says only 2GB is in use. Nautilus shows the folders are there but they're empty and on Windows, performing `chkdsk /f` on it chucks up an error in the same place. I don't want to have to format it unless I have to.