title: SliTaz, usb stick, unable to mount iso or to find a filesystem on it rootfs.gz

text: I deleted every partition on my system, even the partition on my usb stick. Then I created a partition with SliTaz which I'm currently on. But then I found out that my usb stick didn't get discovered if I plug it in. So I made a new ntfs partition(on the usb stick of course) with GParted. Now I wanted to boot into another Linux OS, so I downloaded the iso(kali-linux), then copied it to the drive. But now I can't make it bootable, when I use the "make bootable in a linux os" installation guide from kali-linux, which says, do dd if=kali.iso of=/dev/sdb bs=512k (at first, the partition was at sdb1), and I got "no such file, directory"but I already renamed the file to kali.iso . Then I played around a bit and deleted again the usb partition and then made it an ext3 partition, fat32 partition on finaly back to ntfs. But nothing worked. When it was an ext3 partition and I wanted to copy files on the drive I got "permission denied"(but worked with root user in the console). But it never booted from the iso at startup. Now if I go into mountbox(SliTaz program for mounting), I get some weird things: /dev/sda (232gb): Umounted dev: /dev/loop0p1 Hidden HPSF/NTFS Boot yes #What is loop0p1? /dev/sda1/ System: Linux /dev/loop1 Mounted fs: /dev/root /dev/sdb1 /dev/sdc1 30gb Mounted on: /media/disk-1 #(should be usb stick, but the mounted folder was different at the beginning) /dev/loop0 Mounted on: /media/cdrom read only GParted shows: /dev/sda1 Filesystem: ext2 #(this is SliTaz, everything is fine here, I think) and 218gb of free memory, not "located" * * * /dev/sdc #at the beginning it was /dev/sdb I think, only sure that it was changed. : /dev/sdc1 Filesystem NTFS Mountpoint: /media/disk-1 Size 30gb Output of fdisk -l is               Disk /dev/loop0: 2444 MB, 2444689408 bytes     146 heads, 32 sectors/track, 1022 cylinders     Units = cylinders of 4672 * 512 = 2392064 bytes             Device Boot      Start         End      Blocks  Id System     /dev/loop0p1   *           1        1022     2387360  17 Hidden HPFS/NTFS          Disk /dev/sda: 250.0 GB, 250059350016 bytes     255 heads, 63 sectors/track, 30401 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes             Device Boot      Start         End      Blocks  Id System     /dev/sda1               1        1913    15360000  83 Linux          Disk /dev/sdc: 31.2 GB, 31221153792 bytes     255 heads, 63 sectors/track, 3795 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes             Device Boot      Start         End      Blocks  Id System     /dev/sdc1               1        3796    30487552   7 HPFS/NTFS      If I use the SliTaz program to create a bootable usb stick I get: "unable to mount iso or to find a filesystem on it rootfs.gz" So, how can I fix all this? How did this loop0 stuff come up and some letters changed down in the alphabet. And finally, how can I get my usb stick to be bootable with the iso? Please no blame for kali-linux, I do tests and stuff on my own network or virtualised machines, and I like that many programming stuff that I use with python(gtk, pyside, scapy etc) is preinstalled there. My intention is to make a dualboot with Kali-Linux and SliTaz.


title: Mint GUI doesn't start

text: I installed Mint Linux on my laptop (DELL Inspiron, made:2005) but it has no GUI and only boots in text mode. How can I repair it?


title: Connecting to a serial port with VMWare ESXi and Ubuntu

text: Using VMWare ESXi 5.0.0, having a guest OS Ubuntu 12.04.3, upgraded to the date 05 january 2014. I've added "Serial port 1" to the Ubuntu 12.04 guest OS (let's call it "MyUbuntuPC").   Serial port 1 is defined to use a physical serial port from the path: `/dev/char/serial/uart0` (it is the only available option from the drop-down list)   The serial port is defined to be "Connected" and to "connect at power on". The BIOS configurations for guest OS, regarding the serial port, are valid (IMHO): "Serial port A" and "Serial port B" are configured to "Auto". The "Mode" for serial port B is configured to "Normal" (other options are "IrDA", "ASK-IR" and "FIR"). Some additional info via command line, executed on the guest OS / Ubuntu:               root@MyUbuntuPC:~# dmesg | grep ttyS     [    0.621913] 00:09: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A     [    0.693788] 00:0a: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A     [    4.887004] ttyS2: LSR safety check engaged!     [    4.887466] ttyS2: LSR safety check engaged!     [    4.888102] ttyS3: LSR safety check engaged!     [    4.888557] ttyS3: LSR safety check engaged!          root@MyUbuntuPC:~# ll /dev/ttyS{0,1}     crw-rw---- 1 root dialout 4, 64 Jan  5 18:29 /dev/ttyS0     crw-rw---- 1 root dialout 4, 65 Jan  5 18:29 /dev/ttyS1          root@MyUbuntuPC:~# groups root     root : root dialout          root@MyUbuntuPC:~# setserial -g /dev/ttyS{0..3}     /dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4     /dev/ttyS1, UART: 16550A, Port: 0x02f8, IRQ: 3     /dev/ttyS2, UART: 16550A, Port: 0x03e8, IRQ: 4     /dev/ttyS3, UART: 16550A, Port: 0x02e8, IRQ: 3          root@MyUbuntuPC:~# stty -F /dev/ttyS0 -g     500:5:cbd:8a3b:3:1c:7f:15:4:0:1:0:11:13:1a:0:12:f:17:16:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0          root@MyUbuntuPC:~# stty -F /dev/ttyS0 -a     speed 9600 baud; rows 0; columns 0; line = 0;     intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>;     swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W;     lnext = ^V; flush = ^O; min = 1; time = 0;     -parenb -parodd cs8 hupcl -cstopb cread clocal -crtscts     -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc     -ixany -imaxbel -iutf8     opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0     isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl     echoke          root@MyUbuntuPC:~# stty -F /dev/ttyS1 -g     500:5:cbd:8a3b:3:1c:7f:15:4:0:1:0:11:13:1a:0:12:f:17:16:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0          root@MyUbuntuPC:~# stty -F /dev/ttyS1 -a     speed 9600 baud; rows 0; columns 0; line = 0;     intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>;     swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W;     lnext = ^V; flush = ^O; min = 1; time = 0;     -parenb -parodd cs8 hupcl -cstopb cread clocal -crtscts     -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc     -ixany -imaxbel -iutf8     opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0     isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl     echoke          root@MyUbuntuPC:~# cu -d -l /dev/ttyS0 -s 115200     cu: fconn_open: Opening port /dev/ttyS0 (speed 115200)     cu: fconn_set: Changing setting to 0, 0, 2     Connected.     ~.cu: Exit status 0     cu: fconn_close: Closing connection          Disconnected.      * * * I've separated each command & it's corresponding output with a new line character for better readability. As can be seen, the `cu` process writes "Connected", but I can wait for hours and nothing will happen. I have another PC with Ubuntu 12.04.2 LTS (let's call it "nonVirtual Ubuntu"). It doesn't run on a virtual machine. It runs a `ser2net` process that allows my virtual Ubuntu to ( **successfully** ) connect to the serial port of the "nonVirtual Ubuntu" via the network. The configuration file of `ser2net` contains the line:               3000:telnet:1800:/dev/ttyS0:115200 8DATABITS NONE 1STOPBIT banner      Additional info with command line:               root@nonVirtual Ubuntu:~# dmesg | grep ttyS     [    0.443093] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A     [    0.464725] 00:0a: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A     [    0.484971] 0000:00:16.3: ttyS4 at I/O 0xf0e0 (irq = 19) is a 16550A     [    0.507168] 0000:02:00.0: ttyS5 at I/O 0xe030 (irq = 16) is a ST16650V2     [    0.529410] 0000:02:00.1: ttyS6 at I/O 0xe020 (irq = 17) is a ST16650V2     [    0.551638] 0000:02:00.2: ttyS7 at I/O 0xe010 (irq = 18) is a ST16650V2     [    0.573873] 0000:02:00.3: ttyS8 at I/O 0xe000 (irq = 19) is a ST16650V2      * * * I don't understand why the `cu` process can't make a connection to the board that is connected to the serial port on the virtual machine. (I've also tried to connect using `/dev/ttyS1`).   I guess it has something to do with Linux's interaction with VMWare ESXi ?


title: tenshi and logfiles

text: I'm about to set up Tenshi in order to get important log excerpts. Everything works fine except if I add some apache2 logs,               # /etc/tenshi/tenshi.conf          ...     set logfile /var/log/apache2/error.log      I also created a Tenshi include for `apache2`, but it doesn't work.               # /etc/tenshi/includes-active/apache2          group ^apache2:          trash ^apache2: \[client \d+\.\d+\.\d+\.\d+\] client denied by server configuration:     trash ^apache2: \[client \d+\.\d+\.\d+\.\d+\] Directory index forbidden by Options directive:          group_end      **Question:** What is wrong with the config and how to create an include for non standard logs?


title: Sandbox alike solution for linux

text: I wonder if there is a kind of a sandboxing solution for linux, sometimes there is more than one app that is candidate to solve my problems, in that case I want to try all of them to get the one which better fit my needs. Usually I extract .deb files somewhere and export `PATH` env adding the bin directory and `LD_LIBRARY_PATH` adding the lib direcotry. Most of the times it works well, but sometimes the application requires /etc configurations, or other resources like images on share folder, that I was not able to solve. My test machine is old, so I have low resources, a VM would bore me a lot, a separated linux installation in my disk doing chroot would please me better than a VM in performance, but it still takes some unwanted spaces because of repeated files, almost all of them are the same of my original distro. I was wondering if there is somehow a mixed mount -bind with some magic flag, or other solution, something like the follow:               $ mkdir dir1 dir2     $ echo "Lipsum" > dir1/file1     $ echo "Original" > dir1/file2     $ sudo mount -o bind -some-magic-flag dir1 dir2     $ echo "Changed" > dir2/file2     $ touch dir2/file3     $ ls -1 dir2     file1     file2     file3     # it's ok     $ ls -1 dir1     file1     file2     # file3 sould not be here!     $ sudo umount dir2     $ ls -1 dir2     file2     file3     # file1 was not changed, should not be repeated here, but file2 was     $ cat dir1/file2     Original     $ cat dir2/file2     Changed


title: How can I backup a directory to NTFS while preserving Unix file attributes?

text: I want to make a backup of my home directory to an NTFS partition (an unfortunate limitation). However, when I last tried using just `cp`, the attributes (owner, etc) went away. How can I make a backup while still preserving these attributes? My first instinct is to make a tarball, but I'm not sure if this will work. For reference, I'm running Ubuntu Raring devel.


title: Permissions for FTP directory: Inherit directory owner

text: I am making multiple folders for users (userA/, userB/, etc.) where anyone can create/read a file/folder in any directory (userC can make fileX inside userA/). However, only the directory's owner can modify or delete the files within that folder (userC can only modify/delete files inside userC/). I've tried changing the directory permissions to 7777, however the SUID doesn't apply to directories. How do I allow uploaded files to inherit the directory owner? **Edit:** UserZ owns directory dirZ/. UserZ can create (upload), modify, delete, and read everything inside dirZ/.   Likewise, UserY owns directory dirY/. User Y can create, modify, delete, and read everything inside dirY/. UserY can access dirZ/. UserY can create or read anything inside dirZ/. UserY _can not_ modify or delete anything inside dirZ/. Likewise, UserZ can access dirY/. UserZ can create or read anything inside dirY/. UserZ _can not_ modify or delete anything inside dirY/.


