Error when trying to mount Xen LVM2 volumes

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#


grep for string like xxx12345

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.


Recompile Apache22 with threading seamlessly?

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


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

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.


Shredding everything: files/folders and corresponding filenames

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?


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

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


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

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 ###


emulate tail with sed

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?


Effectivity of shred on different file systems

`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)?


yaourt -Syu is not working in arch linux

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?


Difference between sudo su - user and sudo -iu user

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 !


Difference between sudo -i and sudo su

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


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

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`?


Mplayer controls when using stdin playlists

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.


Finding a number of occurrences of a certain character in tcsh

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.


How can Solaris sub-partitions be accessed in FreeBSD?

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?


Configure kbd and immediately profit of the changes without rebooting

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


unzip two different kind of file extensions

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.


xorg performance in openoffice

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?


ant script stops, waiting for input when run in background

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.


CPU usage monitoring in AIX servers

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?


Return status of `cd` is always 0

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.


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

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.


Falling to git checkout on non-found bash commands

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?


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

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


Networking starts up but interface has no IP

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.


run shell scripts in a sequencing way?

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.


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

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.


Windows 8 not showing in Grub

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.


Help with Setting up network connection in Debian 7.5.0

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?


How do I fix a patch

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.


Simplest way to comment/uncomment certain lines using command line

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


RHEL: Creating stable names for network interfaces

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?


Modify ulimit (open files) of a specific process

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?


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

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


Open file found with 'find' command

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.


Script to dripfeed files

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?


How to uninstall nginx (installed from source)?

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?


Bash script installing within multiple directories

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%.


add audio from playing file to microphone stream

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?


Why does exec file generate 4 processes in Linux?

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


.asoundrc, alsaequal as default breaks firefox MP3 playback

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


On Arch Linux Partitioning

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?


Removing a specific line from a file

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


How to use bash script to read binary file content?

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


facebook unable to load/work properly in linux

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?


