title: Difference between “machine hardware”, "processor type" and “hardware platform”

text: My Linux machine reports "uname -a" outputs as below:               [root@tom i386]# uname -a     Linux tom 2.6.9-89.ELsmp #1 SMP Mon Apr 20 10:34:33 EDT 2009 i686 i686 i386 GNU/Linux     [root@tom i386]#      As per man page of uname, the entries "i686 i686 i386" denotes:   * machine hardware name (i686)   * processor type (i686)   * hardware platform (i386) Additional information:               [root@tom i386]# cat /proc/cpuinfo          <snip>     vendor_id    : GenuineIntel     CPU family   : 6     model        : 15     model name   : Intel(R) Xeon(R) CPU            5148  @ 2.33 GHz     stepping     : 6     CPU MHz      : 2328.038     cache size   : 4096 KB     </snip>      How to differentiate between these three entries ("i686 i686 i386") ?


title: Linux/Unix variant for training system administrators

text: Is there a Linux/Unix based operating system used for training sysadmins? Some bugs would be deliberately included in the system and the training candidate is supposed to solve all of them. It should be something similar to WebGoat.


title: Why does US International Keyboard break Alt_R

text: All adding the U.S. English International (with dead keys) keyboard layout breaks my Alt_R key. Any ideas why? I'm working on RHEL 5.5 using GNOME. The problem disappears if I remove the additional layout and reappears if I add it back. Specific problems include Alt-F2 not working to start the run application app if using Alt_R and CTRL-Alt-L not working for screen looking again if using Alt_R. I tried using xev to troubleshoot. Here's what I get with just the U.S. English layout:               KeyPress event, serial 29, synthetic NO, window 0x1e00001,         root 0x3a2, subw 0x0, time 1766794207, (169,-13), root:(2099,35),         state 0x0, keycode 113 (keysym 0xffea, Alt_R), same_screen YES,         XLookupString gives 0 bytes:          XmbLookupString gives 0 bytes:          XFilterEvent returns: False          KeyRelease event, serial 29, synthetic NO, window 0x1e00001,         root 0x3a2, subw 0x0, time 1766794447, (169,-13), root:(2099,35),         state 0x8, keycode 113 (keysym 0xffea, Alt_R), same_screen YES,         XLookupString gives 0 bytes:          XFilterEvent returns: False        Here's what I get with the U.S. English International (with dead keys) layout:               KeyPress event, serial 26, synthetic NO, window 0x1e00001,         root 0x3a2, subw 0x0, time 1766853750, (169,-13), root:(2099,35),         state 0x0, keycode 113 (keysym 0xffea, Alt_R), same_screen YES,         XLookupString gives 0 bytes:          XmbLookupString gives 0 bytes:          XFilterEvent returns: False          KeyRelease event, serial 29, synthetic NO, window 0x1e00001,         root 0x3a2, subw 0x0, time 1766853872, (169,-13), root:(2099,35),         state 0x80, keycode 113 (keysym 0xffea, Alt_R), same_screen YES,         XLookupString gives 0 bytes:          XFilterEvent returns: False      It makes no difference whether that layout is actually being used at the moment. Just having it in the selected list breaks things. If this is a bug, does anyone know where it should be filed (GNOME, Xorg, Redhat)? **EDIT** : I realized now that I can see my modifier mapping using xmodmap. Initially, mod5 was mapped to mod5 Mode_switch (0x5d) and ISO_Level3_Shift (0x7c). Adding the international layout, maps Alt_R (0x71) to mod5 as well, which why I'm having this problem. Based on Caleb's recommendation, I switched Alt_R to be an ISO_Level3_Shift such that mod5 is now mapped to "mod5 Mode_switch (0x5d), ISO_Level3_Shift (0x71), ISO_Level3_Shift (0x7c)". This still breaks Alt_R as an Alt_L alternative though.


title: Driver is sometimes loaded, sometimes not

text: I was assigned an Ubuntu desktop with some stuff already on it. I did not reformat it, but attached a mini-PCI wireless card over a PCI to mini-PCI adapter. I manually built the `madwifi` driver and installed its .ko files. Now `lshw -C network` always shows the card, but it sometimes shows it as 'unclaimed' and sometimes it shows with the `madwifi` (i.e. `ath_pci`) driver. Any idea what can cause this effect? EDIT: Snippet from `/var/log/kern.log`, on failed load.               Apr 19 11:47:21 manju-desktop kernel: [    9.935304] ath_hal: module license 'Proprietary' taints kernel.     Apr 19 11:47:21 manju-desktop kernel: [    9.936614] ath_hal: 0.9.18.0 (AR5210, AR5211, AR5212, RF5111, RF5112, RF2413, RF5413)     Apr 19 11:47:21 manju-desktop kernel: [    9.958671] wlan: svn r4133 (branch madwifi-0.9.4)     Apr 19 11:47:21 manju-desktop kernel: [    9.975867] ath_pci: svn r4133 (branch madwifi-0.9.4)     Apr 19 11:47:21 manju-desktop kernel: [    9.975940] ath_pci 0000:02:04.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17     Apr 19 11:47:21 manju-desktop kernel: [    9.976024] ath_pci: HAL doesn't support MAC revision 0xffffffff     Apr 19 11:47:21 manju-desktop kernel: [    9.976037] ath_pci 0000:02:04.0: PCI INT A disabled      Output of `lshw -C network`                 *-network:1 UNCLAIMED            description: Ethernet controller            product: AR5413 802.11abg NIC            vendor: Atheros Communications Inc.            physical id: 4            bus info: pci@0000:02:04.0            version: 01            width: 32 bits            clock: 33MHz            capabilities: pm cap_list            configuration: latency=168 maxlatency=12 mingnt=10


title: Need to parse a double entry table with two pairs

text: I have this two-entry table resulting from a program output:               Variable1  : Value1       Variable2  : Value2       Variable3  : Value3       Variable4  : Value4       Variable5  : Value5       Variable6  : Value6       Variable7  : Value7       I need to extract both the first and the fifth pairr\s, something I do with grep:               $ {program command} | grep -e Variable1 -e Variable5      resulting in this output:               Variable1  : Value1       Variable5  : Value5        The problem here is that I need both pairs on the _same_ line but the grep -e command prints a LF/CR after every -e; I need the four pairs in the same line to make a final sort based on file size. I think I could make this in awk or perl from the same command line but alas I'm still somewhat green with them. Any ideas? Thanks in advance.


title: Sound doesn't work in x, but does in virtual terminal

text: I've just installed Fedora 19, bringing over my home directory. I've disabled graphical boot, instead I get dumped to a virtual terminal. I use xmonad instead of gnome3. # weird phenomenon #1 In a virtual terminal, I can run `alsamixer -c0` as my normal user without problem. When I launch X (`startx -- vt3`), I open a terminal, run `alsamixer -c0`, and it doesn't work, saying:               % alsamixer -c0     invalid card index: 0     try `alsamixer --help' for more information      So now I'm in an Xsession, as my normal user, and alsamixer is borked. If I run `sudo alsamixer -c0`, it works. Also, I can switch back to a virtual terminal and run it as my normal user. Pulse is installed and running. I can hear audio played from the virtual terminal. I've tried starting x, killing pulse, and manually starting pulse, but I still only see pulse's dummy device. `aplay -l` in a virtual terminal:               19:06:28 jake@localhost]~% aplay -l     **** List of PLAYBACK Hardware Devices ****     card 0: PCH [HDA Intel PCH], device 0: ALC262 Analog [ALC262 Analog]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 1: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 1: NVidia [HDA NVidia], device 7: HDMI 0 [HDMI 0]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 1: NVidia [HDA NVidia], device 8: HDMI 0 [HDMI 0]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 1: NVidia [HDA NVidia], device 9: HDMI 0 [HDMI 0]       Subdevices: 1/1       Subdevice #0: subdevice #0      `aplay -l` in an xsession:               19:06:51 jake@localhost]~% aplay -l     aplay: device_list:268: no soundcards found...      # weird phenomenon #2 If I start playing some music in the virtual terminal, and switch over to an x session, `mplayer` pauses. Like, I hear music, note the play position, switch to x session, the music stops, I wait ten seconds, switch back to the vt, the music starts, play position is where it was when I switched to X. # permissions of `/dev/snd/*`               % ls -l /dev/snd*     total 0     drwxr-xr-x. 2 root root       80 Jul  9 13:00 by-path/     crw-rw----+ 1 root audio 116,  8 Jul  9 13:00 controlC0     crw-rw----+ 1 root audio 116, 17 Jul  9 13:00 controlC1     crw-rw----+ 1 root audio 116,  7 Jul  9 13:00 hwC0D0     crw-rw----+ 1 root audio 116,  6 Jul  9 13:00 hwC0D3     crw-rw----+ 1 root audio 116, 16 Jul  9 13:00 hwC1D0     crw-rw----+ 1 root audio 116, 15 Jul  9 13:00 hwC1D1     crw-rw----+ 1 root audio 116, 14 Jul  9 13:00 hwC1D2     crw-rw----+ 1 root audio 116, 13 Jul  9 13:00 hwC1D3     crw-rw----+ 1 root audio 116,  5 Jul 10 09:13 pcmC0D0c     crw-rw----+ 1 root audio 116,  4 Jul 10 09:13 pcmC0D0p     crw-rw----+ 1 root audio 116,  3 Jul  9 13:00 pcmC0D2c     crw-rw----+ 1 root audio 116,  2 Jul 10 09:13 pcmC0D3p     crw-rw----+ 1 root audio 116, 12 Jul 10 09:13 pcmC1D3p     crw-rw----+ 1 root audio 116, 11 Jul 10 09:13 pcmC1D7p     crw-rw----+ 1 root audio 116, 10 Jul 10 09:13 pcmC1D8p     crw-rw----+ 1 root audio 116,  9 Jul 10 09:13 pcmC1D9p     crw-rw----+ 1 root audio 116,  1 Jul  9 13:00 seq     crw-rw----+ 1 root audio 116, 33 Jul  9 13:00 timer      getfacl run in x:               % getfacl /dev/snd/controlC0      getfacl: Removing leading '/' from absolute path names     # file: dev/snd/controlC0     # owner: root     # group: audio     user::rw-     group::rw-     mask::rw-     other::---      getfacl run in virtual terminal:               # file: dev/snd/controlC0     # owner: root     # group: audio     user::rw-     user:jake:rw-     group::rw-     mask::rw-     other::---      Any idea what's going on?


title: Vim paste string with non-ASCII characters

text: I am trying to paste a string from a register in VIM which contains non-ASCII characters such as `Ctrl``r`, how can I paste this string into a file, but escape the non-ASCII characters automatically? Essentially, what I am trying to achieve is recording a macro which has some (non-ascii) characters, such as `Ctrl``W` which vim will show as ^W. I want to be able to take the macro (by examining the registers and taking the macro string (i.e @a=^W)) and copying it into a .vimrc file as a key-map, so that when I press the key it will run that macro. I want to do this automatically (or as fast as possible) without having to change ^W into `Ctrl``W` in the .vimrc file, or wherever I paste it too.


title: How to find the machine from which a user logged into current machine using ssh?