title: file mass deletion

text: I would like to delete all the txt, xls,pdf files in a directory as well as its sub directories. I would like to save everything else.               find . -type f ! -iname '*.xml$,.png$,.jpeg$,.gif$,' -delete      that seemed to have done it, but it delete some other files that I need. How can I achieve that without deleting anything else?


title: "watch" command not found in Cygwin?

text: > **Possible Duplicate:**   >  Cygwin has no watch command? I am in the process of learning Unix commands; I started a few days back. I read a post here and tried to use the `watch` command, but my terminal - Cygwin - displays `command not found`! Why does this happen? It happens with other commands like `clear` too.


title: Vim not running inside tmux

text: When I try to open a file using `vim` inside `tmux` the whole window freezes. I have to kill the window with `C-a &`. Here are my `~/.vimrc` settings:               :set autoindent     :set ts=4     :set number     :set shiftwidth=4     :set showmode     :filetype on     :filetype plugin on     :syntax enable     :set mouse=a      and `~/.tmux.conf`               # I like Ctrl-a as the default hotkey     unbind C-b     set-option -g prefix C-a          # Split window using | and -     unbind %     bind | split-window -h     bind - split-window -v          # Set status bar     set -g status-bg black     set -g status-fg white     set -g status-left ‘#[fg=green]#H’          # Highlight active window     set-window-option -g window-status-current-bg red          # Makes window numbering start from 1, instead of 0     set -g base-index 1      I am facing the problem in RHEL. However the same config works fine in my Mac. I guess, things were working fine till my RHEL box got restarted and I tried to recover a file in from vi swap file. Any ideas on how to fix this? [edit]: I tried `ssh` to other box inside `tmux` and running `vi` there. Works fine in remote box ! * * * [added later] Following the suggestion of @jasonwryan, I added the line `set -g default-terminal screen-256color` at the end of `tmux.conf`. That prevented programs like `less` from working. `echo $TERM` inside tmux is "screen" and outside tmux is "xterm". Searching for $TERM led me to https://wiki.archlinux.org/index.php/Tmux, from where I added the line `set -g default-terminal "screen-256color"` as the first line of `tmux.conf`. This made the `$TERM` inside tmux to "screen-256color". But now when I start `vi` inside tmux, it displays the following error:               E558: Terminal entry not found in terminfo     'screen-256color' not known. Available builtin terminals are:         builtin_riscos         builtin_amiga         builtin_beos-ansi         builtin_ansi         builtin_pcansi         builtin_win32         builtin_vt320         builtin_vt52         builtin_xterm         builtin_iris-ansi         builtin_debug         builtin_dumb     defaulting to 'ansi'      * * * Looks like I have solved the issue. Just added `set -g default-terminal xterm` as the first line of my ~/.tmux.conf and it worked !


title: CentOS network connection breaks every 5 min

text: I installed CentOS 6.2 about a month ago and it worked fine. Two days ago I saw that the internet connection is broken, so I reconfigured it. I was able to use it but after a few minutes it broke again. I realize the network configuration is reset every 5 minutes. How can I repair it? I use Static IP.


title: How to detect if a file is hidden

text: I have written this code as part of some coursework, where we have to create a recursive file counter without using the find, du or -R commands. This appears to work but always returns hiddenfilecounter as 0. Is there any particular reason this is not working.               #!/bin/sh     shopt -s dotglob     directoryCounter=0     fileCounter=0     hiddenDirectoryCounter=0     hiddenFileCounter=0     listAllFiles()        {        local dir=$1        local file        local bn=$(basename $dir)                  for file in "$dir"/*; do          if [[ $bn == .* ]]; then          let hiddenDirectoryCounter+=1          listAllFiles "$file"        elif [[ -f $file &&  "$file" == ^. ]]; then          ls -l $file          let hiddenFileCounter+=1        elif [[ -f $file ]];then          ls -l $file          let fileCounter+=1        elif [[ -d $file ]]; then          listAllFiles "$file"          let directoryCounter+=1             fi       done     }      listAllFiles $1     echo File found: $fileCounter     echo Directories found: $directoryCounter     echo Hidden directories found: $hiddenDirectoryCounter     echo Hidden files found: $hiddenFileCounter


title: How do I configure Emacs to use 'ispell' on Mac OS X?

text: I'm using `brew` as my package manager for both Emacs and ispell. I have both installed. Doing a quick google, I was unable to figure out how to tell Emacs where ispell is and to load the appropriate dictionaries. Right now when I do a `M-x ispell-check-version`, Emacs saucily replies: `Searching for program: No such file or directory`. **How do I configure`Emacs` to use `ispell`?**


title: Hiding files on FTP server

text: I have an Ubuntu server and I run an FTP server on it. I changed its folder structure and want to restrict access of users to some of the files not all of them in a way that other files be hidden to users. How can I do this?


title: File IO very slow on RHEL6

text: I recently moved to RHEL6 santaigo OS. I am finding the file io operations like copy, file download taking a long time. This was not the case when I have used RHEL5 earlier. Could anyone suggest a possible way to troubleshoot the issue. The file system has two mounted devices.   1. /dev/mapper/ ** _*_ ****   2. /dev/sda1 Both are ext4 type.


title: How can I find which version of libmysqlclient is installed in Centos?

text: I have a custom exe provided to me but to install it I need an older version of libmysqlclient. How can I check which version is installed?


title: Removing Ubuntu 12.04 LTS from a dual boot setup and recovering the Windows boot manager

text: I have Ubuntu 12.04 LTS and Windows 7 Home Premium on my laptop. My desire is to uninstall Ubuntu without spoiling MBR and Windows 7. I would like to emphasize that Ubuntu was installed later so I select the OS in GRUB. I would also like to uninstall GRUB. How can I do so in a painless and simple manner?


title: Uninstalling default VBoxGuestAdditions on Debian

text: When I ran `sh /media/cdrom/VBoxLinuxAdditions.run` I got the following warning message:               You appear to have a version of the VBoxGuestAdditions software     on your system which was installed from a different source or using a     different type of installer.  If you installed it from a package from your     Linux distribution or if it is a default part of the system then we strongly     recommend that you cancel this installation and remove it properly before     installing this version. If this is simply and older or a damaged     installation you may safely proceed.      How do I uninstall the VBoxGuestAdditions that was a default part of Debian? Edit: After reading and trying out jw013's answer, I suspected that maybe I just didn't know the proper package names. I did a bit more searching, and found out that I can see the list of packages installed by running `dpkg -l`. So I ran               dpkg -l | grep virtualbox      then I got               ii   virtualbox-ose-guest-dkms ...     ii   virtualbox-ose-guest-utils ...     ii   virtualbox-ose-guest-x11 ...      Then I removed each manually by running               apt-get remove virtualbox-ose-guest-dkms virtualbox-ose-guest-utils virtualbox-ose-guest-x11      So far it looks like that might be the solution, though it's weird because when I run the command it wants to install 38 new packages, most of them with xserver related stuff. Edit2: I tried the above with a fresh install (reasonably minimal install -- used the businesscard.iso with nothing marked when tasksel came up) then followed the directions here, and everything worked perfectly!


title: NFS: failed to create MNT RPC client status = -101

text: I am trying for network file system (NFS) booting between two systems.   I am using `dhcp` server to assign IP-address for client. And my kernel and root file system are present in server. My client is able to load the kernel. But can't able to mount the root filesystem. I am getting error regarding remote procedure call (RPC) The following lines appear while booting at client side               NFS:  MNTPATH:  '/nfsroot'     NFS:  sending MNT request for 172.16.6.237:/nfsroot     NFS:  failed to create MNT RPC client, status=-101     NFS:  Unable to mount server 172.16.6.237, error -101     VFS:  Unable to mount root fs via NFS, trying floppy.     VFS:  Cannot open root device "nfs" or unknown-block(2,0)     Please append a correct "root=" boot option; here are the available partitions:     0000     bla bla bla     kernel panic- not syncing: VFS: Unable to mount root fs or unknown-block(2,0)      The above lines are few lines when I am doing NFS (network file system). In kernel configuration i enabled all necessary flags for NFS support. In above error The line related to RPC client is present in kernel fs/nfs/mount_clnt.c program. I also came to know that the error occurs in rpc_ping() function which is present in net/sunrpc/clnt.c file. How can I fix this? edit:- My dhcp.conf looks like this { allow booting; allow bootp; use-host-decl-names on; ddns-update-style interim; ignore client-updates; next-server 172.16.6.237; subnet 172.16.6.0 netmask 255.255.255.0 {               option subnet-mask  255.255.255.0;          range dynamic-bootp 172.16.6.10 172.16.6.254;          default-lease-time 21600;          max-lease-time 43200;          option domain-name-servers 127.0.0.1;          option routers      172.16.6.1;          filename "pxelinux.0";      } host hostname {                                    hardware ethernet 74:27:ea:42:b7:b7;                               fixed-address 172.16.6.238;                               option root-path"172.16.6.237:/nfsroot";                     }      } And my pxelinu.cfg/default file looks like this { default openwrt label openwrt kernel openwrt-x86-generic-vmlinuz append boot=nfs root=/dev/nfs nfsroot=172.16.6.237:/nfsroot,soft,vers=3,clientaddr=172.16.6.238 ip=dhcp rw nfsrootdebug } If I am giving proto=tcp then the error number will become -110 (time out) If I removed proto=tcp the error number becomes -101 (Network unreachable)


title: separate a file into several small files according to columns

text: I have a data file, which can have N rows, and each row is composed M elements separated by white space. Currently, I want to separate each row into several segments. In other words, assume the number of segments is 3; then the original file will be separated into 3 files, each of which has N rows and each row has M/3 elements. Besides writing C++ or Java program, Is there any efficient approach that can fulfill this task on Unix/Linux?


INPUT:               CC2352345|m,safnlasndfmnyxdcvyxcvyxcv             |klasjdf |3|lasdjflasdf|                    |2345567356     CC3543353|asdfasdffghntz                          |klasjdf |3|lsajdfl |                       |3456561235     CC5634554|asfjmklasdfassasdasasdsdfas             |klasjdf |3|lsajdfl |                       |2345635636          |masdfjklasdfjasldfjlasjdfklas|          | |       |                       |2345234566     CC4723456|asdjkfasjkldfjaklsjdflkajldkfjlasjdflk  |klasjdf |2|lsajdfl |                       |2345234525     DD3455463|asldfklklfaem,.rtklqerktljekltjklqe     |klasjdf |3|lsajdfl |                       |4565467546      OUTPUT:               CC2352345|m,safnlasndfmnyxdcvyxcvyxcv             |klasjdf |3|lasdjflasdf|                    |2345567356     CC3543353|asdfasdffghntz                          |klasjdf |3|lsajdfl |                       |3456561235     CC5634554|asfjmklasdfassasdasasdsdfas             |klasjdf |3|lsajdfl |                       |2345635636     CC4723456|asdjkfasjkldfjaklsjdflkajldkfjlasjdflk  |klasjdf |2|lsajdfl |                       |2345234525     DD3455463|asldfklklfaem,.rtklqerktljekltjklqe     |klasjdf |3|lsajdfl |                       |4565467546      QUESTION: How can I delete lines that has an empty first column?