Set Ubuntu System Proxy Settings without Restart from commandline

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`).


periodically can't access google

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.


How to exit bash history search mode?

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?


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

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.


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

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?


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

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


VirtualBox guest: 16 CPUs detected but only 1 online

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.


Passing a bash command-line argument containing a dot

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")


Start Netbeans as super user as a shortcut with password embedded

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!


Does kdenlive have a limit regarding the workable filesize?

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


Can AMD and NVIDIA display cards work together on linux?

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?


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

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?


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

**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'     .....................................................................     ...............................................................................     ...............................................................................     ...............................................................................     ...............................................................................


Why does the sudoers file contain IP addresses?

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?


Why did Debian create the DFSG?

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?


What is a "loop device" when mounting?

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.


FreeNX closes display immediately after successful connect in OpenSUSE 12.2

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?


How does one sort music in Rhythmbox?

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


mutt: define which headers are displayed (in compose)

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?


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

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!


I want a script to do following simple task?

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.


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

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.


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

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


rsync move files, leave directories?

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.


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

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.


How do I install plugins for collectd

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,


Block TTY echo to display

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.


mbsync: Move subfolders to root

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.


Ext2 block structure: size of reserved GDT Blocks

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?


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

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.]


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

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


Replace AAA for BBB in file

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?


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

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?


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

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?


Joli OS on ARM devices

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)


USB 3G Modem for embedded Linux?

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.


Is it okay to disable requiretty?

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?


Memory Stick Partially Corrupt

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.


Why $PATH variable different between two directories?

When I'm in one directory and echo path               pwd     /Users/me/src/some_proj          echo $PATH     /Users/me/.gem/ruby/2.0.0/bin:/opt/boxen/chruby/versions/2.0.0-     p353/lib/ruby/gems/2.0.0/bin:/opt/boxen/chruby/versions/2.0.0-     p353/bin:bin:/opt/boxen/chruby/bin:/opt/boxen/ruby-     build/bin:node_modules/.bin:/opt/boxen/nodenv/shims:/opt/boxen/nodenv/bin:     /opt/boxen/bin:/opt/boxen/homebrew/bin:/opt/boxen/homebrew/sbin:     /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin      When I'm in a different directory and echo path               pwd     /Users/me/src_personal/my_gems/som_gem          echo $PATH     bin:/opt/boxen/chruby/bin:/opt/boxen/ruby-build/bin:     node_modules/.bin:/opt/boxen/nodenv/shims:/opt/boxen/nodenv/bin:     /opt/boxen/bin:/opt/boxen/homebrew/bin:/opt/boxen/homebrew/sbin:     bin:/opt/boxen/chruby/bin:/opt/boxen/ruby-build/bin:     node_modules/.bin:/opt/boxen/nodenv/shims:/opt/boxen/nodenv/bin:     /opt/boxen/bin:/opt/boxen/homebrew/bin:/opt/boxen/homebrew/sbin:     bin:/opt/boxen/chruby/bin:/opt/boxen/ruby-build/bin:     node_modules/.bin:/opt/boxen/nodenv/shims:/opt/boxen/nodenv/bin:     /opt/boxen/bin:/opt/boxen/homebrew/bin:/opt/boxen/homebrew/sbin:     /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin      I get a different $PATH. I thought $PATH was a global variable in the shell that doesn't change. Why are these paths different in different directories?


Is it possible to notify/warn that current path isn't a valid symlink anymore?

Let's say we have `./a` and `./b` directories. Then we create a symlink using `ln -s a x` and entering it `cd x` The `pwd` would be `x` Then in another terminal we change the `x` so that it pointed to `b`. But the first one would still return `x` for `pwd` which is not consistent anymore. So is there a way for current terminal (bash) to alert/warn if the current path is the obsolete symlink?


Allow AD Groups to SUDO

I'm adding some Fedora 20 workstations to our Windows 2003 domain. I've successfully joined the domain with the boxes, and can login with domain accounts. Now I'm trying to allow the default AD group `Enterprise Admins` to use `SUDO`, however whatever I do, it seems that the group cannot be found (or at least it tells me my user account is not in the sudoers file) Structure of the OU (default really):   * mydomain.local      * Builtin     * Computers     * DCOM-Users     * DOmain Controllers     * ForeignSecurityPrincipals     * CompanyName        * Management       * Accounting       * Admins       * SysAccounts       * CustomerService       * Warehouse     * Users I used `realmd` and `sssd` to join the domain, and am trying to allow sudo to groups located under the `Users` OU, but would also like to add some from the `CompanyName --> Admins` OU/Sub-group as well. I'm currently trying this with no luck (in /etc/sudoers)               %MYDOMAIN\\Enterprise^Admins ALL=(ALL) ALL      I've also tried variations as well, such as:               %MYDOMAIN\\Users\Enterprise^Admins ALL=(ALL) ALL     %Enterprise^Admins@mydomain.local ALL=(ALL) ALL      etc... nothing seems to be working. Even after reboots, and/or `systemctrl restart sssd`. If i explicitly add my domain account to the /etc/sudoers file, it works no problem.               myuser@mydomain.local ALL=(ALL) ALL      There are a few resources that seem to indicate it should be possible to add AD groups to sudoers, however so far none of them have worked for me: http://funwithlinux.net/2013/09/join-fedora-19-to-active-directory-domain- realmd/ http://serverfault.com/questions/387950/how-to-map-ad-domain-admins-group-to- ubuntu-admins https://help.ubuntu.com/community/LikewiseOpen


setxkbmap switches between 2 out of 3 layouts

Issuing that command:               setxkbmap -layout "us,ua,ru" -variant ",winkeys" -option "grp:shift_caps_toggle,grp_led:scroll" -model pc105 -rules xorg      When hitting `Caps Lock`+`Shift` I'm switching between English (us) and Ukrainian (ua) layouts, but not Russian (ru). I've tried to reset it with the following command:               setxkbmap -layout "us,ua,ru" -option ""      and played with many different options - nothing helps. My system is Gentoo Linux and window manager wmii.


How to write a systemd .service file running systemd-tmpfiles

I need to run `systemd-tmpfiles --create` during the boot process with a systemd distro. So I need to create a systemd .service file doing this job. In this question you can read all the details about what I need and why: How does systemd-tmpfiles work? I have read some docs about it and I am writing the following test:               [Unit]     Description=Execute tmpfiles to disable usb-wakeup # see details in the link above     Requires=multi-user.target # see details in the link above     After=multi-user.target    # see details in the link above          [Service]     Type=oneshot     ExecStart=/usr/bin/systemd-tmpfiles --create          [Install]     WantedBy=multi-user.target      But I'm not sure, because `systemd-tmpfiles` is not a simple program but a piece of systemd itself. I wouldn't like to break my system. Any tips about a correct .service file?


When was the threading implemented in unix?

Which is the first Unix version or Linux version which implemented threads. And in which version bound and unbound threads were implemented? I know that in current Linux version threads are unbound by default. But is there any version of Unix or Linux in which threads are bound by default instead of unbound. If some one can give a link to a complete change-log of Unix versions that would also be helpful.


How do I apply this revert commit patch from git?

I have found a patch applicable to my system to fix a problem but I have no idea how to get this patch and then apply it. Can anybody help me please? Patch: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=c11e5f35ab490bd30591563816fbc83526521777


How is default readahead value determined

I have two different devices running XFS and the default readahead value set differs between the two disks. Why is that ? How is the default size computed ? Is it device dependent ? I might also add that the devices are RAID disks and I use `blockdev --getra` to see the readahead value.


comm fails on bash variable input

I have a script that's supposed to get the list of files of two directories, get differences and execute some code for certain files. These are the commands to get the file lists:               list_in=$(find input/ -maxdepth 1 - type f | sed 's/input\///' | sort -u);     list_out=$(find output/ -maxdepth 1 - type f | sed 's/output\///' | sort -u);      I execute the script in the correct directory, so this shouldn't fail. The unprocessed files are determined by               list_todo=$(comm -23 <(echo "$list_in") <(echo "$list_out"));      since the option `-23` for `comm` only prints lines of the first argument, that don't appear in both arguments and doesn't print lines that uniquely appear in the second argument. However, only occasionally I get an error saying               command substitution: line 3: syntax error near unexpected token `('     command substitution: line 3: `comm -23 <(echo "$list_in") <(echo "$list_out")'      This really puzzles me, since the exact same script worked fine for the last 3 weeks. I'm using this on a cluster, so several processes might execute the script simultaneously. May the error be caused by this? **Update**. The script is called with `./script` and I've obviously set `chmod +x script` before. (Disclaimer: Even though I'm working on a cluster and these first three lines of my script don't include any locking mechanisms: Of course, no file is ever processed twice)


How to create a custom region in gnome3?

Gnome3 doesn't include my region. I need:   * calendar week to start on monday   * british-english spelling   * 8.5x11 as the default document size for printing   * celsius for temperatures   * miles for distances   * currency in dollars   * etc etc etc How can I make this happen? My thought is, make a new region. Or modify an existing region. But I can't find the documentation for this.


Alternatives to xmove, xpra

A bit of background information: I'm dealing with a piece of software that is part of a larger system. Most pieces of the system have a background process that runs continually, and a GUI that can be open when that piece of functionality is needed. The particular piece of software that is causing me trouble was instead written as a single program containing both the GUI and the background processing. This means that the GUI must always be running, otherwise the associated processing cannot take place. This is not desired (for a number of reasons). As a workaround, I've looked into various X pseudoservers that will allow me to show/hide the GUI window as appropriate. The three I've looked at specifically are **xmove** , **ximove** , and **xpra** **xmove** is really old (hasn't been developed since Nov 1997) and doesn't support 24-bit graphics, which is a non-starter. I've also found something called **ximove**. The author, Mark C. Ballew started it with the intent of improving upon xmove (XIMove≡Xmove Improved). But, looking at his website it looks like the last status update was 8/16/04, and it links to http://forum.ximove.com/ which does not appear to exist anymore. **xpra** seems like the most promising option, but it hasn't quite worked as hoped. I get a lot of errors complaining about "Cairo" which is something that is not covered in any of the xpra files that discuss dependencies... nonetheless the program does work for small applications, such as a web browser. When I attempt to use it for my problem program though, I get a lot more errors (cairo errors and others). and both xpra and the application itself seem to crash. I'm looking into trying out a clean install of the newest version of xpra, but **I'm wondering whether any of you guys have any insight into some other X pseudoserver applications that I should try.**