text: In a multi server architecture, is it possible to find out from which machine a user logged into current machine using `ssh`? For example, `user1` logged into `host1`. From there, the user logged into `host2` as `sruser` using `ssh`. In above example, would it be possible to trace the `sruser` session of `host2` back to `user1` session in `host1`? Would it be possible to get the hostname or terminal of `user1` session?


title: clamd randomly stops

text: I am using clamav in conjuction with c-icap to filter content with squid. I am also using the safebrowsing functionality of clamav to block access to bad domains. For some reason or another, clamav (clamd), suddenly stops running and I see that the c-icap service cannot connect to socket clamd socket. However, I don't see anything in the log files indicating why clamav suddenly stopped. I checked the following basics: 1. clamav logs (syslog output) 2. free space 3. dmesg [Unit] Description = clamd scanner (%i) daemon After = syslog.target nss- lookup.target network.target               [Service]     Type = simple     ExecStart = /usr/sbin/clamd -c /etc/clamd.d/%i.conf --nofork=yes     #Restart = on-failure     Restart = always     PrivateTmp = true     PIDFile=/var/run/clamav/%i.pid          [Install]     Also=clamd@.socket     WantedBy=multi-user.target      Any ideas what may be causing clamav to suddenly stop?


title: Hide lines based on multiple patterns

text: I'm using `less` to view log files quite a lot and every so often I'd like to filter the output by hiding lines which contains _some keywords_. In `less` it's possible to filter-out lines with `&!<keyword>` but that only works for one keyword at a time. I'd like to specify a list of keywords to filter-out. Is this at all possible?


title: Cannot install zone on Solaris 11

text: I am trying to install a _zone_ on Solaris 11. I am using these instructions. I get up to _Listing 2_ when the error occurs.                   # zoneadm -z testzone install         The following ZFS file system(s) have been created:             rpool/zones/testzone         Progress being logged to /var/log/zones/zoneadm.20140522T025544Z.testzone.install                Image: Preparing at /zones/testzone/root.             ERROR: an exception occurred.                  'NoneType' object has no attribute 'bind'                 Please check logs for further information.        ERROR: auto-install failed.      The install log is:               root@solaris-11:~# cat /var/log/zones/zoneadm.20140523T065105Z.testzone.install         [Fri May 23 16:51:05 EST 2014] ==== Starting: /usr/lib/brand/solaris/pkgcreatezone -z testzone -R /zones/testzone ====         [Fri May 23 16:51:05 EST 2014] Progress being logged to /var/log/zones/zoneadm.20140523T065105Z.testzone.install         [Fri May 23 16:51:08 EST 2014]        Image: Preparing at /zones/testzone/root.         [Fri May 23 16:51:12 EST 2014] Running auto-install: '/usr/bin/auto-install -z testzone -Z rpool/zones/testzone/rpool -m /tmp/manifest.xml.PCa4ad -c /usr/share/auto_install/sc_profiles/enable_sci.xml'         [Fri May 23 16:51:14 EST 2014] ERROR: auto-install failed.         [Fri May 23 16:51:14 EST 2014] Exiting with exit code 255         [Fri May 23 16:51:14 EST 2014] ==== Completed: /usr/lib/brand/solaris/pkgcreatezone -z testzone -R /zones/testzone  ==== Zonecfg results:                   root@solaris-11:~# zonecfg -z testzone export         create -b         set brand=solaris         set zonepath=/zones/testzone         set autoboot=true         set bootargs=-m verbose         set ip-type=exclusive         add anet         set linkname=net0         set lower-link=auto         set configure-allowed-address=true         set link-protection=mac-nospoof         set mac-address=random         end Zonecfg info:                   root@solaris-11:~# zonecfg -z testzone info         zonename: testzone         zonepath: /zones/testzone         brand: solaris         autoboot: true         bootargs: -m verbose         file-mac-profile:         pool:         limitpriv:         scheduling-class:         ip-type: exclusive         hostid:         fs-allowed:         anet:             linkname: net0             lower-link: auto             allowed-address not specified             configure-allowed-address: true             defrouter not specified             allowed-dhcp-cids not specified             link-protection: mac-nospoof             mac-address: random             mac-prefix not specified             mac-slot not specified             vlan-id not specified             priority not specified             rxrings not specified             txrings not specified             mtu not specified             maxbw not specified             rxfanout not specified             vsi-typeid not specified             vsi-vers not specified             vsi-mgrid not specified             etsbw-lcl not specified             cos not specified             pkey not specified             linkmode not specified         root@solaris-11:~#


title: How to set up Cron to run mysqlauditgrep command for 11AM on Friday

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


title: What code should I use to download and install my script into a user-writable directory in the user's PATH (without requiring sudo)?

text: Edit: places where I said $HOME/.bin I should have written $HOME/bin or any equivalent is fine. I.E, any user-writable directory that is in the user's PATH. So I have a bash script which I am distributing as a client for my API. Current version installs like this `curl -s http://api.blah.com/install | sudo sh`. I may try to deal with six different package management systems so that they can just `apt-get` or `brew install` at some point, but for now I am going with the one-liner since I want this solution to work for multiple systems. However, apparently there are quite a few users on systems like cygwin or even Macs who don't have sudo at all or don't have it set up. The scenario is a user signs up for my API, enters their credit card information. I have a bash client for the API that doubles as a reference implementation and also a way to try out the API or deploy VMs and Docker containers using the command line. I want to create an easy way for users to install the API client. For example, there used to be a one-line install for npm `curl http://npmjs.org/install.sh | sh`. Also homebrew has a one-line installer `ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"` (see http://brew.sh). My install script just downloads the API client script and puts it in /usr/bin and makes it executable. But I am thinking based on the issues with sudo and the fact that this doesn't really need to be installed globally, I would like to just install it into the user's $HOME/.bin or $HOME/local/bin (create that if it there is no existing equivalent). This is my current install script:               #!/bin/bash     BASE="https://api.blah.com"          sudo bash -c "curl -s $BASE/mycmd > /usr/bin/mycmd"     sudo chmod uga+x /usr/bin/mycmd      First wrinkle that occurs to me is that many users are now in zsh. So if I add or modify a line in ~/.bashrc that updates the PATH to include $HOME/.bin, that won't work for those systems. So to restate the question, **what code should I use to download and install my script into a user-writable directory in that user's PATH ($HOME/local/bin, or whatever is available in PATH by default) directory and make sure that is in their PATH, with the requirement (or at least strong desire) that this will work on almost everyone's system (if they have something like a Unix prompt) (without requiring sudo)?** Since some people consider modifying the PATH to be evil, I would like to install in the default $HOME/whatever/bin for that system, that is already in the user's PATH, if possible, rather than automatically modifying their PATH to include some particular directory. Thanks very much!


title: How to create an executable bash script for these commands?

text: I wish to create an executable bash script that will run the following commands as root, that is, using sudo su               iptables-save | awk '/^[*]/ { print $1 }                           /^:[A-Z]+ [^-]/ { print $1 " ACCEPT" ; }                          /COMMIT/ { print $0; }' | iptables-restore      My first attempt at bash scripting is as follows:               #!/bin/bash     sudo su     iptables-save | awk '/^[*]/ { print $1 }                           /^:[A-Z]+ [^-]/ { print $1 " ACCEPT" ; }                          /COMMIT/ { print $0; }' | iptables-restore     sleep 3;     exit 0      Could someone correct the above and make it workable?


title: Microphone not working on Centos 6.5

text: I have installed CentOS 6.5 on a Dell Insperion with an Intel chip. I first noticed that my microphone is not working on Skype on CentOS although it was working fine with Windows 7 on the same box. The speakers work fine on both operating systems. I did the following test.               arecord -vv -d 10 test.wav     aplay -vv test.wav      and did not get any sound played back. I went to System:Preferences:Sound to get the Sound Preferences dialog. I went to the Input tab and "Microphone" was selected as the connector. I turned the input volume up to maximum and spoke into the microphone but the "Input level" boxes all remained a light grey like it was disabled. The only option for "Choose a device for sound input" is "Internal Audio Analog Stereo".


title: generate consistent machine unique ID

text: Can we generate a unique id for each PC, something like uuuidgen, but it will never change unless there are hardware changes? I was thinking about merging CPUID and MACADDR and hash them to generate a consistent ID, but I have no idea how to parse them using bash script, what I know is how can I get CPUID from               dmidecode -t 4 | grep ID      and               ifconfig | grep ether      then I need to combine those hex strings and hash them using sha1 or md5 to create fixed length hex string.   How can I parse that output?


title: What is the default behavior of %install?