title: Why is kernel-default 114MB on SUSE Studio?

text: I see that               $ du -h /boot/initrd-2.6.37.6-0.5-pae     3.9M     /boot/initrd-2.6.37.6-0.5-pae     $ du -h /boot/vmlinuz-2.6.37.6-0.5-pae     4.1M     /boot/vmlinuz-2.6.37.6-0.5-pae     $ du -sh /boot     17M      /boot      So why does the "kernel-default" package on SUSE Studio come with 114MB?


title: Installing Arch Linux with UEFI Boot and GPT Layout

text: I'm trying to set up a dual UEFI boot Windows/Arch Linux, and have already installed Windows on a GPT layout through UEFI boot. I now want to fresh install Arch Linux using GPT layout as well, and was wondering how I could do that. More specifically, do I need to modify the content of the core install image to be able to boot from it in UEFI? If I manage to boot in UEFI from the core install image, will it automatically set up my partitions using GPT layout? I've read a couples of tutorial on how to set up UEFI boot with Arch, but it seems most of them considered only a situation were Arch Linux was already installed (using MBR layout?) Thank you


title: TLS over unix pipe

text: Can I use TLS/SSL over Unix pipe with Unix command line? I want the equivalent of               $ mkfifo /tmp/spipe     $ echo a|openssl s_server -acceptFifo /tmp/spipe &     [1] 25563     $ openssl s_client -connectFifo /tmp/spipe     a     [1]   Done                    echo a|openssl s_server -acceptFifo /tmp/spipe      (Yes, it's not hard to write a short program to do that, but I was hoping it is possible with existing tools) Let me clarify, I do not want a tcp connection any time in the process. I want to use the TLS/SSL protocol over a UNIX pipe. The client will open a unix pipe, and will connect to the server "listening" on another pipe. I do NOT want to move data from TLS tcp connection to a pipe.


title: Vim - map last shell command to the key

text: Is there any way to map leader-r to repeat last command sent to bash? For example, when working with C files I would like to compile and run program from vim without typing :!make or gcc. I know I can bind specific command to the key but it won't work for other types of files.


title: download packages for different distribution with apt

text: I want to download a `.deb` package with it's dependencies for a different distribution. I have many Linux systems in my company: Ubuntu 11.04, 11.10, 12.10, and Debian 5 and 6. The command to download a full dependency tree would be `apt-get -d install package`. I'm currently using a Debian 6 (squeeze), and downloading packages for the same distribution works fine. I tried downloading ( _without_ installing) packages tree by changing my `sources.list` into Debian 5 (lenny) sources. However I get the following error:               # apt-get -d install python-lxml     ...     The following packages have unmet dependencies:      python-lxml : Depends: python (< 2.6) but 2.6.6-3+squeeze7 is to be installed     E: Broken packages      Running a different OS for each distro will result in 12+ machines. I'm looking for a clearer solution. Any suggestions?


title: How to backup wlan configuration?

text: I'm using Lubuntu 11.10 and I'd like to copy all files containing the configuration to access all wireless network which I usually use. At home or at office it connects automatic. I know that I can edit the connection using the icon but I believe that there is a file containing the login and passwords and all the protocols, anyway, all the set up to the wireless connections. Any help?


title: What should/shouldn't go in .zshenv, .zshrc, .zlogin, .zprofile, .zlogout?

text: The title says it all. I'm looking for guidelines on what one should and should not include in the various startup files for `zsh`. I understand the order of sourcing of these files, and the conditions under which they are sourced, but it is still not clear to me what should go in each.


title: How can I parse my String using regular expression to get only certain number of matches?

text: I am currently using this following regular expression to split my String into groups.               ^([a-zA-Z0-9]*)(\[([a-zA-Z0-9=]*)\]){0,1}@([a-zA-Z0-9]*)$          Pty[R=4]@ID      I am getting four groups               1) Pty     2) [R=4]     3) R=4     4) ID      But, I need only three groups               1) Pty     2) R=4     3) ID      This regular expression should be also be able to accept Pty@ID to get two groups               1) Pty     2) ID      How can I achieve this?


title: What is needed for USB a device to appear under Sound in Ubuntu control panel?

text: I have a device that combines two audio interfaces and one HID interface. It enumerates correctly, as `lsusb -D` shows. Also, a trace with `wireshark` shows no errors - all descriptors are exchanged successfully, `Set Interface` requests are issued by the host and are acknowledged by the device. `dmesg` also does not complain:               sw3@pc90313-sw3:~$ dmesg | tail     [ 6897.106331] input: Logitech USB Optical Mouse as /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.3/1-1.3:1.0/input/input14     [ 6897.106516] hid-generic 0003:046D:C05A.0007: input,hidraw0: USB HID v1.11 Mouse [Logitech USB Optical Mouse] on usb-0000:00:1a.0-1.3/input0     [ 6902.395444] usb 3-1: new high-speed USB device number 45 using xhci_hcd     [ 6902.413395] usb 3-1: New USB device found, idVendor=23e5, idProduct=a050     [ 6902.413400] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0     [ 6902.413403] usb 3-1: Product: Device     [ 6902.413405] usb 3-1: Manufacturer: Me     [ 6902.417288] current rate 44100 is different from the runtime rate 192000     [ 6902.420775] current rate 44100 is different from the runtime rate 192000     [ 6902.424214] hid-generic 0003:23E5:A050.0008: hiddev0,hidraw3: USB HID v1.11 Device [My Device] on usb-0000:00:14.0-1/input3      Yet the device does not appear in the Sound menu in the configuration panel of Ubuntu. My reasoning is, if the configuration descriptor was wrong, and the host didn't know that the device is an audio device, there wouldn't be `Set interface` requests (those serve for muting and unmuting). I want to dig deeper and find out where in the chain is the device not recognised as an audio device. However, my Linux knowledge is meager and I do not know which logs to read, which utilities to use and how to circumvent "Sound" menu on the next lower level of abstraction. _What is the process of adding a device to the Sound menu and at what points can it be observed?_


title: How can I list my `at` jobs by date?

text: I am using > atq command, but I need to list my at jobs by date. How is that possible ?


title: How to exit sh program?

text: I bungled the commands and wrote `sh -man` Now I've entered a program called `sh-3.2` that is seemingly impossible to exit. `Ctrl``c`,`Ctrl``z`, or `Ctrl``x`does not work. `exit`, `quit`, `q`, `:``q` also does not work. All google answers are for exiting shell scripts programmatically.


title: Execute shell script directly, without .sh file

text: Should it be possible to just write something like               for i in 1 2 do echo $i done      in the command line and have it run? Because when I try to do this, nothing happens but > being printed each time I press enter.


title: Cron job is not working

text: i have a cron job c`enter code here`onfigured at `var/spool/cron/testuser`, Am calling "adindex.sh" file from there. Am getting results when am directly put the command directly in prompt(php and sh), But cron is not processing this one. I tried to log the cron using `tail -f /var/log/cron` and got:               Feb 19 04:05:01 ip-118-139-177-76 CROND[18164]: (inwhosting) CMD (/home/testuser/cronlogs/adindex.sh)      Edit: Output for crontab -l               MAILTO=""     */5     *       *       *       *       /home/testuser/cronlogs/adindex.sh     */5     *       *       *       *       /home/testuser/cronlogs/sendemail.sh     */5     *       *       *       *       /home/testuser/cronlogs/sendsms.sh      Ouput of cat /home/testuser/cronlogs/adindex.sh               #wget --user=admin--password=pswd123 http://www.exmaple.com/advertiser/cron/updateindex?cron_key=Inw1234 -O /home/testuser/cronlogs/ad/log_`date "+%Y_%m_%d_%H_%M"`.txt          php /var/www/html/exmaple/cron/advt_index.php     php /var/www/html/exmaple/cron/ad_index.php      Anybody please tell me what is going wrong?


title: Color scheme is lost on shell change

text: My default login shell is `ksh` which shows my default color scheme which i set via putty. But when i change my shell to `bash` my color scheme is lost. Is there a way to retain the color scheme? EDIT: In order to set colors of my console window via putty , i used this link : http://vim.wikia.com/wiki/Desert_color_scheme_with_Vim_in_PuTTY


title: B.A.T.M.A.N. working with cable, not with wireless

text: I'm creating a mesh network with B.A.T.M.A.N.. The version is _2011.4.0_ in host A, _2012.3.0_ in host B. I've setup the network as explained here. I can ping `bat0` interfaces if the connection is done with ethernet cable:               # Host A     ifconfig eth2 mtu 1528     batctl if add eth2     ifconfig bat0 192.168.6.6          # Host B     ifconfig eth0 mtu 1528     batctl if add eth0     ifconfig bat0 192.168.6.7     ping 192.168.6.6 ## Ping ok      If i switch to wireless adhoc, without security, this doesn't work.               # Host A     ifconfig eth1 mtu 1528     batctl if add eth1     ifconfig bat0 192.168.6.6          # Host B     ifconfig wlan0 mtu 1528     batctl if add wlan0     ifconfig bat0 192.168.6.7     ping 192.168.6.6 ## No ping!!!      I'm sure the wireless connection is working because I can ping hosts if I assign ip to wireless interfaces:               # Host A     ifconfig eth1 192.168.99.6          # Host B     ifconfig wlan0 192.168.99.7     ping 192.168.99.6 # Ping ok      I've tried to setup wireless with `iwconfig` and with `wpa_supplicant` but the result doesn't change. Any idea? ### EDIT 1 After some investigations in logs, I've found these interesting lines (host B) repeating:               [   7267780] Received BATMAN packet via NB: 90:4c:e5:__:__:__, IF: wlan0 [00:0b:81:__:__:__] (from OG: 90:4c:e5:__:__:__, via prev OG: 90:4c:e5:__:__:__, seqno 2, ttvn 1, crc 53338, changes 1, td 255, TTL 50, V 14, IDF 0)     [   7267780] updating last_seqno: old 1, new 2     [   7267780] bidirectional: orig = 90:4c:e5:__:__:__ neigh = 90:4c:e5:__:__:__ => own_bcast =  0, real recv =  2, local tq:   0, asym_penalty:  24, total tq:   0     [   7267780] Forwarding packet: tq: 0, ttl: 49     [   7267780] Forwarding packet: rebroadcast neighbor packet with direct link flag      So... _host B_ is receiving something from _host A_! But ping isn't working and `batctl o` says _"No batman nodes in range ..."_


title: What would happen if the amount of free memory (vm.min_free_kbytes) was too low?

text: I came across the following parameter in kernel settings (in sysctl):               vm.min_free_kbytes      This is the amount of free memory (RAM) that's always free no matter what. In my case, I have only 1 GiB of RAM, and this parameter was set to about 64MiB. I thought that's pretty high, so I lowered it to 8MiB so far. I don't know if I can lower it any further, or if lowering it to 8MiB can cause any troubles, so the question is what would happen if the amount of the free memory was too low? Can I safely lower the value to 1MiB?