How can I tell what memory RAM address range is being used by uboot?

I am in uboot and was wondering, how could I tell what RAM address range is being used by uboot. uboot needs memory to run so it might be using some of the RAM. I want to avoid modifying those RAM addresses. How do I know which region of memory is uboot loaded?


What is wrong with my JDK installation?

I tried to compile a Hello world example in java and got a gcc error. As far as I understand it, gcc is trying to compile my java class (and for some reason failing to find the main method, but that's beside the point). I have openSUSE 12.1 64 bit and JDK 1.7 (installed from Oracle's rpm). I have `/usr/java/jdk1.7.0_04/bin/:/usr/java/jdk1.7.0_04/` in my $PATH. When I try to compile a java file, I get:               rumtscho@bradbury:/tmp> javac Hello.java     /usr/lib64/gcc/x86_64-suse-linux/4.6/../../../../lib64/crt1.o:      In function `_start':     /home/abuild/rpmbuild/BUILD/glibc-2.14.1/csu/../sysdeps/x86_64     /elf/start.S:109: undefined reference to `main'      Why is this happening and how can I correct the problem? **Edit** my complete $PATH is: > rumtscho@bradbury:/tmp> echo $PATH > /home/rumtscho/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/usr/lib/mit/bin:.:/home/rumtscho/bin:/home/rumtscho/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/usr/lib/mit/bin:/home/rumtscho/android- > sdk-linux/tools:/home/rumtscho/android-sdk-linux/platform- > tools:/usr/java/jdk1.7.0_04/bin/:/usr/java/jdk1.7.0_04/:/home/rumtscho/bin:/home/rumtscho/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/usr/lib/mit/bin:/home/rumtscho/android- > sdk-linux/tools:/home/rumtscho/android-sdk-linux/platform- > tools:/usr/java/jdk1.7.0_04/bin/:/usr/java/jdk1.7.0_04/