text: I am attempting to build an RPM using the `-bb` flag (%prep %build %install %check package). This is the output of the %install step:               Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.2kgeNY     + umask 022     + cd /<redacted>/BUILD     + '[' /<redacted>/BUILDROOT/<redacted>.i386 '!=' / ']'     + rm -rf /<redacted>/BUILDROOT/<redacted>.i386     ++ dirname /<redacted>/BUILDROOT/<redacted>.i386     + mkdir -p /<redacted>/BUILDROOT     + mkdir /<redacted>/BUILDROOT/<redacted>.i386     + /usr/lib/rpm/check-buildroot     + /usr/lib/rpm/redhat/brp-compress     + /usr/lib/rpm/redhat/brp-strip /usr/bin/strip     + /usr/lib/rpm/redhat/brp-strip-comment-note /usr/bin/strip /usr/bin/objdump     + /usr/lib/rpm/redhat/brp-strip-static-archive /usr/bin/strip     + /usr/lib/rpm/brp-python-bytecompile /usr/bin/python 1     + /usr/lib/rpm/redhat/brp-python-hardlink     + /usr/lib/rpm/redhat/brp-java-repack-jars      Here are the contents of that tmp file:                 RPM_SOURCE_DIR="/<redacted>/SOURCES"       RPM_BUILD_DIR="/<redacted>/BUILD"       RPM_OPT_FLAGS="-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m32 -march=x86-64 -mtune=generic -mfpmath=sse -fasynchronous-unwind-tables"       RPM_LD_FLAGS="-Wl,-z,relro "       RPM_ARCH="i386"       RPM_OS="linux"       export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_LD_FLAGS RPM_ARCH RPM_OS       RPM_DOC_DIR="/usr/share/doc"       export RPM_DOC_DIR       RPM_PACKAGE_NAME="<redacted>"       RPM_PACKAGE_VERSION="<redacted>"       RPM_PACKAGE_RELEASE="<redacted>"       export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE       LANG=C       export LANG       unset CDPATH DISPLAY ||:       RPM_BUILD_ROOT="/<redacted>/BUILDROOT/<redacted>.i386"       export RPM_BUILD_ROOT            PKG_CONFIG_PATH="%{_PKG_CONFIG_PATH}:/usr/lib/pkgconfig:/usr/share/pkgconfig"       export PKG_CONFIG_PATH       set -x       umask 022       cd "/<redacted>/BUILD"         [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "${RPM_BUILD_ROOT}"         mkdir -p `dirname "$RPM_BUILD_ROOT"`         mkdir "$RPM_BUILD_ROOT"                             /usr/lib/rpm/check-buildroot              /usr/lib/rpm/redhat/brp-compress              /usr/lib/rpm/redhat/brp-strip /usr/bin/strip         /usr/lib/rpm/redhat/brp-strip-comment-note /usr/bin/strip /usr/bin/objdump              /usr/lib/rpm/redhat/brp-strip-static-archive /usr/bin/strip         /usr/lib/rpm/brp-python-bytecompile /usr/bin/python 1         /usr/lib/rpm/redhat/brp-python-hardlink         /usr/lib/rpm/redhat/brp-java-repack-jars      I have not overwritten the %install behavior in my spec file. My spec file looks like this:               <stuff>     %prep     %build     %install     %files     <more stuff>      Is the default %install behavior defined in the `rpm-builder` documentation anywhere? How do I know what it's going to execute?


title: How do I re-stream a filtered video stream using VLC?

text: I have an input RTSP stream that I want to apply the "cartoon" gradient filter to before streaming on http. I've managed to stream and apply the filter to the local playback, but the http stream does not have the filtering applied.               cvlc -vvv input_stream rtsp://10.217.12.20:554/axis-media/media.amp?videocodec=h264 --video-filter "gradient{type=1}" --sout '#duplicate{dst=http{vfilter=gradient{type=1},mux=ffmpeg{mux=flv},dst=:8080/coffeecam},dst=display}'


title: sssd: login problems with AD user

text: I've setup my samba4 DC to get account information from a central AD provider via sssd. What I'd like to do now is permit some subset of these users to login via ssh (to linux machines) or via RDP (to windows machines). I can get passwd information from the AD provider using `getent passwd <name>`. Unfortunately this is coming in with params that don't seem to work locally: > johndoe:*:53122:513:John Doe:\\nafs2\u204\johndoe:212578 The errors in `/var/log/secure` appear as follows:               Jul 16 03:42:46 beanbag sshd[3303]: User johndoe not allowed because shell 212578 does not exist       Jul 16 03:42:46 beanbag sshd[3304]: input_userauth_request: invalid user johndoe       Jul 16 03:42:50 beanbag sshd[3303]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=server.edu  user=johndoe       Jul 16 03:42:51 beanbag sshd[3303]: pam_sss(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=server.edu user=johndoe       Jul 16 03:42:51 beanbag sshd[3303]: pam_sss(sshd:auth): received for user johndoe: 6 (Permission denied)       Jul 16 03:42:53 beanbag sshd[3303]: Failed password for invalid user johndoe from 10.95.20.20 port 1714 ssh2      What step(s) have I missed in getting sssd (and it's kin) setup? CentOS 6.4 (x64) NOTE: I have run `authconfig --enablesssd --enablesssdauth --update`. * * * EDIT: Fixed the first part of this problem - 'shell does not exist'. FIX: in `/etc/sssd/sssd.conf` add these lines to the [nss] section:               allowed_shells = /bin/bash     shell_fallback = /bin/bash      Now it attempts to create the (invalid) home directory \\nafs2\u204\johndoe and then returns a 'This account is currently not available.' error. * * * EDIT: If you use the entry `override_shell = /bin/bash (or whatever)` in your domain listing it will fix the above problem.


title: Why are aliases missing inside of bash command?

text: When I run in my terminal:               alias      a list with all my aliases (defined in `~/bashrc` and `~/.bash_aliases` files) will be displayed on my terminal. That's nice and as expected! But when I run:               bash -c "alias"      there is no output, so no aliases. First I thought that `~/.bashrc` file is not sourced in the second case, so I ran:               bash -c ". ~/.bashrc && alias"      but, stupor, again there is no output... Strangely enough, when I run:               bash -c ". ~/.bash_aliases && alias"      only the aliases defined in `~/.bash_aliases` will be displayed. Can someone make some light and make me understand what exactly it is happening here?


title: Fluxbox shuts my screens off after some idle moment

text: I have fluxbox installed beside unity, my distro being ubuntu 13.04. Under unity I have configured my computer not to suspend, not to lock, and not to shut off screens after some idle moment. This works ok. However, I am using fluxbox 99% of the time, and under fluxbox, my screens shut off after something like 10 or 15 minutes. It's not a screensaver, my screens go into pause. I don't know the application that manage this, and how to configure it so as my screens won't shut off. This is a problem for me because when waking up, only the second screen will be restored, even if I run arandr scripts again and again, trying to get my main screen back. My main screen only comes back if I close then reopen my laptop. Maybe that's the issue I should worry about, but I have not the single idea which application manage that either. Any idea what's going on and where I should look at ? **Note** : I've found here a suggestion for modifying `~/.xinitrc` and adding `xset -dpms s off`. However I don't have such file in my ~ directory. I have found a file with a similar name /etc/X11/xinit/xinitrc. Should I modify this one ?


title: Is there a --parents option for mv like for cp?

text: `cp` has a useful feature `\--parents` that allows a file's directory structure to be copied to another directory:               $ cp -v --parents source/directory/from target/     ‘source/directory/from’ -> ‘target/source/directory/from’      How do I similarly _move_ a file?


title: No Login on created on tty2 to 6

text: On my Debian Linux no Login is possible on terminals 2 to 6. Login on 1 works fine, xorg-session with XDM and awesome wm works, too. The Error Message shown on these 5 screens is:               systemd-logind[...]: Failed to issue Method call: Launch Helper exited with unknown return code 1      I don't even know how to start solving this. How can I make these terminals working?


title: DMX problem with fonts

text: I have problem with fonts in xdmx: I am starting new X               startx -- /usr/bin/X11/Xdmx :1 -display 192.168.0.104:0 -fontpath tcp/192.168.0.102:7100                   (II) dmx: Generation:         1         (II) dmx: DMX version:        1.2.20070424 (DMX Project)         (II) dmx: DMX Build OS:       Linux 2.6.32-5-686-bigmem i686 (Debian)         (II) dmx: DMX Build Compiler: gcc 4.7.2         (II) dmx: DMX Execution OS:   Linux 3.2.0-4-686-pae #1 SMP Debian 3.2.46-1+deb7u1         (II) dmx: DMX Execution Host: badeleux-debian         (II) dmx: MAXSCREENS:         16         (II) dmx: Using configuration from command line         (II) dmx: Added 192.168.0.104:0 at 0 0         (II) dmx[o0/192.168.0.104:0]: No Xdmx server running on backend         (II) dmx[o0/192.168.0.104:0]: Name of display: 192.168.0.104:0         (II) dmx[o0/192.168.0.104:0]: Version number:  11.0         (II) dmx[o0/192.168.0.104:0]: Vendor string:   The X.Org Foundation         (II) dmx[o0/192.168.0.104:0]: Vendor release:  11204000         (II) dmx[o0/192.168.0.104:0]: Dimensions:      1280x720 pixels         (II) dmx[o0/192.168.0.104:0]: 7 depths on screen 0:  24,1,4,8,15,16,32         (II) dmx[o0/192.168.0.104:0]: Depth of root window:  24 planes (24)         (II) dmx[o0/192.168.0.104:0]: Number of colormaps:   1 min, 1 max         (II) dmx[o0/192.168.0.104:0]: Options: backing-store no, save-unders no         (II) dmx[o0/192.168.0.104:0]: Window Manager running: yes         (**) dmx[o0/192.168.0.104:0]: Window manager running -- colormaps not supported         (II) dmx[o0/192.168.0.104:0]: 1280x720+0+0 on 1280x720 at depth=24, bpp=32         (II) dmx[o0/192.168.0.104:0]: 0x21 TrueColor   24b 8b/rgb 256 0xff0000 0xff00 0x00ff *         (II) dmx[o0/192.168.0.104:0]: 0xc2 TrueColor   24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xc3 TrueColor   24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xc4 TrueColor   24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xc5 TrueColor   24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xc6 TrueColor   24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xc7 TrueColor   24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xc8 TrueColor   24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xc9 TrueColor   24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xca TrueColor   24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xcb TrueColor   24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xcc TrueColor   24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xcd TrueColor   24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xce TrueColor   24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xcf TrueColor   24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xd0 TrueColor   24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xd1 TrueColor   24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xd2 TrueColor   24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xd3 TrueColor   24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xd4 TrueColor   24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xd5 TrueColor   24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xd6 TrueColor   24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xd7 TrueColor   24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xd8 TrueColor   24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xd9 TrueColor   24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xda TrueColor   24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xdb TrueColor   24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xdc TrueColor   24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xdd TrueColor   24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xde TrueColor   24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xdf TrueColor   24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xe0 DirectColor 24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xe1 DirectColor 24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xe2 DirectColor 24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xe3 DirectColor 24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xe4 DirectColor 24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xe5 DirectColor 24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xe6 DirectColor 24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xe7 DirectColor 24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xe8 DirectColor 24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xe9 DirectColor 24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xea DirectColor 24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xeb DirectColor 24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xec DirectColor 24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xed DirectColor 24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xee DirectColor 24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xef DirectColor 24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xf0 DirectColor 24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xf1 DirectColor 24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xf2 DirectColor 24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xf3 DirectColor 24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xf4 DirectColor 24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xf5 DirectColor 24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xf6 DirectColor 24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xf7 DirectColor 24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xf8 DirectColor 24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xf9 DirectColor 24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xfa DirectColor 24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xfb DirectColor 24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xfc DirectColor 24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xfd DirectColor 24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xfe DirectColor 24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0xff DirectColor 24b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: 0x41 TrueColor   32b 8b/rgb 256 0xff0000 0xff00 0x00ff         (II) dmx[o0/192.168.0.104:0]: DPMS 1.1 (on, disabled, 7200 7200 14400)         (II) dmx[o0/192.168.0.104:0]: (request) s=1280x720+0+0 r=1280x720+0+0 @0,0 (0) (be=1280x720 depth=24 bpp=32)         (II) dmx[o0/192.168.0.104:0]: s=1280x720+0+0 r=1280x720+0+0 @0,0 (be=1280x720 depth=24 bpp=32)         (II) dmx: Using 1280x720 as global bounding box         (II) dmx: XSync batching with 100 ms interval         (II) dmx: Shadow framebuffer support disabled         (II) dmx[i0/192.168.0.104:0]: Using backend input from 192.168.0.104:0         (II) dmx[i0/192.168.0.104:0]: Locating devices on 192.168.0.104:0 (XInputExtension version 2.2)         (II) dmx[i0/192.168.0.104:0]:    2 Virtual co XPointer                 (II) dmx[i0/192.168.0.104:0]:    3 Virtual co XKeyboard                (II) dmx[i0/192.168.0.104:0]:    4 Virtual co XExtensionPointe         (II) dmx[i0/192.168.0.104:0]:    5 Virtual co XExtensionKeyboa         (II) dmx[i0/192.168.0.104:0]:    6 axp20-supp XExtensionKeyboa         (II) dmx[i0/192.168.0.104:0]:    7   USB Keyb XExtensionKeyboa         (II) dmx[i0/192.168.0.104:0]:    8   USB Keyb XExtensionKeyboa         (II) dmx[i0/192.168.0.104:0]:    9 Microsoft  XExtensionPointe         (II) dmx[i0/192.168.0.104:0]: Added backend-mou as pointer device called Mouse0 [core]         (II) dmx[i0/192.168.0.104:0]: Added backend-kbd as keyboard device called Keyboard0 [core]         (II) dmx[i0/192.168.0.104:0]: XKEYBOARD: keycodes = evdev+aliases(qwerty)         (II) dmx[i0/192.168.0.104:0]: XKEYBOARD: symbols  = pc+us+inet(evdev)         (II) dmx[i0/192.168.0.104:0]: XKEYBOARD: geometry = pc(pc105)         (II) dmx[i0/192.168.0.104:0]: XKEYBOARD: From device: evdev pc+us+inet(evdev) pc(pc105)         xinit: XFree86_VT property unexpectedly has 0 items instead of 1         (**) dmx: dmxErrorHandler: RenderBadPicture (invalid Picture parameter)         (**) dmx:                  Major opcode: 148 (RENDER)         (**) dmx:                  Minor opcode: 10 (RenderTrapezoids)         (**) dmx:                  ResourceID:   0x26003ab         (**) dmx:                  Failed serial number:  4436         (**) dmx:                  Current serial number: 4555         (**) dmx: dmxErrorHandler: RenderBadPicture (invalid Picture parameter)         (**) dmx:                  Major opcode: 148 (RENDER)         (**) dmx:                  Minor opcode: 10 (RenderTrapezoids)         (**) dmx:                  ResourceID:   0x26003af         (**) dmx:                  Failed serial number:  4464         (**) dmx:                  Current serial number: 4555         (**) dmx: dmxErrorHandler: RenderBadPicture (invalid Picture parameter)         (**) dmx:                  Major opcode: 148 (RENDER)         (**) dmx:                  Minor opcode: 10 (RenderTrapezoids)         (**) dmx:                  ResourceID:   0x26003b2         (**) dmx:                  Failed serial number:  4483         (**) dmx:                  Current serial number: 4555         (**) dmx: dmxErrorHandler: RenderBadPicture (invalid Picture parameter)         (**) dmx:                  Major opcode: 148 (RENDER)         (**) dmx:                  Minor opcode: 10 (RenderTrapezoids)         (**) dmx:                  ResourceID:   0x26003b7         (**) dmx:                  Failed serial number:  4504         (**) dmx:                  Current serial number: 4555         (**) dmx: dmxErrorHandler: RenderBadPicture (invalid Picture parameter)         (**) dmx:                  Major opcode: 148 (RENDER)         (**) dmx:                  Minor opcode: 10 (RenderTrapezoids)         (**) dmx:                  ResourceID:   0x26003c0         (**) dmx:                  Failed serial number:  4535         (**) dmx:                  Current serial number: 4555         (**) dmx: dmxErrorHandler: RenderBadPicture (invalid Picture parameter)         (**) dmx:                  Major opcode: 148 (RENDER)         (**) dmx:                  Minor opcode: 10 (RenderTrapezoids)         (**) dmx:                  ResourceID:   0x26003ab         (**) dmx:                  Failed serial number:  4559         (**) dmx:                  Current serial number: 4614              Backtrace:         0: /usr/bin/X11/Xdmx (xorg_backtrace+0x49) [0xb77597f9]         1: /usr/bin/X11/Xdmx (0xb760b000+0x152216) [0xb775d216]         2: (vdso) (__kernel_rt_sigreturn+0x0) [0xb75ec40c]         3: /usr/bin/X11/Xdmx (0xb760b000+0x30cd9) [0xb763bcd9]         4: /usr/bin/X11/Xdmx (0xb760b000+0xa992e) [0xb76b492e]         5: /usr/bin/X11/Xdmx (0xb760b000+0x11a0e5) [0xb77250e5]         6: /usr/bin/X11/Xdmx (0xb760b000+0x208d5) [0xb762b8d5]         7: /lib/i386-linux-gnu/i686/cmov/libc.so.6 (__libc_start_main+0xe6) [0xb7154e46]         8: /usr/bin/X11/Xdmx (0xb760b000+0x20c29) [0xb762bc29]              Segmentation fault at address 0x10              Fatal server error:         Caught signal 11 (Segmentation fault). Server aborting              xinit: connection to X server lost              waiting for X server to shut down       and it is correctly displayed on 192.168.0.104, despite that there are no fonts at all (no clock in bar), when I click on LXDE 'Start' Button, popup reveals but with no fonts, and when I move mouse over this popover - X crashes. xfs works, tested from 192.168.0.104:               fslsfonts -server tcp/192.168.0.102:7100     -adobe-courier-bold-o-normal--0-0-100-100-m-0-iso10646-1     -adobe-courier-bold-o-normal--0-0-100-100-m-0-iso8859-1     -adobe-courier-bold-o-normal--0-0-75-75-m-0-iso10646-1     ...      Both machines have installed debian with lxde.


