title: How to examine the fast output of rsync

text: I am using rsync for backup about 100GB files and directories. My command is               sudo rsync -azvv /home/path/folder1/ /home/path/folder2      However, the output for each file goes up so quickly and there are so many files, that I worry if there are some errors I cannot catch. So I wonder how you would catch any errors during backup?


title: How to check on which drives grub2 has actually installed an MBR?

text: I'm on a Debian/Squeeze system (with a history going back to at least Woody) which was upgraded to grub2 as part of the Squeeze upgrade. All works well, but I'm about to mess with the disk configuration. Currently the machine runs off 2 80GB drives with RAID1-ed /, /home and /boot partitions (there's another pair of drives with a RAID1-ed "/data" and a couple of swaps, in case anyone was wondering where the swap is, but I'm not touching those). I've added 2 130GB SSDs, partitioned them to be at least as large as the partitions on the 80GB drives, and intend to switch over to the new SSD drives by growing the RAID1s to include them, waiting for sync, then removing the old drives from the arrays so just the SSDs are left (and then growing the filesystems). But mdadm/ext3 wrangling is not what this question is about... That'll leave me with 2 obsolete 80GB (IDE) drives which I want to remove from the machine. My worry is that removing them will take some crucial MBR with them. How do I ensure the machine remains bootable ? More specifically:   * When I did the Squeeze upgrade, I remember there was some choice presented about which drives grub2 should install to (I went with the default, which was all drives). The SSDs weren't in the machine at the time though; how can I rerun this to get grub to install on the SSD MBRs ? (I'm guessing it's a dpkg-reconfigure of some package).   * How can I find which drives grub2 thinks it's installed on ? Good grief there are almost 200 files under /boot/grub/ these days! Where to look ? Also, it seems slightly odd that /boot/grub/device.map.auto only lists 3 drives currently (2 of the 80GBs but only one of the other drive pair, and none of the SSDs). How do I get that up to date ? ( **Update:** that was a red herring; device.map.auto seems to be a relic from years ago; device.map looked sensible on an update by grub-mkdevicemap. Think my paranoia in this area originates from an old mobo's BIOS which would reorder the device order seen by GRUB on a whim). **Outcome:** all went well and I now have the two old 80GB IDE drives out of the box, and a snappy and quick booting system running off RAID1-ed SSDs with all filesystems resized up to their new partition sizes. The other "missing piece of the Grub puzzle" I was looking for was `dpkg-reconfigure grub-pc` which prompts for which disks to maintain a MBR on. Aaron's answer actually did most to reassure me that this was working as expected, hence accepting that answer.


title: Unix read -p command causes bash error, how do I fix it?

text: I'm trying to prompt the user for a comment               function comment {       if [ ! $1 ]       then        read -p "enter checkin comment < " COMMENT;            else        export COMMENT="$1"       fi             if [ ! $COMMENT ]       then         echo 'no comment!'       else         echo "$COMMENT";       fi       }      **UPDATED** This happens when I enter more than one word into the prompt, if I enter "update" for example I dont get an error message... but if I enter more than one word               enter checkin comment >> sun mars venus      then I get the error (always on the second word)               -bash: [: mars: binary operator expected


title: How does ssh pick which key to use?

text: I'm using the following as a forced command with hg-ssh. This forced command is designed to just allow pushes with hg. However, I must be doing something wrong, because I can actually log in with this key. I've used this for a while, and my recollection is that it used to exit immediately if I used this key to try to log in. I have this following in `.ssh/authorized_keys`.               command="cd /srv/hg/faheem && find . -mindepth 1 -maxdepth 4 -type d -exec /usr/bin/hg-ssh {} +",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-rsa public_key      This may have an obvious answer, but I don't even know what the shell command               cd /srv/hg/faheem && find . -mindepth 1 -maxdepth 4 -type d -exec /usr/bin/hg-ssh {} +      is doing, exactly. Stack Exchange automatically produced this related question that I asked in 2011 and forgot about, so it looks like I got this command from this answer of @Gilles. **UPDATE:** I have two keys for the same local-remote combination. One of these is set up as a regular key in `~/.ssh/authorized_keys`. I.e. it looks like               ssh-rsa public_key      The other is as given above. The regular key is listed first, and the forced- command key second in `~/.ssh/authorized_keys`. From the output of `ssh -vvv` the "regular" key is being used. Here are the relevant stanzas client-side in `.ssh/config`.               Host ramnode     Hostname xx.x.xxx.xxx     ForwardX11 yes          Host ramnode_hg     Hostname xx.x.xxx.xxx     ForwardX11 yes     identityfile ~/.ssh/id_rsa_bulldog_hg      The first is the "regular" key, the second is the forced-command key. Perhaps it is not possible to specify which key should be used, and that ssh just tries keys in order in `~/.ssh/authorized_keys` till something works. **UPDATE 2:** Having tried switching the order of the keys in `~/.ssh/authorized_keys`, with the forced-command key first, this appears to not be the case. Doing               ssh ramnode_hg      still logs me in to the machine. **UPDATE 3:** The output of `ssh -vvv` when logging into the machine.               OpenSSH_6.0p1 Debian-4+deb7u1, OpenSSL 1.0.1e 11 Feb 2013     debug1: Reading configuration data /home/faheem/.ssh/config     debug1: /home/faheem/.ssh/config line 122: Applying options for ramnode_hg     debug1: Reading configuration data /etc/ssh/ssh_config     debug1: /etc/ssh/ssh_config line 19: Applying options for *     debug2: ssh_connect: needpriv 0     debug1: Connecting to xx.x.xxx.xxx [xx.x.xxx.xxx] port 22.     debug1: Connection established.     debug3: Incorrect RSA1 identifier     debug3: Could not load "/home/faheem/.ssh/id_rsa_bulldog_hg" as a RSA1 public key     debug1: identity file /home/faheem/.ssh/id_rsa_bulldog_hg type 1     debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048     debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048     debug1: identity file /home/faheem/.ssh/id_rsa_bulldog_hg-cert type -1     debug1: Remote protocol version 2.0, remote software version OpenSSH_6.0p1 Debian-4+deb7u1     debug1: match: OpenSSH_6.0p1 Debian-4+deb7u1 pat OpenSSH*     debug1: Enabling compatibility mode for protocol 2.0     debug1: Local version string SSH-2.0-OpenSSH_6.0p1 Debian-4+deb7u1     debug2: fd 3 setting O_NONBLOCK     debug3: load_hostkeys: loading entries for host "xx.x.xxx.xxx" from file "/home/faheem/.ssh/known_hosts"     debug3: load_hostkeys: found key type ECDSA in file /home/faheem/.ssh/known_hosts:68     debug3: load_hostkeys: loaded 1 keys     debug3: order_hostkeyalgs: prefer hostkeyalgs: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521     debug1: SSH2_MSG_KEXINIT sent     debug1: SSH2_MSG_KEXINIT received     debug2: kex_parse_kexinit: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1     debug2: kex_parse_kexinit: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-rsa-cert-v01@openssh.com,ssh-dss-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-dss-cert-v00@openssh.com,ssh-rsa,ssh-dss     debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se     debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se     debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96     debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96     debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib     debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib     debug2: kex_parse_kexinit:     debug2: kex_parse_kexinit:     debug2: kex_parse_kexinit: first_kex_follows 0     debug2: kex_parse_kexinit: reserved 0     debug2: kex_parse_kexinit: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1     debug2: kex_parse_kexinit: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256     debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se     debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se     debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96     debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96     debug2: kex_parse_kexinit: none,zlib@openssh.com     debug2: kex_parse_kexinit: none,zlib@openssh.com     debug2: kex_parse_kexinit:     debug2: kex_parse_kexinit:     debug2: kex_parse_kexinit: first_kex_follows 0     debug2: kex_parse_kexinit: reserved 0     debug2: mac_setup: found hmac-md5     debug1: kex: server->client aes128-ctr hmac-md5 none     debug2: mac_setup: found hmac-md5     debug1: kex: client->server aes128-ctr hmac-md5 none     debug1: sending SSH2_MSG_KEX_ECDH_INIT     debug1: expecting SSH2_MSG_KEX_ECDH_REPLY     debug1: Server host key: ECDSA 4e:66:01:8f:a1:44:f6:d9:01:e4:72:ff:6a:ab:8e:31     debug3: load_hostkeys: loading entries for host "xx.x.xxx.xxx" from file "/home/faheem/.ssh/known_hosts"     debug3: load_hostkeys: found key type ECDSA in file /home/faheem/.ssh/known_hosts:68     debug3: load_hostkeys: loaded 1 keys     debug1: Host 'xx.x.xxx.xxx' is known and matches the ECDSA host key.     debug1: Found key in /home/faheem/.ssh/known_hosts:68     debug1: ssh_ecdsa_verify: signature correct     debug2: kex_derive_keys     debug2: set_newkeys: mode 1     debug1: SSH2_MSG_NEWKEYS sent     debug1: expecting SSH2_MSG_NEWKEYS     debug2: set_newkeys: mode 0     debug1: SSH2_MSG_NEWKEYS received     debug1: Roaming not allowed by server     debug1: SSH2_MSG_SERVICE_REQUEST sent     debug2: service_accept: ssh-userauth     debug1: SSH2_MSG_SERVICE_ACCEPT received     debug2: key: /home/faheem/.ssh/id_rsa (0x7f81f0ca2550)     debug2: key: /home/faheem/.ssh/id_rsa_bb (0x7f81f0ca23b0)     debug2: key: /home/faheem/.ssh/id_rsa_bulldog_hg (0x7f81f0c9d590)     debug1: Authentications that can continue: publickey,password     debug3: start over, passed a different list publickey,password     debug3: preferred gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive,password     debug3: authmethod_lookup publickey     debug3: remaining preferred: keyboard-interactive,password     debug3: authmethod_is_enabled publickey     debug1: Next authentication method: publickey     debug1: Offering RSA public key: /home/faheem/.ssh/id_rsa     debug3: send_pubkey_test     debug2: we sent a publickey packet, wait for reply     debug1: Server accepts key: pkalg ssh-rsa blen 277     debug2: input_userauth_pk_ok: fp a1:78:e9:c1:f4:9c:5e:23:a3:d9:38:35:be:0a:b4:8b     debug3: sign_and_send_pubkey: RSA a1:78:e9:c1:f4:9c:5e:23:a3:d9:38:35:be:0a:b4:8b     debug1: Authentication succeeded (publickey).     Authenticated to xx.x.xxx.xxx ([xx.x.xxx.xxx]:22).     debug2: fd 5 setting O_NONBLOCK     debug3: fd 6 is O_NONBLOCK     debug1: channel 0: new [client-session]     debug3: ssh_session2_open: channel_new: 0     debug2: channel 0: send open     debug1: Requesting no-more-sessions@openssh.com     debug1: Entering interactive session.     debug2: callback start     debug2: x11_get_proto: /usr/bin/xauth  list :0 2>/dev/null     debug1: Requesting X11 forwarding with authentication spoofing.     debug2: channel 0: request x11-req confirm 1     debug2: client_session2_setup: id 0     debug2: fd 3 setting TCP_NODELAY     debug3: packet_set_tos: set IP_TOS 0x10     debug2: channel 0: request pty-req confirm 1     debug1: Sending environment.     debug3: Ignored env FULLNAME     debug3: Ignored env SSH_AGENT_PID     debug3: Ignored env KDE_MULTIHEAD     debug3: Ignored env DM_CONTROL     debug3: Ignored env TERM     debug3: Ignored env SHELL     debug3: Ignored env HISTSIZE     debug3: Ignored env XDM_MANAGED     debug3: Ignored env XDG_SESSION_COOKIE     debug3: Ignored env GTK2_RC_FILES     debug3: Ignored env KONSOLE_DBUS_SERVICE     debug3: Ignored env CVSROOT     debug3: Ignored env GS_LIB     debug3: Ignored env GTK_RC_FILES     debug3: Ignored env WINDOWID     debug3: Ignored env OLDPWD     debug3: Ignored env SHELL_SESSION_ID     debug3: Ignored env KDE_FULL_SESSION     debug3: Ignored env HISTFILESIZE     debug3: Ignored env USER     debug3: Ignored env LS_COLORS     debug3: Ignored env SSH_AUTH_SOCK     debug3: Ignored env SESSION_MANAGER     debug3: Ignored env COLUMNS     debug3: Ignored env PATH     debug3: Ignored env DESKTOP_SESSION     debug3: Ignored env PWD     debug3: Ignored env EDITOR     debug3: Ignored env PSQL_EDITOR     debug1: Sending env LANG = en_US.UTF-8     debug2: channel 0: request env confirm 0     debug3: Ignored env KDE_SESSION_UID     debug3: Ignored env PYTHONSTARTUP     debug3: Ignored env KONSOLE_DBUS_SESSION     debug3: Ignored env HISTCONTROL     debug3: Ignored env GPG_TTY     debug3: Ignored env CVS_SSH     debug3: Ignored env SHLVL     debug3: Ignored env COLORFGBG     debug3: Ignored env HOME     debug3: Ignored env KDE_SESSION_VERSION     debug3: Ignored env LANGUAGE     debug3: Ignored env XCURSOR_THEME     debug3: Ignored env LOGNAME     debug3: Ignored env DBUS_SESSION_BUS_ADDRESS     debug3: Ignored env XDG_DATA_DIRS     debug3: Ignored env LESSOPEN     debug3: Ignored env LVM_SUPPRESS_FD_WARNINGS     debug3: Ignored env EMAIL     debug3: Ignored env PROMPT_COMMAND     debug3: Ignored env WINDOWPATH     debug3: Ignored env ALTERNATE_EDITOR     debug3: Ignored env DISPLAY     debug3: Ignored env PROFILEHOME     debug3: Ignored env QT_PLUGIN_PATH     debug3: Ignored env RSYNC_RSH     debug3: Ignored env LESSCLOSE     debug3: Ignored env XAUTHORITY     debug3: Ignored env _     debug2: channel 0: request shell confirm 1     debug2: callback done     debug2: channel 0: open confirm rwindow 0 rmax 32768     debug2: channel_input_status_confirm: type 99 id 0     debug2: X11 forwarding request accepted on channel 0     debug2: channel_input_status_confirm: type 99 id 0     debug2: PTY allocation request accepted on channel 0     debug2: channel 0: rcvd adjust 2097152     debug2: channel_input_status_confirm: type 99 id 0     debug2: shell request accepted on channel 0     Linux faheem 2.6.32-042stab079.6 #1 SMP Mon Aug 26 19:47:50 MSK 2013 x86_64          The programs included with the Debian GNU/Linux system are free software;     the exact distribution terms for each program are described in the     individual files in /usr/share/doc/*/copyright.          Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent     permitted by applicable law.     Last login: Thu Apr 10 01:43:43 2014 from [localhost]      **UPDATE 4:** I have an ssh agent running, and ssh-add -L confirms it has keys loaded.


title: Why do hard links seem to take the same space as the originals?

text: Thanks to some good Q&A around here and this page, I now understand links. I see hard links refer the same inode by a different name, and copies are different "nodes, with different names. Plus soft links have the original file name and path as their inode, so if the file is moved, the link breaks. So, I tested what I've learnt with some file ("saluton_mondo.cpp" below), made a hard and a soft link and a copy.               jmcf125@VMUbuntu:~$ ls -lh soft hard copy s*.cpp     -rw-rw-r-- 1 jmcf125 jmcf125 205 Aŭg 27 16:10 copy     -rw-rw-r-- 2 jmcf125 jmcf125 205 Aŭg 25 13:34 hard     -rw-rw-r-- 2 jmcf125 jmcf125 205 Aŭg 25 13:34 saluton_mondo.cpp     lrwxrwxrwx 1 jmcf125 jmcf125  17 Aŭg 27 16:09 soft -> saluton_mondo.cpp      I found awkward that the hard link, however, has the same size as the original and, logically, the copy. If the hard link and the original share the same inode, that has the data, and only differ by the filename, shouldn't the hard link take only the space of its name, instead of 205 bytes? Or is that the size of the original file that `ls -lh` returns? But then how can I know what space does the filename take? Here it says hard links have no size. Is their file name kept alongside the original file name? Where is the file name of hard links stored?


title: Colon/Semicolon remapping with xmodmap with two active setxkbmap layouts

text: Gentlemen, I'm a non-native english speaker and need a second language layout. And I'm a heavy Vim user, and use `:` much more often than `;`. At the moment they are remapped in `.vimrc`, buth that causes confusion when I'm in console (and everywhere else), so I decided to remap them directly in `.xinitrc` (I know I can put it in `.Xmodmap`). The following works fine:               setxkbmap -layout us,ru -option grp:toggle # change layout with AltGr     xmodmap -e "keycode 47 = colon semicolon" # remap : and ;      except that that key only works in `us` layout. If I switch to `ru` it does absolutely nothing, not even [semi]colon (expected it to print 'ж' and 'Ж'). I know xmodmap is responsible for translation KEYCODE to a KEYSYM, and I'm messing that up, but I would at least expect it to print capital letter instead of lowercase and vice versa. Is there something I'm doing completely wrong or am I just missing something? PS Archlinux `Linux version 3.10.3-1-ARCH`


title: Shortcut to google selected text

text: Is there a way to customize evince to search on Google a selected phrase? Like in Firefox where I select a text and right-click--> "Search Google for ..." If evince isn't customizable, is there any other pdf reader that can do that (and how)? I'm on Linux Mint - mate desktop (if that matters). **UPDATE:** Since firefox seems to be buggy, answers with different mainstream web browsers (chrome, opera etc) are accepted. **UPDATE 2:** I found out that `firefox -remote "openURL(http://www.google.com/search?q=$(xsel), new-tab)"` works **in terminal**. I tried to use it in keyboard shortcuts (linux Mint with Mate) and it doesn't work. Any ideas?


title: Emacs ssh connection abbreviations

text: When connecting to a remote server via ssh in bash I use abbreviations in ~/.ssh/config file:               Host aaa     HostName aaa.ssh.myhost.com     User user1      So I can connect to aaa.ssh.myhost.com, typing: ssh aaa But in Emacs I can't use this abbreviations, so to connect via tramp I have to type:               C-x C-f     /ssh:user1@aaa.ssh.myhost.com:~      How can I setup the abbreviations for Emacs like those I use in bash?


title: how to configure the ks.cfg file in order to fit it under PXE server

text: I want to configure the ks.cfg file under PXE server So I will able to install linux from PXE server   PXE server include the files ( initrd.img & vmlinuz ) and the ks.cfg My default ks.cfg was taken from the original initrd.img ( from ISO file ) And now I need to edit the ks.cfg in order to use this file by the PXE server My question is – what need to change in the ks.cfg in order to work with PXE server For example I guess all                 /tmp/cdrom       in the original ks.cfg need to change to                /mnt/source       and need to add this lines also                    nfs --server=xxx.xxx.xxx.xxx --dir=/RedHat-DIR          network --device eth0 --bootproto dhcp --nodns      There are maybe other changes but I need help I also performed this:                [root@pxe ~]# mkdir /var/www/html/ks       [root@pxe ~]# cp ks.cfg /var/www/html/ks/linux-ks.cfg       [root@pxe ~]# chmod 644 /var/www/html/ks/linux-ks.cfg


title: How can I know the dependency packages for an installed package?

text: Let's say I installed `foo`. The `foo` package depends on `bar`, so `bar` was installed to satisfy `foo`'s dependency. How can I get Ubuntu/APT/dpkg to tell me that `bar` is installed because `foo` is installed? I know aptitude has a way to do this. But I can't for the life of me get it to switch the bottom pane to the "why installed" tab. How to do that would be a potential answer.


title: Combining local and remote terminal multiplexing

text: I use `tmux` regularly to easily handle multiple terminals on my local machine. Sometimes, I need to connect to a remote machine and start a script in one the terminals (i.e. a pane or window in tmux). If my machine disconnects for any reason during this process, the remote script is killed and I cannot re-attach to the remote terminal that started the process. Part of the purpose of terminal multiplexers is to deal with this precise scenario, but in my case, since I am running `tmux` on the local machine, I can't re-attach to the terminal that started the remote process. One option would be to run `tmux` (or GNU screen) on the _remote_ machine within one of the panes of my local tmux session, but I am concerned about running into keyboard shortcut conflicts when **nesting** either `screen` or `tmux` within `tmux`. What is a good way of handling this problem? Is nesting console multiplexers a good idea? Is it the only solution to this problem?


title: Centos 6.5 iconv 2.5 glibc

text: I'm using Centos 6.5 x64 for developing purposes. I need to install iconv 2.5 but could not find how. Centos 6.5 glibc version is 2.12 On Centos 5.9 glibc version is 2.5 Why newer Centos uses older glibc library? How can i update it?


title: How to strip color codes out of stdout and pipe to file and stdout

text: I have a program that uses `printf` with some `tput` mixed in it and I'd like to pipe the output to stdout as well as a file. I'd prefer to use `sed` since I don't want any unnecessary dependencies on my script. Here's what I've got so far. `printf "\n$(tput setaf 6)| $(tput sgr0)$(tput setaf 7)Sourcing files...\033[m\n" | tee install.log` The only issue with this is my log file is getting all of the color output as such... `^[[36m| ^[(B^[[m^[[37mSourcing files...^[[m` I'd like it to just have `| Sourcing files...`


title: Copy MBR and boot partition to a smaller disk

text: I'm using a 32GB SD card for my raspberry pi. I have successfully transferred the operating system (`Archlinux` `ARM`) to a usb harddrive. Which means that I only need the boot partition on the SD card. A 32GB card that only uses about 100MB is an awful waste of space and I do have a smaller SD card with 4GB around. How do I copy the `MBR` and the first partition of the 32GB card to the 4GB card? I've tried saving the `MBR` and the first partition of the bigger card with `dd`:               dd if=/dev/sdb of=mbr_image bs=446 count=1     dd if=/dev/sdb1 of=boot_image      I then created a new partition table on the smaller card that looks exactly like the table on the original 32GB card:               Device    Boot Start       End Blocks  Id System     /dev/sdc1 *     2048    194559  96256  c  W95 FAT32 (LBA)      Finally I copied the previously stored images onto my smaller card:               dd if=mbr_image of=/dev/sdc bs=446 count=1     dd if=boot_image of=/dev/sdc1      Everything looks fine in `fdisk` but it does not work. My raspberry doesn't do anything when I try to boot from the smaller card. Where is the error?


title: Sort -u Function Command Not Working

text: _**As you can see in the picture attached_** screen shot After I used the sort command to sort a VERY large wordlist file I then split them up using the Split command. From there I confirmed that the listed words are in a-z order. I then ran the `sort -u` command and noticed that it was not removing unique words. (It was removing some as I could see the files were a little smaller, but not all.) What am I doing wrong? Overall goal: my over all goal is to take all my wordlists and put them into one large file (25gig), then sort and remove any unique words (cutting this by 40% or so) and then split up the files into manageable sizes. No Windows programs or Linux commands worked.


title: How long do dentries stay in the dcache?

text: On Linux, when I create a new file and open it, an entry about it is created in the dcache's hash table, right? How long does that entry stay there? Does it get removed when nothing is currently using the file anymore, or does it stay there until the cache is full and the kernel decides to remove things from it to create space for new dcache entries? If the latter is the case, how exactly does the kernel determine which entries to remove when the dcache is full? (References to the kernel source would be nice.)


title: How do I send a shutdown event to a QEMU guest (OpenBSD)?

text: I'm using virtualisation solely to install OpenBSD onto the bare hardware, and during the installation, the redirection to the serial port didn't get configured, so, I ended up with the system running, but no way to login and do a clean shutdown.               kvm -m 6144 -smp 4 -drive file=/dev/sda,if=ide \         -drive file=/dev/sdb,if=scsi -drive file=/dev/sdc,if=scsi \         -cdrom install52.iso -boot d -nographic      How can I send a shutdown event to this session? AFAIK, `Ctrl`-`a` `x` as shown here or a `pkill kvm` would not do a clean shutdown yet. Alternatively, how can I switch from the `-nographic` mode into the `-curses` mode ?


title: How to detect when a shell is owned by a remote SSH session?

text: My question is similar to this one, but I'm looking for something slightly different. I have a notebook PC that I use to access Linux machines on a network in two different scenarios:   * I have a direct, wired connection to the network.   * I have an indirect connection to the network. There is a gateway machine on the network exposed to the Internet, which I can use to establish SSH tunnels to hosts on the network. This is obviously a much slower, higher-latency connection. My home directory is network-accessible from all machines, so they share a copy of my `.bashrc`. I would like to add functionality to `.bashrc` to detect which of the two scenarios I'm in and act accordingly (technically, there would be three scenarios, where the third is that I'm logging into my local machine, but that should be easily handled). I would like to do things like:   * `alias ssh ssh -X` when I'm on the local network, but I don't want to use X forwarding over the Internet.   * `export EDITOR=gvim` when I'm on the local network, but `export EDITOR=vim` when I'm remote. And so on. Based on the previous answer, it looks like I should be able to accomplish something like this by checking the contents of `SSH_CLIENT` (if it exists) and seeing if the client IP address matches one of the network adapters on my local machine. I thought I would see if there is a slicker or more robust way to accomplish this.


title: Monitor if a running X session is idle for a while

text: Is there any way to monitor if a X session is inactive for i.e 10 minutes? And I would execute a command when it happens, like a screensaver, but it's not a screensaver in this case.


title: Fedora not shutting down

text: Whether I do `shutdown -P now` or `sudo shutdown --halt now` Fedora does not shutdown. It will send SIGTERM and SIGKILL as usual, but then just stops at the screen with the fedora logo. My only option is to hold the power button down, which is obviously not the best option for shutting down. This started at my last kernel upgrade, `3.5.16` 11 days ago.


title: Linux - Mint, wifi aircard issue

text: I have a microsoft aircard (model 1051 notebook reviever2.0) that I use for wifi. Linux Mint doesn't auto detect wifi with it for some reason. How do I get this to work? Do I need a driver?


title: How to determine what instructions a process is executing?

text: I know about strace and ltrace, but that only tells me what system calls and library calls a process is executing, respectively. I would like to know exactly what instructions a process is executing. Either assembly, or some sort of middle ground between C and assembly if that is possible. Assuming the binary hasn't been compiled with debug symbols, so leaning toward the first option as more likely. Use case: process appears to be hung, no output from strace or ltrace. Determine if process is doing "something". I realize this might be difficult to determine, as I imagine this is analogous to solving the halting problem. However, it might be possible to gather useful data. Second use case: curiosity. It would be interesting to dump the entire list of assembly instructions to a text list. My guess is that I can use gdb to do this, but not sure how, as this is less about debugging a program I have written and more about using gdb to check on the health of a running process. OS is CentOS 6.


title: runit and nginx

text: I'm working on a system whose primary startup system is runit. Unfortunately, runit requires that whatever application it is running be running in the foreground like so:               #!/bin/bash          exec sshd -D      Seeing as nginx doesn't offer a way to run it in the foreground, how can I have runit still manage nginx and be able to stop, start, and restart it using runit's `sv` commands?


title: Which is more idiomatic in a bash script: `|| true` or `|| :`?

text: I don't do terribly much shell scripting, so I was a little surprised when I was reading the documentation for `git submodule` and I saw the syntax they used in this documentation: > A non-zero return from the command in any submodule causes the processing to > terminate. This can be overridden by adding `|| :` to the end of the > command. I had to look up that `|| :` was a shorthand for forcing a command to exit successfully. Anytime I've had to make a command exit successfully, I used `|| true`. Is `|| :` considered to be more idiomatic?


title: Read only unified directory

text: My end goal is that I want a samba share that displays all of the folders across several disks as one unified, read-only folder. This is for a NAS/media server setup. Is there a way to create a unified folder that contains all of the subfolders of each of these drives in this way?


title: 7z getting an event not found error in command line

text: I am using 7zip on my centos machine and ziping a file via command line. This is my syntax               7za a -t7z backup.7z public_html\ -mx0 -xr!restricted_area      What i'm expecting with this syntax is to backup all files in public_html folder then exclude restricted_area folder, I am not really sure if this is correct, but the problem is I am getting this error:               -bash: !restricted_area: event not found      What does this suppose to mean? And also, Is my zipping syntax correct?


title: Back up logs to a new directory

text: I need help to write a script to copy log files. There are two format of logs:   * `System_<date_timestamp>.log`   * `trace_<date_timestamp>.log` New files are generated when trace log reaches 20 MB and sytem log reaches 10MB. Only 5 of these logs (5 for each kind) are allowed to be saved, once there is more than 5 of them, the old files get deleted and replaced by new ones. Therefore, before they get deleted I need to copy them to a different location so that I can view them later when needed to debug. Basically, it will look like the following (showing just trace log format, similar with System log):               trace_12.03.05_17.11.20.log     trace_12.03.05_17.12.30.log     trace_12.03.05_17.13.45.log     trace_12.03.05_17.13.23.log     trace_12.03.05_17.14.40.log


title: How can I be sure that my server is not virtualised?

text: How can I make sure that my Linux server is running on a non-virtualised real box? This is the scenario I am thinking of:   1. I install some distro on a rack-mounted server,   2. I rent some rack space on in a data-center and leave it there,   3. Mallory ("the attacker") goes to the data-center disconnects my server,   4. Mallory takes an image of the disk,   5. Mallory runs the disk image as a guest on a KVM box. Suppose, for the sake of this question, that the attacker   * has modified KVM, or any similar hypervisor, to simulate exactly the same hardware my server was running on,   * knows all the known escape-the-hypervisor or detect-the-hypervisor attacks and has patched the hypervisor to counteract them (so no Red pill and similar). So my question is: will there ever be solid ways to make sure that an OS is running on a physical box (or on one precise physical box), ways that do not rely on virtualisation flaws (like Red pill)? Or the other way around: are there proofs that such kind of detections will always be possible? **Clarification** : this is an hypothetical question, not a discussion about current technologies. Currently it is quite easy to detect whether I am in a virtualised environment, just use `imvirt` and its collection of known virtualisation glitches/flaws. I would like to know if things like "perfect virtualisation" has been discussed and found possible or impossible from a theoretical point of view.


title: How to make grub Command Line Default?

text: I'd like to make grub by default load it's command line instead of automatically booting from it's list of options generated by `update-grub`. How can I do this?


title: How to list console and kernel fonts?

text: I have a number of console fonts installed in `/lib/kbd/consolefonts/` installed.   1. How do I list them (obviously all I can do, is just look at the filenames, but not at a list at available fonts).   2. How can I change the console fonts?   3. How do I make a user manipulable directory for those fonts, should I use `/usr/local/lib/consolefonts/`? Now, my kernel accepts the SYSFONT parameter: `SYSFONT=latarcyrheb-sun16`. I'd like to have a list which fonts my kernel supports and how I can select them (as in, how do I list the kernel compiled fonts, or something).


title: Why does the bell character have a limit?

text: If I repeatedly execute               echo -e "\a"      it will only sound on regular intervals rather than every time I execute the command. I've tried shortening the duration using xset but this doesn't seem to impact anything. Running enlightenment17 on archlinux 64-bit using xterm to issue the commands


title: Fast distro which only allows a USB boot?

text: Older PCs BIOS don't have the ability to boot from USB and there is no upgrade from the motherboard manufacturer that makes that possible. Usually I load UNetbootin to make the USB bootable. Since this fails here, I want to ask for a fast linux which starts from a 32mb hard drive and then enables the USB to boot from. I already tried Grub but as far as I know you have to predeclare the systems used. Since I frequently switch from Tiny Core, Arch and other lean distros, I want to be flexible.


title: De-obfuscate a picture with statistical information?

text: I need to get this kind of information into numbers, how? ![enter image description here](http://i.stack.imgur.com/IXpUJ.png) ![enter image description here](http://i.stack.imgur.com/8MQ8p.png) **Perhaps related**   1. http://dsp.stackexchange.com/questions/1054/how-do-i-recover-the-signal-from-an-ecg-image   2. http://dsp.stackexchange.com/questions/1080/find-a-specific-line-in-a-picture   3. R's biOps here as a generic tool. R's PET has Hough transform here (but may not work in this domain but HT does not seem too complicated, here)


title: How do I install Fedora 18 without SELinux?

text: How can I install Fedora 18 without SELinux ever being part of the installation? I don't want to just disable SELinux after it's installed, I want to never install SELinux at all. Is there a way to do this using the CD image and Live System User?


title: pendrive distro

text: Which distro should I install on my 8GB pendrive? I need it to have powerfull repos (everything, music editing is crushial) and should be lightweighting not losing on functionality. Any propositions? PS: I'm now on windows. EDIT: I'd like to use XFCE and light-weighting should be priority. I mean I'd like to choose all packages from scratch.


title: Optimizing sed command or create new one

text: I'm a newbie in Linux scripting, especially for using `sed` and `awk` commands. For now I'm trying to filter a really big log file and wondering if there are any alternatives for my commands? or some optimizing? here is the code:               #!/bin/bash     nice -20 sed '/./{H;$!d;};x;/37455299339/!d' 1.txt > /tmp/new.txt     nice -20 sed -n '/Acct-Status-Type/,/NAS-Identifier/p' /tmp/new.txt > /tmp/new_1.txt     rm /tmp/new.txt     nice -20 sed '/Acct-Status-Type/{x;p;x;}' /tmp/new_1.txt > /tmp/new_2.txt     rm /tmp/new_1.txt     nice -20 less /tmp/new_2.txt | grep -A1 -B1 37455299339 | grep -A1 -B1 User-Name > new_3.txt


title: Installing Multiple Linux Distros in a single partition

text: I'm currently using Ubuntu 13.04, elementaryos and Windows 8. I would also like to install Backtrack for rare use. But, I'm already out of my partition limit. So, was it possible to combine two partitions and install all the linux distros in that single partition with a shared swap?


title: Creating softlinks to header files that are not in the expected directory

text: 3.12.6-300.fc20.x86_64 #1 SMP Mon Dec 23 16:44:31 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux     Fedora 20      I am trying to install asterisks from source and when I run the ./configure script I get the following error:               checking for uuid_generate_random in -luuid... yes     checking uuid/uuid.h usability... no     checking uuid/uuid.h presence... no     checking for uuid/uuid.h... no     checking for uuid_generate_random in -le2fs-uuid... no     checking for uuid_generate_random... no     configure: error: *** uuid support not found (this typically means the uuid development package is missing)      However, I have already installed the 64 bit versions of uuid and uuid-devel               Name        : uuid-devel     Arch        : x86_64     Version     : 1.6.2     Release     : 21.fc20     Size        : 21 k     Repo        : installed        Name        : uuid     Arch        : x86_64     Version     : 1.6.2     Release     : 21.fc20     Size        : 116 k     Repo        : installed      So I guess its looking for the header file and cannot find it. checking uuid/uuid.h usability... no When I run `locate uuid.h` I can see the uuid.h in the following directory:               /usr/include/uuid.h     /usr/include/linux/uuid.h     /usr/src/kernels/3.12.6-300.fc20.x86_64+debug/include/linux/uuid.h     /usr/src/kernels/3.12.6-300.fc20.x86_64+debug/include/uapi/linux/uuid.h     /usr/src/kernels/3.12.7-300.fc20.x86_64+debug/include/linux/uuid.h     /usr/src/kernels/3.12.7-300.fc20.x86_64+debug/include/uapi/linux/uuid.h      So in trying to fix the problem I created a new directory /usr/include/uuid and created a softlink to that uuid.h in there.               lrwxrwxrwx. 1 root root 9 Jan 15 11:49 uuid.h -> ../uuid.h      It works now:               checking uuid/uuid.h usability... yes     checking uuid/uuid.h presence... yes     checking for uuid/uuid.h... yes      My question is, is it OK to mess around with installed header files like this by creating softlinks? I always worry in case I break something as you need root access to create the softlink. And many there is another solution without the need to create these softlinks.


title: yaourt curl error: Couldn't connect to server

text: I'm trying to install some packages with `yaourt`. For example, when I try to install Google Chrome, I get the following error:               $ yaourt google-chrome     curl error: Couldn't connect to server      I can access to http://aur.archlinux.org but the command fails.


title: How can I know which program is sniffing packets?

text: I found the NIC of a machine is running in promiscuous mode, now how can I locate the program who is actually capturing packets?


title: Unable to launch Gnome System Log Viewer after setting filters

text: I am unable to launch Gnome System Log Viewer after setting some filters. This is so, even after rebooting and reinstalling this GUI program. I found the following relevant line in /var/log/messages: > kernel - [ 2345.123456] traps: logview[1234] trap int3 ip:32682504e9 > sp:7fff9123c150 error:0 It seems to be some exception error with the kernel. How to deal with it and get the viewer to launch again? **UPDATE:** I tried launching it manually with the following command: `gnome-system-log` and it gives me a more verbose error: > GLib-GIO-ERROR **: g_menu_item_set_detailed_action: Detailed action name > 'win.filter_hide info' has invalid format Trace/breakpoint trap It appears that the regex I wrote for `win.filter_hide` has some invalid format. How can I access this and change it manually without the GUI? **UPDATE2:** I tried:               $ gsettings get org.gnome.gnome-system-log filters     @as []     $ gsettings reset org.gnome.gnome-system-log filters      It doesn't work. I think I am somewhere close, but not sure how to access `win.filter_hide` from here. From this image, I don't see how installing `dconf-editor` would help me access that filter. **UPDATE3:** I finally manage to take a peep at the values by logging in as root:               # gsettings get org.gnome.gnome-system-log filters     ['hide info:1:::\\tinfo', 'error:0:#efef29292929::\\terr', 'show all:0:#000000000000::\\d']     # gsettings reset org.gnome.gnome-system-log filters     (process:3453): dconf-WARNING **: failed to commit changes to dconf: The connection is closed      Not sure where is the problem. But as can be seen, I can't even do a reset when logged on as root. And I can't access those values when logged on as normal user. **UPDATE4:** Finally it is solved. The reason why connection is closed is because the root is logged in the user environment. This should work:               $ su -c "gsettings reset org.gnome.gnome-system-log filters" -


title: Share Internet Connection from computer to new router

text: On my linux computer I have an external wlan adapter which is connected wirelessly to internet (an access point). Now I want to connect my linux computer via ethernet cable to a new ddwrt router. This ddwrt router should now "get" internet from my linux computer, so that my linux computer is acting like a internet sharing box. INTERNET <- over wlan (wlan0) -> LINUX COMPUTER <- ethernet eth0 -> DDWRT Router Anyone should now be able to connect wirelessly to the ddwrt router to get internet. How should I configure my linux computer to make it work? Thanks!


title: How redirect input while process is running?

text: I have an interactive application that takes input from the keyboard. Whenever I run the application I always write the same things in the beginning. So I was thinking I could make a file with those things and redirect them to the application with:               myapplication < myinput.txt      The problem is that when I am done with that I want to give control back to the keyboard so I can type the rest of the input. Is it possible? I don't mind using a bash script.


title: Where to put scripts that run when computer is resumed?

text: I need to lock the screen when my computer is waken up from memory suspend, So I tried to put the following script to `/usr/lib/pm-utils/sleep.d` and `/etc/pm/sleep.d`, but it never got executed,               #!/bin/sh          case "$1" in         hibernate|suspend)             ;;         thaw|resume)             vlock -ans             ;;         *) exit $NA             ;;     esac      P.S It's `pm-suspend` not `pm-hibernate`. **EDIT** Tried systemd service as well, no luck:               # /etc/systemd/system/resume@.service     [Unit]     Description=User resume actions     After=suspend.target          [Service]     User=root     Type=simple     ExecStart=vlock -ans          [Install]     WantedBy=suspend.target      And I called `systemctl enable resume@.service` too, vlock wasn't called still.


title: find "an expression" on each file of a directory recursively

text: One of my website on my webserver has suffered an attack : code injection. Here is the malicious code :                     I want to know the name (and path) of all files coutains the expression on my server to stanch the contagion. Here is the expression i want to match :'http://ahtiagge.ru/count27.php' I would like results like that :               /var/www/vhosts/site1.com/httpdocs/index.php     /var/www/vhosts/site1.com/httpdocs/fileN.php     /var/www/vhosts/site1.com/httpdocs/one_directory/fileN.php     /var/www/vhosts/site1.com/httpdocs/one_directory/and_sub/fileN.php      How can I realize this with a shell script ? is it possible ? Is someone can help me ? Best regards,


title: How to sign into an open Wireless Network?

text: I'm running Arch Linux on my netbook. My school have an open Access Point and we must sign into the network via a page which we are redirected to when we try to open whatever website if we are not connected. It works on my Android Smartphone. It works on Windows. It should also works on Linux since my teacher is able to connect to it (he's running Ubuntu). I connect to the access point with wifi-menu to generate a netctl profile. I am connected but I am not redirected to the login page, and when I type the address (taken from my phone) it don't find the server... I tried disabling IPv6, but nothing change...


title: Getting info from syslog.txt

text: I am looking for some cool commands I can use to pull pieces of information out of a syslog. Mostly using this as a learning experience. Let's say I have a syslog showing dropped/accepted connections through my firewall. Say I want to know which source address is being dropped/accepted the most. Format of the syslog looks something like:               Feb 12 09:00:57 kernel: DROP  <4>DROP IN=eth0 OUT= MAC=d8:50:e6:a9:29:e0:00:ab:cd:ef:gh:ij:kl:mn <1>SRC=12.34.56.78 DST=87.65.43.21 <1>LEN=160 TOS=0x00 PREC=0x00 TTL=43 ID=0 DF PROTO=UDP <1>SPT=51413 DPT=1024 LEN=140      Preferably a way to find how many unique entries each SRC had in my syslog something that would show each SRC entry from the syslog along with how many times that same event occurred:               (source address) | (number of entries)     12.34.56.78 | 25     12.34.56.79 | 13     12.23.34.45 | 6     12.32.32.34 | 1      Any cool commands anyone would share?


title: Chromebook Series 3 xfce4 can't boot

text: My Chromebook Series 3 xfce4 can't boot. When I try to enter xfce4 using sudo startxfce4, I get the following response and xfce4 wont start.               sudo startxfce4     Entering /usr/local/chroots/precise...     /usr/bin/startxfce4: Starting X server          Xephyr: Unsupported screen depth 32          Backtrace:     Segmentation fault at address 0x4          Caught signal 11 (Segmentation fault). Server aborting     /usr/bin/xinit: giving up     /usr/bin/xinit: unable to connect to X server: No such file or directory     /usr/bin/xinit: server error     Unmounting /usr/local/chroots/precise...     Sending SIGTERM to processes under /usr/local/chroots/precise...     Sending SIGKILL to processes under /usr/local/chroots/precise...     Sending SIGKILL to processes under /usr/local/chroots/precise...      SIGKILL goes on forever. I'm looking for a fix. I installed ubuntu 12.04 on my chromebook using crouton. I tried completely reinstalling again with cruton. Same response. Although I can still get into precise with sudo enter-chroot. Does anyone know how to fix this? Note: This came after a recent update to my chromebook, it is now on 34.0.1809.2.


title: Run AVD and VirtualBox at the same time

text: I'm developing for Android so I have the Android SDK installed and in it the program that runs virtual machine. Also, from the same reason, I'm running a oracle virtual box to host myself a redmine server. My host is linux mint. Now the issue is, that whenever I'm trying to start one when the other is already on, it complains that the KVM is already taken. I did not see it coming, and obviously it will be a real drag if I'll have to shut down my redmine box to every time I have to do testing, or have to shut down my testing AVD, every time I want to update progress on a task. Is there a way I can run them both? It is not necessary for me to run both machines with hardware support.


title: nohup command doesn't seems to be working?

text: Please let me know any example that shows `nohup` is working for a program even after `logout` , as i tried using without `nohup` command to run a script i background and it seems to be working even after `logout` . example : `ping google.com > ping_result &` Then i `logout` and `login` again and i found the files contents are getting incremented it means that ping is still running however it should not be .


title: Local Client/Server communication using TUN interfaces

text: I want to establish a local communication between a client and a server using TUN interfaces.   1. The client program will be attached to interface TUN1 and we suppose that it has IP address @IP1.   2. The server program will be attached to interface TUN2 and we suppose that it has IP address @IP2.   3. We must define routing rules so that packet with destination address IP2 (server's IP) will go through TUN2 and those with destination address IP1 (client's IP) wille go through TUN1 interface. Rules example:               route add -net 10.2.0.0/24 dev tun2  #we suppose that the server's IP is in the subnet 10.2.0.0/24     route add -net 10.1.0.0/24 dev tun1  #the client's IP is in the subnet 10.1.0.0/24      I need to know the iptables chain that will be traversed by a packet sent from the client to the server. From my understanding I think it should be this:               Client==TUN1--->(PREROUTING)--->Routing--->(FORWARD)--->Routing--->(POSTROUTING)--->TUN2==Server


title: How to check whether a particular port is open on a machine from a shell script and perform action based on that?

text: I am running my below shell script on a machine on which c++ application server is running on port 8080 and in the shell script I am executing an URL and stores the response coming from that URL in DATA variable. But suppose if the same app server is down, then it will not be able to execute the URL and then it will print out `Retrying Again` and sleep for 30 seconds and then execute the same url again.               #!/bin/bash          HOSTNAME=$hostname     DATA=""     RETRY=15          echo $HOSTNAME          while [ $RETRY -gt 0 ]     do         DATA=$(wget -O - -q -t 1 http://$HOSTNAME:8080/beat)         if [ $? -eq 0 ]         then             break         else             echo "Retrying Again" >&2                  # restart the server                  let RETRY-=1             sleep 30         fi     done          echo "Server is UP"      And here `HOSTNAME` is the local hostname of the server on which I am running my above shell script. **Problem Statement:-** Now what I am trying to do is, if the server is down, then it will print out `Retrying Again` so after that I want to check whether port `8080` is opened on `$HOSTNAME` or not. If not, then it means server is down so I want to restart the server by executing this command and then sleep for 30 seconds as shown above in the shell script.               /opt/app/test/start_stop.sh start      Is this possible to do here in my above shell script? I am running this shell script on Ubuntu 12.04.


title: Is there any CLI/terminal slideshow app?

text: I'm asking myself: is there, on linux, any software that can build and show simple slides on terminal, like the slides you make on Libreoffice Impress (but way more simple)? This would be a great experience to make a presentation using only the console, whithout any advanced graphics (like GL and framebuffer), maybe using only ncurses or other lib like that. Any help? **EDIT 1:** I'm using and recommending vimdeck. Thank you all :D **EDIT 2:** This question is still open for a standalone software or any plugin that can use LaTeX.


title: Web server seems to keep serving old images, issue with Apache & VirtualBox?

text: I'm asking this here because I'm pretty sure it's a Linux issue. I'm running Apache server locally on Ubuntu Server 12.10, which runs inside a virtual machine (VirtualBox) on Windows 7. The "www" directory is shared between the Ubuntu VM and my Windows OS, using VirtualBox's "Share Folder" facitility. **NOTE:** It's basically a local directory in windows. In Ubuntu it gets automatically mounted on startup. The server is also accessible from my Windows host via a URL like `http://192.168.56.101/website1`. The thing is that images from that URL appear to be cached until I restart the virtual machine. For example: The URL `http://192.168.56.101/website1/images/bg.png` on the Apache server running on Ubuntu points to this file `c:\www\website1\images\bg.png` on the Windows share. In the Ubuntu VM it exists under `/var/www/website1/images/bg.png`. If I modify this file in Photoshop in my Windows host, the changes are not seen in the Ubuntu server. I suspect that Linux caches the file or something, because after restarting the VM I'll seeing the updated image. Is there any way I could disable caching for anything under the `/var/www` directory? Would this decrease performance or something?


title: dhcp query to get IP by MAC

text: I am using `CentOS 6.5` and `Internet Systems Consortium DHCP Server 4.1.1-P1` I found this file /var/lib/dhcpd/dhcpd.leases but not simple to parse it in bash is there any way to get the online clients or commend to get IP by MAC?


title: Bash script in RHEL to add/remove users in iptables

text: I will try to reword this as best as I can. I created a virtual machine to serve as a loadtest server with RHEL. If a user requested access to this server to run a loadtest, his workstation ip would be added to the iptables so that he would have access from his Windows Workstation via ssh. It was decided that instead of editing the iptables file and then restarting services with service iptables restart, a script would be written to add a users workstation each time a user wanted to run a loadtest on this server. In addition, a seperate script would be written to remove a users workstation ip from iptables without restarting services. I suppose my main question is how do you add a rule in iptables and have it take effect without running service iptables restart ? Same question for removing a rule in iptables. Is there a few commands I can run for this or does a script need to be written ? This is what I have so far to add a users workstation: iptables -I INPUT 1 -p tcp -s xxx.xxx.xx.xxx --dport 22 -m comment --comment "Test for pvaldez" -j ACCEPT


title: Missing unicode characters

text: I've just switched from KDE to lightweight slim+xmonad environment and my fonts are not rendering correctly.   1. I use DejaVu font family (default for Debian 7.x) which supports all characters I need (Proof: I've looked up these characters in gucharmap + in "konsole" app)   2. I use rxvt-unicode as terminal, with fonts set in .Xresources. "konsole" app (opened directly in xmonad) shows all characters properly. Both urxvt and konsole are set to use DejaVu Sans.   3. Even google-chrome behaves strangly. Obviously it uses different font for interface and for webpage, but even when I force DejaVu Sans as webpage font (through CSS), it doesn't help. ![google](http://i.imgur.com/DSzR6ux.png)   4. Lot of other unicode characters works. The one on screenshot is from Korean hangul -- could it be related to asian fonts?


title: Remove album from playlist in Audacious in Winamp mode

text: I have installed Audacious on Xubuntu 13.04 and when it's in WinAmp mode the playlist is too small to display songs (I need to resize it but then it's bigger then a player and it don't look good) because it display Album name. Is it posible to format what is displayd in playlists or maybe just remove the album?


title: can't find command 'linux16', need to update Dell BIOS. use startup disk?

text: I'm running Ubuntu 13.10, Dell has dropped support for linux except for one server line, and none of these solutions work because the `linux16` command is gone from grub2. How can the final steps involving `linux16` be replaced to work with grub2? Ubuntu was installed with UEFI active if that helps. * * * Is it possible to change to CSM in the BIOS from UEFI, boot with a Ubuntu USB startup disk, and use the non-UEFI grub to use `linux16`? If so, should the bios update files be on my HDD (encrypted) or the bootable USB? What else?


title: Safe Directory Delete

text: I alias `rm` to `rm -i` so that when I mistype `file*` as `file *` I get prompted before accidentally deleting files I didn't intend to delete. Is there an equivalent idiom for directories? In particular, to delete a directory and its contents, you have to `rm -r`. Using `rm -ri` will prompt you for all the files in it, not just the top-level directory. For directories with a lot of files, that's not convenient. To avoid that, I frequently use `rm -rf`, but that scares me. I'm only a typo away from blowing away lots of important stuff (e.g. `rm -rf ~ /foo` instead of `rm -rf ~/foo`--ouch!). One could write a mildly annoying script to replace, e.g., rmdir with something that only prompts for the things listed on the command line, but it seems like this is the kind of problem for which a solution should already exist.


title: terminal hangs after start up of red5 server

text: Every time I start up the red5 server it works but hangs so only way to stop it is to close terminal window, I've never been able to command start and stop it and go on to something else without losing my shell connection.


title: When I try to add the Android SDK to my PATH, it gives a context error

text: I'm getting a weird message when my shell reads `.profile`:               /Users/alex/.profile:export:69: not valid in this context: SDK/tools:/Applications/Android      The error is triggered by this line in my `.zprofile`:               emulate sh -c "source .profile"      And yet, the following all work:               bash .profile     zsh .profile     sh .profile     sh -c "source .profile"     source .profile      All return without a problem - no console messages, exit code 0. Here is the source on GitHub, and here is the relevant code block:               if [ $(uname -s) = "Darwin" ]; then         # For distributed.net client         PATH=$PATH:/Applications/dnetc518-macosx-x86         # For MacPorts         PATH=$PATH:/opt/local/bin:/opt/local/sbin         # For Fink         test -r /sw/bin/init.sh && . /sw/bin/init.sh         # For Android         PATH=$PATH:"/Applications/Android SDK/tools":"/Applications/Android SDK/platform-tools"         # For Homebrew formulae on OS X         export PATH=/usr/local/bin:/usr/local/sbin:$PATH              ##         # Your previous /Users/alex/.bash_profile file was backed up as /Users/alex/.bash_profile.macports-saved_2013-03-16_at_00:07:13         ##              # MacPorts Installer addition on 2013-03-16_at_00:07:13: adding an appropriate PATH variable for use with MacPorts.         export PATH=/opt/local/bin:/opt/local/sbin:$PATH         # Finished adapting your PATH environment variable for use with MacPorts.     fi     # this is line 69. it is blank in the original file.      I'm using the `zsh` that comes with OS X 10.9. I haven't gotten a chance to test this on a GNU/Linux box yet, but I don't think that's the problem.               % zsh --version     zsh 5.0.2 (x86_64-apple-darwin13.0)


title: Debian 7.2 xfce flash is not working. it gives a white box

text: i have just installed debian. i then installed flashplugin-nonfree. iceweasel and firefox give a white box in place of the video. so i installed hal for some reason. still no change. here is a video of what im talking about. youtube video


title: How to build space separated, escaped full paths of files recursively matching glob?

text: I have a program which requires paths to files as arguments, which cannot be quoted and must not depend on working dir. Can this be done without chaining multiple `xargs`, `tr`, `find`, `readlink`s? Example output for "*.csv" files: `/home/user/a\ b.csv /home/user/my\ dir/c\ d\$2.csv`


title: Cronjob to Run and then Terminate

text: I want to add a cron entry that does something like:               00 00 * * * * /tmp/script.sh      Is there something I can add to the end of the line, so that when it is finished, it will remove the line out of my cron? Also, if there is a better way to do it, I would definitely want that information instead.


title: Fedora 20 boots in emergency mode

text: After reformatting a disk that I think had nothing to do with the Fedora installation, it now boots always in emergency mode, no matter what "Fedora" option I choose in the bootloader My disk configuration: I have 3 500GB disk in an array with Intel Matrix Storage. The array was split in 2 disks. One of them, Raid 0. Fedora (home, root, swap) are partitions of this disk (they aren't the only ones). The other disk in the array used to be Raid 5. I changed it to Raid 0 and formatted it to NTFS from Windows. After that, I can't boot Fedora. Windows is on a separate 1TB disk. In the journal log, I see "red stuff" including:   * tsc: fast tsc calibration failed    * Failed to find module 'vboxdrv'/'vboxnetflt'/'vboxnetadp'   * Failed to start Load Kernel Modules   * inotify_add_watch(7, /dev/sda2, 10) failed: No such file or directory   * inotify_add_watch(7, /dev/sda4, 10) failed: No such file or directory   * inotify_add_watch(7, /dev/sda3, 10) failed: No such file or directory   * inotify_add_watch(7, /dev/sda1, 10) failed: No such file or directory   * [sdi] No Caching mode page found. Assuming drive cache: write through   * Dependency failed for Mark the need to relabel after reboot Clearly I have no idea which of these errors where already there when the PC worked normally. The /etc/modules.load.d folder is empty (not sure if it should be) Thanks for the help


title: How to check a ksh script for syntax errors?

text: $ cat foo.sh      #!/bin/ksh          echo foo     ehco foo2      It doesn't warns for errors:               $ /bin/ksh -n foo.sh      $ echo $?     0      **Question:** How can I get the "ksh -n" to warn me about syntax errors?


title: Modifying linux for different boards

text: There are different linux available for different boards- called "linux ports" For example a (uc)linux port for STM32F4291 Discovery kit, a linux port for Beagleboard and so on. I want to know what are the major **differences and similarities** between these ports? I am asking this because say, I want to take port-A for Board 1, and modify it to run on board 2. Once I know the differences/similarities I will have a better idea of this modification required.


title: Slow down mp3 audio

text: I love VLC's option of slowing down audio playback. Now I want to take my mp3-files to a portable player and play them there. Unfortunately the player does not have a slow down option. How can I convert mp3s so they sound like being played slowly using VLC? I will prefer a command line tool, but will accept other free software tools for GNU/Linux.


title: Konsole: disable right-click menu

text: My trackpad does not have a middle button, so I have to click both buttons to simulate middle button. Often that fails and I get the context menu (which I have never ever had any use for in Konsole). I would like to either disable the context menu or (even better) have the right-click be interpreted as a middle click.


title: rolling diffs for storage of highly similar files?

text: At work we do a nightly dump of our mysql databases. From day to day, I would guestimate that close to 90-95% of the data is duplicate, increasing as time goes on. ( Heck at this point some are probably 99% ) These dumps are where one line is a single mysql INSERT statement, so the only differences are whole lines, and the order in which they're in in the file. If I got them sorted, the actual difference from file to file would be very small. I've been looking, and I haven't found any way to sort the output on dump. I could pipe it through the `sort` command, though. Then there would be long, long blocks of identical lines. So I'm trying to figure a way to store only the diffs. I could start with a master dump, and diff against that each night. But the diffs would be larger each night. Or, I could make rolling diffs, which individually would be very small, but seems like it would take longer and longer to compute, if I have to put together a master diff of the whole series each night. Is this feasible? With what tools? * * * **Edit** I'm not asking how to do mysql backups. Forget mysql for the moment. It's a red herring. What I'm wanting to know is how to make a series of rolling diffs from a series of files. Each night we get a file ( which _happens to be a mysqldump file_ ) that is 99% similar to the one before it. Yes, we gzip them all. But it's redundant to have all that redundancy in the first place. All I really need is the differences from the night before... which is only 1% different from the night before... and so on. So what I'm after is how to make a series of diffs so I need only store that 1% each night.


title: Invalid greeting from server

text: I'm trying to csup and i'm getting "Invalid greeting from server"               su-3.2# /usr/bin/csup -z -h cvsup.freebsd.org /usr/share/examples/cvsup/standard-supfile     Connected to 72.233.193.64     Invalid greeting from server     su-3.2#


title: elementary os on ubuntu

text: I have installed Ubuntu 14.04 on my laptop I tried to install Pantheon desktop enviroment because I tried it on the elementary os before and I liked it but the last version of elementary os is depended on a Ubuntu 12.04 and I wanted to use Ubuntu 14.04. I searched how to install it and I installed with these commands:               sudo apt-add-repository -y ppa:elementary-os/daily      sudo apt-get update     sudo apt-get install pantheon      when those commands didn't work I typed this:               sudo apt-get install elementary-desktop      but it didn't work correctly this is a list of the problems:   * I can't change languages with `shift``alt` although I enabled changing language with them in settings    * time isn't displayed   * the top right information: wifi,the icon of turning of the computer etc.. (it's in the picture in the top left because I am using a language making it at the top left)   * some of the shortcuts that I enabled don't work like : `ctrl` `alt` `backspace` ![](http://i.stack.imgur.com/kVb9v.jpg)


title: How can I find all ascii files under one directory that have the word shirt in them? Starting from root

text: What command would I use to find all of the files under the girl directory that have the ascii text “shirt” inside the files, starting from the root directory?


title: “No PostgreSQL user name specified” - possible concurrency issues?

text: For my dissertation I'm running the same cronjob on around 300 machines, which is:               10,25,40,55 * * * * /path/to/db_script.sh 1>/dev/null      This script gets some values from the system (whether there is someone logged on), and then runs an INSERT statement on a remote PostgreSQL database. In my script, I specify the location of the .pgpass file for authentication, which is in the same folder as this script. This folder is mounted on (I believe) an NFS file system mounted with AMD. Now, mostly the cronjob runs fine, but every so often I get a couple of errors that say:               psql: FATAL:  no PostgreSQL user name specified in startup packet     FATAL:  no PostgreSQL user name specified in startup packet      Could this be due to the large number of machines trying to access the .pgpass file at the same time? Can S.O. suggest a way to avoid these errors? I'm currently only getting 2 or 3 machines with the error (out of approximately 200 at the moment), and it doesn't happen every time the job runs. But, it would be nice to avoid it entirely!


title: What encoding does my Konsole support?

text: How can I check what encoding (ASCII, UTF-8, UTF-16 etc) my Terminal uses? It shouldn't matter, but I am using Konsole on `KDE3.5`.


title: Copy just permissions and ownership from one tar file to another

text: I have two tar files which are basically backups of my /data folder on android. The problem is the permissions and ownership of the files inside latest back-up is messed up. However the permissions in older tar is perfect. I want a way to read permissions from old.tar and copy over the changes to latest.tar. I tried extracting files to my own system using -p and --same-owner flag but the ownership changes to `root` instead of `system` because my computer doesn't have a user or group called system but my android phone does. I thought I'd extract the files, and write a script which uses stat and grep to read permissions and ownership and sets the permissions and ownerships of the files in latest.tar. But it doesn't seem to work that way. Can anyone give me some help on this issue.


title: Debian Squeeze does not add OTF Fonts

text: I am trying to add a few OTF fonts to my debian system. I copied the font folder in question over to /usr/share (`cp -R /home/morris/Desktop/Collected\ Fonts /usr/share/fonts`) and ran `fc-cache -f -v` which gave the following output:               /usr/share/fonts: caching, new cache contents: 0 fonts, 4 dirs     /usr/share/fonts/Collected Fonts: caching, new cache contents: 0 fonts, 30 dirs     /usr/share/fonts/Collected Fonts/Adobe Caslon Pro: caching, new cache contents: 6 fonts, 0 dirs     /usr/share/fonts/Collected Fonts/Adobe Garamond Pro: caching, new cache contents: 6 fonts, 0 dirs     /usr/share/fonts/Collected Fonts/Adobe Jenson Pro: caching, new cache contents: 32 fonts, 0 dirs     /usr/share/fonts/Collected Fonts/Andale Mono: caching, new cache contents: 1 fonts, 0 dirs     /usr/share/fonts/Collected Fonts/Bell Centennial Std: caching, new cache contents: 4 fonts, 0 dirs     /usr/share/fonts/Collected Fonts/Caecilia LT Std: caching, new cache contents: 8 fonts, 0 dirs     /usr/share/fonts/Collected Fonts/DIN 1451 Std: caching, new cache contents: 2 fonts, 0 dirs     /usr/share/fonts/Collected Fonts/DIN 30640 Std: caching, new cache contents: 2 fonts, 0 dirs     /usr/share/fonts/Collected Fonts/Didot LT Std: caching, new cache contents: 5 fonts, 0 dirs     /usr/share/fonts/Collected Fonts/Egyptienne F LT Std: caching, new cache contents: 4 fonts, 0 dirs     /usr/share/fonts/Collected Fonts/Folio Std: caching, new cache contents: 5 fonts, 0 dirs     /usr/share/fonts/Collected Fonts/Frutiger LT Std: caching, new cache contents: 14 fonts, 0 dirs     /usr/share/fonts/Collected Fonts/Futura Std: caching, new cache contents: 20 fonts, 0 dirs     /usr/share/fonts/Collected Fonts/Helvetica Neue LT Std: caching, new cache contents: 51 fonts, 0 dirs     /usr/share/fonts/Collected Fonts/ITC Cushing Std: caching, new cache contents: 8 fonts, 0 dirs     /usr/share/fonts/Collected Fonts/ITC Officina Sans Std: caching, new cache contents: 4 fonts, 0 dirs     /usr/share/fonts/Collected Fonts/ITC Officina Serif Std: caching, new cache contents: 4 fonts, 0 dirs     /usr/share/fonts/Collected Fonts/Letter Gothic Std: caching, new cache contents: 4 fonts, 0 dirs     /usr/share/fonts/Collected Fonts/LinoLetter Std: caching, new cache contents: 8 fonts, 0 dirs     /usr/share/fonts/Collected Fonts/Memphis LT Std: caching, new cache contents: 7 fonts, 0 dirs     /usr/share/fonts/Collected Fonts/Minion Pro: caching, new cache contents: 64 fonts, 0 dirs     /usr/share/fonts/Collected Fonts/Museo: caching, new cache contents: 5 fonts, 0 dirs     /usr/share/fonts/Collected Fonts/Myriad Pro: caching, new cache contents: 40 fonts, 0 dirs     /usr/share/fonts/Collected Fonts/OCR A Std: caching, new cache contents: 1 fonts, 0 dirs     /usr/share/fonts/Collected Fonts/OCR B Std: caching, new cache contents: 1 fonts, 0 dirs     /usr/share/fonts/Collected Fonts/Olympian LT Std: caching, new cache contents: 4 fonts, 0 dirs     /usr/share/fonts/Collected Fonts/Serifa Std: caching, new cache contents: 6 fonts, 0 dirs     /usr/share/fonts/Collected Fonts/Syntax LT Std: caching, new cache contents: 5 fonts, 0 dirs     /usr/share/fonts/Collected Fonts/Times New Roman MT Std: caching, new cache contents: 7 fonts, 0 dirs     /usr/share/fonts/Collected Fonts/Trade Gothic LT Std: caching, new cache contents: 14 fonts, 0 dirs     /usr/share/fonts/X11: caching, new cache contents: 0 fonts, 6 dirs     /usr/share/fonts/X11/100dpi: caching, new cache contents: 0 fonts, 0 dirs     /usr/share/fonts/X11/75dpi: caching, new cache contents: 0 fonts, 0 dirs     /usr/share/fonts/X11/Type1: caching, new cache contents: 9 fonts, 0 dirs     /usr/share/fonts/X11/encodings: caching, new cache contents: 0 fonts, 1 dirs     /usr/share/fonts/X11/encodings/large: caching, new cache contents: 0 fonts, 0 dirs     /usr/share/fonts/X11/misc: caching, new cache contents: 0 fonts, 0 dirs     /usr/share/fonts/X11/util: caching, new cache contents: 0 fonts, 0 dirs     /usr/share/fonts/truetype: caching, new cache contents: 0 fonts, 7 dirs     /usr/share/fonts/truetype/freefont: caching, new cache contents: 12 fonts, 0 dirs     /usr/share/fonts/truetype/openoffice: caching, new cache contents: 1 fonts, 0 dirs     /usr/share/fonts/truetype/ttf-dejavu: caching, new cache contents: 21 fonts, 0 dirs     /usr/share/fonts/truetype/ttf-liberation: caching, new cache contents: 12 fonts, 0 dirs     /usr/share/fonts/truetype/ttf-lyx: caching, new cache contents: 9 fonts, 0 dirs     /usr/share/fonts/truetype/ttf-sil-gentium: caching, new cache contents: 4 fonts, 0 dirs     /usr/share/fonts/truetype/ttf-sil-gentium-basic: caching, new cache contents: 8 fonts, 0 dirs     /usr/share/fonts/type1: caching, new cache contents: 0 fonts, 2 dirs     /usr/share/fonts/type1/gsfonts: caching, new cache contents: 35 fonts, 0 dirs     /usr/share/fonts/type1/mathml: caching, new cache contents: 1 fonts, 0 dirs     /usr/X11R6/lib/X11/fonts: skipping, no such directory     /usr/local/share/fonts: caching, new cache contents: 0 fonts, 0 dirs     /root/.fonts: skipping, no such directory     /var/cache/fontconfig: cleaning cache directory     /root/.fontconfig: not cleaning non-existent cache directory     fc-cache: succeeded      I rebooted the system afterwards. However none of the new fonts show up neither in Prefernces > Appearance > Fonts or in OpenOffice Writer. Any ideas how to get this to work?


title: Excluding a specific directory using a recursive 'ls'

text: I've been using the following command to list the most recently updated files (recursively) within a specific directory and order by modification time:               $ stat --printf="%y %n\n" $(ls -tr $(find * -type f))      However, within the hierarchy, there is one directory that is full of files that get updated on a near minute-by-minute basis, that makes the above command near useless for finding files outside of the offending directory. I tried using the `ls -I` flag but to no avail:               $ stat --printf="%y %n\n" $(ls -trI 'bad-dir' $(find * -type f))      Is there a simple way of excluding a single/specific directory using the `ls` command? Or should I be pushing the search into the `find` command?


title: Convert pdf to jpg keeping the same name; resize & create thumbs then rename?

text: I have a lot of `pdf` files (3308) on which I must apply four steps: 1) I have to convert all to `jpg` I found this little script on the web with ImageMagick: batch converting pdf to jpg I want to do this, but I keep my files the same name as before: `foo.pdf` => `foo.jpg` Also I would like all images are saved in a folder in "scenes" 2) Then I have to resize to 612x792 3) Then I have to create thumbnails in 255x330 4) Finally I have to rename them. Indeed, I have a `csv` file in which is their names and new names Here is an example of some lines.   Each line corresponds to the "actual name" file "comma" "the new name." There are 3308 rows, one per file               current_name,new_name     foo,bar     PS130_1060,55-large      As you can see, the extensions are not displayed because the two files are in `jpg` format. I am completely lost, I do not know whether to use 4 scripts or if it is possible in one script. I often work in PHP, but I wanted to do a bit of bash to change, but it's a bit hot for me. Can you help me?