title: Connect To Wifi on Arch Linux

text: I have a fresh installation of Arch Linux. During the install I used `wifi-menu` to connect to wifi. After the installation I tried to use it and it said I needed to install `dialogs` to use it - which wasn't possible because I currently had no access to the Internet. As a side note the laptop I use is a Sony Vaio Pro 13. It doesn't have an Ethernet connection because it's so thin. So I am forced to use wireless. I have read the docs and attempted to use `netctl` but it fails to connect and returns an error that I need to install `wpa_supplicant` - Again I can't install because I cannot connect to the net. What other solutions do I have available in order to connect to my access point so I can download the necessary packages? Btw, `iw` is not installed. It also appears `ifconfig` and `ipconfig` are not installed, which doesn't seem right.


title: How to tell if two ethernet interfaces are on the same lan?

text: I have to secure interfaces on Linux servers by setting bonding interfaces. The cabling information is not accurate. Is there a simple way to know if two interfaces are connected to the same LAN? Some interfaces have no IP, if possible I would prefer to not set dummies IPs. * * * I finally did it using `mping`, which was already available on the servers. Installing new commands without going through the change process was considered non ethical by the change managment. Type this into one terminal:               ifconfig eth2 up      ifconfig ethO up      tcpdump -i eth2 -c 3 arp net 10.10.10.10      and in another one that:               arping -D -I eth0 10.10.10.10      `tcpdump` should displays lines like that:               16:15:43.032103 arp who-has 10.10.10.10 (Broadcast) tell 0.0.0.0     16:15:44.032277 arp who-has 10.10.10.10 (Broadcast) tell 0.0.0.0     16:15:45.032441 arp who-has 10.10.10.10 (Broadcast) tell 0.0.0.0      _`-D` is optional but it give a nice 0.0.0.0 source address, which I prefered as I was broadcasting and seemed unlikely to trigger any reply_.


title: ssh-agent not adding key when started graphically

text: Recently I added the following script to my auto-start (in KDE):               eval `ssh-agent`     ssh-add      The script should be started at login and ask for my passphrase and load my secret key. It does almost fine. The scripts is executed right and the agent is started and the environment variables are all set and I'm asked for my passphrase. The only problem is that the key is not loaded after that. But if I then enter ssh-add into a terminal I'm asked for my passphrase and the key is stored for the rest of my X-session. What am I doing wrong? Why is the key not loaded, even though I'm asked for my passphrase? PS: I'm running on Debian jessie.


title: xubuntu (main HD) and Kali (second HD) both LVM encrypted but Kali won't appear in grub?

text: * /dev/sda = xubuntu 14.04 Trusty Tahr   * /dev/sdb = Kali Linux   * /dev/sdc = Windows 7 Ultimate I installed xubuntu with grub, and Kali without. Both are luks-encrypted drives with LVM. Kali doesn't show up in xubuntu's grub, though. Is it because of the encryption? How do I work around this to add Kali to the grub menu? _Updating grub_ :               shu@shubuntu:~$ sudo update-grub     Generating grub configuration file ...     Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.     Found linux image: /boot/vmlinuz-3.13.0-30-generic     Found initrd image: /boot/initrd.img-3.13.0-30-generic     Found linux image: /boot/vmlinuz-3.13.0-24-generic     Found initrd image: /boot/initrd.img-3.13.0-24-generic     Found memtest86+ image: /memtest86+.elf     Found memtest86+ image: /memtest86+.bin     Found Windows 7 (loader) on /dev/sdc1     /usr/sbin/grub-probe: warning: Couldn't find physical volume `(null)'. Some modules may be missing from core image..     /usr/sbin/grub-probe: warning: Couldn't find physical volume `(null)'. Some modules may be missing from core image..     /usr/sbin/grub-probe: warning: Couldn't find physical volume `(null)'. Some modules may be missing from core image..     /usr/sbin/grub-probe: warning: Couldn't find physical volume `(null)'. Some modules may be missing from core image..     /usr/sbin/grub-probe: warning: Couldn't find physical volume `(null)'. Some modules may be missing from core image..     done


title: RFCOMM device seems to be missing (dev/rfcomm0)

text: I am trying to send and receive serial commands over bluetooth. I have installed pyBluez library. The issue is that while the rfcomm.conf exists there is no rfcomm0 in /dev/ directory. I rebooted but no change. If I run the following I get Permission denied error.               sudo echo "This is a test" > /dev/rfcomm0      Why isn't the rfcomm added automatically to /dev after usb bluetooth module is connected? Bluetooth module is compatible and I am able to scan and find devices via command line. Bluez and bluez-utils were installed already.


title: Can I increase brightness of text in Arch shell?

text: I just installed Arch Linux. All I have right now is the shell. The text is very difficult to read on a black background. My eyesight is fine. Can I change the brightness of the text, or can I only change the font?


title: Grouped aggregate utility (like SQL GROUP BY)?

