title: How to convert grub config to use kernel device names instead of UUID

text: I've got a bunch of identical systems on which I want to clone the same openSUSE 12.3 installation. I've set up clonezilla on PXE server. After appling the disk-image of on another machine, it fails to boot. This is because all the partitions are referred to be their UUIDs instead of the kernel-assigned name (sda1, sda2, etc). How do I configure grub to be using the kernel names instead of the UUID so that the image can be truly ported to the other systems? I have tried setting `GRUB_DISABLE_LINUX_UUID=true` in `/etc/default/grub` and then run `grub2-mkconfig -o /boot/grub2/grub.cfg`. I have also changed the entry in `/etc/fstab`. After these changes, the system still boots fine on the source machine, but doesn't boot on all the others. Grub loads, but only shows the word "GRUB" and thats all. Nothing else happens. My current `grub.cfg` is the following:               #     # DO NOT EDIT THIS FILE     #     # It is automatically generated by grub2-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="${saved_entry}"          if [ x"${feature_menuentry_id}" = xy ]; then       menuentry_id_option="--id"     else       menuentry_id_option=""     fi          export menuentry_id_option          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 {       if [ x$feature_all_video_module = xy ]; then         insmod all_video       else         insmod efi_gop         insmod efi_uga         insmod ieee1275_fb         insmod vbe         insmod vga         insmod video_bochs         insmod video_cirrus       fi     }          if [ x$feature_default_font_path = xy ] ; then        font=unicode     else     insmod part_msdos     insmod ext2     set root='hd0,msdos5'     if [ x$feature_platform_search_hint = xy ]; then       search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 --hint='hd0,msdos5'  5613d48c-eedb-4389-91bc-e49de73a1cc4     else       search --no-floppy --fs-uuid --set=root 5613d48c-eedb-4389-91bc-e49de73a1cc4     fi         font="/usr/share/grub2/unicode.pf2"     fi          if loadfont $font ; then       set gfxmode=auto       load_video       insmod gfxterm       set locale_dir=$prefix/locale       set lang=en_US       insmod gettext     fi     terminal_output gfxterm     insmod part_msdos     insmod ext2     set root='hd0,msdos5'     if [ x$feature_platform_search_hint = xy ]; then       search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 --hint='hd0,msdos5'  5613d48c-eedb-4389-91bc-e49de73a1cc4     else       search --no-floppy --fs-uuid --set=root 5613d48c-eedb-4389-91bc-e49de73a1cc4     fi     insmod gfxmenu     loadfont ($root)/boot/grub2/themes/openSUSE/ascii.pf2     loadfont ($root)/boot/grub2/themes/openSUSE/DejaVuSans10.pf2     loadfont ($root)/boot/grub2/themes/openSUSE/DejaVuSans12.pf2     loadfont ($root)/boot/grub2/themes/openSUSE/DejaVuSans-Bold14.pf2     insmod png     set theme=($root)/boot/grub2/themes/openSUSE/theme.txt     export theme     if [ x${boot_once} = xtrue ]; then       set timeout=0     elif sleep --interruptible 0 ; then       set timeout=5     fi     ### END /etc/grub.d/00_header ###          ### BEGIN /etc/grub.d/10_linux ###     menuentry 'openSUSE 12.3' --class 'opensuse-12-3' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-5613d48c-eedb-4389-91bc-e49de73a1cc4' {         load_video         set gfxpayload=keep         insmod gzio         insmod part_msdos         insmod ext2         set root='hd0,msdos5'         if [ x$feature_platform_search_hint = xy ]; then           search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 --hint='hd0,msdos5'  5613d48c-eedb-4389-91bc-e49de73a1cc4         else           search --no-floppy --fs-uuid --set=root 5613d48c-eedb-4389-91bc-e49de73a1cc4         fi         echo    'Loading Linux 3.7.10-1.4-default ...'         linux   /boot/vmlinuz-3.7.10-1.4-default root=/dev/sda5   splash=silent acpi=on barrier=off reboot=pci  init=linuxrc splash=silent quiet showopts         echo    'Loading initial ramdisk ...'         initrd  /boot/initrd-3.7.10-1.4-default     }     submenu 'Advanced options for openSUSE 12.3' $menuentry_id_option 'gnulinux-advanced-5613d48c-eedb-4389-91bc-e49de73a1cc4' {         menuentry 'openSUSE 12.3, with Linux 3.7.10-1.4-default' --class 'opensuse-12-3' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.7.10-1.4-default-advanced-5613d48c-eedb-4389-91bc-e49de73a1cc4' {             load_video             set gfxpayload=keep             insmod gzio             insmod part_msdos             insmod ext2             set root='hd0,msdos5'             if [ x$feature_platform_search_hint = xy ]; then               search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 --hint='hd0,msdos5'  5613d48c-eedb-4389-91bc-e49de73a1cc4             else               search --no-floppy --fs-uuid --set=root 5613d48c-eedb-4389-91bc-e49de73a1cc4             fi             echo    'Loading Linux 3.7.10-1.4-default ...'             linux   /boot/vmlinuz-3.7.10-1.4-default root=/dev/sda5   splash=silent acpi=on barrier=off reboot=pci  init=linuxrc splash=silent quiet showopts             echo    'Loading initial ramdisk ...'             initrd  /boot/initrd-3.7.10-1.4-default         }         menuentry 'openSUSE 12.3, with Linux 3.7.10-1.4-default (recovery mode)' --class 'opensuse-12-3' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.7.10-1.4-default-recovery-5613d48c-eedb-4389-91bc-e49de73a1cc4' {             load_video             set gfxpayload=keep             insmod gzio             insmod part_msdos             insmod ext2             set root='hd0,msdos5'             if [ x$feature_platform_search_hint = xy ]; then               search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 --hint='hd0,msdos5'  5613d48c-eedb-4389-91bc-e49de73a1cc4             else               search --no-floppy --fs-uuid --set=root 5613d48c-eedb-4389-91bc-e49de73a1cc4             fi             echo    'Loading Linux 3.7.10-1.4-default ...'             linux   /boot/vmlinuz-3.7.10-1.4-default root=/dev/sda5  showopts apm=off noresume edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset x11failsafe             echo    'Loading initial ramdisk ...'             initrd  /boot/initrd-3.7.10-1.4-default         }     }          ### END /etc/grub.d/10_linux ###          ### BEGIN /etc/grub.d/20_linux_xen ###     ### END /etc/grub.d/20_linux_xen ###          ### BEGIN /etc/grub.d/20_memtest86+ ###     ### END /etc/grub.d/20_memtest86+ ###          ### BEGIN /etc/grub.d/20_ppc_terminfo ###     ### END /etc/grub.d/20_ppc_terminfo ###          ### BEGIN /etc/grub.d/30_os-prober ###     menuentry 'Windows 7 (loader) (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-chain-52EA4C7AEA4C5C7B' {         insmod part_msdos         insmod ntfs         set root='hd0,msdos1'         if [ x$feature_platform_search_hint = xy ]; then           search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  52EA4C7AEA4C5C7B         else           search --no-floppy --fs-uuid --set=root 52EA4C7AEA4C5C7B         fi         chainloader +1     }     ### 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  ${config_directory}/custom.cfg ]; then       source ${config_directory}/custom.cfg     elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then       source $prefix/custom.cfg;     fi     ### END /etc/grub.d/41_custom ###          ### BEGIN /etc/grub.d/90_persistent ###     ### END /etc/grub.d/90_persistent ###


title: How to make Compiz start automatically?

text: I'm using Linux Debian Squeeze and I already have compiz installed. I want metacity stop automatically boot, and instead want compiz to start automatically.


title: Is it possible to install Gentoo by building on one machine and copying the files?

text: I have an older machine with a failing cdrom drive. Because of this I'm having a hard time installing Gentoo on the system. I wanted to run a proposed work around past you and see if it makes sense. Using another Linux machine (running Ubuntu) I was going to install Gentoo into a folder on that machine. By that I mean: create a folder and put stage 3 files in it along with the portage snapshot, chroot into the folder, build the kernel (with Genkernel), install system tools, and basically everything in a standard install short of writing to the MBR. Once I have that environment set up I would throw it into a tarball. Then I would boot up the target machine via a Linux boot disk (it can do this for short periods of time), setup the partitions, deploy that tarball, and write out to the MBR. In my head this all seems to make sense. What do you think? Would I run into problems with any of the compiles of the kernel or system tools? Thanks in advance! **Update 5/11:** The target machine is a laptop from 1997. While it does have a USB port it cannot boot from it. The cdrom drive is difficult to remove and does not have a standardized connector. While the hard drive is easily removable I do not have a way to connect a 2.5" IDE drive to any of my other computers. Some of these issues can be solved by throwing a little bit of money at the machine but I rather not put any money into a machine this old. And, before you ask, I plan on using this machine mostly as a typewriter--the keyboard has a great feel to it.


title: How to use cURL commandline to download a file, for which the link is hidden(activates on-click only)

text: I was referring to this question. However, I am wondering how to do the same with `curl`. So far, I have tried the following:               curl -O output.rar --referer http://subs.sab.bz/ 'http://subs.sab.bz/index.php?s=ece2929c25861a7244025e1628e7ee5a&act=download&attach_id=75766'      I also tried with `-e` switch, but it does not work for me. Can anyone help me out? Thanks in advance!!


title: I want to use openldap account to send or receive email from internet

text: I have DNS server + DHCP sever + openldap +samba with only IP: 192.168.100.114; and domain is samba+ldap with domain name abc.local. In this server, I created some group and users (Ex: user1, user2,.., user100 bussiness, technology, accounting) in domain Ldap Samba. Now, I build mailserver (Postfix, dovecot, squirrelmail) with IP:10.10.10.100. I want to use these users of LDAP+samba (user1->user100) to send and receive email from internet. I dont know how to use these account? I have register host company.com.vn to public outside and surely I want these account is named user1@company.com.vn user2@company.com.vn ... replace user1@abc.local, user2@abc.local ....in mailserver linux. I also don't know how to configure! I already set in domain ISP record MX.


title: Aliases and tmux

text: Aliases defined in `.bash_aliases` and `.bashrc` don't work in `tmux`. Can this be changed in some configuration, so the aliases work under `tmux`?


title: Accents not working on LibreOffice. How to report bug

text: When I try to write an accent (spanish in my case) in Libre Office, it just won't write it. I know everything else is fine since I can write accents on other programs (i.e my console). What is curious is that I can write accents (í ó ú) until I click somewhere else, lets say, I open firefox or I do something in KUbuntu. Then, if I start working in LibreOffice again, I can't write accents anymore. So, if this is a bug, where should I report it?


title: Windows 8 booting issue from GRUB