title: `systemd` messages after starting login

text: After boot-up process `systemd` starts `agetty`, but after 1--2 seconds additional messages are appeared: ![Photo](http://i.stack.imgur.com/oOTfW.png) How to avoid this? I use Arch Linux, systemd 194.               $ grep '^[^#]' /etc/systemd/system/getty.target.wants/getty@tty1.service     [Unit]     Description=Getty on %I     Documentation=man:agetty(8)     After=systemd-user-sessions.service plymouth-quit-wait.service     After=rc-local.service     Before=getty.target     IgnoreOnIsolate=yes     ConditionPathExists=/dev/tty0          [Service]     Environment=TERM=linux     ExecStart=-/sbin/agetty --noclear %I 38400     Type=idle     Restart=always     RestartSec=0     UtmpIdentifier=%I     TTYPath=/dev/%I     TTYReset=yes     TTYVHangup=yes     TTYVTDisallocate=yes     KillMode=process     IgnoreSIGPIPE=no     Environment=LANG= LANGUAGE= LC_CTYPE= LC_NUMERIC= LC_TIME= LC_COLLATE= LC_MONETARY= LC_MESSAGES= LC_PAPER= LC_NAME= LC_ADDRESS= LC_TELEPHONE= LC_MEASUREMENT= LC_IDENTIFICATION=     KillSignal=SIGHUP          [Install]     Alias=getty.target.wants/getty@tty1.service


title: Exynos 5 DVFS or turning off cores in Ubuntu - Scaling frequency for one of the cores only (dual core) (cpufreq)

text: I was wondering if there is possible to scale only one of the cpu cores in the A15 in Exynos 5 ? I have tried using e.g cpufreq-set -c 1 -f 500MHz, but both cores are set to the same frequency. When running cpufreq-info, it displays that : "CPUs which need to have their frequency coordinated by software: 0 1" on both CPU 0 and CPU 1. Maybe this means that both cores are scaled. However, is there any way of turning off a core, or to perform frequency scaling of individual cores in Ubuntu ?


title: How can I install a new keyboard layout in KDE 4?

text: I have a custom X11 keyboard layout that I can use with `setxkbmap`. But after some searching I've found that apparently just having the XKB layout file isn't enough to set it as a new keyboard layout in KDE 4. What I would like to have my custom layout be recognized by the KDE system so that I can choose it using the systray applet, or install it as the default using the System Settings module. What do I need to do to make this happen? If it's complicated, that's fine, I would still like to know what is involved. I've looked at this question which seemed to be related, but it apparently is about creating the keyboard layout in the first place, which I've already done.


title: Does using ctrl+c instead of esc to exit insert mode break anything in vi?

text: When using vi, you can exit insert mode with `Ctrl` + `C` instead of the more traditional `Esc`. Are there any situations where it would be undesirable to use for former instead of the latter? Does it break anything other than best practice?


title: How to share files Between RHEL and Ubuntu

text: I have installed RHEL 5.5 on VIrtual Box and Host system is Ubuntu 12.04. I can access the files of Ubuntu by using the sharing services of Virtual Box. ![Virtual Box](http://i.stack.imgur.com/d7NMe.png) **But how can I access the files of RHEL which is installed on Virtual Box?** # Network Configuration RHEL is connected to Ubuntu using Bridged adapter ![Network Mode](http://i.stack.imgur.com/lsoYt.png)


title: rpmbuild: Is there a way to specify recommended packages

text: So, search as I might, I can't find anything about specifying recommended packages in a spec file. I wouldn't even consider it possible if I hadn't seen it in the spec file for Mono 2.10.9. It reads the following:               Recommends:     libgdiplus0 >= 2.6      But rpmbuild is definitely complaining about it. I'm guessing it's not something that's actually allowed. Is that the case? Is there another way to recommend some other packages during the install phase?


title: Setting up an ad-hoc network on boot

text: I'm pretty new to Linux; this project is me trying to learn more. I've done login scripts before but not boot scripts, so that's one of my questions. My other question is how to get an ad-hoc network working with just terminal commands, so that I can make a boot script to do it. I'm running Fedora 18 off of a flash drive for now, but when I'm done configuring I'll be copying everything to an old laptop's hard drive. (The goal of this project is to not have to buy a better wireless router) The most luck I've had setting up an ad-hoc was by using Gnome's "Use as Hotspot..." button in my wireless network settings, and then changing the name and WEP code (Can I use other encryption methods?) using iwconfig in the terminal, but I want it all done with terminal commands so that I can just run a script to set it all up. I think I can figure out how to use iptables to set up my port forwarding and junk myself, but first I need to get this computer able to share its internet connection wirelessly.


title: Unable to convince Thunderbird to open links in anything but Firefox on ArchLinux

text: I've gone through the following articles doing the steps to ensure that thunderbird will open links in Chromium instead of Firefox:   * http://kb.mozillazine.org/Register_protocol   * http://kb.mozillazine.org/Default_browser#KDE Everywhere else in KDE, things open appropriately in the right browser (chromium). I've tried clobbering my profile, and starting again from scratch. I'm at a loss here, I can't figure out why everything else is using chromium as the default browser, but thunderbird continues to use firefox, no matter what. I'm running ArchLinux, in KDE, and I've set up chromium as the default browser.


I created a startup script to start/restart/stop a group of applications. I used the lib `/etc/init.d/functions` in my script. It is working well on my system, but it not working for my client; he is getting the error: > No such file or directory /etc/init.d/functions Right now I don't know which linux distro my client uses. Is the `init.d/functions` file different for different Linux distros? If so, how can I find it?


title: Grep does not seem to work properly for me

text: Command:               LC_ALL=C fgrep -f /root/inputfile.txt *.txt > outputfile.txt      inputfile contains this kind of stuff;               -name1:     -name2:     -othername:      `*.txt` (multiple files) contains things such as               -name:email@email:d-o-b::alias      When I grep a small list of names from the input file, some which exist in the `*.txt`'s, some which don't. I get other false results.               000_na_name_000:493982:email@yahoo.com:2000-01-05:XX:X:123.123:alias      There is absolutely nothing in the input that should case these false results, and there's a lot of them.


title: Remove messages from qmail queue without stopping qmail

text: I have 500k spam messages in my outgoing queue. From experience, I know this will take a long time to remove. All the tools I know of require stopping qmail to remove messages. Does anyone one know of a tool which will let me selectively delete messages from the queue without stopping mail services?


title: My touchpad malfunctions after running for a while

text: I have 2-finger scrolling set up on my touchpad, using GNOME settings. After running my laptop for a while (several hours), such scrolling is no longer functional, and the touchpad itself is rather unstable (barely usable). Here's the output from syslog:               Nov 15 21:07:06 tshepang kernel: [40639.175677] psmouse.c: TouchPad at isa0060/serio4/input0 lost sync at byte 4     Nov 15 21:07:06 tshepang kernel: [40639.177708] psmouse.c: TouchPad at isa0060/serio4/input0 lost sync at byte 1     Nov 15 21:07:06 tshepang kernel: [40639.191630] psmouse.c: TouchPad at isa0060/serio4/input0 - driver resynched.     Nov 15 21:07:07 tshepang kernel: [40639.503288] psmouse.c: TouchPad at isa0060/serio4/input0 lost sync at byte 1     Nov 15 21:07:07 tshepang kernel: [40639.505326] psmouse.c: TouchPad at isa0060/serio4/input0 lost sync at byte 1     Nov 15 21:07:07 tshepang kernel: [40639.507310] psmouse.c: TouchPad at isa0060/serio4/input0 lost sync at byte 1     Nov 15 21:07:07 tshepang kernel: [40639.509479] psmouse.c: TouchPad at isa0060/serio4/input0 lost sync at byte 1     Nov 15 21:07:07 tshepang kernel: [40639.511280] psmouse.c: TouchPad at isa0060/serio4/input0 lost sync at byte 1     Nov 15 21:07:07 tshepang kernel: [40639.511285] psmouse.c: issuing reconnect request     Nov 15 21:07:07 tshepang kernel: [40640.198742] Unable to query Synaptics hardware.      I'm on Debian Unstable, currently with Linux 3.1. The problem is reproducible with Linux 3.0. I haven't tried any other kernel. Reloading the psmouse module (`sudo modprobe -r psmouse && sudo modprobe psmouse`) doesn't help, forcing me to reboot the machine. I'm wondering if this could be a hardware problem.


title: Privoxy: blocking twitter, facebook and google outside of their domainslr

text: _**Related subject:** blocking facebook.com outside facebook.com domain_ This is from default.filter               #################################################################################     #     # shockwave-flash: Kill embedded Shockwave Flash objects.     #                  Note: Better just block "/.*\.swf$"!     #     #################################################################################     FILTER: shockwave-flash Kill embedded Shockwave Flash objects.          s|<object [^>]*macromedia.*</object>||sigU     s|<embed [^>]*(application/x-shockwave-flash\|\.swf).*>(.*</embed>)?||sigU      This is how you implement it in the .action file               #############################################################################     # Kill embedded Shockwave SWF objects     #############################################################################     {+filter{shockwave-flash}}     .funny-games.biz/      Works fine, but... I am failing to achieve my wanted result .filter:               #################################################################################     #     # trace-widget: Get rid of particularly annoying so-called sharing buttons.     #     #################################################################################     FILTER: trace-widget Kill embedded spying buttons.          s|||sigU      .action:               #----------------------------------------------------------------------------     # Deny access for Facebook Google and Twitter scripts     #----------------------------------------------------------------------------     {+filter{trace-widget}}     /      What is wrong with it? I am puzzled on how it can be applied for frames and scripts like: Twitter:                     Google: g+ analytics etc.               <g:plusone annotation="inline"></g:plusone>                Facebook:                         Share                Your help is deeply appreciated. _**Update (working filter rules)_** Facebook:               s|]*(sharer.php).*>(.*)||sigU     s|]*(like.php).*>(.*)||sigU      (this would be better if a facebook.com and fbcdn.net domains be added to these rules so that it won't block any other PHP or JS or other contents of the current website) Google: (not always working - cutroni.com)               s|)||sigU      Twitter: (work with fenopy.eu but not with The Pirate Bay HTTPS pages https://thepiratebay.org/) (not always working - cutroni.com)               s|)||sigU      Your help, for a better code, is deeply appreciated. **Edit:** _Not f'd — you won't find me on Facebook fsf.org/fb (Just for fun xD)_               s|]*(sharer.php).*>(.*)||sigU


title: aliasing a slightly complex script on Linux/bash

text: Stormvirux provided this nice script in another thread. It puts column headings on the output of an `ls -l` listing:               #!/bin/bash     { echo Permissions links Owner Group Size Last_modMonth Last_modTime Last_modTime Filename; ls -l ; } | column -t | awk 'NR!~/^(2)$/'     ls -l | head -1 Just running it on the command line works great. I like it and want to use it as an alias for, say `lsl` on a Linux system running bash. But I can't for the life of me figure out how to make the delimiters work so it is interpreted correctly. When I try just using the alias command on the command line (which I do before I commit it to a configuration file like `.bashrc`), it won't work. I get various errors when I try various ways to package it so it's interpreted correctly. Can someone tell me how to get this working as an alias, or point me to a good reference that can clearly tell me what I need to do to get something like this working as an alias?


title: Can I move a directory with open files?

text: Imagine a bunch of processes using a `/home/user/logs` directory. They have some logs open for a longer time.


title: Mac OS X: dircolors not found?

text: I just switched to a Macbook Air. I installed zsh using homebrew, but when I use some of the code that I (originally had) in my `.zshrc`, I get an error saying that `.dircolors was not found`. Below is the code in question:               zstyle ':completion:*' auto-description 'specify: %d'     zstyle ':completion:*' completer _expand _complete _correct _approximate     zstyle ':completion:*' format 'Completing %d'     zstyle ':completion:*' group-name ''     zstyle ':completion:*' menu select=2     eval "$(dircolors -b)"     zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}     zstyle ':completion:*' list-colors ''     zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s     zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=* l:|=*'     zstyle ':completion:*' menu select=long     zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s     zstyle ':completion:*' use-compctl false     zstyle ':completion:*' verbose true          zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'     zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd'      Is `dircolors` not shipped with Mac OS X? How should I install it? # Update: If I run dircolors directly on the shell I get: `bash: dircolors; command not found`


title: apt-get via ssh-tunnel if only port 22 is allowed

text: I have a server which has only access to the outer world via port 22 (for the use of ssh from the server to other computers). I want to install some packages via `apt-get` on this server. Can I achive this with a ssh-tunnel to my super-machine which has internet access on all ports? If so, how? Because if I start a tunnel via ssh to my super-machine, the super-machine has its sshd waiting on port 22. I assume that I cannot reuse this same port 22 for the tunneling, can I? Is there another solution?


title: How can I tell if my hard drive is PATA or SATA?

text: I have an ATA hard disk in my laptop, running Fedora 11, kernel 2.6.30.10-105.2.23.fc11.i586. I am looking to upgrade the disk in here (would love to get an SSD) but I forgot if it's a serial ATA or an old parallel ATA interface. There's not much use upgrading to an SSD if it's PATA... How can I tell if the disk is connected via a PATA or an SATA interface?


title: --no-desktop and %U what for?

text: I want to know why is this argument so important when lauching nautilus or pcmanfm. What happens if i don't? Also, i want to know what is the meaning of %U for:               Exec=pcmanfm %U


title: Problems converting PDF to DjVu

text: I have a PDF file (copyrighted, so I can't include it here). I'm trying to convert it to DjVu, using some online websites as well as `pdf2djvu`, but they all fail. In the case of `pdf2djvu`, the error was: > PDF error: FoFiType1::parse a line has more than 255 characters, we don't > support this Is there any way around this? How do I deal with PDF to DjVu conversion problems?


title: Change zsh completion to put completions above the prompt

text: I'm a long-time tcsh user that finally decided to try out zsh. I've been toying around with completion, but one thing I don't like is that when I hit tab for a completion that might have a lot of values, it prints the completion options below the prompt, pushing the prompt up off the bottom of the terminal. TCSH would leave the old prompt, print the completions on new lines below, and then reprint the prompt and the command that you had typed so far. Is there any way to change the completion logic so that completion options are printed above the prompt?


title: How to use a D-Link usb network adapter on debian

text: I have a Debian (squeeze) desktop, and I need to use a D-Link 150 USB Wireless Network Adapter. So far I've done this:               $ lsusb     ...     Bus 001 Device 006: ID 2001:3c18 D-Link Corp.     ...      After looking for a solution in google, I found that I needed to install the following package:               firmware-ralink_0.28+squeeze1_all.deb      I've installed it, but Debian doesn't want to find the adapter. When I run `lsmod`, I can't find what I'm supposed to find: `rt2870sta` Can you point me in the right direction? * * * A little more data. I checked `ifconfig`, and there's not any wireless adapter detected by debian:               # ifconfig     eth0 ...     lo ...      The contents of `/etc/network/interfaces` is:               auto lo     iface lo inet loopback     allow-hotplug eth0     #NetworkManager#iface eth0 inet dhcp      I hope this additional data helps


title: how to allow SSH connection with a password instead of key exchange.

text: I need to connect to a remote host over ssh. The client doesn't support ssh key method but able to connect to remote but get disconnected with an error "no supported authentication methods available". How do I allow only client A to be able to connect to this remote host B without using ssh keys method.


title: find arcana: can't get pipe to work in -exec line

text: How do I pipe the results of a find through a sed to xform the stream, and then use that transformed stream as one of two arguments to a script? IE: **find** turns up file1.tiff (among others)   **sed** transforms file1.tiff --> file1.jpg   a command is executed using both of these arguments: **convert file1.tiff file1.jpg** I've tried this a number of ways and can't get it. Here's one attempt that gives the flavor:               find ./out -regex ".*_p[bg]_.*tiff" -exec echo "Processing {}" \; -exec convert {} `echo {} | sed s/tiff/jpg/` \;      I should just give up and write a Python script to do each of these pieces separately, but I'm finally trying to learn UNIX tools and now am obsessed. Help!


title: System call invokation methods in new kernel

text: I read that in the newer kernels system calls are invoked using the INT X80 instruction and also using the sysenter instruction. And also the sysenter instruction gives faster invocation as compared to the other method. How could I check which all system calls are invoked by that method?


title: How to make an rpm package that installs a Java environment if needed

text: I'm very new to RPM packaging and I'm curious if, during the installation of one RPM it is possible to conditionally install another RPM if needed. In a nutshell. My RPM requires a particular JRE. While installing my RPM, what is the best way to:   1. Check for the existence of the JRE and...   2. If the JRE does not exist, install it.


title: Dragging of windows slow/laggy after installing ATI Radeon HF 4870 graphic drivers in Ubuntu 10.10 Gnome?

text: I recently installed ubuntu 10.10. Graphics were actually fine, by just using the default drivers, and I could drag windows fast and smoothly. However, since I have an ATI Radeon HD4870 card I should be able to get more out of it by installing the ATI driver for linux. So, I decided to install the ATI drivers for my radeon 4870. Now my resolution is fine and everything looks alright, but when I drag windows its not smooth at all and very laggy. I haven't seen any other implications, although I didn't test any graphic heavy applications. The window dragging is very laggy though and thus a problem. Any idea what could cause this?