text: Unix has several utilities for performing relational algebra-like operations on streams (`grep`, `join`, `cut`, additional things with `awk`). Is there a grouped aggregate utility readily available (or installable on most Linux distros)? The goal would be to take a file with some keys in one column and values in another, such as:               foo.txt   u1    394082     bar.txt   u2    3948     frob.c    u1    29322      And output a file that has the unique values of one column, along with some aggregate of the values in another column. For example, the sum of the 3rd column by the 2nd:               $ aggregate --sum=3 --group-by=2 <data     u1 423404     u2 3948      Does such a utility exist (Perl, Awk, etc. one-liners don't count), or is it something waiting to be written?


title: Is there a way to simulate a "Close" event on various windows using the terminal?

text: I answered on Ask Ubuntu Quit all instances of `gnome-terminal` via a command but as you all can read `gnome-terminal` didn't seems to have a `SIG`call I could use to simulate this "Close" event. So this lead me to ask, is there a way in GNOME/KDE/LXDE/{put your window/desktop manager/environment here} to simulate the "Click in close button" event? I have read different questions that could have any relation to this, but don't answer this. What I'm looking is for a _global_ command (if exist) to do this in different scenarios. If none exist, please explain how the "Close" button works. Posible uses:   * I open a set of applications for a determinated task, and want to close all of them (when no longer used) in a single stroke/command without suppress any _You want to save your work?_ alerts.   * Close all the `gnome-terminal` instances but warn me if there is child process still running.   * Nothing else comes into my mind right now...


title: Here document and input redirection with -

text: What does the following command do? In particular I don't understand the role of `-` in input redirection.                cat <<-EOF | command $argument         first option                   second option         EOF      Is it mandatory to have the `-` in the input redirection?


title: Changed /etc/ssh/sshd_config. Now can't get to SU. Am I screwed?

text: To allow one of my users ssh access I added the line               AllowUsers user      to my sshd_config. I gave the box a reboot and attempted to ssh back in as superuser. I was unable to do so. I have my keys- both public and private locally, but I'm guessing the change in the config is preventing me logging in. However I can get into the `user` account. This is just a EC2 VM, so there's no desktop trick I can try. `user` has just standard permissions


title: privoxy unable to take any additional connections

text: I run a public proxy and I've got about 400 clients, but when I check the logfile:               /var/etc/privoxy/logfile      I get lots of: > unable to take any additional connections. In `/etc/privoxy/config` I have set `max-client connections` to 100000000000000 and I'm still getting the error. What is going on? My server is powerful and I'm not getting any lag or problems with the internet connections on it. In the config file it says that connections are limited to the resources of the server, but I guess this is not the case here?


title: sed how to substitute when string has "http://" in it?

text: I have a file `xx` that has the following contents:               @base_url = "http://dmstaffing-stage.herokuapp.com/"      I want to use sed to eliminate this line (replace with nothing). I have used this sed technique with several other line successfully, e.g.               sed -i 's/require "selenium-webdriver"//' xx      But my attempt for the @base_url line isn't working. I suspect either the " or the // in the http:// are messing it up but I can't seem to fix! I have tried:               $ sed  's/@base_url = "http://dmstaffing-stage.herokuapp.com/"//' xx     sed: -e expression #1, char 23: unknown option to `s'          $ sed  's/@base_url = \"http://dmstaffing-stage.herokuapp.com/\"//' xx     sed: -e expression #1, char 24: unknown option to `s'          $ sed  's/@base_url = "http:\/\/dmstaffing-stage.herokuapp.com/"//' xx     sed: -e expression #1, char 58: unknown option to `s'      but none worked.


title: Give default write permission to group to any newly created files and folders

text: Let's say that we have 2 users: a and b, that are both part of group general. I would like that any file or folder that A creates, would have write permission to the group GENERAL. How can I do it? For instance, the newly created file is set as:               -rw-r--r-- 1 a general      This doesn't give write permission to the group general


title: How are Gnome shell extensions supposed to be managed?

text: I'm having trouble understanding the intended way of managing Gnome shell extensions. I can't find any appropriate programs in the Dash for doing that. The only way I can actually manage extensions is via extensions.gnome.org. It's impossible that this page is supposed to be the tool for managing extensions - it makes absolutely zero sense (it breaks UX, for one). Please tell me that there is a plan for a native application aimed at managing these handy extensions.


title: Why were tables built into ipchains?

text: Why are tables built into `ipchains`? What was the benefit of adding tables to `ipchains`? Is there a simple scenario that would illustrate how tables are used to increase performance or offer some other benefit?


title: What don't I need to backup?

text: I'm trying to do a simple system backup (with cpio or tar), and I was looking for what I need to back up and found this question. The answer was basically, "it depends on what you're running on your machine". If there is a disk failure, I want to easily get my server running again without having to reinstall a lot of things. I'm using a web server and a fair amount of 3rd party programs. I'm thinking I'll back up everything except the absolutely unnecessary. So are there any directories that I shouldn't backup because it would be a waste of time and disk space?


title: Choosing a device name under /dev from the kernel command line

text: I am booting CentOS via a USB install. The boot method is simply booting the ISO from GRUB2 installed on the USB Key. The USB key always gets the "name" `/dev/sda`. Can I change that name from the kernel command line? Just adding some info: When I boot Debian from an external USB hard-drive, that hard drive is labeled /dev/sdb, and the one inside the laptop is labeled /dev/sda. This really enhances my suspicion I can control the labels, but how ?


title: No output to log from tee when starting mplayer as an arg to gnome-terminal

text: I want to view mplayer's normal terminal output, and also write it to a log.   That works fine when I run mplayer from the commandline, eg:               mplayer "$HOME/gdr01.wav" 2>&1 |tee $HOME/junk.log      However, I want to launch mplayer in it's own gnome-terminal window. Neither of the following commands write to the log, althought the terminal display works.               (gnome-terminal -e "mplayer $HOME/gdr01.wav 2>&1 |tee $HOME/junk.log" &)      gnome-terminal -e "mplayer $HOME/gdr01.wav 2>&1 |tee $HOME/junk.log" &      What is at play here, and what is the trick to get it to work? _EDIT:_ The problem is that I get the _terminal's_ mesages being written to the log (eg. an `ibus` warning). However, although _mplayer_ generates thousands of lines, none are written to the log.


title: Trouble understanding the Debian bug reporting system

text: I am currently experiencing this bug, except that I'm using the Wheezy/testing netinstaller. Strangely, I used the netinst .iso a few months ago, and everything was fine. So it almost seems as if the same bug keeps creeping back into the system. That said, I have a very hard time understanding the format of the bug reporting system. What does 'archived' mean? Does that mean it was fixed? And what should I do to report my bug, given that it's with the most recent version of the installer?


title: What is the max number of x-clients?

text: I am developing an x-server implementation, and I want to make it as similar to the current one as possible. I read through the documentation, but I couldn't find anything specific. In particular, I'm trying to find a numbering scheme for windows. It seems to me that this is implementation specific. Either way, I found this concerning window ids: > The most significant 11 bits of the XID indicate the client, leaving 21 bits > for each client, giving each client 2^21 (= 2,097,152) XIDs. I've read elsewhere that the max x-clients is 255: here and here. Is there any clear documentation on how windows should be numbered?


title: Create bootable hfs+ partition for macbook

text: I've installed Debian testing on a Macbook Pro (mid 2014) without keeping OS X on the internal SSD. I've used the following GPT partition layout:   1. HFS+   2. EFI on /boot/efi   3. BTRFS on /   4. SWAP on swap I've heard that the Apple implementation of UEFI is different and only boots from a HFS+ partition instead of the default FAT32 partition, so i decided to create a HFS+ partition. The Debian installer automatically installed Grub 2 to the EFI partition, when i manually issue grub-install to the HFS+ partition, grub-install fails. I'm a bit in the dark about how Fedora/Ubuntu solves this problem, those distributions create a HFS+ partition and get it to boot after the install. I'd like to avoid using refind because i'm not using OS X anymore. I do however have OS X installed on a SD card. How can i get my laptop to boot Debian directly without using refind?


title: Downgrade PHP 5.4 -> 5.3 on CentOS 5.10

text: Due to being in some dependency hell and some issues with PHP 5.4, we downgraded from PHP 5.4 -> 5.3. Since doing so, a few of our web apps are acting strange. E.g: `# php index.php` Results in: `Parse error: syntax error, unexpected $end in... on line 14` Usually this indicates someone forgot to close some curly brackets or close off `<?php` or `{` or something - but I've checked that and doesn't appear to be any syntax problems. It was also working fine prior to the downgrade. Any ideas? After down-grade: `[root@server ~]# php -v PHP 5.3.3 (cli) (built: Dec 10 2013 22:12:52) Copyright (c) 1997-2010 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies [root@server ~]# rpm -qa | grep php php53-common-5.3.3-22.el5_10 php53-mysql-5.3.3-22.el5_10 php53-xml-5.3.3-22.el5_10 php53-ldap-5.3.3-22.el5_10 php- pear-1.9.4-27.el5.remi php53-5.3.3-22.el5_10 php53-imap-5.3.3-22.el5_10 php53-pdo-5.3.3-22.el5_10 php53-gd-5.3.3-22.el5_10 php53-process-5.3.3-22.el5_10 php53-cli-5.3.3-22.el5_10 php53-devel-5.3.3-22.el5_10 php53-mbstring-5.3.3-22.el5_10` [Update/edit: even stranger - many of the PHP files are working fine if I call them from the command line but when I hit them via the browser/apache, they return nothing.]


title: AIX NIM Master replicate / sync fails to an Alternate Master

text: I am getting a error when I try to replicate / sync my NIM database and resources to an Alternate NIM Master newly created in my environment:               error replicating resources: unable to /usr/lpp/bos.sysmgt/nim/methods/c_rsh <my_server_hostname>      I already have the APAR IZ67043 installed on my system. Is there any workaround for this situation? smitty fastpath used:               # smitty nim_mac_op_sync_hdr      command executed:               # nim -Fo sync -a replicate=yes <nim_alt_master_hostname>      My environment info: Power 780 (P7+) oslevel: 6100-07-081339


title: How do I run as a limited user while logged in as Root, and another question

text: Is there a way to, on linux, do:   1. run as limited user when logged in as root? (like sudo but vice versa, so instead of GRANTING rights, it limits them, i.e., for use with "bundle install" for missing ruby dependency gems for Metasploit-framework, etc);   2. remove ALL dangling symlinks on the system as a whole, all in one full swoop, like how aptitude search/purge ~c does for leftover configuration files, but only to, or also to clean up invalid, dangling symlinks?


title: Getting two fields from same line together

text: I've got a situation where I've got several lines, and I need two different fields out of each of them. To be specific, I have a list of references in a bibliography and I want to get the last name and the year. Sample input:               Aloise-Young, P.A. (1993). The development of self-presentation.  Self-promotion in 6- to 10-year-old children. Social Cognition, 11, 201-222.     Banerjee, R. (2002). Children's understanding of self-presentational behavior: Links with mental-state reasoning and the attribution of embarrassment. Merril-Palmer Quarterly, 48, 378-404.     Bennett, M., & Wellman, H. (1989). The role of second-order belief-understanding and social context in children's self-attribution of social emotions. Social Development, 9, 126-130.      Desired output:               Aloise-Young 1993     Banerjee 2002     Bennett 1989      I can get the last names with `cat file | cut -d, -f1` I can get the years with `cat file | grep -o "[[:digit:]]\\{4\\}"` My problem is that now I have two separate outputs and I don't know how to combine them in the way I want. Any ideas? I suspect maybe `awk` can do what I need, but I'm a bash noob and I don't know `awk` yet.


title: How to enable Virtualization AMD-V Aspire one AO725 from BIOS or otherwise

text: I'm try to use the virtualbox to visualizer the system of 64bits but the error that get is:               La aceleración VT-x/AMD-V ha sido habilitada, pero no es funcional. Su sistema invitado de 64-bit fallára al detectar una CPU de 64-bit y no podrá arrancar.     Compruebe que VT-x/AMD-V están habilitadas en la BIOS de su computadora anfitrión.      _For the ones not knowing Spanish, google translate gives:_               VT-x/AMD-V acceleration has been enabled but is not functional.      Its system of 64-bit guest will fail to detect a 64-bit CPU and will not boot.     Check VT-x/AMD-V are enabled in the BIOS of your host computer.      I've checked the AMD V CPU Virtualization Extensions with the following command:               grep --color svm /proc/cpuinfo      The output is:               flags  : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat              pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb              rdtscp lm constant_tsc rep_good nopl nonstop_tsc extd_apicid perfmperf              pni monitor ssse3 cx16 popcnt lahf_lm cmp_legacy svm extapic              cr8_legacy abm sse4a misalignsse 3dnowprefetch ibs skinit wdt arat cpb              hw_pstate npt lbrv svm_lock nrip_save pausefilter     flags  : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat              pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb              rdtscp lm constant_tsc rep_good nopl nonstop_tsc extd_apicid              aperfmperf pni monitor ssse3 cx16 popcnt lahf_lm cmp_legacy svm              extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch ibs skinit wdt              arat cpb hw_pstate npt lbrv svm_lock nrip_save pausefilter      Running the command `lscpu`               Architecture:          x86_64     CPU op-mode(s):        32-bit, 64-bit     Byte Order:            Little Endian     CPU(s):                2     On-line CPU(s) list:   0,1     Thread(s) per core:    1     Core(s) per socket:    2     Socket(s):             1     NUMA node(s):          1     Vendor ID:             AuthenticAMD     CPU family:            20     Model:                 2     Stepping:              0     CPU MHz:               800.000     BogoMIPS:              1996.36     Virtualization:        AMD-V     L1d cache:             32K     L1i cache:             32K     L2 cache:              512K     NUMA node0 CPU(s):     0,1      **Update** Run the command:               grep -o "^flags\s*:.*\ssvm\(\s\|$\)" /proc/cpuinfo      the output is:               flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc extd_apicid aperfmperf pni monitor ssse3 cx16 popcnt lahf_lm cmp_legacy svm      flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc extd_apicid aperfmperf pni monitor ssse3 cx16 popcnt lahf_lm cmp_legacy svm       so, It's possible fixed it's from the bios or otherwise. How to fix the mistake? Is it possible at all?


title: Back up snapshots without being admin

text: I would like to make a back up/snapshot of a folder where I have built various programs (~4.1 GB in size). The idea is to be able to **quickly** restore everything in this path to it's original state in case something happened to the drive where it resides. One limitation I have is that I do not have access to the hardware nor sys rights to this machine (not sure if I may need them when _restoring_ things) Can I preserve every file, permission, timestamp, symbolic link, etc. in a tar file? Most importantly, would that be enough to later restore every single file and program to a working state? If tar is not an adequate for this task, what are my alternatives? Are there any other (free) command line tools that are better for this job?


title: How root can make sure that this time sudo will not prompt for password a specific user?

text: I am writing a script, that will setup `lxc` on the host, and then configure a container. I want this script to be unattended. After the container is created and run, there is a moment, when I want to log in as the user and perform some commands with `sudo`. I know how to setup ssh to let me login without asking any questions. The only bit that is left, is to make sure, that I can do the `sudo`. I don't want to disable the `sudo` - I just want to mimic a situation, when the user actually puts the password. So far I made the following:               if [ ! -d /var/lib/lxc/$puppetmastername/rootfs/var/lib/sudo/$user ]; then         sudo mkdir /var/lib/lxc/$puppetmastername/rootfs/var/lib/sudo/$user     fi     sudo touch /var/lib/lxc/$puppetmastername/rootfs/var/lib/sudo/$user/0          sudo grep '!tty_tickets' /etc/sudoers     if [ $? -ne 0 ]; then         echo 'Defaults         !tty_tickets' >>/var/lib/lxc/puppetmaster/rootfs/etc/sudoers     fi      Unfortunately, it is insufficient, the container still asks for password.


title: Forward SIGTERM to child in Bash

text: I have a Bash script, which looks similar to this:               #!/bin/bash     echo "Doing some initial work....";     /bin/start/main/server --nodaemon      Now if the bash shell running the script receives a SIGTERM signal, it should also send a SIGTERM to the running server (which blocks, so no trap possible). Is that possible?


title: How can I install Linux on a UEFI system with Secure boot?

text: My motherboard is a Gigabyte 990XA-UD3 (CPU 1), it's a UEFI -Dual boot, and when I try installing Linux Mint 16 Cinnamon or Ubuntu 13.10 it always bring this error               (initramfs) Unable to find a medium containing a live file system.      I put all my BIOS config in legacy options, disabled UEFI, but still the same error. Right now I am running Windows 8.1 64b I use Universal USB installer and made a live USB


title: Packets sent through TUN interface not routed

text: I have a C program attached to a TUN interface. In my C program, I'm building packets and writing them to the TUN interface. Now to check if packets are really sent from my TUN interface I use iptables rules to log them: `#iptables -t mangle -A PREROUTING -j LOG --log-prefix "PREROUTING-MANGLE " --log-level 4 #iptables -t mangle -A INPUT -j LOG --log-prefix "INPUT-MANGLE " --log-level 4 #iptables -t mangle -A FORWARD -j LOG --log-prefix "FORWARD- MANGLE " --log-level 4` I can see log messages in the PREROUTING chain, which means packets are correctly sent from the TUN interface. But I can't see packets hit other chains. I have correctly configured my routing rules and the forwarding option is activated. Is there any way to log dropped packets or to know the reason why are they dropped? Any help would be very appreciated!


title: xscreensaver logs non-existent login attempts

text: I am using xscreensaver to lock my screen. When the screen is locked, any mouse movement brings up the login dialog. After a timeout, login fails with the message "authentication via PAM timed out" The problem is that since nobody tried to log in (i.e. nobody typed password and confirmed with enter), this should not be considered a login attempt. And therefore should not be logged as such (should not be loged at all) I often move the mouse just to make sure my screen is locked. Then, my auth log is flooded with useless logs which make the other, important information harder to see. Is there any way to fix this ? I am using xscreensaver 5.15-3 installed from a package in Debian Wheezy. I would be happy to recompile my package, if this problem could be fixed. # UPDATE: I have noticed, `xscreensaver` is using it's own `pam` configuration file: `/etc/pam.d/xscreensaver`. Is there perhaps a way to modify the pam file to fix this problem? Perhaps ignoring "login attempts" when the password is empty?


title: Recursively iterate through files in a directory

text: Recursively iterating through files in a directory can easily be done by:               find . -type f -exec bar {} \;      However, the above does not work for more complex things, where a lot of conditional branches, looping etc. needs to be done. I used to use this for the above:               while read line; do [...]; done < <(find . -type f)      However, it seems like this doesn't work for files containing obscure characters:               $ touch $'a\nb'     $ find . -type f     ./a?b      Is there an alternative that handles such obscure characters well?


title: How to bypass WD MyBook Essential external HDD hardware lock?

text: I have a Western Digital Mybook Essential external HDD 2TB which is password locked. Well with my old OS it showed me that is unlocked, but as I changed the OS it's showing that is locked, I've already tried all the possible combinations of passwords that I could remember but no luck. I'm using Knoppix now to access the HDD somehow but I don't know how.   * `fdisk -l` doesn't show the HDD.   * `lsusb` is showing me that it's connected   * In `/media/sr1` appears the WD Unlocker mounted, but the HDD itself is not showing. If I can't access the HDD by bypassing the lock then it's even possible then to retrieve the data from it if I format the locked HDD? Because as I've read the hardware locked devices have a formating technique after which the data cannot be retrieved (is this true?).


title: Obtain .cer file from .pem file

text: I have generated RSA private key using below command:               openssl genrsa -out privkey.pem 2048      And created a self signed certificate using below command:               openssl req -new -x509 -key privkey.pem -out cacert.pem -days 3650      Now I am trying to convert cacert **.pem** file to certificate **.cer** Any ideas?


title: Where is CONFIG_APM in kernel - 2.6.38.8

text: From here: http://www.xenomai.org/documentation/xenomai-2.6/TROUBLESHOOTING > Q: Which CONFIG_* items are latency killers, and should be avoided ?   >  ...   >  APM: The APM model assigns power management control to the BIOS, and BIOS > code is never written with RT-latency in mind. If configured, APM routines > are invoked with SMI priority, which breaks the rule that adeos-ipipe must > be in charge of such things. DISABLE_SMI doesnt help here (more later). **The problem is that I am not able to find this APM thing anywhere.** ![enter image description here](http://i.stack.imgur.com/11SK9.png) ![enter image description here](http://i.stack.imgur.com/CXIv4.png) **"ACPI (Advanced Configuration and Power Interface) Support"** results in the following menu:                --- ACPI (Advanced Configuration and Power Interface) Support     [*]   Deprecated /proc/acpi files     [*]   Deprecated power /proc/acpi directories      <M>   ACPI 4.0 power meter      < >   EC read/write access through /sys/kernel/debug/ec (NEW)     [*]   Deprecated /proc/acpi/event support     <M>   AC Adapter     <M>   Battery     {M}   Button     {M}   Video     <M>   Fan     [*]   Dock     <M>   Processor     < >   IPMI (NEW)     <M>   Processor Aggregator     <M>   Thermal Zone     -*-   NUMA support     ()    Custom DSDT     Table file to include     [*]   Debug Statements     [ ]   Additionally enable ACPI function tracing     <M>   PCI slot detection driver     {M}   Container and Module Devices (EXPERIMENTAL)     <M>   Memory Hotplug     <M>   Smart Battery System     < >   Hardware Error Device (NEW)     [ ]   ACPI Platform Error Interface (APEI) (NEW)      Please help.


title: Segmentation fault while doing `sudo su -`

text: I am getting a segmentation fault error while doing `sudo su -` or `sudo su - username` in Linux Server (RHEL 4.7). Can any one help me resolve this issue? Linux server (RHEL 4.7) is a LDAP client.


title: cp -f cannot overwrite cp -i alias

text: In my /home/user/.bashrc file, I have those aliases to prevent mistakes:               alias rm='rm -i'     alias cp='cp -i'     alias mv='mv -i'      If I'm really sure of what I'm doing, I can overwrite `rm` and `mv` aliases using `rm -f` or `mv -f`, it will not ask me if I really want to overwrite files. The problem, is that it doesn't work for the `cp` command, using `cp -f` will still ask me a question. Is this normal? What should I do in order to have `cp -i` alias by default and be able to use `cp -f` command too? I'm using Debian Wheezy 64bit.


title: What is the difference between `terminator -e ranger` and ranger from terminal?

text: EDIT: I just noticed that when I hit `Enter` on the `ranger` (if it is executed with `terminator -e ranger`) then nano opens while with `e` it uses my main editor. In contrast, when I use a normal shell to execute `ranger` and then I hit `Enter`, my main editor shows up. By normal, I mean if I launch firstly the `terminator` and then the `ranger`. Why is it different?


title: Fedora-GRUB in Mint

text: I want to install the GRUB2-Layout of Fedora in Mint. (I'm a new user, so I can't upload images. :( The image is here: http://ryanlerch.fedorapeople.org/Selection_045.png) Does anybody know, how I can do that?


title: Skype hangs on Slackware when terminating the call

text: I have Skype 4.0.0.8, installed on Linux Slackware 14.0, kernel 3.7.0-smp+. It works, but every time when I click upon stop conversation button, skype hangs and I have to kill it. How can I debug it to learn, what's causing trouble? Maybe, try using Windows skype through Wine?


title: Filtering the Xth element in a row?

text: For example, I want to get **only the 3rd element** in each row when I call:               xinput --list --short|grep "slave  pointer"      I get the output:               ⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]     ⎜   ↳ SynPS/2 Synaptics TouchPad                id=11   [slave  pointer  (2)]     ⎜   ↳ MCE IR Keyboard/Mouse (ite-cir)           id=12   [slave  pointer  (2)]     ⎜   ↳ Logitech Unifying Device. Wireless PID:101a   id=14   [slave  pointer  (2)]      I would like to get only the names like "SynPS/2 Synaptics TouchPad", ... I saw somewhere a solution with awk and print somehow, but isn't there a simpler solution to achieve that **without** `awk` or `perl` or such?


title: bash script , echo output in box

text: I have created this Function , which generate below output on terminal , but this function seems complex, So I posted here for any improvement or for same alternate solution. ![enter image description here](http://i.stack.imgur.com/fcvET.png)               #!/bin/bash     function box_out() {             input_char=$(echo "$@" | wc -c)             line=$(for i in `seq 0 $input_char`; do printf "-"; done)             # tput This should be the best option. what tput does is it will read the terminal info and render the correctly escaped ANSI code for you. code like \033[31m will break the readline library in some of the terminals.             tput bold             line="$(tput setaf 3)${line}"             space=${line//-/ }             echo " ${line}"             printf '|' ; echo -n "$space" ; printf "%s\n" '|';             printf '| ' ;tput setaf 4; echo -n "$@"; tput setaf 3 ; printf "%s\n" ' |';             printf '|' ; echo -n "$space" ; printf "%s\n" '|';             echo " ${line}"             tput sgr 0     }          box_out $@


title: how to pipe find's output into another find

text: In searching how to make `find` sort the files it finds based on modification time I found this answer which provides the following incantation:               find . -type f -printf '%T@ %p\n' | sort -k 1nr | sed 's/^[^ ]* //' | head -n 10      The problem with the above is that I can't memorize it and I can't figure a way to package it as a shell script so that I can feed it with my own invocation of `find` where I 'll have the option of applying whatever arguments I want. E.g. how can I package the above in the form of a shell script "`showLatest`" so I can do things like the following?               find src -type f -iname \*.py | showLatest 10


title: How can I configure all dependencies before installation?

text: I'm new for FreeBSD and currently I'm installing many ports and many of them have a long list of dependencies, I'm tired of wait to finish the installation of one dependency to configure the installation of the next dependency. Is there a way to facilitate this task ?


title: Know which directory is "mount -o bind" by asking the kernel (Linux)

text: If I do `mount -o bind /my/dir /mnt/tmp`, I can see the content of `/my/dir` within `/mnt/temp`. However, if I type `cat /proc/mounts`, I get the following output:               /dev/sda7 /my ext4 rw,relatime,user_xattr,barrier=1,data=ordered 0 0     /dev/sda7 /mnt/tmp ext4 rw,relatime,user_xattr,barrier=1,data=ordered 0 0      As you can see, I know that `sda7` is the underlying device, but I don't know which directory within that filesystem is "mount bound" in `/mnt/temp`. How can I know that without typing `mount` which doesn't rely on the kernel but on `/etc/mtab`? **I'd like to get the information from the kernel itself.** **EDIT:** it would be nice if the solution could also work for directories bound _at mount time_ from `/etc/fstab` with this kind of line: `/my/dir /mnt/temp none bind 0 0`


title: vsftpd limit users to /home/user/minecraft

text: So using vsftpd I want to lock a user to `/home/theirname/Minecraft`. I can't change their home directory because a program I'm using(McMyAdmin) will try to reinstall itself but I don't want them having access to the programs configs.


title: Why is make unavailable on the default Gentoo liveCD?

text: Whilst attempting to install Gentoo on my desktop, I ran into some trouble getting my wireless card to work. This is the card I am using. The modules included with the Live CD didn't detect my card, so I downloaded the drivers from the Rosewill website, and followed the build instructions.. up until it told me to use `make`. The Gentoo Live CD doesn't come with `make`. So, I am confused as to how I should continue from here. **EDIT:** I ended up remembering I have a _really long_ cat5 cable, and used that for the initial installation, and then compiled the drivers after chrooting into stage3


title: Wireless not showing a network in the scan results

text: I have a weird problem of connecting to a wireless network. I am connecting to a network named "C-202" with WPA-Personal. This network shows up in the scan results some time and won't show some time. I can't really figure out a pattern from this. Sometime the network won't show up. It may work after few restarts. I was using `Wicd` initially and thought this was the problem with wicd. Uninstalled wicd and started using `NetworkManager`, but the problem persists. Then I tried the scan directly on terminal like               iwlist wlan0 scan      This shows a list of networks available, but not the one I want to connect. I can connect to that network from other computers, but not from this. Interestingly, when I change the SSID from `C-202` to `C-202-New`, it shows up in the list and I can connect. The connection works for few days and the problem starts again. Changing the SSID again will fix it. It looks to me like some cache is messing things up. **Wireless details**               $ lspci -v | grep wireless     03:00.0 Network controller: Intel Corporation PRO/Wireless 3945ABG [Golan] Network Connection (rev 02)         Subsystem: Intel Corporation PRO/Wireless 3945ABG Network Connection         Flags: bus master, fast devsel, latency 0, IRQ 44         Memory at d8000000 (32-bit, non-prefetchable) [size=4K]         Capabilities: <access denied>         Kernel driver in use: iwl3945      I have no clue on how to debug this issue. Can anyone help me to debug and fix this issue? Any help would be appreciated


title: ALSA dummy device - how to configure?

text: I am working on an audio stream between two virtual servers. For that, I have set up a dummy soundcard (as the vservers don't have a hw card) using `modprobe snd-dummy`. That seems to work fine - I am able to tweak volume levels using `alsamixer`. Unfortunately, I am not able to record any playback. I used `arecord -r 48000 -c 1` to see what's going on, and the output is quite creepy. It contains paths:               Aufnahme: WAVE 'stdin' : Unsigned 8 bit, Rate: 48000 Hz, mono     RIFF$WAVEfmt »data8¶5m8¶5m {D {DXCCC± C²5m  C@P {D°}DxC@C0C! C°~DPÀ}DІCÐ{DÐ{DÀ{DQ`C C  `D(²5m@0re/alsa/bluetooth.confáЂC²5m 0°|Dre/alsa/pulse.confЂC²5mbluetooth.confaC CiceAà|D|D  |Dr/.asoun P°CCX|DÐ{DÀ{DÑ CCÿÿÿÿÿÿÿÿèC`CPC`C C |D¸CCCA CC   CP@Cà~D~DC8¶5m8¶5m {D {DXCCC± C²5m  C@P {D°}DxC@C0C! C°~DPÀ}DІCÐ{DÐ{DÀ{DQ`C C  `D(²5m@0re/alsa/bluetooth.confáЂC²5m 0°|Dre/alsa/pulse.confЂC²5mbluetooth.confaC CiceAà|D|D  |Dr/.asoun P°CCX|DÐ{DÀ{DÑ CCÿÿÿÿÿÿÿÿèC`CPC`C C |D¸CCCA CC   CP@Cà~D~DC8¶5m8¶5m {D {DXCCC± C²5m  C@P {D°}DxC@C0C! C°~DPÀ}DІCÐ{DÐ{      And so on... There mentions of `[..]/alsa/pulse.conf`, `bluetooth.conf` and `.asoun[drc?]` are really really strange. Does anyone have a clue what is going on here? Have I configured the soundcard the wrong way, or is there anything I missed?


title: rhel 6 default gateway not working

text: I have six similar **RHEL 6** servers in the lab and the settings are same in all the servers. The settings are,               static IP address: 129.XXX.XXX.XX     Subnet Mask: 255.255.254.0     Default Gateway: 129.XXX.XXX.1      My default gateway has suddenly stopped working in one of the servers ( _server1_ ) and am investigating what caused this issue. Now, if I do `route -n` in _server1_ , I get the output as,               Kernel IP routing table     Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     129.XXX.XXX.0   0.0.0.0         255.255.254.0   U     1      0        0 eth0      I suspected it could be firewall issue but I checked with the school network and the firewall is configured correctly. My `/etc/hosts` file is as below.               127.0.0.1   server1.xxx.edu        localhost      My `/etc/resolv.conf` is as below.               # Generated by NetworkManager     search xxx.edu. xxx.edu     nameserver 129.xxx.xx.xx      In _server2_ which belongs to the same network as _server1_ , `route -n` gives the output as below.               Kernel IP routing table     Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     129.xxx.xxx.0   0.0.0.0         255.255.254.0   U     1      0        0 eth2     0.0.0.0         129.xxx.xxx.1   0.0.0.0         UG    0      0        0 eth2      I am trying to figure out if am missing something else. **EDIT** The contents of `/etc/sysconfig/network` on _server1_ ,               NETWORKING=yes     HOSTNAME=server1.xxx.edu     GATEWAY=255.255.254.0      **Edit 2:** After I changed the default gateway, if I execute `route -n` command the output is as below.               Kernel IP routing table     Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     129.xxx.xxx.0   0.0.0.0         255.255.254.0   U     0      0        0 eth0     169.254.0.0     0.0.0.0         255.255.0.0     U     1002   0        0 eth0      I also tried removing the default gateway entry in the `/etc/sysconfig/networks` file as well. But I get the same output for `route -n` as above.               cat /etc/sysconfig/network-scripts/ifcfg-eth0     DEVICE="eth0"     NM_CONTROLLED="yes"     ONBOOT=yes     TYPE=Ethernet     BOOTPROTO=none     IPADDR=129.xxx.xxx.xx     PREFIX=23     GATEWAY=129.xxx.xxx.1     DNS1=129.xxx.xx.xx     DOMAIN=xxx.edu.     DEFROUTE=no     IPV4_FAILURE_FATAL=yes     IPV6INIT=no     NAME="System eth0"     LAST_CONNECT=1406927310


title: Create release version using tar

text: I have a project with the usual stuff (source code, yadda, yadda) and I want to have a command to Scons (but it could be whatever build system to be honest) that will do the following:   1. Build the system -- this is easy.   2. Create a tar ball of the system -- this is easy.    3. When the content of the tar ball are extracted, they extract in a `fubar-VERSION/` directory -- this is the tricky part. I can do the latter manually by creating a symlink, then `tar`ing from one directory above the project one but that feel inelegant. Any idea? To clarify, I want to be able to do this:               ; pwd     ~/project     ; scons release     [...]     ; cp project-X.Y.Z.tbz /tmp     ; cd /tmp     ; tar jxvf project-X.Y.Z.tbz     ./project-X.Y.Z/[...]      Thus the archives extracts in a directory named after the project with the right version number.


title: Uninstall the Encrypted LVM function to remove the prompted password entry during Ubuntu Boot

text: When I installed Ubuntu 11.04 and I was offered the option of enabling "encrypted LVM" for my hard drive. After choosing that option, I am prompted for my password during boot to decrypt the LVM. Now, I am thinking about cancell/uninstall/remove "encrypted LVM' function as I don't want to input the "encrypted LVM" password every time when the system reboot. I know that you can setup a SSH to decrypt the LVM but that requires the installation of other programs. Is there a better/clean way to solve this problem like just uninstall the "encrypted LVM"? How to do it and this question is NOT specific to Ubuntu. Thanks.


title: How to grep on source code without catching comments

text: I search a way to grep on source code without having sometimes false-positive because of comments. For instance if I search on foo on this .c source code :               /*       * foo has changed [...] and is now a 2-parameters function      */     // foo(24)     foo(42, 28);      A naive `grep` will find 3 occurrences where I want only one. I have seen this way to do it on StackOverflow, but it does not fill my needs : PHP is not available on the platform. I have also found this way for one-line comments, but it only solves a part of my problem. I need to use classical scripting tools (awk, sed, bash, grep, etc) and I need it to be _fast_ even if there are thousands of files. Do you now if and how it's possible to grep on source code, and only source code ?


title: How do I log into my Linux laptop if I have forgotten both the login and password?

text: How do I log into my Linux laptop if I have forgotten both the username and password?


title: Store passwords of Linux users in plain text - on purpose

text: I want to reset passwords temporarily to log in as root at least one time to change passwords. I have access to the hard drive and I can run a live distro to gain root access. I did think it would be enough to change for each user the `x` in the second column of `/etc/passwd`, but this does not work.


title: How to make user passwords shown as a clear text in Linux?

text: We know that users' passwords are saved in `/etc/passwd`, but in an encrypted way, so even the root can't see them:               jane:x:501:501::/home/jane:/bin/bash     fred:x:502:502::/home/fred:/bin/bash      As shown above, `:x:` represents the password. Is there a way (possible configuration) to save the password in the `/etc/passwd` in clear text and such that the root can see them?


title: How to use GNU tools to extract and merge two substrings of the same string?

text: Suppose I get the following result after doing a `grep "emailed"`               /home/John/logs/2013-07-10.171222-0400EDT.html:I have emailed Mark. Thanks      I want to extract the date from this so that my output looks like -               2013-07-10:I have emailed Mark. Thanks      How can I do this using any one of the GNU tools? In particular, I want to pipe the output of grep to the tool. I suppose that `sed` may be the tool that does this, but I'm not sure how.


title: List overlapping instances of a pattern

text: I'm trying to capture a string and the 21 characters preceding it then output this to a new file. This is what I'm using currently:                   grep -o ".\{21\}gt" ../data/fastadata.txt > primerdata.txt      And I get some of the output I desire, but it skips instances of `gt`, when any amount of the preceding 21 characters were part of a previous capture string. For example:               aaaatccataaatcgaggattacaagtggaaaacaaggaggcagt      will capture               tccataaatcgaggattacaagt      but not               caagtggaaaacaaggaggcagt      I believe it's, because the two strings would share `caagt` and the end and beginning of strings 1 & 2 respectively. It ends up missing at least half of all instances. How do I correct this? It captures 121 instances of `...gt`, but there are something like 200 instances of 21 characters preceding `gt` in the text file below. Here is some text from the file I'm searching that contains instances of what I'm talking about (hard-wraps for formatting):               aaaccggcctcaagggaacgggtatgtctgcctcacctgtcggagatctacccaatcccagtctgcatct     aacggacactctaatgcaactgctggactgctgcttcctcaccctaacctgcagtggccaaatcgttttg     gtatccaccagcgtggagcagctattgggtcactgtcagtccgatttgtatggccagaatctactgcaga     tcacgcatcccgatgatcaggatctgttaagacagcagctaatacccagggatatagagaccctgttcta     tcagcatcagcaccaccagcagcaggggcacaatccccagcagcactccacttccacgtcggcctcaact     tcgggcagtgatctggaggaggaggaaatggagacggaggaacaccgtctgggtcggcagcagggagagg     cggacgatgacgaggatcacccgtacaaccgacgaacacccagcccgcggagaatggcccatttggcgac     cattgatgaccgactacgcatggatcggcgctgctttaccgtccgcttggctagggcttccacgcgagcg     gaggccacgcgtcattacgagcgggttaagatcgatggctgctttcgtcgcagtgactcctccttaaccg     gaggtgccgctgccaactatccgattgtctcccagctgatacgacgctcgagaaacaacaatatgctggc     tgctgctgcagcagtggcagcagaagcggcgacggtgccgccccagcacgatgccattgcccaggcggcg     ctgcacgggattagcggcaatgatattgtcctggtggccatggccagggtgctgcgagaggaacggccgc     ctgaggagacggagggtacagtgggcttgaccatttacagacagccagaaccctatcagttggagtacca     tacgaggcatctaatcgacggcagcatcatcgactgtgatcaaaggattggtctggtggcgggatatatg     aaggatgaggtgggtatattaacatcatctctctgaactgcttacgacaactaatcgtgtactctccact     cgaaacaggtgcgcaaccttagtcccttctgtttcatgcacctggacgacgttcgctgggtgattgtggc     ccttcgacaaatgtacgattgcaacagtgactacggcgagagctgctaccgtctgctgtcccgcaacggg     cgcttcatttacctgcacaccaagggatttctggaggtcgaccgtggcagtaataaggtgcattcctttc     tgtgcgtcaacacgctgctcgatgaggaggcgggccggcaaaaggtgcaggagatgaaggagaaattctc     gacaatcatcaaggcggagatgcccacgcagagcagcagtcccgatttgcccgcctcgcaggcaccgcag     caacttgagagaattgtcctctatctaatagagaacctacagaagagtgtggattcagcagagacggttg     gcggccagggcatggaaagcctaatggacgatggctacagttcgccagcaaataccttaactctcgagga     gttagctccctcgcccacgcccgccttggccttggtgccgccggctccctcatcggtcaagagctccatc     tccaagtcggtgagtgtggtcaatgtgacggcggccagaaagtttcagcaggagcatcagaagcagcgtg     aacgtgaccgtgagcagcttaaggagcgcaccaactccacgcagggcgtgatccggcaactgagcagctg     cctaagcgaggcggaaacggcatcctgtatcctatcaccagccagtagcttgagtgccagcgaagcaccg     gacacgcccgatccgcacagcaacacatcaccgccaccgtcgctccacacacgtcccagtgtcctgcatc     gaaccctgaccagcacgctgcgatgacgggctgatggaacctggtttgccttctaattgggtgtgtggaa     atggacgtcattggtagctcacgtgcccacaaacgaattagtatcggtaatataatcctggccaatcgca     aaatgaaaacccaaaatgtatcagaaaaaaacgagcattattcaaatagtttaaaaattcagccaaaaaa     cttaaaaacgaaaaaaaagagcgtgggttgaaaaaccttttgttttcatattcacatttccaagctttga     gcaatcaaacaattttaattttcagtatacacatatgtataatgagttggctttacaaaagctattaaca     aatcaagcaattgtgt


title: Can't install 'MFC42.DLL'

text: I tried this:               winetricks mfc42      and got the following result:               Executing w_do_call mfc42     Executing load_mfc42     Executing wine /home/sajjad/.cache/winetricks/vcrun6/vc6redistsetup_deu.exe /T:C:\windows\Temp\_mfc42 /c     wine: Unhandled page fault on read access to 0x00000001 at address 0x7bc493a0 (thread 0067), starting debugger...     err:seh:raise_exception Unhandled exception code c0000005 flags 0 addr 0x7bc493a0     ------------------------------------------------------     Note: command 'wine /home/sajjad/.cache/winetricks/vcrun6/vc6redistsetup_deu.exe /T:C:\windows\Temp\_mfc42 /c' returned status 5.  Aborting.


title: Suddenly cannot open any terminal on Linux Mint

text: I suddenly cannot open a gnome-terminal window in Linux Mint. I installed xterm and guake too now looking for a replacement, but none of them will open either. When I do try to open gnome-terminal by any method, the window will flash on the screen, but then it instantly closes before I can really see anything. My .xsession-error file is completely full of different messages, but the following is an example of what seems to be triggered directly when I try to open gnome-terminal.               Window manager warning: Log level 16: /build/buildd/glib2.0-2.36.0/./gobject/gsignal.c:2593: instance `0xacf1710' has no handler with id `17056'     Window manager warning: Log level 16: /build/buildd/glib2.0-2.36.0/./gobject/gsignal.c:2593: instance `0xacf1710' has no handler with id `17057'     Window manager warning: Log level 16: /build/buildd/glib2.0-2.36.0/./gobject/gsignal.c:2593: instance `0xaa1ae80' has no handler with id `17102'     Window manager warning: Log level 16: /build/buildd/glib2.0-2.36.0/./gobject/gsignal.c:2593: instance `0xaa1ae80' has no handler with id `17103'         JS ERROR: !!!   Exception was: Error: got a _calcWindowNumber callback but this._appButton is undefined         JS ERROR: !!!   Exception was a String           JS LOG: AppTrackerError: get_window_app returned null and there was no record of metaWindow in internal database       Guake behaves similarly. With xterm, I see nothing at all... no window and no new error messages. The eshell inside emacs and the command executer associated with Alt+F2 both seem to be working fine.


title: Spike in swap utilisation without high swap rate

text: Every Saturday, for reasons unknown to me, one of my servers experiences a spike in swap utilisation. It's not necessarily a problem as there is plenty of free memory available, but I'd still like to understand what's going on. In particular, I'm perplexed by a situation where swap goes from 2% used to 100% used over a period of around 20 minutes. When this happens though, there doesn't seem to be any increase in the swap rate. The server has an 8 GB swap partition, so I would expect a page out rate of thousands of pages a second in order to fill the available space. Furthermore, there doesn't seem to be any spike in memory utilisation at the time that causes the server to swap. Can anyone give an explanation for the observed behaviour? The server is RHEL 4.8 (old, I know) with a 2.6.9 Kernel. I've included some output from sar below. Swap utilisation jumps from 2% to 100% in around 20 minutes:               $ sar -r -f sa12     ....     06:00:01 PM kbmemfree kbmemused  %memused kbbuffers  kbcached kbswpfree kbswpused  %swpused  kbswpcad     06:10:01 PM   4583856  11847032     72.10     79676    319804   8178056    207864      2.48     19816     06:20:01 PM   4720904  11709984     71.27     38840    225108   8178400    207520      2.47     19124     06:30:02 PM   4839160  11591728     70.55      1404    144948   1968152   6417768     76.53   6227068     06:40:02 PM   4827016  11603872     70.62      1640    145484     10232   8375688     99.88   8182968     06:50:02 PM   4836376  11594512     70.57       844    123304        60   8385860    100.00   8193044     07:00:01 PM   4825764  11605124     70.63       920    128108      4516   8381404     99.95   8188680     ....      Here are the swapping statistics for the same period.               $ sar -W -f sa12     ....     06:00:01 PM  pswpin/s pswpout/s     06:10:01 PM      0.00      0.00     06:20:01 PM      0.00      0.00     06:30:02 PM      0.68      0.00     06:40:02 PM      1.85      0.00     06:50:02 PM      5.07      0.00     07:00:01 PM      8.62      0.00     ....


title: Shell Script - how to scp into remote server and download files and protect password

text: I have a remote server that I need to download Apache logs from. I can manually `scp` into the server and get the files, but I'd like to put this in crontab. The only way to automate it is to include the password of the target server which I'd rather not do. What would you recommend to `scp` into the other server, get files and download them to another machine?


title: Trouble with adding routes to different subnets

text: I'm having some confusion with adding routes to different subnets. Here's the layout:   1. I have a vpn connection on `tap0` which connects me to `192.168.14.110`   2. That connection, on the other end is routed to allow me access to `192.168.15.x` network.   3. The `.15` network, from one specific machine on it `(.15.226)` is connected to `10.1.1.x` network.   4. The only way so far that I access the `10.1.1.x` network, is by using RDP from my linux box to the `.226` machine, which is less than efficient. So, question is how can I add the routes from my local machine to be able to route to the `.15` then the `10.x.x.x` network?


title: How can I write a small log with bash?

text: I'm running applications via PHP `exec` with bash. My problem is that this creates large log files. I need only the last ouptut I don't need a log of all activity per second. This is my bash :               %s > %s 2>&1 & echo -n $! > %s      How should I modify to not append the output file, to rewrite it? The full script is:                 exec(sprintf("%s > %s 2>&1 & echo -n $! > %s", $cmd, $outputfile, $pidfile));      This is my full program:               $kovNev = 'uid1_fil_'.time();            $cmd = 'btdownloadheadless --saveas /var/www/virtual/tigyisolutions.hu/boxy/htdocs/downloaded_torrent/'.$kovNev.'/   '.$_REQUEST["torrent"];     $outputfile = 'downloaded_torrent/folyamatok/'.$kovNev.'.txt';     $pidfile = 'downloaded_torrent/folyamatok/'.$kovNev.'_id.txt';     exec(sprintf("%s 2>&1 | tail > %s& echo -n $! > %s", $cmd, $outputfile, $pidfile));


title: Why are Unity and GNOME so graphics-intensive?

text: Sure, the desktops are very detailed now, but I see that they appear to be fairly simple, especially the GNOME shell. Why is the 'simple-looking' Gnome shell so 'graphics-intensive'?


title: arp (where're my network devices?)

text: On linux there's `arp` command:               arp -n          Address                  HWtype  HWaddress           Flags Mask            Iface     192.168.1.100            ether   00:55:d1:c5:f8:1b   C                     eth0      and               arp-scan -I eth0 -l          Interface: eth0, datalink type: EN10MB (Ethernet)     Starting arp-scan 1.8.1 with 256 hosts (http://www.nta-monitor.com/tools/arp-scan/)     192.168.1.2 00:1b:fc:35:6a:9b   ASUSTek COMPUTER INC.     192.168.1.54    c8:d3:a6:34:d2:1d   (Unknown)     192.168.1.14    f0:25:b9:c2:6a:29   (Unknown)      Why I can't see correctly my devices? I also have done:               nmap -sn 192.168.1.0/24      with `arp` command I see 1 device, with `arp-scan` I see other devices. Does `arp` command read the cache, while `arp-scan` does a new scan (without reading any cache?)


title: Wait for a X window to appear/disappear (in a sane way)

text: Inside a shell script, I need to wait for a window that has a string on its title to appear, do some action, and then wait for it to disappear, and do some other action. Until yesterday, I had this simple code. The problem with it is that the disk can't be put in a power saving state while the script is left running, and it can be for many hours:               while :; do         until wmctrl -l | grep -q "$string"; do   # until             sleep 0.5         done         : do action 1              while wmctrl -l | grep -q "$string"; do   # while             sleep 0.5         done         : do action 2     done      Since I decided the mentioned code was insanely waking the disk, I went through the documentation of a few command line tools, and decided on `xdotool` to wait for the window to appear, and `xprop` to figure out when the window has vanished:               while :; do         # we use `until' because sometimes xdotool just crashes         until xdotool search -sync -all -onlyvisible -pid $pid -name "$string"; do             :         done              # xdotool isn't trustworthy either, so check again         wmctrl -l | grep -q "$string" ||             continue              : do action 1              xprop -spy -root _NET_CLIENT_LIST_STACKING | while read line; do             if [[ ! ${_line:-} || $_line = $line ]]; then                 _line=$line                 continue             else                 _line=$line                 if wmctrl -l | grep -q "$string"; then                     continue                 else                     : do action 2                     break                 fi             fi         done     done      Now I have two new problems with the code above:   * `xdotool` not only crashes and gives strange results, as I have workarounded before, but it also sucks about 15% of CPU while left waiting for the window to appear. So that means I got rid of simple code that wakes the disk, to write code that is left wasting the CPU for hours, and my intention was saving power in the first place.   * `xprop -spy` will notify me every time I change focus (which I have workarounded through `$_line`) or create and destroy windows. That wakes the disk more frequently than xdotool. I'm looking for a simple program that just waits for the window with the title `$string` to appear or disappear. It can be an existing command line tool, a python script, compilable C code..., but I should be able to integrate it somehow to my script (even if it just writes some information to a fifo)!