How to make dual boot live dvd

Can we make a live dvd with a dual boot option between Ubuntu and Linux mint? I have both the iso's. They both are larger than 800mb. If I will burn 2 dvd's, Then a lot of space will be wasted. So I wanted to make one live cd that can boot both of them. I have searched the net but did not find any result.


How do I know if acct is running? (The Linux user accounting system)

I have installed the `acct` package and it is running because I can see file activity in the log file. I know there is the command `accton on` to turn it on, but how do I determine that its running short of checking that there is activity in the log file? I believe from my reading that there is no daemon running as the accounting is managed as part of the kernel and this program simply enables the activity to be logged. PS: There is no process called "acct"


Generate own (stronger) RSA host key for OpenSSH?

I would like to replace the default 2048 bit host key generated when installing OpenSSH or starting it the first time with one of 4096 bit length. This leads to two questions:   * Does OpenSSH allow running with a 4096 bit RSA host key (for SSH2 obviously)?   * How can `ssh-keygen` be convinced not to prompt for a passphrase? The version of OpenSSH I am running is 6.6p1.


Skype webcam upside down but v4l1compat missing

I am running Linux Mint, but i think this issue will be mutual with Ubuntu. My webcam in Skype is upside down (in Cheese it's ok). There are a lot of topics dealing with this coming up with fix like this:               $ LD_PRELOAD=/usr/lib/i386-linux-gnu/libv4l/v4l1compat.so skype      or similar modifications. Unfortunately, I don't have this file.               $ locate v4l1compat.so      outputs only:               /usr/lib/x86_64-linux-gnu/libv4l/v4l1compat.so      which doesn't work:               $ LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libv4l/v4l1compat.so skype     ERROR: ld.so: object '/usr/lib/x86_64-linux-gnu/libv4l/v4l1compat.so' from LD_PRELOAD cannot be preloaded: ignored.      Skype loads, but the webcam is still upside down. I remember I've read somewhere that I should use 32bit libraries because of skype. But how can I get those? I tried simple copy from another Linux machine, but that unsurprisingly did not help.


cURL <- feature

$ cat file | curl -F 'sprunge=<-' http://sprunge.us      So the output of `echo` gets passed as a POST parameter to cURL. Is this a cURL specific feature?