title: Unpack, modify and pack initrd as a user

text: I've got a problem with rebuilding the `initrd` image as a user. Firstly, when I try to "unpack" the original `initrd` image:               cpio -idm < initrd-base      cpio: dev/tty8: Cannot mknod: Operation not permitted     cpio: dev/tty3: Cannot mknod: Operation not permitted     cpio: dev/zero: Cannot mknod: Operation not permitted     cpio: dev/loop0: Cannot mknod: Operation not permitted     cpio: dev/loop4: Cannot mknod: Operation not permitted     cpio: dev/loop7: Cannot mknod: Operation not permitted     cpio: dev/loop5: Cannot mknod: Operation not permitted     cpio: dev/loop2: Cannot mknod: Operation not permitted     cpio: dev/tty9: Cannot mknod: Operation not permitted     cpio: dev/tty4: Cannot mknod: Operation not permitted     cpio: dev/null: Cannot mknod: Operation not permitted     cpio: dev/loop6: Cannot mknod: Operation not permitted     cpio: dev/loop1: Cannot mknod: Operation not permitted     cpio: dev/console: Cannot mknod: Operation not permitted     cpio: dev/loop3: Cannot mknod: Operation not permitted     cpio: dev/tty1: Cannot mknod: Operation not permitted     133336 blocks      How can I get rid of these warnings? Secondly - I'm not sure how file ownership will be handled. After I unpack it it seems that everything belongs to the current user. How will `initrd` look after repacking it? I prefer to not alter the standard access rights.


title: Display Present working directory in Terminal