text: I dual booted Windows 8 and Kali Linux(1.0.7) with Kali installed in legacy mode(because my laptop doesn't allow me to boot from any external device in UEFI mode,it says system does not have DVD/CD or USB boot option). Now when I reach the GRUB menu it shows the Windows 8 loader but fails to boot from it. Now if I have to boot Windows I have to switch to UEFI mode or press `F12` to get into boot setup and boot from the Windows boot manager. If I have to use Kali GRUB boots it automatically. How do I fix the Windows boot issue? Windows is on dev/sda5 whereas Kali is in dev/sda10.


title: How to prevent xdotool from locking the current window after a script?

text: I have a simple BASH script with `xdotool`, that reads some data from a CSV, and enters it into a form in some other software:               #!/bin/bash          sleep 5          while read -r line     do         a="$(echo $line | awk '{ print $1 }')"         xdotool type $a         xdotool key "$Tab"     done < ./data.csv          aplay Beep.wav      The script works as intended, but after the beep tone, the screen becomes locked:   * The mouse moves, but no windows can see it (e.g. tool tips do not appear) and it cannot click on anything, even the current window.   * The keyboard words, but only within the current window.   * The window is locked in this manner for about 5 minutes, then suddenly is not locked anymore. CTRL+ALT+F1 allows me to change consoles, but `killall -9 xfce4-terminal` and `killall -9 xdotool` did not stop the lock. How can I prevent `xdotool` from locking the current window after running it in a script?


title: Looking for obsolete "libGLcore.so.1"

text: I've installed Steam on Debian using the Steam Wheezy Installer. On start up it says it's missing the 32-bit library `libGLcore.so.1`. Doing a package search I find it only exists in old nVidia drivers, whereas I'm currently running the 300 series driver. Why is Steam looking for an ancient library unrelated to the one I've been running for years and is there anything I can do to fix it?


title: How to enable/disable a serial port?

text: I need to disable and then enable a serial port for testing purposes on a Java program. Since the `man` page of `setserial` is stating: " _Using UART type none will disable the port._ ", I use `sudo setserial /dev/ttyS4 uart none` to disable the port. This successfully disables the serial port. To enable the serial port again, I use `sudo setserial /dev/ttyS4 -a autoconfig` and the port is up as expected. After I've disabled the port, I do try to open the port using the Java gnu.io.CommPortIdentifier function. When I try to enable the port after the executing the `gnu.io.CommPortIdentifier` function, I get this output:               $ sudo setserial /dev/ttyS4 -a autoconfig     Cannot autoconfigure port: Device or resource busy      How can I work around this problem? Is there a better way to enable/disable the serial port? Or can I clear the list of requests made to the port? I obviously can't just kill the process, since my test is running in it.


title: No network in slackware

text: I have just installed Slackware. I am not new to Linux but new to Slackware. I wonder how to install network in it. After the Slackware installation, audio and network were not working. ![screenshot](http://i.stack.imgur.com/E5TVc.png) This is how it looks like , no audio , network


title: Recursively rename e-mail files from .txt to .eml

text: Directory "$d" contains a few thousand e-mail files with the .txt extension. To open them in my e-mail client, I need to rename them to .eml Will this command rename them correctly:               find "${d}" -type f -name '*.txt' | while read f; do mv -vn "${f}" "${f%.*}".eml; done      or is there a better, more robust way to do this? I could not think of an elegant way of doing this using:               -exec ...{}... \;


title: stop processing in shell script but don't exit

text: I've got a script that I run continually to monitor vsftpd logs. Here is a small example:               #!/bin/sh     tail -n0 -F /var/log/vsftpd.log | while read line; do         if echo "$line" | grep -q 'OK UPLOAD:'; then             username=$(echo "$line" | cut -d" " -f9 | sed 's/\[\(.*\)\]/\1/')             if [ $? -ne 0 ]; then                 echo "ERROR: Failure to get parse username. Line it is trying to parse: $line" >>/var/log/ftpmonitor.log                 # We need to remove the file with any error so it doesn't linger                 rm -rf $home$filenamewithpath                 if [ $? -ne 0 ]; then                     echo "ERROR: Failed to delete video file" >>/var/log/ftpmonitor.log                     exit 1                 fi                 exit 1             fi          # lot of other stuff here...          fi     done      I want to catch any errors I can with any command failure and stop. Originally I thought I'd use exit to stop. Normally that makes sense but in this case this script needs to keeping running all the time monitoring the vsftpd logs. So I don't want to exit the script I want to just stop any other commands after that failure. How can I achieve this?


title: Linux distros wont boot

text: I haven't been able to find an answer to this problem anywhere so im posting it here. So I'm trying to put a couple Linux distros on a laptop, using xboot and a USB drive, and when the computer booted, it went to the xboot menu, let me pick which distro I wanted, started loading it, but freezes right after beginning to load. So far this happens with mint, Fedora, Fubuntu, and Ubuntu, while puppy, mageia, and dragora appear to work. Thing is, its not just with the laptop but the same thing happens when I try to run any of those ISO's using QEMU on a computer I know works. When I first tried loading Linux a couple months ago, I tried all of those same ISO's (as in the exact same file) and they all worked fine, but now only some do. Any ideas on why they wont load? It doesn't really freeze though, because the computer will reboot instantly with `Ctrl`+`Alt`+`Del`, it just wont move past the first loading screen. EDIT: After many more searches, it appears some Linux distros need "virtualization technology" and my laptop lacks hardware for this. If anyone knows a way to get around this, let me know. It looks like a dead end though.


title: Can I select only one result from a bash glob?

text: I'm trying to write a script for work to automate some reporting on an output. The Log files are (currently, it's being 'standardise' in the future) stored in this sort of path structure: `/<root_path>/<process_one_path>/logs/<time_date_stamp>/<specific_log_file>` `/<root_path>/<process_two_path>/logs/<different_time_date_stamp>/<specific_log_file>` Every part of the path is known except the time date stamps, which are always the latest in the folder. If I try to use a wild card in place of the time date stamp, I get multiple results, e.g.:               > ls /<root_path>/<process_two_path>/logs/* [tab]     20130102-175103     20130118-090859     20130305-213506      I only want it to return the latest one, is this possible with Bash? NB (I don't have zsh, and as lovely as it sounds I doubt we'll ever get it at work)


title: Would someone please explain lspci -vv output?

text: I have the following output from running `lspci -vv -s 00:00` on my single board computer running Linux.               07:05.0 RAID bus controller: Adaptec AAC-RAID (Rocket) (rev 03)     Subsystem: Adaptec ASR-2230S + ASR-2230SLP PCI-X (Lancer)     Control: I/O- Mem+ BusMaster+ SpecCycle+ MemWINV+ VGASnoop-     ParErr- Stepping- SERR+ FastB2B-     Status: Cap+ 66MHz+ UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- SERR-     Latency: 64 (250ns min, 250ns max), Cache Line Size: 64 bytes     Interrupt: pin A routed to IRQ 74     Region 0: Memory at f7a00000 (64-bit, non-prefetchable) [size=2M]     Region 2: Memory at f79ff000 (64-bit, non-prefetchable)     [Remaining output truncated]      The above is only example output and not exactly what I am getting but it contains the items of interest. I understand most of the output from the lspci command, but I would like someone to explain to me the lines that begin with **Region** ... What type of memory am I looking at here specified by the Region line? How might I access it? With that asked, I am trying to accomplish communication between two single board computers connected over the PCI bus. I should be able to talk directly. All there is a PCI arbiter running the bus. This is what I've accomplished so far... I created a Linux kernel module for outbound PCI traffic. Basically it maps all the way down from userspace (with a user space application) using the driver mmap implementation. I write to the location returned by mmap and I actually see the traffic with a bus analyzer! Now on the other single board computer I try read its sysfs resource for the PCI device but only see all FFs and no changes. Any advice or explanation on how all of this memory mapping occurs, involving PCI, would be greatly appreciated.


title: Shell script: whole directory to the remote ftp server

text: I am trying to `ftp` some recording files to a remote server for backup every night. I am very confused regarding shell script. My question / problem is : I want to move the whole folder/directory instead of file to the remote server. Here is current script:               HOST='10.113.68.50'     USER='sms'     PASSWD='Abc123451'     LOCALPATH='kmpy/unica/Campaign/partitions/partition1/CiktiDosyalari'     FILE=*.sms     DIR='SMS/'          ftp -n $HOST <<EOF     quote USER $USER     quote PASS $PASSWD     cd $DIR     lcd $LOCALPATH     put $FILE     quit     exit;     EOF


title: Does a Virtual Machine Server Have a Web address?

text: Hi I'm trying to set up a server for my moodle virtual programming lab. It has something named a jail server that is used to run code remotely. I have a Ubuntu server set up with all the correct software in a virtual machine using virtual box on Mac OSX. My aim is to have access to the server as detailed in these instructions, My question essentially being, from my Virtual Box Ubuntu Install, do I have an URL Path that I can use to execute code on remotely. Something like > www.MoodlePython.com:52000 if so how do I know I can feed data through the ports.


title: Cross executing binaries

text: I have a Linux machine that I own and administer (CLIENT). I have access to a UNIX server, with no administrative privileges at all (SERVER). Previously, I used to copy a lot of files from this server, processes them in my client, and then push them back to the server. Lately, I'm working remotely, and to move 5~10 Gb, many times a day; so this approach is not an option anymore. So what I want do is to:   1. ( **optional, if you have a better idea** ) transfer a binary (compiled to that Unix, I have most of then, but a reference to cross compile could be helpful)   2. run _my_ binaries against those files, on the SERVER (using their computing power, and memory, since the tasks are huge).   3. save the results on the server (with a redirection "> file.txt")   4. not leave ( **or even install** ) these apps on the server. How this kind of result could be accomplished? Below some additional back ground. On this specific server, there is a long process to request, and almost certainly not to be granted, authorization to install new programs. Believe-me I've tried. One of the questions taken into consideration for this request was "how will this work be done without this software?", to which my reply was "I've been doing it on my workstation with copies of the files", to which they replied "so continue working that way." Since I have started these analysis by UNIX, the results are great for the main business; so demand is increasing. I've managed to maintain a solution scalable that is performing well. But the transfers are a big concern now. I stand to lose my ability to work from home if this analysis cannot be done anymore.


title: Shredding an external HDD

text: How do I shred the data on an external HDD? I am trying `shred "/media/me/New Volume/"` but I get `failed to open for writing: Is a directory`. Why?


title: Chrome certificate

text: How do I add trusted certificates for google-chrome through command line ? For firefox, I can use `certutil` binary. For google-chrome which binary or what steps are required ?


title: How to print strings matching a pattern with grep?

text: I want to get a list of strings matching the following pattern:               CLASS_NAME:"*"      where `*` represents any number of characters. I tried:               grep -o CLASS_NAME:\".*\" script.js      and               grep -o CLASS_NAME:\"*\" script.js      The first case returns the entire line after the matched string while the second case terminates at the first `"`. How can I get it to return just the matched string?


title: How to properly use /usr/xpg4/bin/grep -F

text: I have a problem producing filtering out hanzoMollusc (2)from my grep.               https://node.hanzo.com/production/application/ (1)           https://node.hanzoMollusc.com/Messaging/Receiver (2)      My grep command is this for (2) which is working just fine.               /usr/xpg4/bin/grep -E 'node.hanzoMollusc.*Exception' diag* | grep -c 2013-03-28      Problem is if I wanted to search for (1) I need to modify the grep command a bit and use -F where its stated in the manual               "Matches using fixed strings. Treats  each pattern  specified as a string instead of a regular expression"      This is what I have come up so far... which is not working....               /usr/xpg4/bin/grep -F 'https://node.hanzo.com/application/*Exception' diag* | grep -c 2013-03-28      My problem lies in the domain part which is node.hanzo and node.hanzoMollusc that is why I didn't use -E on (1). Can anyone help me to fix this. # Edit I was able to get what I want exactly with a few tweaks from Gilles example. Actually he was right I tried reading my question and it wasn't clear. My problem boils is this. I have a problem filtering this               https://node.hanzoMollusc.com/Messaging/Receiver      everytime I use this command:               /usr/xpg4/bin/grep -E 'node.hanzoMollusc.*Exception' diag* | grep 2013-03-28      because it also shows up both node.hanzo and node.hanzoMollusc on the results. I tweaked Gilles example and I was able to get the result right               /usr/xpg4/bin/grep -E '(https://node.hanzo.com/production/application)[/ ].*Exception' diag*      Thanks alot Gilles.


title: Difference betwen grep pattern ^$ and ^

text: I understand that grep matches all the blank lines for the pattern `^$`. But what does just `^` means. When I gave `grep '^' filename`. It matched all the lines. Also `grep '' filename` matched all the lines


title: Unable to compile beclock on Arch

text: I was unable to compile beclock on latest Arch, with `yaourt -S bekwinfx-git`:               CMake Error at CMakeLists.txt:9 (find_package):       By not providing "FindXCB.cmake" in CMAKE_MODULE_PATH this project has       asked CMake to find a package configuration file provided by "XCB", but       CMake did not find one.            Could not find a package configuration file provided by "XCB" with any of       the following names:              XCBConfig.cmake         xcb-config.cmake            Add the installation prefix of "XCB" to CMAKE_PREFIX_PATH or set "XCB_DIR"       to a directory containing one of the above files.  If "XCB" provides a       separate development package or SDK, be sure it has been installed.      And I tried to use `pkgfile` to find these files, and to no avail (I already updated pkgfile cache) Anyone know how to fix that? **UPDATE** Seems like XCB and other X11 libs are already included in compile flags, so removing them doesn't hurt


title: Need help with re-partitioning

text: First of all: I'm just a beginning Linux-User ;-) I've set up a server with OpenVZ support. I wrote a backup script that's dumping the vz containers from time to time. But some containers are not backed up due to insufficient disk space. So I ran `df -h` which gives me this:               Filesystem            Size  Used Avail Use% Mounted on     240f0d7c-195b-461b-87e3-0d0dfc33c3d4                           5.0G  4.4G  362M  93% /     tmpfs                 2.0G     0  2.0G   0% /lib/init/rw     udev                   10M  660K  9.4M   7% /dev     tmpfs                 2.0G  4.0K  2.0G   1% /dev/shm     /dev/sda3             270G   32G  225G  13% /vz     /dev/sda4             184G  188M  174G   1% /srv      So it seems the problem is the root partition (?) which has only 362M available. As `/srv` has 174G which is may too much I want to "give" some disk space from there to root. Can someone explain how I can do this and maybe explain it a little bit. I don't really know much about this mounting/partioning on Linux (yet). Thanks!


title: Errors when loading terminal

text: Every time I run a new terminal window (before I do a single thing), I am greeted with these messages:               env: bash: No such file or directory     env: bash: No such file or directory     env: bash: No such file or directory     env: bash: No such file or directory     env: bash: No such file or directory     -bash: grep: command not found     -bash: tar: command not found     -bash: cat: command not found      For instance, when I type `cd ~/`, I get: `-bash: find: command not found`. Can anyone help? I don't know where to start. Thanks in advance!


title: Notification out of screen

text: The notifications extrude the screen. Anyone could help? I am on Ubuntu 11.10 with Gnome3.2. ![notifications extrude the screen](http://i.stack.imgur.com/wQRLi.png)


title: Substituting the first occurrence of a pattern in a line, for all the lines in a file with sed

text: Is it possible to do it in one liner? I have an output like this:               "First line" - Description       " Second line" - Description       "Third line" - Description       " Fourth line" - Description        This input is generated automatically. I want to replace the first occurrence of `"` (quotation mark + space) with `"` (quotation mark) for each line. If I apply the substitution globally, it will also change every occurrence of `line" -` to `line"-`, so I was wondering if it is possible to use a sed one liner to accomplish this. I have tried using `^` like this               sed -r ':a;N;$!ba;s/(\^\" )/\"/g'      But it's not working, it doesn't replace anything. I tried               sed -r ':a;N;$!ba;s/(^|\" )/\"/g'      and it replaces all the occurrences. I've just started to use sed, so I don't really know if I'm doing something wrong. What am I missing here?


title: Mapping a key to AltGr with KDE On Ubuntu

text: Is there a way to Assign `AltGr` to the right `Win` key? I'm Using KDE Workspace in Ubuntu 14.04.


title: Configuring USB digital microphone under Linux

text: I just bought a digital USB microphone. It looks nice, but I cannot make it work. I use openSuse 12.3. How do I ever know whether my system has the drivers for such and such microphone? The good news it shows in `alsamixer` as usb microphone. It is set as capture device with full volume, it's listed in `arecord --list-devices` but still I cannot start recording with `arecord hw:N,M . [ I get mute file -- test.wav ] . From what I understood, the first step should be to disable all third party sound servers (like Pulse-Audio, Xine, Phonon etc.) and try the ALSA way.               tom@oberon:~> lsusb      Bus 003 Device 002: ID 046d:c044 Logitech, Inc.     LX3 Optical Mouse Bus 003 Device 003: ID 062a:0201 Creative Labs     Defender Office Keyboard (K7310) S Zodiak KM-9010 Bus 010 Device 002:     ID 0d8c:0005 C-Media Electronics, Inc.      The `arecord --list-devices` gives line:                card 1: MICROPHONE [USB MICROPHONE], device 0: USB Audio [USB Audio]        Subdevices: 1/1   Subdevice #0: subdevice #0      I tried recording with `audacity`, but it does not work to no extend. dmesg comand output:               [ 4270.201048] usb 10-1: new full-speed USB device number 3 using xhci_hcd     [ 4270.247392] usb 10-1: New USB device found, idVendor=0d8c, idProduct=0005     [ 4270.247399] usb 10-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3     [ 4270.247404] usb 10-1: Product: USB MICROPHONE     [ 4270.247408] usb 10-1: Manufacturer: MICE MICROPHONE     [ 4270.247411] usb 10-1: SerialNumber: 201308     [ 4270.261462] input: MICE MICROPHONE USB MICROPHONE as /devices/pci0000:00/0000:00:07.0/0000:04:00.0/usb10/10-1/10-1:1.2/input/input56     [ 4270.261677] hid-generic 0003:0D8C:0005.0004: input,hidraw3: USB HID v1.11 Device [MICE MICROPHONE USB MICROPHONE] on usb-0000:04:00.0-1/input2     [ 4270.298216] xhci_hcd 0000:04:00.0: ERROR: unexpected command completion code 0x11.     [ 4270.298227] usb 10-1: Not enough bandwidth for altsetting 1     [ 4270.306239] ALSA mixer.c:889 10:0: cannot get min/max values for control 2 (id 10)     [ 4270.306390] usbcore: registered new interface driver snd-usb-audio      What does it mean : > [ 4270.298216] xhci_hcd 0000:04:00.0: ERROR: unexpected command completion > code 0x11. [ 4270.298227] usb 10-1: Not enough bandwidth for altsetting 1 > ???


title: Windows host shares doesn't get mount when I boot into Linux guest in vmware?

text: I've enable network shares in vmware and I want to share a Windows folder with my Linux guest OS but I don't know where to look in my guest OS? In Linux I've looked into network shares and samba shares to no avail. My Linux is a standard installation of Suse 12.1.


title: Prevent a file from being deleted even after rm -f

text: I usually stay on StackOverflow but I think on this topic you guys are much more experts here. So today's exercise is weird, I have to write a `script.sh` and in it do whatever I can to prevent `test.txt` from being deleted but the catch is that the last line **has** to be               rm -f test.txt      I don't really know much about shell (I usually do c/objective-c) so I picked up a book, haven't finished it but still have no clue of how to do that. I thought about permissions, but the script will be given all permission when tested so it's not an option... (I don't know if it matters but the script will be run on OS X).


title: How to move the existing mount point from /usr/local to /usr in Ubuntu 11.04?

text: I am running Ubuntu 11.04. During installation, instead of `/usr`, I mistakenly assigned `/usr/local` to a separate partition. Now I want to change the mount point to default to `/usr` on boot but I don't want to go through the pain of installing Ubuntu again.


Are there any GUI's for Linux that doesn't use X11? Since X has very poor security :O e.g.: Ubuntu, Fedora - what else are there? Goal: having a Desktop Environment without X. - what are the solutions? (e.g.: watch Flash with Google Chrome, Edit docs with LibreOffice, etc., not using text-based webbrowsers) Maybe with framebuffers? But how? :O


title: Moving Java sinks in PulseAudio

text: I want to record some gameplay on Minecraft. I created several sinks (and learned PulseAudio through trial and error). How can you tell Java/OpenAL to allow sink moving? I already edited `~/.alsoftrc` to allow sink moves with no avail.


title: Why is my TCP throughput much greater than UDP throughput?

text: I haven't done anything unusual to my hardware or kernel configurations (all default settings, fresh OS install, Linux kernel 3.11 TCP/IP stack) and I'm averaging about 3.83 million messages per second through TCP while I'm only averaging 0.75 million messages per second through UDP. This seems to completely defy what I expect of the two protocols. What's the most likely cause for the drastic difference and how can I diagnose it on Ubuntu 13.10?               #TCP RESULTS     Recv   Send    Send                          Utilization       Service Demand     Socket Socket  Message  Elapsed              Send     Recv     Send    Recv     Size   Size    Size     Time     Throughput  local    remote   local   remote     bytes  bytes   bytes    secs.    10^6bits/s  % S      % S      us/KB   us/KB          87380  65536     64    10.00      1963.43   32.96    17.09    5.500   2.852          #UDP RESULTS     Socket  Message  Elapsed      Messages                   CPU      Service     Size    Size     Time         Okay Errors   Throughput   Util     Demand     bytes   bytes    secs            #      #   10^6bits/sec % SS     us/KB          4194304      64   10.00     7491010      0      383.5     28.97    24.751     212992            10.00     1404941              71.9     25.03    21.381      For this test I have two test servers that are identical and directly connected via a 10G crossover cable. The NICs used in this case are Intel X520's with out-of-box configurations and connected onto a PCIe 3.0 x8 slot on the motherboard, which communicates with the CPU via a NUMA controller.


title: Driver for Canon i-SENSYS MF3010

text: In the specifications for Canon i-SENSYS MF3010 http://www.canon- europe.com/For_Home/Product_Finder/Multifunctionals/Laser/i-SENSYS_MF3010/ it is mentioned the printer is compatible with GNU/Linux. On the download page http://www.canon- europe.com/Support/Consumer_Products/products/Fax__Multifunctionals/Laser/LaserBase_MF_series/i-SENSYS_MF3010.aspx?type=download&page=1 there is no driver for GNU/Linux. Where do I find a driver?


title: ssh tunneling a local display to another server

text: I have a GUI test stand simulation connected to some hardware that is under test. The test stand is a Sun Sparc Ultra 2 SunOs 5.7. The simulation software checks to see if your running your display on `:0.0`. If not it won't apply power. We do not have the source to re-write the simulation to not check this. I have a need to "See" what is being displayed on the local terminal. I have tried `x11vnc` but it seems that Xsun might not support the record extension. SSH -X sets the DISPLAY to `:10.0` so that is out. I really need to port forward the 6000 port to the say the 6001 port on my windows box running cgwin. (I am assuming 6001 is `:1.0` and is what my x server on my windows box will be listing too). Is any of this possible I am at whits end. Here is the offending code.               /* Console can always access the HW */     if (xserver != (char *) NULL)     {         /* if the first two characters are ":0" */         if ((xserver[0] == ':') && (xserver[1] == '0'))             termtype = TERMINAL_LOCAL;         else if (uname(&utshost) == 0)         {             nnlen = strlen(utshost.nodename);             if ((int) strlen(xserver) >= (int) (nnlen + 2))             {                 if ((strncmp(xserver, utshost.nodename, nnlen) == 0) &&                         (xserver[nnlen] == ':') && (xserver[nnlen + 1] == '0'))                     termtype = TERMINAL_LOCAL;                 else                     termtype = TERMINAL_REMOTE;             } /* END if */         } /* END if/else */     } /* END if */      I get this when running `xdpyinfo -queryExtensions` (truncated for relevancy):               name of display:    localhost:0.0       version number:    11.0       vendor string:    The Cygwin/X Project       vendor release number:    11001000       maximum request size:  16777212 bytes       motion buffer size:  256       bitmap unit, bit order, padding:    32, LSBFirst, 32       image byte order:    LSBFirst       number of supported pixmap formats:    7       supported pixmap formats:           depth 1, bits_per_pixel 1, scanline_pad 32           depth 4, bits_per_pixel 8, scanline_pad 32           depth 8, bits_per_pixel 8, scanline_pad 32           depth 15, bits_per_pixel 16, scanline_pad 32           depth 16, bits_per_pixel 16, scanline_pad 32           depth 24, bits_per_pixel 32, scanline_pad 32           depth 32, bits_per_pixel 32, scanline_pad 32       keycode range:    minimum 8, maximum 255       focus:  window 0x200023, revert to PointerRoot       number of extensions:    22           BIG-REQUESTS  (opcode: 132)           Composite  (opcode: 146)           DAMAGE  (opcode: 147, base event: 90, base error: 149)           DOUBLE-BUFFER  (opcode: 138, base error: 138)           DPMS  (opcode: 139)           GLX  (opcode: 148, base event: 91, base error: 150)           Generic Event Extension  (opcode: 128)           MIT-SCREEN-SAVER  (opcode: 133, base event: 82)           RANDR  (opcode: 143, base event: 88, base error: 146)           RECORD  (opcode: 137, base error: 137)           RENDER  (opcode: 142, base error: 141)           SGI-GLX  (opcode: 148, base event: 91, base error: 150)           SHAPE  (opcode: 129, base event: 64)           SYNC  (opcode: 134, base event: 83, base error: 133)           X-Resource  (opcode: 145)           XC-MISC  (opcode: 136)           XFIXES  (opcode: 141, base event: 86, base error: 139)           XFree86-Bigfont  (opcode: 140)           XINERAMA  (opcode: 144)           XInputExtension  (opcode: 130, base event: 65, base error: 128)           XKEYBOARD  (opcode: 135, base event: 85, base error: 136)           XTEST  (opcode: 131)       default screen number:    0        When I ssh name@server.com The $DISPLAY is servername:0.0 which is local but I can not see. When I ssh -X name@server.com The $DISPLAY is localhost:0.0 which my simulation sees as remote.


title: Rotate pdf pages: 90 degree for even pages and -90 degree for odd pages

text: I was wondering in a pdf file, how to rotate pdf pages: 90 degree for even pages and -90 degree for odd pages? By pdftk, all I know is to rotate a page by `pdftk in.pdf cat 1W output out.pdf`, and rotate all pages by `pdftk in.pdf cat 1-endW output out.pdf`. Thanks!


title: Top show high CPU on process but idle on load average

text: I am running FreePBX on DigitalOcean VM. I am facing some call dropping issue in Asterisk. When looking at "htop", "top" and FreePBX GUI, I see different results of CPU utilization and can't understand if my VM is OK or needs attention w.r.t CPU. Load average shows nearly idle system while CPU utilization of Asterisk process is pretty high. htop result: ![enter image description here](http://i.stack.imgur.com/RAy9U.jpg) top result: ![enter image description here](http://i.stack.imgur.com/WS68h.jpg) FreePBX GUI result: ![enter image description here](http://i.stack.imgur.com/ShmB2.jpg) Could someone please advise me on this? 74% CPU on a process yet idle system on load average. Can this be an issue causing call dropping on Asterisk?


title: On Solaris 7 Box trying to get X Record Extension Library to work using x11vnc

text: Does Xsun support this extension? Im on a Solaris Sparc Ultra 2 SunOs 5.7. x11vnc version: 0.9.9


title: Telnet over Ethernet for Linux?

text: I have used MikroTik RouterOS and I found a telnet-over-Ethernet (a layer 2 telnet), MAC telnet on it. I think it's a great tool, when SSH dies, or someone misconfigures IP Addresses. So the thing about it that you could telnet to a MAC address, log in, etc. RouterOS is based on Linux, but are there Layer 2 telnet solutions - open- source projects (or in the repositories) under e.g.: Ubuntu, Fedora? http://lunatic.no/2010/10/routeros-mac-telnet-application-for-linux-users/


title: How to make a symbolic link to /usr/bin/vim but with start-up parameters?

text: After I `make&make install` vim from source, I found many symbolic links of vim in `/usr/local/bin`, such as evim, rvim, view... The `vim(1)` man page said that "rvim" is equivalent to "vim -Z" and so on. Now I wonder: can I make such a symbolic link with `ln(1)` myself, and if so, how?


title: apt installing more packages than specified as dependencies

text: I was trying to install `texmaker` from the repository. For installing the `texlive` I followed the steps described here. For this the control file I used is this. It has the file texlive-binaries in it. Then I tried to install `texmaker` from `apt`. It has the dependency listed as               # apt-cache depends texmaker     texmaker       Depends: libc6       Depends: libgcc1       Depends: libpoppler-qt4-3       Depends: libqt4-network       Depends: libqt4-xml       Depends: libqtcore4       Depends: libqtgui4       Depends: libqtwebkit4       Depends: libstdc++6       Depends: zlib1g       Depends: texmaker-data       Recommends: aspell       Recommends: ghostscript       Recommends: netpbm       Recommends: psutils         texlive-local       Recommends: texlive-latex-extra         texlive-local      |Recommends: <hunspell-dictionary>         myspell-fr         myspell-ru         hunspell-an         hunspell-ar         hunspell-be         hunspell-da         hunspell-de-at         hunspell-de-at-frami         hunspell-de-ch         hunspell-de-ch-frami         hunspell-de-de         hunspell-de-de-frami         hunspell-en-ca         hunspell-en-us         hunspell-eu-es         hunspell-fr         hunspell-gl-es         hunspell-hu         hunspell-kk         hunspell-ko         hunspell-ne         hunspell-ro         hunspell-ru         hunspell-se         hunspell-sh         hunspell-sr         hunspell-sv-se         hunspell-uz         hunspell-vi         myspell-et         myspell-lv         myspell-pl      |Recommends: <openoffice.org-spellcheck-de-de>         hunspell-de-de         myspell-de-de      |Recommends: <myspell-dictionary>         myspell-de-de-oldspell         myspell-fr         myspell-ru         hunspell-kk         myspell-af         myspell-bg         myspell-ca         myspell-cs         myspell-da         myspell-de-at         myspell-de-ch         myspell-de-de         myspell-en-au         myspell-en-gb         myspell-en-us         myspell-en-za         myspell-eo         myspell-es         myspell-et         myspell-fa         myspell-fi         myspell-fo         myspell-fr-gut         myspell-ga         myspell-gd         myspell-gv         myspell-he         myspell-hr         myspell-hu         myspell-hy         myspell-it         myspell-ku         myspell-lt         myspell-lv         myspell-nb         myspell-nl         myspell-nn         myspell-pl         myspell-pt-br         myspell-pt-pt         myspell-sk         myspell-sl         myspell-sw         myspell-th         myspell-tl         myspell-uk       Recommends: hunspell-en-us       Recommends: asymptote       Recommends: ibus-qt4      But when I tried to install `texmaker` from `apt` is shows               # apt-get install texmaker     Reading package lists... Done     Building dependency tree            Reading state information... Done     The following extra packages will be installed:       asymptote asymptote-doc ed freeglut3 ibus-qt4 libgraphite3 libibus-qt1       libptexenc1 libqtwebkit4 libruby1.9.1 libsigsegv2 libyaml-0-2       python-imaging-tk ruby ruby1.9.1 tex-common texlive-binaries texlive-common       texmaker-data      Why is it so? I had no problem installing `tex-studio` and `texworks`.


title: How to find out whether a certain processor is 64bit or 32bit?

text: Now, the answer that jumps into everyone's minds at this point is, of course, `uname -a`. But I believe that, in this case, it is not the correct answer. Why? Well, I have installed a 64bit version of Debian (netinst, though). `uname -a` says it's a 64bit system. What's the problem? Well, this is a 10 year old computer, and I'm pretty sure it's not 64bit. An answer that had just sprung into my mind is creating a C program to check the max size of an integer... I'll do that. But, is there another way to actually check the hardware? I'm guessing `uname` has its string cached somewhere, and I'm not sure how it can be updated. The second part of my question is this: if I had incidentally installed a 64bit version of Debian, and if it had somehow repaired itself from the installer to reach a functional state (there were strange errors at the first boot), how can I fix the situation (that is, make the system believe it's actually 32bit) without reinstalling? And even for reinstalling, I need to know definitely which arch I have.


title: How can I determine if my processor is 64 or 32 bit?

text: > **Possible Duplicate:**   >  How do I know that my CPU supports 64bit operating systems under Linux? I am running Debian Squeeze, how can I determine whether my processor is 64 or 32-bit? I'm thinking of downloading a 64-bit OS because it's said to perform better.


title: Connection error for linux webcam driver for matlab

text: This might seem like a duplicate post, well yes it is, but I have a different problem compared with the duplicate version of it. My value for `imaqhwinfo` gives me:                  InstalledAdaptors: {'dcam'  'linuxvideo'}         MATLABVersion: '7.14 (R2012a)'           ToolboxName: 'Image Acquisition Toolbox'        ToolboxVersion: '4.3 (R2012a)'      The value for `imaqhwinfo('linuxvideo',1)` gives me:               DefaultFormat: 'YUYV_640x480'        DeviceFileSupported: 0                 DeviceName: '1.3M WebCam'                   DeviceID: 1      VideoInputConstructor: 'videoinput('linuxvideo', 1)'     VideoDeviceConstructor: 'imaq.VideoDevice('linuxvideo', 1)'           SupportedFormats: {1x7 cell}      So, after that I gave the following to the Matlab terminal:               vid = videoinput('linuxvideo', 1);     set(vid, 'ReturnedColorSpace', 'RGB');      However, after inputting the following line:               img = getsnapshot(vid);      I get the following error:               Warning: Unable to set the selected source.  Perhaps the device is in use.      Error using imaqdevice/getsnapshot (line 62)     Could not connect to the image acquisition device.  Device may be in use.      I posted this question to Matlab central and am waiting for a reply. I'm using ArchLinux(64 bit) & Matlab(2012a) ( 64 bit). Webcam apps such as Cheese are running okay. I can see my face. I also have Skype, though I haven't configured it yet. ### TL;DR Can anybody help me fix this issue? It would be a great help, because if I cannot, I'll have to re-install Windows 7 for just a little bit of a school assignment, and that's time consuming. Plus I don't want to go back to Windows right now. P.S: `lsusb` gives me:               Bus 002 Device 005: ID 148e:099a EVATRONIX SA      Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub     Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 001 Device 003: ID 064e:a219 Suyin Corp. 1.3M WebCam (notebook emachines E730, Acer sub-brand)     Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub     Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub


title: Is it possible to assign multiple commands to a single hotkey? (bash, xterm)

text: Back in the day, if my cursor was in the middle of a really long shell command I'd just hit `Ctrl`+`C` to get myself a new command prompt. Then I learned about `Ctrl`+`K`/`C` and life was good. Unfortunately those sequences are a little awkward for me, so now I'd like to map one shortcut to reset the entire line with one sequence. Is it possible to map something like `Ctrl`+`X` so it performs those two commands? I checked the variables in `man bash` and found `kill-whole-line` but I'm not sure how to implement it in my .bashrc -- or if that's even what I need (seems like it is). ED: I learned `Ctrl`+`X` might not be the best choice because it's a gateway to other bash shortcuts, so I went with something else.


title: copying files from unix to windows?

text: Is there any way to automate the process of copying the files between windows and unix without doing it manually, using tools such as `winscp`. I need to copy files from unix to windows such by executing some commands in windows. I goolged it and found these tools that can do this.               ftp     sftp     scp     pscp     winscp console.      **EDIT** : Can I get something using `pscp` because I just found out that `ftp` is not enable in my servers. Please suggest a way of doing it and I need to run whatever script/command in windows only for copying the unix files. **EDIT 2** : Getting this error in `winscp` console for `sftp` :               winscp> get abc.sh c:\     abc.sh                    |          0 KiB |    0.0 KiB/s | binary |   0%     Can't create file 'c:\abc.sh'.     System Error.  Code: 2.     The system cannot find the file specified     (A)bort, (R)etry, (S)kip, Ski(p) all:


title: What is the default idle timeout for OpenSSH?

text: I can't seem to find an answer to this simple question, which I need for some compliance documentation. On a default install of CentOS 6.5 (OpenSSH 5.3p1-94.el6), after how long of being idle will a user's SSH session be terminated? I believe the following can be set to increase the idle timeout, but they are commented out by default.               $ grep -i alive /etc/ssh/sshd_config     #TCPKeepAlive yes     #ClientAliveInterval 0     #ClientAliveCountMax 3      Also, is there a command to dump a list of the current `sshd` settings? I don't see anything in `man sshd`.


title: Remote virtual displays

text: I have two machines in local network, e.g. `192.168.8.30 (1)` and `192.168.8.31 (2)` and for each connected 2 displays. I want to use all of display like a physically connected to one of machine. Can I use one X server for every displays ? or use "same functional" by another ways.


title: Getting information on a machine's hardware in Linux

text: How can I check what hardware I have? (With BIOS version etc.)


title: listing all hardware details on Linux

text: > **Possible Duplicate:**   >  checking hardware on linux I want to list all the hardware details about my system. To start with I've following things in my mind. `processor` `memory` `bios` `hba` I've got few details about processor like `processor: Current Speed, Max Speed, Family, Manufacturer, Version, No of CPU's` Can anybody expand the list for me of what other hardware details i need to figure out.


title: How to find information about devices in Linux

text: I want to find the following information for devices in Linux:   * Bus speed (e.g. 66 MHz)   * IRQ settings   * Vendor identification   * AGP rate (e.g. 1x, 2x, 4x)   * MAC address  I am only able find the last one by `/sbin/ifconfig | grep HWaddr` How can I find this information in Linux?


title: How to achieve fast user switching with multiple graphics adapters, prevent virtual terminal switch?

text: My boxen has two video nVidia graphics adapters which I'd like to assign to separate seats, including virtual terminals. This question most likely isn't display manager specific, but in this case I'm using lightdm-1.2.2 to set up an instance on top of a secondary video card.               [SeatDefaults]     xserver-command=X -sharevts -isolateDevice PCI:0:2:0     #xserver-layout=     xserver-config=xorg-6600.conf          [LightDM]     #start-default-seat=true     #greeter-user=lightdm     minimum-display-number=6     minimum-vt=7      This is how it launches:               [+0.00s] DEBUG: Launching process 10099: /usr/bin/X -sharevts -isolateDevice PCI:0:2:0 :6 -config xorg-6600.conf -auth /var/run/lightdm/root/:6 -nolisten tcp vt7 -novtswitch      There is already another Xorg-1.12 instance running on top of the primary video card. When I start lightdm everything is fine, because of `-sharevts -novtswitch` and both X servers display correctly on their respective monitors. Now when I launch `/usr/libexec/lightdm/gdmflexiserver` to do fast user switching, this triggers a vt switch -> `vt8`, which is understandable. **Unfortunately this also bumps my primary video card off its vt7 display.** How do I prevent the primary graphics adapter from switching? Would this have anything to do with the recent udev multiseat capability? Would I somehow be able to separate my sets of virtual terminals on top of separate graphics adapters?


title: Linux webserver reboot issue

text: I've webserver, it works fine when there is no load into it. when I've load onto it and try to restart httpd server gets reboot itself or sometimes it automatically get reboot It is Xen HVM with OS CentOS 6.2. I'm unable to trace the fault, even I've not found anything in /var/log/message or dmesg. Any help in this regard restarting httpd only not whole VM here are logs for this particular VM               domid: 4     config qemu network with xen bridge for  tap4.0 br0     Using file /mnt/Servers/webserver/webserver-cent62.img in read-write mode     Watching /local/domain/0/device-model/4/logdirty/cmd     Watching /local/domain/0/device-model/4/command     Watching /local/domain/4/cpu     char device redirected to /dev/pts/1     qemu_map_cache_init nr_buckets = 10000 size 4194304     shared page at pfn feffd     buffered io page at pfn feffb     Guest uuid = 6d0055e3-0d25-8c26-f7a2-45b675c28ec3     Time offset set 0     char device redirected to /dev/pts/2     xen be: console-0: xen be: console-0: initialise() failed     initialise() failed     populating video RAM at ff000000     mapping video RAM from ff000000     Register xen platform.     Done register platform.     platform_fixed_ioport: changed ro/rw state of ROM memory area. now is rw state.     xs_read(/local/domain/0/device-model/4/xen_extended_power_mgmt): read error     Log-dirty: no command yet.     vcpu-set: watch node error.     xen be: console-0: xen be: console-0: initialise() failed     initialise() failed     xs_read(/local/domain/4/log-throttling): read error     qemu: ignoring not-understood drive `/local/domain/4/log-throttling'     medium change watch on `/local/domain/4/log-throttling' - unknown device, ignored     xen be: console-0: xen be: console-0: initialise() failed     initialise() failed     xen be: console-0: xen be: console-0: initialise() failed     initialise() failed     cirrus vga map change while on lfb mode     mapping vram to f0000000 - f0400000     platform_fixed_ioport: changed ro/rw state of ROM memory area. now is rw state.     platform_fixed_ioport: changed ro/rw state of ROM memory area. now is ro state.     Unknown PV product 3 loaded in guest     PV driver build 1     region type 1 at [c100,c200).     region type 0 at [f3001000,f3001100).     squash iomem [f3001000, f3001100).


title: Using UTF-8 chars with `write` message program

text: when I use the `write` program to send messages, how can I use UTF-8 chars? I send:               write user2     Ehilà! Com'è?      But receiver gets:               Message from user1@samehost on pts/1 at 21:08 ...     EhilM-CM- ! Com'M-CM-(?      The machine is the same and `LANG` in konsole is already `en_US.UTF-8`.


title: Finding and replacing text inside awk block

text: I want to find and replace a value inside awk block. Here is a sample input file to my script               P1     10,9:11/18013013582     ,10:1     ,167:0     ,487:5/E.164     11,9:15/310410532169026     ,10:60     ,167:0     ,487:4/IMSI     12,18:15/013329002130500     ,19:0     15,9:10/9609610015     ,10:1     ,14:68     ,167:0     ,436:5/ABCDE     ,487:5/E.164     16,87:1     17,9:10/8013765024     ,10:1     ,11:1     ,12:0     ,167:0     ,487:5/E.164     23,9:11/13123149810     ,10:1     ,11:1     ,167:0     ,487:5/E.164     P3     42,3:1.     ,4:3     ,300:1.     43,3:1.     ,4:3     ,300:1.     44,3:0.     ,4:7     ,300:0.     45,5:0.3      And here is the piece of code that I am currently using,               nawk -v fname="${filename}" -F '/|:' '              function isnum(x){return(x==x+0)}              /P1/,/P3/{                 # Found start increment i reset variables go to next line                 if(/P1/){                        ++i                         fid =""                         count++                        next                     }                      # Found end validate variable and print go to next line                 if(/P3/){                     printf "%s|",count                     printf "%s|",isnum(fid)?fid:"NULL"                       next                      }                 if(!fid && /36,59:*/)                     {                         fid = $NF                     }             ' ${filename} >>output.txt      Basically, I my input file will contain several P1/P3 blocks, I am taking one block at a time and finding out value from it. Now, what I want to basically do is change the value of first ,11: **1** (i.e the one after 17,9 part) into 11: **2** based on the value of 17,9:10/ **8013765024**. Please note there can be several ,11 before and after but those have to remain unchanged. Please suggest how to proceed further. I am very new to both awk and sed. Also, I tried writing a regular expression but could not figure out it properly. Here it is,               17[,0-9:\]*[\n]*,11


title: How do I force grub2 to detect my arch linux install?

text: I have an uncommon setup. I have Ubuntu installed on one, and _a backup from a direct copy of an older Arch Linux install_ on the second. By direct copy, I mean I tar'd the contents of an entire partition initially, and now I've extracted those contents to another partition. So: 1 - Ubuntu, with GRUB2 2 - Arch from a backup Ubuntu runs and boots fine. After extracting Arch to a partition, I changed fstab to reflect its new partition. But now I'm stuck trying to get Arch to boot. I tried running update-grub in Ubuntu but it doesn't pick up the Arch install. So how can I get this to work?


title: iptables logging prefix gets corrupted

text: I've been using `iptables` for some time but recently noticed that the log prefix I'd set had got corrupted. In /etc/iptables/rules.v4` I have:               -A LOGNDROP -j LOG --log-prefix "iptables denied: " --log-level 7      I found that in `/var/log/syslog` I actually have records like               Jul 25 20:10:04 zotac kernel: [688421.696561] --log-prefixIN=wlan0 OUT= MAC=1c:4b:d6:ee:a9:64:00:24:17:0c:a7:ef:08:00 SRC=173.194.67.109 DST=192.168.1.4 LEN=40 TOS=0x00 PREC=0x00 TTL=44 ID=36871 PROTO=TCP SPT=587 DPT=60497 WINDOW=0 RES=0x00 RST URGP=0      Where the log prefix has somehow got set to `\--log-prefix`.I can fix this by executing:                ~# iptables -R LOGNDROP 1 -j LOG --log-prefix "iptables denied: " --log-level 7      But why is this happening and how do I fix it? FYI: `Debian Wheezy [Linux version 3.2.0-2-686-pae (Debian 3.2.20-1)]` with `iptables [1.4.14-2]` and `iptables-persistent [0.5.3+nmul]`


title: Is it possible to run Steam games using optirun?

text: I am using Bumblebee on OpenSuse 13.1 on my Intel HD4600 / Nvidia GTX 860M combo.   Steam games seems to lag a bit, when using `primusrun`. (`vblank_mode=0 primusrun`) Testing both `primusrun` and `optirun` with `glxspheres`, indicates that `optirun` is the better option on my system. But my Steam games does not start with the `optirun` command.               vblank_mode=0 primusrun glxspheres       209.926051 frames/sec - 234.277473 Mpixels/sec          vblank_mode=0 optirun glxspheres       250.734727 frames/sec - 279.819955 Mpixels/sec      Any help would be appreciated.


title: What causes /proc/<pid>/* resources to become owned by root, despite the procs being launched as a normal user?

text: I've noticed that some procs, such as bash, have their entire `/proc/<pid>/` resources readable by the user who created that proc. However other procs, such as chrome or gnome-keyring-daemon, have most of their `/proc/<pid>/` resources only accessible by root, despite the process itself being owned by the normal user and no suid being called. I dug through the kernel a bit and found that the /proc/ stuff gets limited if a task lacks a 'dumpable' flag, however I'm having a hard time understanding under what scenarios a task becomes undumpable (other than the setuid case, which doesn't apply to chrome or gnome-keyring): https://github.com/torvalds/linux/blob/164c09978cebebd8b5fc198e9243777dbaecdfa0/fs/proc/base.c#L1532 Anyone care to help me understand the underlying mechanism and the reasons for it? Thanks! Edit: Found a good doc on why you wouldn't want to have your SSH agent (such as `gnome-keyring-daemon`) dumpable by your user. Still not sure _how_ `gnome- keyring-daemon` is making itself undumpable. https://github.com/torvalds/linux/blob/164c09978cebebd8b5fc198e9243777dbaecdfa0/Documentation/security/Yama.txt#L30


title: Unable to install the selected kernel

text: I have problem with my DVD drive. It's corrupted and when I'm trying to install Ubuntu it stucks (even with the miniISO) I was able to successfully start the OS from system rescue CD. I'd like to have a possibility to copy minimum information from CD and instead of it download the most files from the internet because my DVD drive won't manage it and stucks. I can't use USB installation, my laptop doesn't support it. I succeeded according to this guide and downloaded netboot files. I copied files and directories to my `/boot` directory on `/dev/sda1` partition and performed the steps in the guide.               root=hd(0,1)     linux /boot/linux     initrd /boot/initrd.gz     boot      After the command `boot` in Grub and in the process of `installing the base system` I got this error               Configuring linux-image-3.5.0-26-generic     Unable to install the selected kernel     An error was returned while trying to install the kernel into the target system.     Kernel package: 'linux-generic'.     Check /var/log/syslog or see virtual console 4 for the details.      /var/log/syslog Did I something wrong? Can I repair this error?


title: Grub2 keyboard layout when decrypting partition

text: According to the OpenSUSE 12.3 documentation the only keyboard layout which can be used during a Grub2 boot is the "US keyboard layout". Is there really no way to change the keyboard layout used when decrypting a partition during boot? If not, is this constraint due to Grub2 or OpenSUSE 12.3?


title: Copy first n files in a different directory

text: > **Possible Duplicate:**   >  How to move 100 files from a folder containing thousands? Is it possible to copy only the first 1000 files from a directory to another? Thanks in advance


title: How does this directory use so much space

text: Unix is not my native language and I'm getting confused by their concept of filesystems. When I look at my free space I see:               /$ df -kh     Filesystem            Size  Used Avail Use% Mounted on     /dev/xvda1            7.9G  7.1G  397M  95% /     none                  3.7G  120K  3.7G   1% /dev     none                  3.7G  4.0K  3.7G   1% /dev/shm     none                  3.7G   48K  3.7G   1% /var/run     none                  3.7G     0  3.7G   0% /var/lock     /dev/xvdf             100G   19G   82G  19% /db     /dev/xvdg             100G   15G   86G  15% /images     /dev/xvdb             414G  199M  393G   1% /mnt      To me this means all files and directories under /db is on filesystem xvdf, everything under /images is on xvdg and everything under /mnt is on xvdb. Everything else is on xvda1. However, xvda1 has only 7.9G of space. So why does               /$ sudo du -sh var     25G     var      show me that /var is taking up 25G? I thought at first that maybe it's counting the contents at the destinations of symbolic links but I know a few directories down there's a symbolic link to the /images directory and that's got 86G of content so var should be >86G if symbolic links are followed. So how can /var take up 25G on a drive that has only 7.9G? btw, this is an ubuntu instance running in amazon's EC2, if that's significant.


title: Mouse click sound on fedora

text: I have a USB touch screen system with Fedora 14 installed. I couldn't get to play sound on any mouse click (on touch). Is there anyway to play a click sound, either by changing some configuration or using an application?


title: Is there any utility or procedure available to dm-crypt my existing live data in place to make a full disk encryption

text: Once I already have a running Linux system installed with live unencrypted data on my HDD. Is there any reasonable way to dm-crypt that entire HDD right in place? (Without backing up then restoring or transferring to a new FS.) If so is there any way to do it online? I.e. be able to operate my Linux system in the hour or so that it takes to encrypt all the data?


title: How to remove mounted locations that have been added using the mount command?

text: I've mounted few shared locations using the below command.               mount -t cifs /mnt/systemfolder -o username=name,password=password //10.10.1.1/My-Shared-Folder      A few incorrect locations* have been erroneously mounted while running this command. Now when I execute just the `mount` command, it lists all the right and wrong locations I've mounted.   *     * I have mounted the same location multiple times. How do I remove locations that show up from executing the `mount` command so that I can remove the incorrect ones I've mounted? The `umount` command does not help me remove the mounted location. Here's a screenshot showing the results to the `mount` and `umount` commands. ![enter image description here](http://i.stack.imgur.com/k3GL6.png)


title: File manager with spring-loaded folders?

text: One thing I miss about Finder, Mac OS X's file manager, is the spring-loaded folder function where if you drag a file(s) over another folder long enough, the folder would open and you can "navigate" through folders while holding down the mouse button until you reach where you want to drop the file. Does such a feature exist in Linux file managers? Is so, which ones? Thanks. BTW, I prefer lightweight programs with as few dependencies as possible.


title: Clustering Servers to run one vm

text: I am looking at clustering about five machines and I wanted to get some opinions about what is the best way to go about it. I'm wanting to run one VM over the five machines, firstly I want to ask, 1: If I cluster the five machines will their hardware be combined? HDD's CPU's Ports etc.. 2: Would the hardware be accessible (Usable) within the VM Ultimately what I am asking is If I cluster five machines and run a VM over them will that make the VM a 'speed demon' combining CPU's and HDD's? Also what are some of the clustering operating systems out there at the moment? I have looked around but it seems that a lot of it is deprecated or just old. If you need any more information just ask. **NOTE: I'm not wanting the cluster to process files parallel, I want the speed of the processors, RAM and HDD's combined into one VM working over top of the cluster**


title: Locate a directory within an archive

text: I have .tgz archive i'm trying to locate a directory within it to extra how do i search within a .tgz i tried the following below but no luck.               tar -tzf archive-9.tgz | grep '161519' | xargs tar -Oxzf archive-9.tgz | grep -B 3


title: grep acting strangely

text: Grep has been acting strangely on one of my systems (Ubuntu Desktop - all my other systems are Ubuntu Server), and I can't figure out why. I created a control file named _text_ that contains the following text:               grep     test!!      the following commands work on all of my systems except the problem child:               $ grep grep *     text:grep     $ grep 'test!!' *     text:test!!      On my problem child grep simply hangs. I have compared **.bashrc** , **.bash_aliases** , and even **/etc/bash_completion** , but I can't find the problem. Any ideas what could be causing the problem?


title: Application updates inside of Docker containers?

text: Typically on a server, automatic updates of security-related patches are configured. Therefore, if I'm running MySQL 5.5 and a new security patch comes out, Ubuntu Server will apply the upgrade and restart MySQL to keep me protected in an automated way. Obviously, this can be disabled, but it's helpful for those of us who are a bit lazy ;) Does such a concept exist inside of a Docker container? If I'm running MySQL in a Docker container, do I need to constantly stop the container, open a shell in it, then update and upgrade MySQL?


title: GNU/Linux licensing confusion

text: I am building a Gnu/Linux distribution. I am keeping the kernel open source but the desktop environment and the programs (the ones built by me) on top of it will be proprietary. Is it possible? The GNU GPL v2 states that one cannot make the derivatives of GPL-licensed software closed source. Therefore I am not modifying the Linux kernel but adding some add-ons. And will there be any licensing problems if the project as a whole is to be closed source?


title: Can a real-time process exist in the 'expired' queue of linux kernel?

text: **In the Linux kernel 2.4:** Real-time processes are given a priority of 0-99 and they co-exist in the ready queue along with the nice processes (who's priority goes between 100 and 139). But real-time processes are supposed to run as long as they need to, so when their time-slice is consumed, they get more time. **So can the real-time process exist in the expired queue where all processes who consumed their time-slice are present?**


title: DenyHosts and no-ip.com

text: I recently installed `DenyHosts` and after a few remote logins I noticed that `sshd: 8.23.224.110` had been added to the `host.deny` file after `/var/log/auth.log` showed a few `sshd: Did not receive identification string from 8.23.224.110`. This appears to be `no-ip.com`. I use `ddclient` to dynamically update my ip-address to point to my hostname at `no-ip.com`; something like `myhostname@no-ip.org` so that instead of having to `ssh` to a dynamic ip I can always just connect to the above host. I don't understand why `8.23.224.110` would be trying to connect to my ssh service however, can anyone shed some light on this? Is it some kind of by product of me `ssh`'ing to the no-ip hosted hostname? Is it likely to be problematic now `DenyHosts` has banned it?


title: File owner must belong to file group?

text: I have a rather simplistic understanding of file permissions on *nix systems. I understand that there is a file owner and file group, but is there a hard and fast rule on whether the said file owner _must_ belong to the file group also? Or put another way, can a file belong to a group that the owner is not a part of? If so (or if not), why? I'd like to increase my understanding... I can't seem to find anything that specifically talks about this out on the interwebs... I'm also open to some good reading material on the subject.


title: Locate occasional CPU kernel hog

text: I have a 2.6.35 PREEMPT kernel running on moderate-speed ARMv7 processor. About once every 100 - 125s, something causes the kernel to fail to process some audio-related drivers sufficiently quickly to avoid underruns. The hold- up are generally in the range 15-30ms, but can be very much longer. It is not clear whether the hold-up is entirely in-kernel or may relate to the scheduling of a user process running with real-time priority (SCHED_RR, 2). My guess is that there is a (at least one) driver that is not playing nice with preempt. Some strace output from the user process illustrates some aspect of both normal and abnormal behaviour, although I am not certain how to interpret the various time reports? Normal case:                    0.000518 poll([{fd=10, events=POLLIN|POLLERR|POLLNVAL, revents=POLLIN}], 1, 3415) = 1           0.010202 poll([{fd=10, events=POLLIN|POLLERR|POLLNVAL}, {fd=6, events=POLLOUT|POLLERR|POLLNVAL, revents=POLLOUT}], 2, 3404) = 1           0.000585 poll([{fd=10, events=POLLIN|POLLERR|POLLNVAL}, {fd=6, events=POLLOUT|POLLERR|POLLNVAL, revents=POLLOUT}], 2, 3404) = 1           0.000302 poll([{fd=10, events=POLLIN|POLLERR|POLLNVAL, revents=POLLIN}], 1, 3404) = 1           0.010706 poll([{fd=10, events=POLLIN|POLLERR|POLLNVAL}, {fd=6, events=POLLOUT|POLLERR|POLLNVAL, revents=POLLOUT}], 2, 3393) = 1           0.000480 poll([{fd=10, events=POLLIN|POLLERR|POLLNVAL}, {fd=6, events=POLLOUT|POLLERR|POLLNVAL, revents=POLLOUT}], 2, 3392) = 1       No blocking occurs on the poll for output on fd6 and, when only fd10 is polled for input, a block of around 10ms occurs. This is reflected both in the report of the duration of the system call and the interval between system calls (they are consistent). Failure case (extreme example):                    0.000305 poll([{fd=10, events=POLLIN|POLLERR|POLLNVAL, revents=POLLIN}], 1, 3543) = 1           0.010730 poll([{fd=10, events=POLLIN|POLLERR|POLLNVAL}, {fd=6, events=POLLOUT|POLLERR|POLLNVAL, revents=POLLOUT}], 2, 3533) = 1           0.000475 poll([{fd=10, events=POLLIN|POLLERR|POLLNVAL}, {fd=6, events=POLLOUT|POLLERR|POLLNVAL, revents=POLLOUT}], 2, 3532) = 1           0.000329 poll([{fd=10, events=POLLIN|POLLERR|POLLNVAL, revents=POLLIN}], 1, 3532) = 1           0.953349 poll([{fd=10, events=POLLIN|POLLERR|POLLNVAL}, {fd=6, events=POLLOUT|POLLERR|POLLNVAL, revents=POLLOUT|POLLERR}], 2, 2578) = 1       Notice in this case that, even though the second-last call is recorded as taking 10ms (normal), it is 953ms before the last call. What tools can I use to track down the culprit?


title: How to watch pgrep?

text: When running a `pgrep` command with `watch` it does not only show the actual pgrep output, but also the `watch` process as well. Example:               watch pgrep -lf donothing      will show 3 processes, although               pgrep -lf donothing      does not show one. Is thee an elegant way to handle this properly with `watch` to not display the _own_ process of `watch`? EDIT Using the suggestions by Patrick:               watch pgrep -f '^python donothing.py'      shows me the usage of `pgrep` (updated every 2 seconds...)               watch pgrep -l 'python donothing.py'      as well (the `pgrep` commands alone DO work but not in connection with `watch`).               watch "pgrep 'python donothing.py'"      does not show anything, although the process is there.


title: Clunking hard drive, some info appears in dmesg but none in fdisk -l, what are my options?

text: I've been backing up old IDE hard drives onto a new USB drive this afternoon. One, a 2002 120gb Western Digital, has been a bit of a problem. I have connected it (as with the other hard drives) to the IDE port on the motherboard, and when I power on the computer, it makes clunky/whirry sounds which I'd prefer not to hear. Clunk, whirr, HDD powers down, powers up, OS tries again, then eventually the OS (OpenSuse right now) loads. The relevant output from `dmesg` is as follows:               [    1.044144] ata1: clearing spurious IRQ     [    1.065767] ata1.00: ATA-5: WDC WD1200JB-00CRA1, 17.07W17, max UDMA/100     [    1.065769] ata1.00: 234441648 sectors, multi 16: LBA      [    1.065858] ata1: clearing spurious IRQ     [    1.072420] ata1: clearing spurious IRQ     [    1.072685] ata3.01: ATA-8: ST3500418AS, CC38, max UDMA/133     [    1.072689] ata3.01: 976773168 sectors, multi 16: LBA48 NCQ (depth 0/32)     [    1.080399] ata4.00: ATAPI: BENQ    DVD DC DW220S, 9B32, max UDMA/100     [    1.080614] ata4.01: ATA-8: ST3500418AS, CC38, max UDMA/133     [    1.080617] ata4.01: 976773168 sectors, multi 16: LBA48 NCQ (depth 0/32)     [    1.081269] ata1.00: configured for UDMA/100     [    1.081374] scsi 0:0:0:0: Direct-Access     ATA      WDC WD1200JB-00C 17.0 PQ: 0 ANSI: 5     [    1.081574] sd 0:0:0:0: [sda] 234441648 512-byte logical blocks: (120 GB/111 GiB)     [    1.081609] sd 0:0:0:0: [sda] Write Protect is off     [    1.081611] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00     [    1.081628] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA     [    1.081722]  sda:      In `fdisk -l`, nothing relating to sda shows up. What I was hoping to do, was do a big ol' `dd` copy of `/dev/sda`, then use photorec or something to get some files out of it. The fact that it was recognized in `dmesg` is encouraging, but I'm wondering whether there is in fact anything to be done. Would be grateful for any help in deciphering the `dmesg` info!


title: How can I find the correct name for my microphone and sound output using aplay or pacmd or something else, to apply in asound.conf?

text: I need to write a default mic and default speaker output in the `asound.conf` config file. But I don't know exactly how I can find my external sound card or microphone device's name, so that on reboot or unplug/plug I don't have to reconfigure it again. I tried to find them by using:               sun@sun-To-be-filled-by-O-E-M:/tmp$ pacmd dump | grep alsa_input     set-source-volume alsa_input.pci-0000_00_1b.0.analog-stereo 0xddb     set-source-mute alsa_input.pci-0000_00_1b.0.analog-stereo no     suspend-source alsa_input.pci-0000_00_1b.0.analog-stereo yes     set-source-volume alsa_input.usb-0d8c_C-Media_USB_Audio_Device-00-Device.analog-mono 0x9091     set-source-mute alsa_input.usb-0d8c_C-Media_USB_Audio_Device-00-Device.analog-mono no     suspend-source alsa_input.usb-0d8c_C-Media_USB_Audio_Device-00-Device.analog-mono yes     set-source-volume alsa_input.usb-046d_HD_Pro_Webcam_C920_8E9E4FCF-02-C920.analog-stereo 0xfffe     set-source-mute alsa_input.usb-046d_HD_Pro_Webcam_C920_8E9E4FCF-02-C920.analog-stereo no     suspend-source alsa_input.usb-046d_HD_Pro_Webcam_C920_8E9E4FCF-02-C920.analog-stereo yes     set-default-source alsa_input.usb-046d_HD_Pro_Webcam_C920_8E9E4FCF-02-C920.analog-stereo      or:               sun@sun-To-be-filled-by-O-E-M:/tmp$ aplay -l     **** List of PLAYBACK Hardware Devices ****     card 0: PCH [HDA Intel PCH], device 0: ALC892 Analog [ALC892 Analog]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 0: PCH [HDA Intel PCH], device 1: ALC892 Digital [ALC892 Digital]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 0: PCH [HDA Intel PCH], device 7: HDMI 1 [HDMI 1]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 2: Device [C-Media USB Audio Device], device 0: USB Audio [USB Audio]       Subdevices: 1/1       Subdevice #0: subdevice #0      But it confused me. Which one is the name that I have to use when doing `sudo vim /etc/asound.conf`? From the information given above this device is my microphone:               card 2: Device [C-Media USB Audio Device], device 0: USB Audio [USB Audio]       Subdevices: 1/1       Subdevice #0: subdevice #0      And from the above information this device is my audio output:               card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]       Subdevices: 1/1       Subdevice #0: subdevice #0      How can I tell this in my `/etc/asound.conf`? I tried the following but it does not work:               pcm.usb     {         type hw         card C-Media USB Audio Device     }     pcm.!default     {         type asym         playback.pcm         {             type plug             slave.pcm "dmix"         }         capture.pcm         {             type plug             slave.pcm "usb"         }     }


title: Named service won't start - seems to be caching errors

text: When I try to restart / start the `named` service, it keeps failing.               service named restart      Results in:-               Stopping named:                                            [  OK  ]     Starting named:     Error in named configuration:     /etc/named.conf:2: missing ';' before '}'                                                                [FAILED]          service named start      Results in:-               Starting named:     Error in named configuration:     /etc/named.conf:2: missing ';' before '}'                                                                [FAILED]      The thing is, even if `named.conf` contains no syntax errors or even if the file doesn't exist at all, I'm still getting this error preventing me from starting the service. Currently trying with a `named.conf` containing the following:-               options {     listen-on port 53 { 127.0.0.1; };     };      And checking the syntax of `named.conf` using               named-checkconf /etc/named.conf      Results in no errors. Yet when starting the service, I still get the above error. I can't see any other errors in the logs relating to this and don't really know where to get to the bottom of this. Any ideas? (Even reverting back to the `named.conf` file that was in place before I stopped the service returns the same error now and this was previously running fine). Contents on `init.d/named` can be seen at this pastebin. CentOS 6.4 - Linux version 2.6.32-358.6.2.el6.x86_64 (mockbuild@c6b8.bsys.dev.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC) ) #1 SMP Thu May 16 20:59:36 UTC 2013 # Update               bash -x /etc/init.d/named start      Snippet from results possibly of relevance?               + echo 'Error in named configuration:'     Error in named configuration:     + echo '/etc/named.conf:2: missing '\'';'\'' before '\''}'\'''     /etc/named.conf:2: missing ';' before '}'     + failure     + local rc=0     + '[' color '!=' verbose -a -z '' ']'     + echo_failure     + '[' color = color ']'     + echo -en '\033[60G'                                                                + echo -n '['     [+ '[' color = color ']'     + echo -en '\033[0;31m'     + echo -n FAILED     FAILED+ '[' color = color ']'     + echo -en '\033[0;39m'     + echo -n ']'     ]+ echo -ne '\r'     + return 1     + '[' -x /bin/plymouth ']'     + /bin/plymouth --details     + return 0     + echo


title: Linux listing files between two date without touch command

text: I need a command which will list the files between given date and time (YYYYMMDDHHMMSS - format) in to a text file. I don want to use touch command as its creating permission issue. I am new to this so please help me with explanation.


title: Where do I find a list of terminal key codes to remap shortcuts in bash?

text: For example:               "\e[1;5C"     "\e[Z"     "\e-1\C-i" I only know bits and pieces, like `\e` stands for escape and `C-` for `Ctrl`, but what are these numbers (`1`) and letters (`Z`)? What are the `;`, `[` and `-` signs for? Is there only trial and error, or is there a complete list of bash key codes and an explanation of their syntax?


title: Unable to set hostname for use within network

text: I am having a lot of trouble setting up a hostname for my home server for use within my home network. My home server is running Ubuntu 12.04 LTS and all packages are up to date. Management of this server is done using SSH only, no GUI is present. I want to use the servers host name mainly for accessing web pages and samba shares from several Windows computers and Android devices. My homeserver acquires its (static) IP address from a Linksys WRT54GC using DHCP. Both `/etc/hosts` and `/etc/hostname` have added "homeserver" as a host name. I did not tamper `/etc/dhcp/dhclient.conf`, because the default settings should work according to Ubuntu sources. The router is only able to resolve host names for DHCP clients. It does not let me edit the client names like some newer products can. All host names of my Windows PC are recognized by the router. I am also able to ping those machines using their host names. So everything seems to be all right on my router. The Linksys WRT54GC is cascaded to an ISP configured DSL modem/router. All internet traffic is routed to the Linksys, as it is placed in the DMZ of the DSL modem/router. The IP address of the DSL modem/router is 192.168.1.1 and the Linksys is 192.168.2.1. The Linksys is configured using a static IP address. The DNS server for the Linksys is configured to 192.168.1.1. All clients linked to the Linksys report having 192.168. **1**.1 as the DNS server. This issue might have something to do with this bug.   I have installed the `isc-dhcp-client` package from 13.04, but that did not do the trick. If this bug still exist in Ubuntu 12.04 LTS (and 13.04), I would like to know a work around. ### Edit #1 The OP posted the contents of the file: `/etc/dhcp/dhclient.conf`:               # Configuration file for /sbin/dhclient, which is included in Debian's     #   dhcp3-client package.     #     # This is a sample configuration file for dhclient. See dhclient.conf's     #   man page for more information about the syntax of this file     #   and a more comprehensive list of the parameters understood by     #   dhclient.     #     # Normally, if the DHCP server provides reasonable information and does     #   not leave anything out (like the domain name, for example), then     #   few changes must be made to this file, if any.     #          option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;          send host-name "<hostname>";     #send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;     #send dhcp-lease-time 3600;     #supersede domain-name "fugue.com home.vix.com";     #prepend domain-name-servers 127.0.0.1;     request subnet-mask, broadcast-address, time-offset, routers,         domain-name, domain-name-servers, domain-search, host-name,         netbios-name-servers, netbios-scope, interface-mtu,         rfc3442-classless-static-routes, ntp-servers,         dhcp6.domain-search, dhcp6.fqdn,         dhcp6.name-servers, dhcp6.sntp-servers;     #require subnet-mask, domain-name-servers;     #timeout 60;     #retry 60;     #reboot 10;     #select-timeout 5;     #initial-interval 2;     #script "/etc/dhcp3/dhclient-script";     #media "-link0 -link1 -link2", "link0 link1";     #reject 192.33.137.209;          #alias {     #  interface "eth0";     #  fixed-address 192.5.5.213;     #  option subnet-mask 255.255.255.255;     #}          #lease {     #  interface "eth0";     #  fixed-address 192.33.137.200;     #  medium "link0 link1";     #  option host-name "andare.swiftmedia.com";     #  option subnet-mask 255.255.255.0;     #  option broadcast-address 192.33.137.255;     #  option routers 192.33.137.250;     #  option domain-name-servers 127.0.0.1;     #  renew 2 2000/1/12 00:00:01;     #  rebind 2 2000/1/12 00:00:01;     #  expire 2 2000/1/12 00:00:01;     #}


title: UUOC with ssh file transfer

text: Just wondering; is it possible to skip the `cat` in               some_command | ssh remote 'cat > outputfile'      ? It feels like a UUOC.


title: Problem in Joining RHEL with Windows 2008

text: I configured Domain on my test machine (Win2k8) and domain name is **win2008ad.local** and computer name is win2k8. So the full name is **win2k8.win2008ad.local**. I installed packages on RHEL 5 related to winbind, Samba, and KRB After doing all the configurations when i run this command **net ads join -U administrator** it gives me this error ![enter image description here](http://i.stack.imgur.com/esHGT.png) and **wbinfo -u** gives this error _Error Looking up Domain Users_ Contents of `/etc/security/pam_winbind.conf`:               #     # pam_winbind configuration file     #     # /etc/security/pam_winbind.conf     #          [global]          # turn on debugging     ;debug = yes          # request a cached login if possible     # (needs "winbind offline logon = yes" in smb.conf)     ;cached_login = yes          # authenticate using kerberos     krb5_auth = yes          # when using kerberos, request a "FILE" krb5 credential cache type     # (leave empty to just do krb5 authentication but not have a ticket     # afterwards)     ;krb5_ccache_type = FILE          # make successful authentication dependend on membership of one SID     # (can also take a name)     ;require_membership_of =      Contents of `/etc/krb5.conf`:               [root@rhmain ~]# cat /etc/krb5.conf     [logging]      default = FILE:/var/log/krb5libs.log      kdc = FILE:/var/log/krb5kdc.log      admin_server = FILE:/var/log/kadmind.log          [libdefaults]      default_realm = WIN2008AD.LOCAL      dns_lookup_realm = false      dns_lookup_kdc = false      ticket_lifetime = 24h      forwardable = yes          [realms]      #EXAMPLE.COM = {       #kdc = kerberos.example.com:88       #admin_server = kerberos.example.com:749       #default_domain = example.com       WIN2008AD.LOCAL = {       kdc = win2k8.win2008ad.local       admin_server = win2k8.win2008ad.local     }          [domain_realm]      #.example.com = EXAMPLE.COM      #example.com = EXAMPLE.COM      .win2k8.win2008ad.local = WIN2008AD.LOCAL          [appdefaults]      pam = {        debug = false        ticket_lifetime = 36000        renew_lifetime = 36000        forwardable = true        krb4_convert = false      }      Contents of `/etc/hosts`:               10.20.20.221    win2k8.win2008ad.local  winad      Contents of `/etc/nsswitch`:               passwd:     files winbind     shadow:     files     group:      files winbind      Contents of `/etc/pam.d/system-auth`:               auth        required      pam_env.so     auth        sufficient    pam_winbind.so     auth        sufficient    pam_unix.so nullok try_first_pass     auth        requisite     pam_succeed_if.so uid >= 500 quiet     auth        required      pam_deny.so          account     required      pam_unix.so     account     required      pam_winbind.so     account     sufficient    pam_succeed_if.so uid < 500 quiet     account     required      pam_permit.so          password    requisite     pam_cracklib.so try_first_pass retry=3     password    sufficient    pam_winbind.so     password    sufficient    pam_unix.so md5 shadow nullok try_first_pass use_authtok     password    required      pam_deny.so          session     optional      pam_keyinit.so revoke     session     required      pam_limits.so     session     [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid     session     required      pam_unix.so      And finally `/etc/samba/smb.conf`:               security = ads     realm = WIN2008AD.LOCAL      What am I missing?


title: Remotely turn off display output?

text: I'm using x11vnc and SSH to tunnel VNC remotely to my local machine. One of the interesting side-effects of this is that as I use my work computer from home, my coworkers will see me moving around my mouse, typing, etc. and can stand at my computer in the office and spectate everything. Is there a way for me to disable display output remotely but still be able to VNC into my actual desktop as I left it? Preferably, stopping keyboard and mouse input for the duration of the session would be a good idea™.


title: Custom help / man -like command (for reminders)

text: I often end up in a situation, where I don't use a command for a while, but then suddenly need to use it; and I need to wade through several help pages until constructing the command line I want. Case in point: occasionally I need to use `nmcli`; and then I need to re-check `nmcli nm help` and `nmcli con help` several times, until I remember what sort of a command I need. What I have done then, is basically document some of this in a text file; the problem is then I usually save it on Desktop; then every once in a while I clean the Desktop files, so I end up thinking "ah, I don't really use `nmcli- examples.txt` all that much, let me move this one elsewhere too"; then when I need it again, I have to issue a find for it first (provided I can remember the file name to look for). So I was thinking - making a script that: would have a default location set (e.g. `~/customhelp`), where one could keep specifically these kind of reminder text files; and would list the files in that directory upon `bash` smart completion for the first command argument; and would open such a file name supplied on the command line either in `less` (or in the default GUI text editor if a command line switch is supplied) shouldn't be too difficult. But I'd rather not try reinventing the wheel, so I was wondering - if any sort of a command for a scheme of usage as described, exists already in a typical GNU/Linux system?


title: Debian 6.0 and Intel "Sandy Bridge" (DH67CL) integrated video

text: Is there a way to get the above to work - I have a quite recent desktop with the hardware and OS mentioned in the title. I was in a rush when first installing it, so I just grabbed an nvidia PCI-e adapter since the **Sandy Bridge** onboard video did not work out of the box (I think I only got VESA video in X).


title: How do I emulate su's behavior with sudo?

text: I'm trying to make sudo ask for target password, except when run by `root`. Here's what I do:               Defaults:!root    targetpw      This way it asks for my password, and if I make it like this:               Defaults:yuri    targetpw      it asks for target user's password, but that's not what I wanted.


title: Show two desktop pagers with different settings in KDE

text: I'm trying to set up a CentOS 6 system with KDE. I have an older system that use gnome that I'm happy with, and I'm trying to make the KDE system behave as much like the gnome one as possible. The current issue is the pager. On Gnome, I have two pager widgets. one has the full 4x4 view of all of my virtual desktops with just silhouettes of the windows. The other just shows the current desktop, and just shows the name. If I try this in KDE, all pager widgets appear to have the same settings. All I really want is a full 4x4 pager widget, and another widget that just has the name of the current desktop. How do I do this? I'm not sure what version of KDE I have, I tried looking it up, but nothing seemed to say...


Good evening, I installed ArchLinux on a USB stick, and I would like to boot it in qemu. Unfortunately, most examples I found boot an image (iso..). The stick is definitely bootable as if I restart my computer, it shows a grub that can successfully start ArchLinux. I have tried things such as > sudo qemu-system-x86_64 -usb -usbdevice > disk:/media/louis/FlyinBaboon/boot/initramfs-linux.img -boot menu=on only to get boot errors. **What is the correct way to start qemu by giving it a path to a linux root?** ( _/media/louis/FlyingBaboon_ corresponding to my USB stick's root)


title: Limiting number of processes by name

text: is it possible to limit number of processes for a given group or user using the process name? Eg. I'd like to groups **remotes** have only 5 simultaneous **ssh** processes that are run on my server. I don't see any options in **pam_limit** (I can only limit number of process per user or group, regardless of process name) and I don't see ability in **cgroups**. Do you have any ideas how to accomplish this? (script in cron is not an answer for me :))