text: I am complete newbie to Mac/*nix. This is what I presently see in Mac Terminal as always > EN-AAABBBB:~ username$ Probably, my understanding is `EN-AAABBBB` is my Mac name and followed by username. But I would like to transform this into this format > username@pwd$ How do I achieve this? and some other customization tips are welcome :) [Colors etc..] _Note_ : I tried adding `PS1='\u@ \W \$ '` to `.bash_profile`, now getting the result as > username@ ~ $ `\w or \W` should display working directory, which's not. Any help!


title: grep file from file

text: What is the fastest way to `grep -v` a file against another one, both **line by line**. does `grep` support this ? Or should I use it on two for loops ?


title: Question About Bootloader Partition (Mint)

text: I have a quick question that I ran across while trying to install Linux Mint along with Windows 8 on my computer. I'm pretty new to Linux stuff so I'm sorry if this is pretty obvious. I'm mainly looking for confirmation that my partitioning scheme will work, but also what I should do with the bootloader. I have a hard drive and an SSD, but the hard drive is just being used for storage so I won't really mention it. As it stands, my SSD already has Windows 8 installed on an NTFS partition, as well as a 10GB swap partition and an empty ext4 partition where I plan to install Mint. I have a few questions about this setup   1. Will there be any problems mounting /home on an empty ext4 partition on my hard drive while mounting / on the SSD? I can't see why it would be, but I thought I might as well ask.   2. The Mint installer asks me which device to use for the boot loader installation. The choices on my SSD are:     * /dev/sdb (entire SSD)     * /dev/sdb1 (described as Windows 8 (loader) in menu, which is the NTFS partition with the entire Window 8 installation including bootloader)     * /dev/sdb6 (the ext4 partition where I'm installing Mint) Right now, /dev/sdb1 is marked as my boot partition which makes sense, seeing as that's where the Windows 8 bootloader is. If I choose to install the new bootloader there, would it overwrite the Windows 8 one and mess everything up? My understanding is that Mint installs GRUB, and when you boot into that it gives you the choice of going into Mint or Windows, and if you choose Windows it just jumps over to the Windows bootloader. With this mind, I was thinking that I should just install the bootloader into /dev/sdb6, leaving the Windows partition completely alone and then set /dev/sdb6 as my boot partition. Then when I boot it will go into GRUB, and if I choose the Windows 8 bootloader it will jump over to /dev/sdb1 and start Windows normally. I really don't understand this stuff that well though, so I thought it would definitely be a good idea to ask so I don't make Windows unbootable or something. I also don't understand the choice of putting the bootloader in /dev/sdb since there is no unallocated space on the SSD or anything, so the idea of installing the bootloader across 3 partitions seems a little off to me.


title: In KDE, I would like to make the activities dropdown (from the top left of a window) single select

text: I always want a window on only one activity, so as it stands now, I have to right click activities and select the new activity, then right click activity again and unselect the current activity. Is there a way I can configure the system so clicking one unclicks the other?


title: Switch between numbers and symbols on caps lock

text: Is it possible to set caps lock to switch between inserting numbers and the symbols they normally trigger when one holds shift? e.g. when you normally press the 9 key, you get a `(` unless caps lock is on. I tried adding this line to my layout file, on `/usr/share/X11/xkb/symbols`:               key <AE05> {        [ percent, 5 ]       };      This effectively switches the 'normal' and 'shift' meanings, but it won't work on caps lock - only on shift.


title: How do I install packages permanently on my Beagleboard?

text: I have spent some time getting my BeagleBoard XM computer up and running with the default Angstrom demo image after it has sat unopened for close to a year. I've been able to interact with it through the serial port, and then through putty. I can install packages such as Apache, and it seems to work fine. However, with the exception of writing test files to one specific mount point, all other mount points seem to be temporary. So when I install a new package and then reboot the computer, the package is no longer there. Is there a trick to `opkg`, or do I have to create a new image that builds the bulk of the file systems on the SD card? I am fine with adding packages and programming, but building images is tedious and daunting.


title: last modified with grep

text: I'd like to make a list to stdout of the files modified in the last two hours in the . directory using grep. It has to be automatic (can't ask user what time is it or similar stuff) and I have to use only grep, not conditional statements. I don't know even if it is possible but I'm pretty curious. This is what I've done by now:               #!/bin/bash          #redirect output to a file otherwise grep will read all as one line not giving a readable   output     ls -lrt > ls_out     date > date_extr          # extract hour from date. E interpret what follows as an extended regex. o print only what is matched. m 1 stop after one match     #I'll go back 2 hours     time_=$(date | grep -Eo [0-9]+?: | grep -Eom 1 [0-9]+?)     time_1=$[$time_-1]     time_2=$[$time_-2]          #grep day and month from the previous file "" to include spaces in date_     date_=$(grep -oE [0-9]+\ [A-Za-z]+\  date_extr)     grep "$date_" ls_out > ls_date          #match time as it is if it has 2 digits for example 11, 19, 21. \ number avoid matches as 19: if time_ is 9:     grep \ $time_:      ls_date     grep \ $time_1:     ls_date     grep \ $time_2:     ls_date          #match 09: if time_ output was 9:     grep 0$time_:      ls_date     grep 0$time_1:     ls_date     grep 0$time_2:     ls_date          #cleaning up     rm ls_out ls_date date_extr      It works fine, the only problem is that it doesn't list files modified the day before if the script is run at 00 or 1 a.m. The problem is that ii should grep the date AND the output of ls -lrt and I seem to need an if. In case you are asking the reason of this question, it is the link where I take it with some modifications: http://tldp.org/LDP/Bash-Beginners- Guide/html/sect_04_05.html. Question number 7. Thank you for your time


title: Quick and dirty way to run a process more than once

text: I am looking for very simple bash script that would allow me to launch a process a few times. What's essential to me is that after the processes terminate, everything will clean up automatically. Intended usage:               bash multiplerun.sh 5 executable.sh parameters_to_executable      I could probably write it myself, but it would take me so long that I've decided to ask experts; I'm very little skilled at using *ix systems. EDIT: Oh, and I forgot to add that I want to run them in parallel - running them one after another is pretty straightforward.


title: Does a fault in a kernel module necessarily result in a system crash?

text: Or is it possible to overcome the fault, since the code isn't in the monolithic part of the kernel?


title: Split file into multiple small files, separate by the newline symbol

text: Is there a utility that split file by newline symbol? e.g if a file contains the following lines,               aa     bbb     cccc      If I want to split it to 3 files, the desired output would be: `aa`, `bbb` And `cccc` (in 3 different files) I already checked the `split` command, it only cut file by file sizes, not what I want. If I don't wrote a utility myself, is there any standard tool to use?


title: Save files to mounted partition (fstab), but also main partition

text: I've mounted a USB in `/etc/fstab`:               UUID=xxxx-xxxx /mnt/someFolder auto users,uid=...      I want to save important files to this partition, but I want to have a backup on my normal filesystem in case the partition goes corrupt. The problem is, however, that when I unmount the partition added in fstab the files disappear from the main partition that I'm working on. Q: Is it possible to save my files to both the mounted partition, but also the main partition at the same time without using scripts that copy them? If so, how?


title: recursively change file permission but not directories?

text: I was doing a mass recursive change of permissions of some files that I had migrated to a unix system. I changed them to ug+rw, but then I found that I could not traverse subdirectories. I looked at the man page for `chmod` and didn't see any explanation for excluding directories, so I googled a little and found that people used `find` to recursively change the permissions on directories to 'execute' for user and group. I did that and then I could look into them. But it seemed to me that I should be able to be able to do this find `chmod` -- to recursively change the files to read/write but not make the directories untraversable. Have I done this the 'right' way or is there a simpler way to do it?


title: umount - device is busy

text: Sometimes when I want to umount a device, e.g.               sudo umount /dev/loop0      I will get the message               umount: /mnt: device is busy.             (In some cases useful info about processes that use              the device is found by lsof(8) or fuser(1))      I usually solve this issue by closing a console window (in my case xfce4-terminal) and then `umount`. What does this problem mean? Is there some smarter solution? thanks


title: Multiple dom0's on a single Xen host?

text: I've recently been researching Xen, and this has come up as a quistion for me. Is it possible to have more than 1 dom0 running on a single Xen host? The reason I ask is that this is very similar technology to IBM's Power VM and in particular the VIOS used to own the hardware and manage it on the other LPARs behalf. In our company using LPARs and VIOS we always have 2 VIOS per host so that if one VIOS fails for some reason the other continues to provide access to the hardware for the other LPARs.


title: What to change to place text in the centre of the screen

text: The following program will clear the screen               #include <stdio.h>     int main()     {         fputs("\033[2J", stdout);         return 0;     }      So, what should I modify/add in the above code to put a text string in the middle of screen? Note: screen size is: rows=25, columns=80


title: Is it good to make a separate partition for /boot?

text: I've seen some people make a separate partition for `/boot`. What is the benefit of doing this? What problems might I encounter in the **future** by doing this? * * * Also, except for `/home` and `/boot`, which partitions can be separated? Is it recommended?


title: .sh file cannot be executed without explicitly calling sh

text: This problem has bugged me so much and I can't find a solution. Sorry in advance if it is a newbie question. Let's say I have a file called `run.sh` that contains:               #! /bin/sh -x          x-www-browser index.html      And `ls -l run.sh` says:               -rwxr-xr-x 1 myusername myusername 39 Jan  9 19:32 run.sh      And `./run.sh` says:               bash: ./run.sh: Permission denied      Why does it not work? Why does `sh -x run.sh` work perfectly? * * * **More info, since it's not so easy apparently** If I do a `sudo`, it will not output an error, but won't do anything either.               myusername@crunchbang:/mnt/data$ sudo ./run.sh     [sudo] password for myusername:      myusername@crunchbang:/mnt/data$


title: Does linux have Blackbox like mechanism when system crashed in embeded linux?

text: In embeded linux, some times after the system crashes, we hope there is a blackbox (will record the key info before the system restart) , in linux, is there have such kind of mechanism to record the key data before restart, for example,which process crashed, what's the memory usage? CPU load? kernel log and app log, core dump file and so on?


title: Tmux Split Panes in the same window

text: I am new to using tmux in scripting and I am attempting to manipulate it so when I run a script I can have multiple screens attached and split in my `Putty` session, and also have it color coded and binded so that if I use `ALT+arrow key` it will switch to the next pane. This is what I have so far for coding:               tmux new-session -d -s PortalDB     tmux selectp -t PortalDB     tmux splitw -h -p 50     tmux attach -t PortalDB     tmux set-window-option -g window-status-current-bg yellow     tmux new-session -d -s HardwareAgent     tmux selectp -t HardwareAgent     tmux splitw -h -p 50     tmux attach -t HardwareAgent     tmux set-window-option -g window-status-current-bg blue     tmux new-session -d -s Profile     tmux selectp -t Profile     tmux splitw -h -p 50     tmux attach -t Profile     tmux set-window-option -g window-status-current-bg red     tmux new-session -d -s JoinCode     tmux selectp -t JoinCode     tmux splitw -h -p 50     tmux attach -t JoinCode     tmux set-window-option -g window-status-current-bg green               tmux bind -n M-Left select-pane -L     tmux bind -n M-Right select-pane -R     tmux bind -n M-Up select-pane -U     tmux bind -n M-Down select-pane -D      When I run the script, the color coding works, however I want it to split the screens horizontally, but instead I get this: ![Result](http://i.stack.imgur.com/PQVfO.png) Can someone suggest a way where I can split the panes evenly? Another thing I noticed is that when I run this script, it runs 4 different windows attached to the sessions I named, I just need it to split horizontally 4 times in one window. Can anyone suggest how to make it as such?


title: What is the purpose of kernel module dm_mirror a.k.a. dm-mirror?

text: When running an `$ lsmod` command, the output lists:               dm_mirror              21715  0     dm_region_hash         15984  1 dm_mirror     dm_log                 18072  2 dm_region_hash,dm_mirror      I have tried to search for "dm-mirror module" and found for example a http://en.wikibooks.org/wiki/Linux_Guide/Modules as result. But there were no details. What is the **dm_mirror** module, and what is its purpose?


title: Can I highlight the current prompt line in zsh?

text: Is it possible to highlight (set a background colour) for the whole line of the prompt in `zsh`? In my emacs config I have the line on which the cursor sits a slightly different colour to the window background, which is a great visual aid. I'm wondering whether it's possible to do the same in my terminal/zsh prompt, so that it effectivly "draws a line" under everthing that's been run. I've tried setting `PROMPT='%{$bg[grey]%}# '` in my `.zshrc` but the highlight only extends as far as I type, not to the edge of the terminal. Is what I'm trying to achieve possible?


title: what is the purpose of -i in front of scp and ssh commands?

text: What is the "-i" for in the command "scp -i _key_ *username*@ _address_ : _path 1_ *path 2*"? Note: I've seen "-i" used in ssh commands as well.


title: Why is Compass running on screen 1 printing its output onto screen 0?

text: I'm using 2 `screen` windows for this. `screen` window 0 is mostly used for `git` `screen` window 1 is used exclusively for running `compass` in watch mode. Now, whether I redirect all `compass` (run with the `\--quiet` parameter) output to `/dev/null` (`> /dev/null 2>&1`) or not… this somehow prints a lot of crap onto my `screen` window 0. As I like a clean terminal as much as the next person, I'd like to solve this.


title: terminal: displaying special characters

text: In some programs, such as `htop` the lines and frames are not displayed correctly. Instead, they are displayed as `-` and `/`. ![enter image description here](http://i.stack.imgur.com/09Xkp.png) But on another machine, they are displayed correctly as proper lines: ![enter image description here](http://i.stack.imgur.com/klp54.png) I am not sure if this is a terminal issue, or if perhaps some package is necessary. Can somebody please advise? In case it is relevant: My system is Debian Wheezy, my interpreter is `bash` and my terminal emulator is `gnome-terminal`


I have this piece of code given below as a part of my main script               if [ -e /tmp/rsm/Logs/filename_$$.txt ];     then     {     total=0     for files in $(<filename_$$.txt);     do     #cd /tmp/rsm/Logs     docs=`grep -i "Number.*processed" $files | cut -d" " -f5`     total=$(($total+$docs))     done     echo "---------------------------------------------------------"     echo  "Total Number Of Documents Processed On $date : $total"     echo "---------------------------------------------------------"     }     else     {     echo "There are "0" logfiles processed on $date"     }     fi      which gives the error               SDSLoad_onscreendocs.ksh[32]: 1024+: 0403-053 Expression is not complete; more tokens expected.      Please help me get rid of this error.


title: Create new-window with current directory in tmux

text: Is is possible to open a `new-window` with its working directory set to the one I am currently in. I am using _zsh_ , if it matters.


How can I split a file into multiple files based on pattern using perl? Ex: input to be a .txt file, name of the output file stored in another .txt file


title: Full disc encryption with GRUB2

text: Does anyone know of a good Howto on how to fully encrypt a HDD (even the /boot!) with GRUB2? Is it possible using fedora 14 or ubuntu 10.04?


title: Map a shell command to execute it into vim

text: I want to map, in my `~/vimrc` file, the key `<F4>` in `vim` in order to execute the `indent` program on the file which I'm currently editing. How can I do it? If I do this,the compatibility with `vi` will be broken? Thanks in advance.


title: zsh equivalent of bash show-all-if-ambiguous?

text: In bash, if you hit tab when there are multiple possible completions you get a list of matches that keeps reprinting if you repeatedly press tab. In tcsh, setting autocomplete to enhanced also achieves this. In zsh, you do get the list of matches, but on 2nd, 3rd tab press it starts cycling through matches. Is there a way to get zsh to do the equivalent of bash's show-all-if-ambiguous without the cycling? I'm not looking for the clever but useless "why would you press tab several times if it displayed after the first?". If I had been able to adjust my habits I'd have done so by now.


title: Can't Log into Fedora 19 after force shutdown

text: I was exploring my new fedora 19 after a crash in KDE (I don't know what I just did). I couldn't shutdown my laptop either with the graphical method or the terminal way (because the terminal refused to open). So I forced the shutdown by pressing the shutdown button in my laptop. After I restarted my laptop and entered my password and user, a black screen appeared and went back to logging screen again (the same thing happened with root). So how should I fix this problem?


title: Does CentOS 5.9 need Grub to run on hardware RAID?

text: I'm doing a fresh install of CentOS 5.9 x64 on a server with 8 disks in RAID5. At some point during the install, it gave me the option of configuring Grub, or not bothering. I chose not to bother, since CentOS was the only OS I would be installing. After installing and rebooting, sans install media, it wouldn't boot--just sat there with a blinking cursor at the BIOS message saying it would try to boot from the HD now. Is that normal? So I put the install media back in, rebooted, did `linux rescue`, ..., `chroot ...`, and `grub-install /dev/cciss/c0d0`, and everything looked good. When I reboot without the install media, though, I just get a `grub>` prompt, and no matter how many times I have it write the configuration again, I'm stuck with the grub prompt on boot now, and I'm not even sure I need Grub. Do I actually need it, or is it a false solution to the blinking cursor problem? If I do need it, why is it stuck despite `success` messages when I `root` and `setup`?


title: How to stop `grep` from truncating pipe output

text: Is there any way to have an `echo` at the end of a pipe simply append to the current output rather than removing it all? For example, how can I keep the output for my `cat` and `grep` and add "END OF OUTPUT" to the end of the output from the same pipe:               $ cat file.txt | grep 'foo' | echo "END OF OUTPUT"     something foo      foo     foo something     END OF OUTPUT      Similar to how `cat -` works:               echo "START OF OUTPUT" | cat - file.txt


title: How to track the number of processes and forks per user?

text: I need to figure out how many forks are done and how many concurrent processes are run by each user over time. It does not look like this information is tracked by my distribution. I know how to sets limits, but I'm interested in tracking these numbers for each user.


title: rsyslog conf file problem

text: I'm running Fedora (F19) and my _/var/log/messages_ is filled with info coming from avahi-daemon: stuff like:               Jan 21 14:13:42 localhost avahi-daemon[554]: Invalid response packet from host 10.10.22.3.      from my local network since I read somewhere that it's harmless, but I dont have time at the moment to debug it, I thought about disabling the reporting by modifying _/etc/rsyslog.conf_. I modified this line:               *.info;mail.none;authpriv.none;cron.none   /var/log/messages      to this line               *.info;mail.none;authpriv.none;cron.none;avahi-daemon.none   /var/log/messages      but with the new line rsyslog doesnt work anymore! **systemctl restart rsyslog** reports it as running, but nothing gets ever written in _messages_ - doing stuff that normally gets reported, as stopping&restarting some process (e.g. **systemctl restart cups** ), nothing gets reported. If I restore the _rsyslog.conf_ line as before, the restart of cups gets reported. There is some problem in the way I modified that line?


title: Explanations of an Android image build script

text: I was getting one program for partitioning SD card.I have given that script below:               #!/bin/sh     if [ $# -lt 2 ]; then        echo "example usage: $0 /dev/sdc \$ANDROID_ROOT"        exit 1     fi          DRIVE=$1     ANDROID_ROOT_DIR=$2          sudo umount ${DRIVE}*          sudo dd if=/dev/zero of=$DRIVE bs=1 count=1024     sudo sync     sudo parted $DRIVE mklabel gpt     sudo parted $DRIVE mkpart boot fat32 1MB 9MB     sudo parted $DRIVE mkpart system ext4 9MB 521MB     sudo parted $DRIVE mkpart cache ext4 521MB 1033MB     sudo parted $DRIVE mkpart userdata ext4 1033MB 2033MB     sudo parted $DRIVE mkpart media fat32 2033MB 3033MB     sudo sync          sudo mkfs.ext4 ${DRIVE}2 -L system     sudo mkfs.ext4 ${DRIVE}3 -L cache     sudo mkfs.ext4 ${DRIVE}4 -L userdata     sudo mkfs.vfat -F 32 ${DRIVE}5 -n media     sudo sync          sudo dd if=${ANDROID_ROOT_DIR}/device/ti/panda/xloader.bin of=$DRIVE bs=131072 seek=1     sudo sync     sudo dd if=${ANDROID_ROOT_DIR}/device/ti/panda/bootloader.bin of=$DRIVE bs=262144 seek=1     sudo sync     sudo dd if=${ANDROID_ROOT_DIR}/out/target/product/panda/boot.img of=${DRIVE}1     sudo sync     ${ANDROID_ROOT_DIR}/out/host/linux-x86/bin/simg2img ${ANDROID_ROOT_DIR}/out/target/product/panda/system.img ${ANDROID_ROOT_DIR}/out/target/product/panda/system.ext4.img     sudo dd if=${ANDROID_ROOT_DIR}/out/target/product/panda/system.ext4.img of=${DRIVE}2     sudo sync     sudo e2label ${DRIVE}2 system     sudo sync      I know that while executing this .sh file, the content will be running on linux. Even though I can understand the program, I am having doubt on one line:                ${ANDROID_ROOT_DIR}/out/host/linux-x86/bin/simg2img ${ANDROID_ROOT_DIR}/out/target/product/panda/system.img ${ANDROID_ROOT_DIR}/out/target/product/panda/system.ext4.img      Please anyone can explain what happens in this line? there is no linux command, then how can it run without error? And another doubt is: This code `parted` `DRIVE` as 5 partition as boot, system, cache, userdata and media. But why does boot not created? that is, `{DRIVE}1` is not set know? Then where will be `xloader.bin, bootloader.bin and boot.img` all stored?


title: Using multiple NICs for faster internet?

text: My laptop have a ethernet card and a wifi card. Ethernet line have maximum download rate at 1.5MiB/sec and wifi is over 1MiB/sec too, but it seem only have one NIC can working at a moment (if I turn on ethernet then system not using wifi althought it's connected). I want using 2 NICs at the same time for faster internet speed (may be around 2.5MiB/sec??), how can I do that? **Update:**   I mean, `Download Them All` plugin for firefox report my internet speed (over ethernet card) when download a movie is 1.5MB/s and other internet speed (over wireless card) is 1.0MB/s. How can I use two NICs at the same time to download a file? **Update 2:** Here is two different internet connections for wifi and ethernet, once have maximum is 1.5MB/s and once have maximum is 1.0MB/s My laptop is: HP CQ40 129TU (pretty old :D)   Wireless card: BCM4312 (b43 module)


title: How do I isolate my file system data from another system root?

text: I have a linux machine(kubuntu 13.04)   A my friend asked me give him an account with being able to use `sudo`. So, I made an account for him and put the account in `/etc/group` for him to use `sudo`   I don't care he installs or manages any programs but don't want him to access my home folder `/home/myaccount` and its sub folders. How can I do this?


title: Does any Linux distribution support setting mouse scroll wheel sensitivity?

text: I have tried Ubuntu 13.04 and Linux Mint 15 and both **DO NOT HAVE** optinos for setting mouse scroll wheel sensitivity. They had only mouse acceleration and sensitivity, but the scroll wheel speed you cannot set in these distributions. It's frustrating, to not be able to set this thing. Is this only a problem of Gnome distros or KDE and Xfce has the same problems too?


title: dxdiag.dll out of date? (Debian Wheezy 64 bit)

text: I am currently trying to make South Park: Stick of Truth work on Debian Wheezy (64 bit). Currently, upon launching the game, the game locks whatever workspace I'm on and I have to use xkill to stop it running. I have reason to believe that the error is related to directx and upon trying to figure the software by running               wine ~/.wine/drive_c/windows/system32/dxdiag.exe      I receive an error:               ERROR: DXDIAGN.DLL IS OUT OF DATE      Is there anyone out there who can help me?


title: How to reset the file descriptor

text: I was trying to use file descriptor for printing the lines in the file               #!/usr/bin/ksh     exec 3<&0     exec 0< file.txt     while read LINE     do        echo “$LINE”     done      and I am done with my code ,it prints the output as like my wish I forgot to reset the file descriptor of 0               exec 0<&3      what will happen ?   1. The descriptor scope will last only inside the program or entire unix shell?   2. How we come to know which value is holding which file descriptor (printing the values of file descriptor using shell)   3. It will automatically reset the system (AIX) is restarted ?


title: Is it possible to mount one H.D.D. via USB Hub on two PCs?

text: Having a HDD Drive on a USB hub with two partitions. Can I mount first partition to Computer A and second partition to Computer B without trouble? Or even better, would it be possible to mount one partition to both computers?


title: Why do I get fsync() failed: Disk quota exceeded on my linux machine?

text: I get `fsync() failed: Disk quota exceeded` but when I use `df -h` and `df -i` there is enough space in all the folders. What can I do?


title: How to retrieve dual-boot option after Windows reinstall?

text: Initially I had set up Slackware 13.37 and Windows 7 Home Premium dual boot. After upgrading to Windows 7 Ultimate, the dual-boot window does not show anymore so I cannot choose to boot Slackware. Is there a way to fix this without deleting the Slackware partition and reinstalling?


title: Suppressing "sudo: sorry, a password is required to run sudo"

text: I am trying to test if a user has the required sudo rights to run a command as another user without providing a password. What I have is this                sudo -u other-user -n true       if [ $? -ne 0 ]; then         echo "ERROR: You don't have the neccessary sudo rights"       else         echo "OK. You do have the neccessary sudo rights"       fi      However, the scripts prints this error message if sudo requires a password                 sudo: sorry, a password is required to run sudo      Is it possible to suppress this error message? I have tried to redirect both system err and system out but the error message still appears.                 sudo -u other-user -n true > /dev/null 2>&1


title: Copy Sequential Files

text: I have 12 files named `dmp_000, dmp_001`, etc, all the way to dmp_011. I would like to copy all of them to rdmp_000, rdmp_001, and so on, sequentially so the numbered files coincide. There must be an easy way to do this rather than individually? Thank you!


title: unbuffer/expect swallows the rcode when its child is signaled

text: `unbuffer` is able to pass along the return code of a process under normal circumstance, but if the process you are unbuffering is killed, for instance with a segfault, I see `$?` as `0` while I expect `139`. How can I get it to pass along the `139`? e.g. if I `unbuffer` a bash script that has simply `exit 1`, I get `$?` as `1`. If I unbuffer a bash script that has `kill -11 $$`, I get `0`. `unbuffer` is actually just an `expect` script that comes with `expect`, but I don't know it well enough to decifer why the return code is not passed along.


title: Bash STDERR still appearing after redirection

text: I am trying to parse the output of `yum check-update` in Bash 4 (Red Hat) and want to skip the first line that states: _'This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.'_ I used strace to determine the FD and it appears to be 2/STDERR but redirecting it with `2>/dev/null` does not work. What could be the cause? Strace output:               write(2, "This system is not registered to"..., 112This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.     ) = 112


title: Bash ignoring my PATH and it's cache

text: I have installed pip in my ~/.local/bin/ directory. Here are the outputs of which, type and $PATH               $ type pip     pip is hashed (/home/bcc/pedros/.local/bin/pip)     $ which pip     /usr/bin/pip     $ echo $PATH     ~/.local/bin/:~/bin:~/.bin:/global/bin:/opt/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games      I can't figure out whats wrong with my PATH. This is affecting other installations in my linux as well. My linux:               Distributor ID: Debian     Description:    Debian GNU/Linux 6.0.7 (squeeze)


title: Internet SSH Server Security Considerations

text: What steps should I take to reasonably secure my linux desktop before opening sshd to the Internet so I can connect from anywhere?


title: Show only hidden files (dot files) in ls alias

text: I'm using the command `ls -a | grep '^\\.'` for showing only the hidden files. I added the line `alias hidden='ls -a | grep '^\\.'' # show only hidden files` to `.bash_aliases` file but this does not work. It's probably the problem with `'` character. Could you please help me write the correct alias (and possible rename the title for this question)?


title: Show older or newer history items with the history command in zsh

text: I typed in the history command and it showed me the last 10 commands executed by me. Now I wanted to see the last 20 commands executed by me so (after reading the documentation): > An argument of n lists only the last n lines. I typed in `history 20`. This showed me all the commands starting from command number 20 to the current command which was somewhere around 2000. So I tried `history -20` and this works. It shows me the last 20 commands. But this is not what is said in the documentation. Also `history -d [offset]` is supposed to delete the command on that offset. Even that does not work in my zsh. This is straight out of my zsh shell : ![enter image description here](http://i.stack.imgur.com/Oz3Mk.png)


title: BluRay Burner High I/O Wait State with UDF; Optimization Possible?

text: I've recently scaled back my home network, with one of the bigger changes being a switch-over to using a BD-RE drive for backup. With years of pictures and home video consuming about 25GB, and [important] documents well under 10GB, this SEEMED like a great way to go. Everything WORKS perfectly, my only concern is the overhead. I have the disc formatted UDF, and a script running `rsync` nightly to sync up selected paths in the filesystem to the drive. During the sync, My CPU(s) are showing roughly 25% in the wait state. This wouldn't be so bad, but it STAYS at this level for a very long time, and in the process, slows everything down to a crawl. I've even observed my load average spiking to 15.9+ (on a Core 2 Quad). The "actual" CPU utilization during this time is only around 6% (ALL VMs combined), so this is strictly an I/O bottleneck. Documentation specific to Blu-Ray burners is scarce (under Linux) compared to everything else, and I've never had an I/O bottleneck high enough to warrant any in-depth analysis. Considering the drive is burning at 2x (~9MB/s), it should complete in roughly an hour, but instead runs for many hours. Is there any way to optimize this to reduce the wait states? Am I simply constrained by kernel drivers/hardware/??? Is this just a nasty side-effect of using UDF that I'm unaware of? Could this have anything to do with running 3 VMs (2x Windows & 1x MythTV) as well as NFS along with this process? Is there any way to determine with certainty which piece of the puzzle is the problem? Sorry for the barrage of questions at the end; any help is greatly appreciated. **EDIT:** After the answer from psusi, I had a thought; is there a way to prioritize I/O on a per-device basis? Something along the lines of "guaranteed XXX PCI card 1MB/s", "limit XXX block device to 20MB/s", etc.???


title: Virtual hosting a tomcat webapp in Apache on RHEL 5.0

text: I am in a hosting fix! I have developed a web app for my organisation that allows sharing, interacting, etc. I want to DEPLOY IT ON LAN. BUT... I don't want the end user to type: `10.21.34.56:8080/webapp` Instead I want him to type: `http://www.webapp.com` and let the local DNS on the intranet resolve it to the corresponding IP. I can do a little..I succeed in this: "www.webapp.com:8080". > **I don't want the 8080 to be typed.** Though I found a way to do this. I am not fully satisfied. The browser by default sends all the http requests to port 80. So, I used iptables on the server, and redirected the request to port 8080. That didn't seem worthwhile discovery. SO, I hear about virtual hosting on apache-tomcat, which they say is a solution to this. Show me light!


title: How to put the completed downloads in a directory with aria2c?

text: alias download='while true; do timeout -s 9 1260 aria2c *.torrent --lowest-speed-limit=1024 --disable-ipv6=true --seed-time=0 --max-connection-per-server=6 --enable-rpc=false; sleep 1; done'     alias seed='aria2c --check-integrity=false --bt-seed-unverified=true --lowest-speed-limit=1024 --disable-ipv6=true --max-connection-per-server=6 -d . *.torrent --seed-time=999999 --seed-ratio=999999.0'      So I'm using these aliases with aria2 to download torrent files. Theres only 1 problem with this: how can I put the finished downloads in a directory? (using the "download" alias) p.s.: the "while true..." in the "download" alias is there because the download "slows down"... after a while, and I need to restart aria2c :D


title: "tar: unrecognized option --warning" during 'apt-get install'

text: I just ran `apt-get upgrade` on my debian 5 vps and I got this error: > tar: unrecognized option `--warning=no-timestamp' Now when I try to install other packages e.g: imagemagick I get the same error:               li197-162:~# apt-get install imagemagick     Reading package lists... Done     Building dependency tree            Reading state information... Done     The following packages were automatically installed and are no longer required:       pkg-config comerr-dev libssh2-1-dev libpcre3-dev libdb4.6-dev libsqlite3-dev libmysqlclient15-dev libldap2-dev libpcrecpp0 libexpat1-dev libpq5 libidn11-dev     Use 'apt-get autoremove' to remove them.     The following extra packages will be installed:       fontconfig-config imagemagick-common libfontconfig1 libfreetype6 libglib2.0-0 libice6 libjasper1 libjpeg8 liblcms1 liblqr-1-0 libltdl7 libmagickcore4 libmagickwand4 libpng12-0 libsm6 libtiff4       libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxext6 libxml2 libxml2-dev libxt6 ttf-dejavu-core x11-common     Suggested packages:       imagemagick-doc autotrace cups-bsd lpr lprng enscript ffmpeg gimp gnuplot grads hp2xx html2ps libwmf-bin mplayer povray radiance sane-utils texlive-base-bin transfig xdg-utils libjasper-runtime       liblcms-utils     Recommended packages:       libmagickcore4-extra ghostscript netpbm ufraw-batch libglib2.0-data shared-mime-info gsfonts xml-core     The following NEW packages will be installed:       fontconfig-config imagemagick imagemagick-common libfontconfig1 libfreetype6 libice6 libjasper1 libjpeg8 liblcms1 liblqr-1-0 libltdl7 libmagickcore4 libmagickwand4 libpng12-0 libsm6 libtiff4       libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxext6 libxt6 ttf-dejavu-core x11-common     The following packages will be upgraded:       libglib2.0-0 libxml2 libxml2-dev     3 upgraded, 25 newly installed, 0 to remove and 190 not upgraded.     Need to get 0B/11.2MB of archives.     After this operation, 22.4MB of additional disk space will be used.     Do you want to continue [Y/n]? Y     Preconfiguring packages ...     x11-common template parse error: Template parse error near `Choices-sr@latin.UTF-8: Samo glavni korisnik, Samo za korisnike konzole, Svako', in stanza #1 of /tmp/x11-common.template.65052          tar: unrecognized option `--warning=no-timestamp'     Try `tar --help' or `tar --usage' for more information.     dpkg-deb: error: subprocess tar returned error exit status 64     dpkg: error processing /var/cache/apt/archives/libfreetype6_2.4.6-2_i386.deb (--unpack):      subprocess dpkg-deb --control returned error exit status 2     tar: unrecognized option `--warning=no-timestamp'     Try `tar --help' or `tar --usage' for more information.     dpkg-deb: error: subprocess tar returned error exit status 64     dpkg: error processing /var/cache/apt/archives/ttf-dejavu-core_2.33-2_all.deb (--unpack):      subprocess dpkg-deb --control returned error exit status 2     tar: unrecognized option `--warning=no-timestamp'     Try `tar --help' or `tar --usage' for more information.     dpkg-deb: error: subprocess tar returned error exit status 64     dpkg: error processing /var/cache/apt/archives/fontconfig-config_2.8.0-3_all.deb (--unpack):      subprocess dpkg-deb --control returned error exit status 2     tar: unrecognized option `--warning=no-timestamp'     Try `tar --help' or `tar --usage' for more information.     dpkg-deb: error: subprocess tar returned error exit status 64     dpkg: error processing /var/cache/apt/archives/libfontconfig1_2.8.0-3_i386.deb (--unpack):      subprocess dpkg-deb --control returned error exit status 2     tar: unrecognized option `--warning=no-timestamp'     Try `tar --help' or `tar --usage' for more information.     dpkg-deb: error: subprocess tar returned error exit status 64     dpkg: error processing /var/cache/apt/archives/x11-common_1%3a7.6+9_all.deb (--unpack):      subprocess dpkg-deb --control returned error exit status 2     tar: unrecognized option `--warning=no-timestamp'     Try `tar --help' or `tar --usage' for more information.     dpkg-deb: error: subprocess tar returned error exit status 64     dpkg: error processing /var/cache/apt/archives/libice6_2%3a1.0.7-2_i386.deb (--unpack):      subprocess dpkg-deb --control returned error exit status 2     tar: unrecognized option `--warning=no-timestamp'     Try `tar --help' or `tar --usage' for more information.     dpkg-deb: error: subprocess tar returned error exit status 64     dpkg: error processing /var/cache/apt/archives/libpng12-0_1.2.46-3_i386.deb (--unpack):      subprocess dpkg-deb --control returned error exit status 2     tar: unrecognized option `--warning=no-timestamp'     Try `tar --help' or `tar --usage' for more information.     dpkg-deb: error: subprocess tar returned error exit status 64     dpkg: error processing /var/cache/apt/archives/libsm6_2%3a1.2.0-2_i386.deb (--unpack):      subprocess dpkg-deb --control returned error exit status 2     tar: unrecognized option `--warning=no-timestamp'     Try `tar --help' or `tar --usage' for more information.     dpkg-deb: error: subprocess tar returned error exit status 64     dpkg: error processing /var/cache/apt/archives/libjpeg8_8c-2_i386.deb (--unpack):      subprocess dpkg-deb --control returned error exit status 2     tar: unrecognized option `--warning=no-timestamp'     Try `tar --help' or `tar --usage' for more information.     dpkg-deb: error: subprocess tar returned error exit status 64     dpkg: error processing /var/cache/apt/archives/libtiff4_3.9.5-2_i386.deb (--unpack):      subprocess dpkg-deb --control returned error exit status 2     tar: unrecognized option `--warning=no-timestamp'     Try `tar --help' or `tar --usage' for more information.     dpkg-deb: error: subprocess tar returned error exit status 64     dpkg: error processing /var/cache/apt/archives/libxau6_1%3a1.0.6-3_i386.deb (--unpack):      subprocess dpkg-deb --control returned error exit status 2     tar: unrecognized option `--warning=no-timestamp'     Try `tar --help' or `tar --usage' for more information.     dpkg-deb: error: subprocess tar returned error exit status 64     dpkg: error processing /var/cache/apt/archives/libxdmcp6_1%3a1.1.0-3_i386.deb (--unpack):      subprocess dpkg-deb --control returned error exit status 2     tar: unrecognized option `--warning=no-timestamp'     Try `tar --help' or `tar --usage' for more information.     dpkg-deb: error: subprocess tar returned error exit status 64     dpkg: error processing /var/cache/apt/archives/libxcb1_1.7-3_i386.deb (--unpack):      subprocess dpkg-deb --control returned error exit status 2     tar: unrecognized option `--warning=no-timestamp'     Try `tar --help' or `tar --usage' for more information.     dpkg-deb: error: subprocess tar returned error exit status 64     dpkg: error processing /var/cache/apt/archives/libx11-data_2%3a1.4.4-2_all.deb (--unpack):      subprocess dpkg-deb --control returned error exit status 2     tar: unrecognized option `--warning=no-timestamp'     Try `tar --help' or `tar --usage' for more information.     dpkg-deb: error: subprocess tar returned error exit status 64     dpkg: error processing /var/cache/apt/archives/libx11-6_2%3a1.4.4-2_i386.deb (--unpack):      subprocess dpkg-deb --control returned error exit status 2     tar: unrecognized option `--warning=no-timestamp'     Try `tar --help' or `tar --usage' for more information.     dpkg-deb: error: subprocess tar returned error exit status 64     dpkg: error processing /var/cache/apt/archives/libxext6_2%3a1.3.0-3_i386.deb (--unpack):      subprocess dpkg-deb --control returned error exit status 2     tar: unrecognized option `--warning=no-timestamp'     Try `tar --help' or `tar --usage' for more information.     dpkg-deb: error: subprocess tar returned error exit status 64     dpkg: error processing /var/cache/apt/archives/libxt6_1%3a1.1.1-2_i386.deb (--unpack):      subprocess dpkg-deb --control returned error exit status 2     tar: unrecognized option `--warning=no-timestamp'     Try `tar --help' or `tar --usage' for more information.     dpkg-deb: error: subprocess tar returned error exit status 64     dpkg: error processing /var/cache/apt/archives/libxml2-dev_2.7.8.dfsg-4_i386.deb (--unpack):      subprocess dpkg-deb --control returned error exit status 2     tar: unrecognized option `--warning=no-timestamp'     Try `tar --help' or `tar --usage' for more information.     dpkg-deb: error: subprocess tar returned error exit status 64     dpkg: error processing /var/cache/apt/archives/libxml2_2.7.8.dfsg-4_i386.deb (--unpack):      subprocess dpkg-deb --control returned error exit status 2     tar: unrecognized option `--warning=no-timestamp'     Try `tar --help' or `tar --usage' for more information.     dpkg-deb: error: subprocess tar returned error exit status 64     dpkg: error processing /var/cache/apt/archives/libglib2.0-0_2.28.6-1_i386.deb (--unpack):      subprocess dpkg-deb --control returned error exit status 2     tar: unrecognized option `--warning=no-timestamp'     Try `tar --help' or `tar --usage' for more information.     dpkg-deb: error: subprocess tar returned error exit status 64     dpkg: error processing /var/cache/apt/archives/liblcms1_1.19.dfsg-1_i386.deb (--unpack):      subprocess dpkg-deb --control returned error exit status 2     tar: unrecognized option `--warning=no-timestamp'     Try `tar --help' or `tar --usage' for more information.     dpkg-deb: error: subprocess tar returned error exit status 64     dpkg: error processing /var/cache/apt/archives/liblqr-1-0_0.4.1-1.1_i386.deb (--unpack):      subprocess dpkg-deb --control returned error exit status 2     tar: unrecognized option `--warning=no-timestamp'     Try `tar --help' or `tar --usage' for more information.     dpkg-deb: error: subprocess tar returned error exit status 64     dpkg: error processing /var/cache/apt/archives/libltdl7_2.4-4_i386.deb (--unpack):      subprocess dpkg-deb --control returned error exit status 2     tar: unrecognized option `--warning=no-timestamp'     Try `tar --help' or `tar --usage' for more information.     dpkg-deb: error: subprocess tar returned error exit status 64     dpkg: error processing /var/cache/apt/archives/libjasper1_1.900.1-10_i386.deb (--unpack):      subprocess dpkg-deb --control returned error exit status 2     tar: unrecognized option `--warning=no-timestamp'     Try `tar --help' or `tar --usage' for more information.     dpkg-deb: error: subprocess tar returned error exit status 64     dpkg: error processing /var/cache/apt/archives/imagemagick-common_8%3a6.6.9.7-5_all.deb (--unpack):      subprocess dpkg-deb --control returned error exit status 2     tar: unrecognized option `--warning=no-timestamp'     Try `tar --help' or `tar --usage' for more information.     dpkg-deb: error: subprocess tar returned error exit status 64     dpkg: error processing /var/cache/apt/archives/libmagickcore4_8%3a6.6.9.7-5+b1_i386.deb (--unpack):      subprocess dpkg-deb --control returned error exit status 2     tar: unrecognized option `--warning=no-timestamp'     Try `tar --help' or `tar --usage' for more information.     dpkg-deb: error: subprocess tar returned error exit status 64     dpkg: error processing /var/cache/apt/archives/libmagickwand4_8%3a6.6.9.7-5+b1_i386.deb (--unpack):      subprocess dpkg-deb --control returned error exit status 2     tar: unrecognized option `--warning=no-timestamp'     Try `tar --help' or `tar --usage' for more information.     dpkg-deb: error: subprocess tar returned error exit status 64     dpkg: error processing /var/cache/apt/archives/imagemagick_8%3a6.6.9.7-5+b1_i386.deb (--unpack):      subprocess dpkg-deb --control returned error exit status 2     Errors were encountered while processing:      /var/cache/apt/archives/libfreetype6_2.4.6-2_i386.deb      /var/cache/apt/archives/ttf-dejavu-core_2.33-2_all.deb      /var/cache/apt/archives/fontconfig-config_2.8.0-3_all.deb      /var/cache/apt/archives/libfontconfig1_2.8.0-3_i386.deb      /var/cache/apt/archives/x11-common_1%3a7.6+9_all.deb      /var/cache/apt/archives/libice6_2%3a1.0.7-2_i386.deb      /var/cache/apt/archives/libpng12-0_1.2.46-3_i386.deb      /var/cache/apt/archives/libsm6_2%3a1.2.0-2_i386.deb      /var/cache/apt/archives/libjpeg8_8c-2_i386.deb      /var/cache/apt/archives/libtiff4_3.9.5-2_i386.deb      /var/cache/apt/archives/libxau6_1%3a1.0.6-3_i386.deb      /var/cache/apt/archives/libxdmcp6_1%3a1.1.0-3_i386.deb      /var/cache/apt/archives/libxcb1_1.7-3_i386.deb      /var/cache/apt/archives/libx11-data_2%3a1.4.4-2_all.deb      /var/cache/apt/archives/libx11-6_2%3a1.4.4-2_i386.deb      /var/cache/apt/archives/libxext6_2%3a1.3.0-3_i386.deb      /var/cache/apt/archives/libxt6_1%3a1.1.1-2_i386.deb      /var/cache/apt/archives/libxml2-dev_2.7.8.dfsg-4_i386.deb      /var/cache/apt/archives/libxml2_2.7.8.dfsg-4_i386.deb      /var/cache/apt/archives/libglib2.0-0_2.28.6-1_i386.deb      /var/cache/apt/archives/liblcms1_1.19.dfsg-1_i386.deb      /var/cache/apt/archives/liblqr-1-0_0.4.1-1.1_i386.deb      /var/cache/apt/archives/libltdl7_2.4-4_i386.deb      /var/cache/apt/archives/libjasper1_1.900.1-10_i386.deb      /var/cache/apt/archives/imagemagick-common_8%3a6.6.9.7-5_all.deb      /var/cache/apt/archives/libmagickcore4_8%3a6.6.9.7-5+b1_i386.deb      /var/cache/apt/archives/libmagickwand4_8%3a6.6.9.7-5+b1_i386.deb      /var/cache/apt/archives/imagemagick_8%3a6.6.9.7-5+b1_i386.deb     E: Sub-process /usr/bin/dpkg returned an error code (1)     li197-162:~#       I really have no idea what is wrong and how to fix this. Is it possible to undo an `apt-get upgrade`?


title: Is there a checklist for getting the "beep" program to work?

text: Debian has a program called "beep" available, that lets you make the computer beep at whatever frequency or time you want. http://packages.debian.org/wheezy/beep The problem that many people seem to have is that they don't want their computers to beep, so they complain about the beeps, and then the default gets set to things like pcspkr module getting blacklisted and other stuff that stops beeping, and unfortunately stops the beep program from working. I want beep to work! I like being able to make the computer beep for various reasons. But I don't know all the things to check to figure out why it doesn't work, so I go for workarounds like getting wav files and playing them. I would much rather just get beep to work! Does anybody know all the things that have to be checked to get beep to work? Already I've checked that the pcspkr module isn't blacklisted and is loaded, and checked the volume levels and muting using alsamixer. But still no beeps. How can I make my computers beep please?


title: How to change readline's/bash's meta key?

text: Readline/bash use the meta key quite often but it only works when I use the Esc-key for it. How can I configure bash/readline to accept a different key as meta?


title: How to get list of available wireless networks without being root

text: I would like to get a list of all the wireless networks.               iwlist wlan0 scan | grep ESSID      This will only show me the wireless network I am currently connected to. When I run the command as root, it shows me all the available networks. If I run the command without sudo quickly after this, all the networks will show up, but after a while they are all gone except the network I am currently connected to. Is there a way to get all the available networks when I am not root?


title: Managing multiple Vims (vim and MacVim)

text: My machine came with Vim 7.3 and I just installed MacVim 7.4, so now I'm juggling both and I'm not sure how to manage the two. I'm plagued by questions like:   * Should I remove the older version?   * Where should MacVim be located? Currently MacVim.app is in `/Applications`, and I see a couple executables at `/Applications/MacVim.app/Contents/MacOS/MacVim` and `/Applications/MacVim.app/Contents/MacOS/Vim`. The pre-installed Vim 7.3 is sitting at `/usr/bin/vim`. I'd like to be able to use 7.4 both from the terminal and in MacVim. I haven't installed MacVim's "mvim" script and not sure I will. What is the best way to set this up?


title: Source of Fedora Core 6 Live CD

text: I have spent quite a bit of time trying to search for a source for the above. There are many webpages pointing to (what I believe is) the original link - http://download.fedora.redhat.com/pub/fedora/projects/live/FC-6-i386-livecd-1.iso However, using this with the below hopeful's was unfruitful ( _Added to_ ): _The Internet Archive - Software Collection_   The internet Archive - Way Back Machine (All crawled dates)   Google's cache   http://www.oldversion.com/linux/ Can anyone point me in the right direction? **EDIT:** Also, as goldilocks reminded me due to this comment, I should have pointed out - Have found the archives at http://mirrors.fedoraproject.org/publiclist/Fedora/6/i386/ and (not like they should be very different) looked through all of them.