title: My reverse-ssh tunnel is using keepalives but they're not helping

text: I have an ssh client machine **picard** behind multiple unreliable internet connections - all with NAT. I have my server **time** , reliable with a static IP. I want to be able to access **picard** thorugh **time**. I've done this before: `ssh -N -R 19999:localhost:22 user@my.domain` This works, but if there is a problem it exits and does not restart, and it doesn't start on boot, so now I add a sydtemd service to run: `/bin/bash -c "while true; do /usr/bin/ssh -i <unencrypted key> -o ServerAliveInterval=10 -v -o ServerAliveCountMax=6 -N -R 19999:localhost:22 user@my.domain; sleep 5; done"` `while true ... sleep 5` re-runs ssh if it exits `-o ServerAliveInterval=10` sends a keep-alive every 10 secnods `-o ServerAliveCountMax=6` exits if 6 keep-alives go out with no response `-v` keeps debug info in `/var/log/messages` through systemd On the server side I added a couple of lines to `sshd_config`:               KeepAlive yes     ClientAliveInterval 10     ClientAliveCountMax 6      Same idea as the client - break the connection after 60s of inactivity. Unfortunately it seems to take a lot longer than a minute to restart:               < tunnel is up and keepalives are coming in >     Jun  7 17:31:02 picard bash[135]: debug1: client_input_global_request: rtype keepalive@openssh.com want_reply 1     Jun  7 17:31:12 picard bash[135]: debug1: client_input_global_request: rtype keepalive@openssh.com want_reply 1     Jun  7 17:31:15 picard bash[135]: debug1: client_input_channel_open: ctype forwarded-tcpip rchan 2 win 2097152 max 32768     Jun  7 17:31:15 picard bash[135]: debug1: client_request_forwarded_tcpip: listen localhost port 19998, originator 127.0.0.1 port 38267     Jun  7 17:31:15 picard bash[135]: debug1: connect_next: host localhost ([127.0.0.1]:22) in progress, fd=4     Jun  7 17:31:15 picard bash[135]: debug1: channel 0: new [127.0.0.1]     Jun  7 17:31:15 picard bash[135]: debug1: confirm forwarded-tcpip     Jun  7 17:31:15 picard bash[135]: debug1: channel 0: connected to localhost port 22     Jun  7 17:31:20 picard systemd-logind[137]: New session 1 of user main_username.     < I break eth0 and plug it back in after NM sees it's down >     < eth0 is back up within a few seconds >     < nothing happens with my ssh connection for a LONG time >     Jun  7 17:54:16 picard bash[135]: Write failed: Broken pipe     Jun  7 17:54:22 picard bash[135]: OpenSSH_6.1p1, OpenSSL 1.0.1c-fips 10 May 2012     Jun  7 17:54:22 picard bash[135]: debug1: Reading configuration data /etc/ssh/ssh_config     Jun  7 17:54:22 picard bash[135]: debug1: /etc/ssh/ssh_config line 50: Applying options for *     Jun  7 17:54:22 picard bash[135]: debug1: Connecting to my.domain [123.234.123.234] port 22.     Jun  7 17:54:22 picard bash[135]: debug1: Connection established.     Jun  7 17:54:23 picard bash[135]: debug1: identity file /home/test/.ssh/id_rsa type 1     Jun  7 17:54:23 picard bash[135]: debug1: identity file /home/test/.ssh/id_rsa-cert type -1     Jun  7 17:54:23 picard bash[135]: debug1: Remote protocol version 2.0, remote software version OpenSSH_5.8p1 Debian-1ubuntu3     Jun  7 17:54:23 picard bash[135]: debug1: match: OpenSSH_5.8p1 Debian-1ubuntu3 pat OpenSSH_5*     Jun  7 17:54:23 picard bash[135]: debug1: Enabling compatibility mode for protocol 2.0     Jun  7 17:54:23 picard bash[135]: debug1: Local version string SSH-2.0-OpenSSH_6.1     Jun  7 17:54:23 picard bash[135]: debug1: SSH2_MSG_KEXINIT sent     Jun  7 17:54:23 picard bash[135]: debug1: SSH2_MSG_KEXINIT received     Jun  7 17:54:23 picard bash[135]: debug1: kex: server->client aes128-ctr hmac-md5 none     Jun  7 17:54:23 picard bash[135]: debug1: kex: client->server aes128-ctr hmac-md5 none     Jun  7 17:54:23 picard bash[135]: debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent     Jun  7 17:54:23 picard bash[135]: debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP     Jun  7 17:54:23 picard bash[135]: debug1: SSH2_MSG_KEX_DH_GEX_INIT sent     Jun  7 17:54:23 picard bash[135]: debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY     Jun  7 17:54:23 picard bash[135]: debug1: Server host key: RSA 7a:19:72:9d:f5:39:f5:03:cf:16:b2:ee:fc:a4:e6:ba     Jun  7 17:54:23 picard bash[135]: debug1: Host 'my.domain' is known and matches the RSA host key.     Jun  7 17:54:23 picard bash[135]: debug1: Found key in /home/test/.ssh/known_hosts:1     Jun  7 17:54:23 picard bash[135]: debug1: ssh_rsa_verify: signature correct     Jun  7 17:54:23 picard bash[135]: debug1: SSH2_MSG_NEWKEYS sent     Jun  7 17:54:23 picard bash[135]: debug1: expecting SSH2_MSG_NEWKEYS     Jun  7 17:54:23 picard bash[135]: debug1: SSH2_MSG_NEWKEYS received     Jun  7 17:54:23 picard bash[135]: debug1: Roaming not allowed by server     Jun  7 17:54:23 picard bash[135]: debug1: SSH2_MSG_SERVICE_REQUEST sent     Jun  7 17:54:23 picard bash[135]: debug1: SSH2_MSG_SERVICE_ACCEPT received     Jun  7 17:54:23 picard bash[135]: debug1: Authentications that can continue: publickey,password     Jun  7 17:54:23 picard bash[135]: debug1: Next authentication method: publickey     Jun  7 17:54:23 picard bash[135]: debug1: Offering RSA public key: /home/test/.ssh/id_rsa     Jun  7 17:54:23 picard bash[135]: debug1: Server accepts key: pkalg ssh-rsa blen 279     Jun  7 17:54:23 picard bash[135]: debug1: read PEM private key done: type RSA     Jun  7 17:54:24 picard bash[135]: debug1: Authentication succeeded (publickey).     Jun  7 17:54:24 picard bash[135]: Authenticated to my.domain ([123.234.123.234]:22).     Jun  7 17:54:24 picard bash[135]: debug1: Remote connections from LOCALHOST:19999 forwarded to local address localhost:22     Jun  7 17:54:24 picard bash[135]: debug1: Requesting no-more-sessions@openssh.com     Jun  7 17:54:24 picard bash[135]: debug1: Entering interactive session.     Jun  7 17:54:24 picard bash[135]: debug1: remote forward success for: listen 19999, connect localhost:22     Jun  7 17:54:24 picard bash[135]: debug1: All remote forwarding requests processed     Jun  7 17:54:44 picard bash[135]: debug1: client_input_global_request: rtype keepalive@openssh.com want_reply 1     Jun  7 17:54:45 picard bash[135]: debug1: client_input_channel_open: ctype forwarded-tcpip rchan 2 win 2097152 max 32768     Jun  7 17:54:45 picard bash[135]: debug1: client_request_forwarded_tcpip: listen localhost port 19999, originator 127.0.0.1 port 60222     Jun  7 17:54:45 picard bash[135]: debug1: connect_next: host localhost ([127.0.0.1]:22) in progress, fd=4     Jun  7 17:54:45 picard bash[135]: debug1: channel 0: new [127.0.0.1]     Jun  7 17:54:45 picard bash[135]: debug1: confirm forwarded-tcpip     Jun  7 17:54:45 picard bash[135]: debug1: channel 0: connected to localhost port 22     Jun  7 17:54:50 picard systemd-logind[137]: New session 3 of user main_username.     < whenever I connect the keepalive debug messages stop coming, not sure if this is normal >      I'm sure I've overlooked something. I've seen some projects like autossh that do pretty much the same thing I'm doing now, but I'd like to be able to fix this if possible. How do I get the delay down to 2-3 minutes instead of 23 minutes?


title: removing stack of popd/pushd paths

text: After `pushd`ing too many times, I want to clear the whole stack of paths. How would I `popd` all the items in the stack? I'd like to `popd` without needing to know how many are in the stack? The bash manual doesn't seem to cover this. Why do I need to know this? I'm fastidious and to clean out the stack.


title: Custom Linux Timezone

text: I believe rdesktop 1.7.1 is sending Linux timezones (For example "EST") to the Windows client I regularly connect to _(I am yet to find a way of seeing what Windows receives in the way of RDP settings in general, or just the timezone setting; Nor do I know how to monitor what rdesktop is sending to the Windows client. If anyone can increase my knowledge in either of these areas, please provide info/point me at something to read)_. This seems to be causing an issue with Windows, as it doesn't match any of the timezones in the registry @ `HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones` (See below error _"Your current time zone is not recognized. Please select a valid time zone using the link below"_ ). ![](http://i.imgur.com/MnGCcCc.jpg) I don't have `zic` on my live distro (Parted Magic) and so was wondering if there is any other way of changing the time zone to display "Eastern Daylight Time" either system wide, or just what rdesktop sends?


title: Why doesn't Alpine's viewer command work within GNU screen and how can I fix it?

text: The title pretty much says it all. When I run the viewer command in alpine from within GNU screen it tells me "viewer command completed" but it doesn't actually bring up Lynx (or any other viewer). I even tried writing my own script that would just write the arguments out to a file and no dice. I tried piping the message to a file, and I get "Can't exec (script) no such file or directory" However, if I close out alpine, detach from screen, and then start alpine, I can use the viewer or pipe messsages just fine. So, what is the problem here and how can I fix it? ### Update 1: The value of TERM depends on what I login with - from Eterm on my laptop, `TERM` is `Eterm` outside of screen and `screen` inside. From Connect Bot it's `screen` attached or not. And here is my .screenrc               $ cat .screenrc      defscrollback 10000     caption always "%?%F%{-b bc}%:%{-b bb}%?%C|%D|%M %d|%H%?%F%{+u wb}%? %L=%-Lw%45>%{+b by}%n%f*%t%{-}%+Lw%-0<"          shell bash          bind j focus down     bind k focus up     bind t focus top     bind b focus bottom          screen -t 'system'     screen -t 'alpine'     screen -t 'programming'      screen -t 'suppliments'      screen -t 'ssh'     screen -t 'webby'     screen -t 'ipython' ipython     screen -t 'mpg321'     screen -t 'irssi'       **Update 2:** Changing the term value didn't fix anything. I tried `tmux` for a while, and that actually worked, but I had some issues with it properly sizing based on what screen I was using (whatever the smallest dimension was). So now I'm using a somewhat strange hack - I run a tmux session inside my screen session and run alpine inside that tmux session. Viewing URLs works perfectly fine now, but obviously this is not the ideal situation, and I'd welcome any better fixes.


title: command for counting number of active cron jobs in crontabs

text: ### Problem statement I have 5 solaris boxes, some have Solaris 10 and some have Solaris 9.   All of them have many cronjobs in their crontabs. I would like to know number of active cronjobs available, so I manually count the cronjobs. _Now I am looking for a command [bash shell I am using] to count the number of active cronjobs._ I have tried `crontab -l|wc -l`, but my crontab contains many comments lines which are also counted with my command. ![crontab](http://i.stack.imgur.com/aAGYF.png) ### What I have tried               crontab -l|wc -l      ### What I am expecting A bash shell command to count the number of active cronjobs (excluding comments lines).


title: Why is connecting scanners to Linux such a pain?

text: I've run into this problem yesterday, after about six months or so, where I used my scanner for the last time. I've installed a new Linux in the meantime. I have a Mustek BearPaw 1200 CU Plus. It's an old and quite cheap scanner, but it's been working for over six years now, so until it breaks, there's no need to replace it. In order to make this scanner run, I have to get a `PS1Dfw.usb`, which is the Firmware, that needs to be loaded every time before scanning onto the device. After installing sane and the backends, and putting the firmware into `/usr/share/sane/gt68xx/`, I could scan the pages I needed. But why is this such a pain? Printers aren't that hard to connect to Linux, so why's that with scanners? And why aren't the firmware's in a package or something? The site where I downloaded the firmware from, hasn't been updated since 2007, and is no longer maintained. What if it finally goes offline, do we lose support for all gt68xx based scanners? Any advice on how to make this simpler is welcomed (I don't use my scanner that often, and I usually do a new installation of the OS in the mean time. Then, when I _do_ need my scanner, it's all looking up how to make that damn thing work all over again).


title: lxpanel borked since dist-upgrade in Debian Sid

text: On 13-Aug, several LXDE-related packages were installed in my Siduction Linux system. All of these updates came from the Debian repos. Now, lxpanel is not started when I log in, so I have no panel icons nor menus. On 15-Aug, several more LXDE components were upgraded, and I hoped that these would fix my problem. But, they didn't. If I manually start lxpanel, it starts without errors, but the panel displayed is completely blank. Has anyone seen similar problems? I need help, please.


title: How to set Ralink RT5390 into N mode using iw?

text: I'm working on supporting a new wifi card for my company. This is the first `n` mode card I've worked with, previously we've used `iw` to set the cards into either `b` or `g` mode as follows:               case $mode in       1) iw dev $name set bitrates legacy-2.4 1 2 5.5 11;; # 802.11b       2) iw dev $name set bitrates legacy-2.4 6 9 12 18 24 36 48 54;; # 802.11g only     esac      I'm looking for a third command for the `case` statement, but I've not been able to find anything on google.


title: cannot boot my ubuntu partition

text: I am running SUSE 11.2. Ubuntu is on the extended partition `/dev/sda5`, but when I boot I get               Error 19: Linux kernel must be loaded before initrd      This is the Ubuntu entry in menu.lst:               #Don’t change this comment – YaST2 identifier: Original name: none#     title Ubuntu 10.04     root (hd0,4)     kernel /vmlinuz root=/dev/sda5 ro quiet splash     initrd /initrd.img


title: Resolve missing package dependencies when trying to install octave

text: I am trying to install the `octave` software package on a RHEL 6 Workstation. I have installed the `epel-release 6.5` package to enable the EPEL package repository. When I try to install the `octave` using `yum`, the following errors are returned:               Error: Package: 6:octave-3.4.2-2.el6.x86_64 (epel)                Requires: libfftw3.so.3()(64bit)     Error: Package: 6:octave-3.4.2-2.el6.x86_64 (epel)                Requires: libfftw3f.so.3()(64bit)     Error: Package: 6:octave-3.4.2-2.el6.x86_64 (epel)                Requires: libglpk.so.0()(64bit)      I tried to use `yum` to search for the packages _libfftw3, libfftw3f, libglpk, fftw3,fftw3f, and glpk_. However, it was not able to find any of these packages. I am wondering if anybody knows   1. Should I try to find the packages by the names _fftw3,fftw3f,_ and _glpk_? Or should I search for the names _libfftw3, libfftw3f, libglpk_?   2. Does this mean I have to try to find the required dependency packages online? Is there a reliable website providing these RPM packages for RHEL Workstation 6? Thank you very much.


title: Connection problems creating a socks server with antinat

text: How can I run a socks server using antinat. I read the tutorials, but I can't get it working. My firewall is off, but I get the error: > proxy server is refusing the connection What could I be doing wrong?


title: Error with fetchmail and SSL certificates

text: I have a problem configuring my mail client on my Mac OS 10.6.8. These were the steps I did:               # touch ~/.fetchmailrc      I edited the file and created the contents:               poll pop.gmail.com with proto POP3 and options no dns     user 'GMAIL_USERNAME@gmail.com' there with password 'GMAIL_PASSWORD' is 'LOCAL_USERNAME'                 here and wants mda "/usr/bin/procmail -d %T"  options ssl keep sslcertck sslcertpath      "/Users/LOCAL_USERNAME/.ssl/certs"        Then I executed:               # chmod 710 ~/.fetchmailrc      I copied the certificates from here http://af- design.com/blog/2010/04/28/using-linux-fetchmail-with-gmail/ into the directory `~/.ssl/certs/` and issued the following commands:               # ls ~/.ssl/certs/              equifax.pem    gmail.pem   imap.gmail.pem          # c_rehash ~/.ssl/certs/      This generated the following files in the `~/.ssl/certs` directory:               17974aab.0     578d5c04.0     b627f838.0     equifax.pem    gmail.pem           imap.gmail.pem      It seems that I have the correct one as I didn't receive any complaints. Finally I ran the command:               # fetchmail -v      and got the error:               fetchmail: 6.3.11 querying pop.gmail.com (protocol POP3) at Thu, 03 May 2012 16:41:02    +0200 (CEST): poll started     Trying to connect to 173.194.67.108/995...connected.     fetchmail: Server certificate verification error: unable to get local issuer certificate     fetchmail: Certificate/fingerprint verification was somehow skipped!     fetchmail: SSL connection failed.     fetchmail: socket error while fetching from lgu.tbz@gmail.com@pop.gmail.com     fetchmail: 6.3.11 querying pop.gmail.com (protocol POP3) at Thu, 03 May 2012 16:41:02 +0200 (CEST): poll completed     fetchmail: Query status=2 (SOCKET)     fetchmail: normal termination, status 2      I tried to do as suggested in some forums, for example modifying the username or similar, but it did not help. Any help is appreciated.


title: Hard drive/device partition naming convention in Linux

text: What is the hard disk drive/device partition naming convention in Linux? For example, `[hd0,0]`, `sd0`, etc. What does it actually mean? What is the significance of this when i need to install multiple OSes on the same machine? How can we relate it to windows partitioning (example: `C:\` drive or `D:\` drive)?


title: Keyboard Fn problem on  Samsung netbook

text: I'm running Slackware Linux on a Samsung NC 110 netbook. None of the `Fn` keys work exept for the audio volume level keys. Currently I can control the brightness of the display with this command: `echo -n 6 > /sys/class/backlight/samsung/brightness` I would like to use this netbook with a projector but I can't switch the display without the use of the `Fn` keys. Is there an alternate way to send the display to a projector without using the `Fn` keys? Thanks


title: Execute scripts without decrypting them

text: I have a set of scripts (bash, ruby, python) and want to put everything into a container like file so I can deploy this container on a lot of servers. This scripts need to protect from accessing other users (root included). So my idea was to create a encrypted container with all the sensitive scripts and mount this into RAM on boottime. But after mounting this container, the files are accessible from the system for everybody which has permission to it. Is there some technique to deploy interpreted scripts (bash, ruby, ...) onto a system and nobody can see its content at any time? I don't want to run some "obfuscating" scripts.


title: Run jar on startup in all *nix based systems

text: I have a jar file which I need to run at startup in all distros of Linux. My previous question here, gave me an idea a rough idea on X-servers. Since I wasn't able to perform startup, I moved on to the idea of adding a .desktop file to `/etc/xdg/autostart`. This works for ubuntu and I am currently testing it in Linux Mint both cinnamon and mate versions. I did a small research for other distros but they don't seem to have the `/etc/xdg/autostart` instead they have `/xdg-autostart` but I need to run my jar file in all distros of Linux. I tried crontab but `@reboot` didn't work in ubuntu 14.04 for me. Another problem is I need to remove the file I am placing to startup when I uninstall the jar. If I edit rc.local, I won't be able to revert the edit. Is there a common way in which I can do startup in Linux


title: Create / Edit files in specific folder using different user / group

text: I want to know if the following scenario is possible. I am a user called www-admin and I am in the group www-admin. I am also a sudoer. I want to have all the files I create in the folder `/var/www/domain` to have the group `domain` and the user `domain`. If I as user `www-admin` create and edit the files inside `/var/www/domain` all tha's domain:domain. Is this possible:?


title: Installing OpenVPN to replace Cisco VPN because Cisco will not work with the kernel I am on or downgrade instead?

text: I had difficulties installing Cisco5.0 VPN on my Ubuntu 10.04 LTS. I asked for assistance in this question: link to previous question. The answer is that this Cisco program will run on only older versions of the kernel. I would like to use the VPN to connect through my university's network so that I can view academic journals under their subscription. One option could be to downgrade the kernel; how can this be done and what consequences would this have? The second question is whether I can install an alternative VPN client to connect? I have a ".pcf" file from the university to use with the Cisco client. Would this be compatible information to allow another client to connect? Is the connection independent of the software used?


title: Last command in ksh

text: In bash I can use `!!` to indicate the last command. In ksh I think you can use `r` to do something similar, but it seems to fail in one of my common patterns: typing `sudo [last command]`.               > cp foo /bar     cp: permission denied     > r c       # If I do this it will repeat my cp call     > sudo r c  # when I do this, it tells me that "r" is not a command      How can I use history to quickly type "sudo [last command]"?


title: Why can my gentoo systemd installation only execute files as root?

text: If I try to login as any other user, via `su` it says 'permission denied'. If I use `su -l` it says 'canot cd to `/home/<user>`'. Logging in via the tty just kicks anyone without a message out except root.   If I try to install somthing via portage, it says 'permission denied to `/usr/bin/sandbox`'. When I try to run `gdm`, it just shows a black screen. Also, I get an error when trying `sudo -u <username> [a command]` as root. It says:               sudo: unable to stat /etc/sudoers: Permission denied     sudo: no valid sudoers sources found, quitting     sudo: unable to initialize policy plugin      This guy seems to have had a similar problem in 2005. However, nobody helped him out. This is my kernel configuration. However, I don't think that is the problem. I've literally searched for hours. Any suggestions would be appreciated.


title: WebGUI for Virtualization?

text: Are there any virtualizations that can be accessed via a WebGUI too? I mean the administration part is enough on a terminal, but we need a virtualization/webgui solution for "customers". So that they could for ex.: reboot their guest machine or reach it when it's "frozen" [bsod/kernel panic] or maybe clone it, etc. There is Xen with the xen-shell, but it's not good because it's only available via terminal. Any solutions?


title: How to change or create Lvm partition in Centos after install OS in shell

text: How to change or create Lvm partition in Centos dedicate server after install OS in shell?


title: uniq a csv file ignoring a column, awk maybe?

text: Given this file (annotations are not part of file, but form part of explanation)...               x,a,001,b,c,d,y     x,a,002,b,c,e,yy     x,bb,003,b,d,e,y     x,c,004,b,d,e,y     x,c,005,b,d,e,y   # nb - dupe of row 4     x,dd,006,b,d,e,y     x,c,007,b,d,e,y   # nb - dupe of row 4 and 5     x,dd,008,b,d,f,y     x,dd,009,b,d,e,y   # nb - dupe of row 6     x,e,010,b,d,f,y      ... I would like to derive the following output:               x,a,001,b,c,d,y     x,a,002,b,c,e,yy     x,bb,003,b,d,e,y     x,c,004,b,d,e,y     x,dd,006,b,d,e,y     x,dd,008,b,d,f,y     x,e,010,b,d,f,y      If column 3 were cut from the file, and then uniq were run over the file, then if the remaining rows had their column three value added back in at the right place, then I'd get the above result. But I'm really struggling, to come up with something that would do this. I'd welcome an opportunity to learn about linux's text processing utilities. Performance: Files don't look likely to grow to more than 1MB, and there is only 1 file per day. Target: Debian GNU/Linux 7 amd64, 256MB / Xeon. Edit: tweaked example as fields are not fixedwidth, and a solution involving `uniq --skip-chars=n` will not work as far as I can tell.


title: gpg starting gpg-agent on demand?

text: The man page of `gpg-agent` states:                  The agent is usualy started on demand by gpg,  gpgsm,  gpgconf  or        gpg-connect-agent.   Thus there is no reason to start it manually.        In case you want to use the included Secure Shell  Agent  you  may        start the agent using:               gpg-connect-agent /bye             The usual way to run the agent is from the ~/.xsession file:               eval $(gpg-agent --daemon)      This on the one hand tells me that "there is no reason to start it manually" and on the other hand tells me how to start it manually. -- Did I misunderstand anything here? On my system it seems like I definitely have to start it manually. Otherwise for example `gpg-connect-agent` complains: `can't connect to the agent: IPC connect call failed`. - Do I need to configure anything to make `gpg-connect- agent` start the agent as stated in the man page? * * * Also the man page of `gpg-connect-agent` says:                  --agent-program file               Specify the agent program to be started if none is running.      However `gpg-connect-agent --help` does not list this option and the command also complains if I try to use it. Seems like the man page describes a different command, or did I miss anything important? * * * My system is a current Arch Linux. (Same situation on another debian box.) Requested details:               $ gpg --version     gpg (GnuPG) 2.0.22     libgcrypt 1.5.3     Copyright (C) 2013 Free Software Foundation, Inc.     License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>     This is free software: you are free to change and redistribute it.     There is NO WARRANTY, to the extent permitted by law.          Home: ~/.gnupg     Supported algorithms:     Pubkey: RSA, ELG, DSA, ?, ?     Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,             CAMELLIA128, CAMELLIA192, CAMELLIA256     Hash: MD5, SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224     Compression: Uncompressed, ZIP, ZLIB, BZIP2     $ gpg-connect-agent --version     gpg-connect-agent (GnuPG) 2.0.22     Copyright (C) 2013 Free Software Foundation, Inc.     License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>     This is free software: you are free to change and redistribute it.     There is NO WARRANTY, to the extent permitted by law.          Home: ~/.gnupg     $ man gpg-connect-agent |grep -A1 agent-program            --agent-program file                   Specify the agent program to be started if none is running.     $ gpg-connect-agent --agent-program foo     gpg-connect-agent: invalid option "--agent-program"     $ gpg-connect-agent /bye     gpg-connect-agent: can't connect to the agent: IPC connect call failed


title: How can I replace a tty using getty with qingy on ubuntu 12.04 or later?

text: Qingy is a getty replacement. I'd like to use it for a tty terminal on Linux Mint 15 (in hopes of getting tmux to get proper 256 colors in tty which fails with fbterm) which means replacing getty. I'm not sure how to do so, as it says I need to edit /etc/inittab, which doesn't exist in current versions of Ubuntu.


title: rc.subr can't access file?

text: On FreeBSD 8.3 I'm running script (as root):               /usr/local/etc/rc.d/foo/foo.sh start      content is typical:               . /etc/rc.subr     name="foo"     rcvar=${name}_enable     load_rc_config ${name}     required_files=${foo_conf}      in `/etc/rc.d.local` I have:               foo_conf=/cf/foo/config/foorc      And when I start it I get:               /usr/local/etc/rc.d/foo.sh: WARNING: /cf/foo/config/foorc is not readable.     /usr/local/etc/rc.d/foo.sh: WARNING: failed precmd routine for foo      But when I run application (`/usr/local/bin/foo`) directly with `-f` parameter as `/cf/foo/config/foorc` application starts normal. Permission for `foorc` file: `-rwxr-xr-x` and for directory: `drwxr-xr-x`. Fragment in rc.subr looks like:               check_required_before()     {         for _f in $required_files; do         if [! -r "${_f}" ]; then         warn "${_f} is not readable"         fi         done     }      It is permission problem or what?


title: how do i suppress seds unnessary output while using option -e?

text: why n option is not working here                  [root@testgfs2 final]# echo a b c | sed -ne 's/[[:blank:]]/"/gp' -ne 's/^/"/pg' -ne 's/$/"/pg'         a"b"c         "a"b"c         "a"b"c"      i just need :               "a"b"c"      actually i want sed to do somehting like :               echo a b c d | sed ...      output:               'a' 'b' 'c' 'd'


title: Digging through huge gziped log files

text: From time to time I need to dig through huge log files (several GB unpacked) to debug a specific error. Now, vim is OK for browsing through the file, but when I need to find something in the file it's completely useless. Is there some tool that could index the log and allow me to search the file faster? Ideally a command line tool. EDIT: Just to clarify, tools like `ack` or `grep` aren't suitable since I need to examine the context of the matches and `-C`,`-A`,`-B` just aren't good enough. Plus `ack` and `grep` are still unusably slow.


title: grep upto matching brackets

text: I have a file like this:-               pin(ABC) {                     a b c d e f {                     abc                     }                    }       pin(XYZ) {                     g h i j k  {                             j k {                               cg {                            }                           }                          }                         }       abcd pqrs rstu       mango banana tree       pin(PQR) {                      mango                }        Now i want to grep the text like this:-   when i give ABC as input then output should be a file named ABC with the content from "pin(ABC) {" upto matching bracket "}" like this :-               pin(ABC) {                     a b c d e f {                     abc                     }                    }        when i give PQR the output should be a file named PQR with this content:-               pin(PQR) {                      mango                }        & so on for any word which is inside pin()   one way to do it is to grep the text from "pin(ABC" till next name "pin" & direct the output to the file named "ABC" , it works for only ABC but fails for case of PQR & XYZ. How to do it.


title: Theme looks different depending on location in FS?

text: I am noticing an annoying effect when copying GTK themes and I am unable to explain it. Copying a theme from /usr/share/themes to ~/.local/share/themes results in a new theme that looks different than the original. As it's a `cp -a` copy that is surprising to me and I can't find a proper explanation for it. Why does the copied theme in ~/.local yield a different result than the original in /usr? The whole story: I am unhappy with the current coloring scheme I use for XFCE because it won't highlight the active tab in a gnome-terminal. The only solutions to this problem I was able to find was "use another coloring scheme". However, all the coloring schemes that solve this problem for me have other effects I don't like. So I am looking to bring that one feature of highlighted active tabs into my favorite coloring scheme. I start out copying my favorite scheme from /usr/share/themes into ~/.local/share/themes by               cp -a /usr/share/themes/i_like_you_best ~/.local/share/themes/renamed_to_be_discernible      Now, when I open `xfce4-appearance-settings` I can select renamed_to_be_discernible as coloring scheme. Unfortunately, renamed_to_be_discernible looks different than i_like_you best. Here are two small screenshots showing the difference. ![with scheme i_like_you_best](http://i.stack.imgur.com/1DgEX.png) ![with scheme renamed_to_be_discernible](http://i.stack.imgur.com/nXCRG.png) The left picture shows a (piece of a) window using the original scheme i_like_you_best, whereas the right picture shows the same screenarea but with renamed_to_be_discernible. Notice the difference in the gray used for the window manager decorations and the two much more pronounced borders of the menu and tab bars. One of the reasons why I like i_like_you_best best is that it's simple. Consequently the entire theme is just one file `/usr/share/themes/i_like_you_best/gtk-2.0/gtkrc`. That file does neither include nor reference another file explicitly. Why do these two themes yield different results? These days Xfce still uses GTK2 and I was hoping if i threw `i_like_you_best/gtk-2.0` and `theme_with_what_i_want/gtk-3.0` together I would get an Xfce theme that does what I want, but apparently even copying the gtk-2.0 folder to a new location breaks the theme.


title: Unable to pass a bash variable as a python argument in bash

text: For some reason I cannot pass the bash variable `$FOLDER` as a python argument on the following code. The python script downloads some files from amazon s3. Bash script:               #!/bin/bash     FOLDER=$(./aws get $BUCKET"/location.txt")     python /data/pythonscript.py $FOLDER     #      The output of the `$FOLDER` is a regenerated date eg. `2014/07/31/14-16-34` which is used as a path. Here is the python script:               #!/usr/bin/python          import boto, sys     from boto.s3.connection import S3Connection          access_key = 'accesskey'     secret_key = 'secretkey'     bucket_name = 'a name'     folder_path =  str(sys.argv[1]) if len(sys.argv) > 1 else ''          print("Forwarded folder path " + folder_path)          conn = S3Connection(access_key, secret_key)     bucket = conn.get_bucket(bucket_name)          print("Bucket Location:" + bucket.get_location())          for key in bucket.list(prefix=folder_path, delimiter=''):             if '.' in key.name:                     file_name = key.name[len(folder_path)+1:]                     print("Downloading file " + file_name)                     key.get_contents_to_filename('/data/temp/' + file_name)      When I execute the bash script without changing the `python /data/pythonscript.py $FOLDER` line, I get the following output:               Forwarded folder path 2014/07/31/14-16-34      Buckect Location:       But when I change it to `python /data/pythonscript.py 2014/07/31/14-16-34` , everything works:               Forwarded folder path 2014/07/31/14-16-34     Bucket Location:      Downloading 2014/07/31/14-16-34/FacetedSearch.zip      Downloading file FacetedSearch.zip     Downloading 2014/07/31/14-16-34/Location.zip     Downloading file Location.zip     Downloading 2014/07/31/14-16-34/LocationPage.zip     Downloading file LocationPage.zip


title: Install r5u87x on FreeBSD

text: I need to install Ricoh r5u87x webcam loader on FreeBSD, because it solve not suspending in unix/linux boxes on my vaio laptop as I try it in UBUNTU, but the loader is simply for Linux, I think. Is there any solution for FreeBSD? Thanks.


I am new to linux. I am looking at some configuration notes for a CentOS, but I am configuring a Redhat machine. I am not clear:   1. What the below commands install?    2. Why one might install these?    3. Are these applicable to a RedHat installation?                   yum groupinstall  "Development Libraries"         yum groupinstall  "Development Tools"         yum groupinstall  "Server Configuration Tools"      Note: I started by Googling _yum group install "development libraries"_ , but felt some terms might be ambiguous.


title: The ERE regex to split() string between a delimiter and end-of-word

text: I'm using a long **gawk 3.1.6** script to do a complex conversion of Zim markdown text into GtkDialog code and am stuck on the following problem... Sample ASCII input...               [[link|label label]] [[link]] @tag more text      Commandline test to find right regex...               re="[][][][]"; echo '[[link|label label]] [[link]] @tag more text' | awk -v RE=$re '{split($0,A,RE); printf "\n(" A[1] ")(" A[2] ")(" A[3] ")(" A[4] ")(" A[5] ")(" A[6] ")(" A[7] ")(" A[8] ")\n"}'      The regex `"[][][][]"` splits out the two hyperlink forms quite nicely so that's not a problem. > It would be more understandable if we could divided it in two -- `"[][]"` > and `"[][]"`. We are looking for either "[[" or "]]" to split on. The order > of the characters in the class have to be reversed to comply with class > meta-character restrictions. The problem is in also splitting out the "@tag" into just "tag". "tag" could be any alphanumeric text either followed by a space or the end of the string. Executing the commandline test above yields...               ()(link|label label)( )(link)( @tag more text)()()      But I need it to yield...               ()(link|label label)( )(link)( )(tag)(more text)      I've tried numerous regex strings like `"[][][][]|@[[:alnum:]]*"` which drops the entire word and yields...               ()(link|label label)( )(link)( )( more text)()      and `"[][][][]|@"` which yields...               ()(link|label label)( )(link)( )(tag more text)()      Any ideas?


title: Where is / why is there no log for normal user systemd services?

text: I'm trying to learn basic systemd usage and I've run into a confusing issue with user service units. When running ordinary services with **systemctl start some.service** I can find the full log for this service (including what it has printed to stdout / stderr, as I understand it) by running **sudo journalctl --unit some.service**. Consider the example servicefile **chatty.service** :               [Service]     ExecStart=/usr/bin/echo "test from chatty.service"      When I place this service file in **~/.config/systemd/user/chatty.service** and run it with **systemctl --user start chatty.service** I cannot find its output sent to stdout in journalctl, neither with plain **journalctl** nor with **journalctl --user**. I only get the following output in both:               Jan 15 19:16:52 qbd-x230-suse.site systemd[1168]: Starting chatty.service...     Jan 15 19:16:52 qbd-x230-suse.site systemd[1168]: Started chatty.service.      And **journalctl --unit chatty.service** does not return anything at all (with or without --user makes no difference). While if I move the same service file to **/etc/systemd/system** and run it with **sudo systemd start chatty.service** I then get the following output when I run **sudo journalctl --unit chatty.service** :               Jan 15 19:28:08 qbd-x230-suse.site systemd[1]: Starting chatty.service...     Jan 15 19:28:08 qbd-x230-suse.site systemd[1]: Started chatty.service.     Jan 15 19:28:08 qbd-x230-suse.site echo[27098]: test from chatty.service      It seems like the user service unit isn't as well integrated somehow, is this expected, am I missing something or is it a bug? I am running openSUSE 13.1 x86-64, with systemd 208 (default install).


title: How to speed up migration from Raid 5 to Raid 6 with mdadm?

text: Today I started the migration of my Raid 5 to Raid 6 by adding a new disk (going from 7 to 8 disks, all 3TB). Now the reshape is in progress:               Personalities : [raid6] [raid5] [raid4]      md0 : active raid6 sdi[9] sdh[8] sdf[7] sdc[6] sdd[4] sda[0] sde[5] sdb[1]           17581590528 blocks super 1.2 level 6, 512k chunk, algorithm 18 [8/7] [UUUUUUU_]           [>....................]  reshape =  2.3% (69393920/2930265088) finish=6697.7min speed=7118K/sec          unused devices: <none>      but it is slow as hell. It will be almost 5 days before completion. I was using to reshape the array in about 1 day, but here it is horrible. The speed is very low. The backup file is on a SSD. I did change the stripe size and the min and max speed limits, and it did not change a thing. Is there any way I can speed up the process to reasonable amount of time or I have to wait 5 days to finish ? Update: iostat -kx 10               avg-cpu:  %user   %nice %system %iowait  %steal   %idle                0.05    0.00    1.68   22.07    0.00   76.20          Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util     sda            1675.90  1723.00   27.60   23.90 13875.20  6970.00   809.52     0.55   10.79    8.59   13.33   7.97  41.02     sdb            1675.90  1723.10   27.20   23.80 13670.40  6970.00   809.43     0.55   10.80    8.96   12.90   8.12  41.43     sdc            1675.90  1723.60   27.50   23.30 13824.00  6970.00   818.66     0.65   12.85   10.48   15.65   9.83  49.94     sdd            1675.90  1723.10   27.60   23.80 13875.20  6970.00   811.10     0.55   10.80    8.93   12.98   8.16  41.95     sde            1675.90  1723.10   27.20   23.80 13670.40  6970.00   809.43     0.60   11.79    9.17   14.79   9.19  46.87     sdf            1675.90  1723.80   27.70   23.10 13926.40  6970.00   822.69     0.72   14.28   11.65   17.43  10.12  51.40     sdg               0.00     4.10    0.00   93.20     0.00 39391.20   845.30     6.07   65.14    0.00   65.14   2.71  25.29     dm-0              0.00     0.00    0.00    4.30     0.00    18.40     8.56     0.00    0.07    0.00    0.07   0.02   0.01     dm-1              0.00     0.00    0.00   89.60     0.00 39372.80   878.86     6.07   67.78    0.00   67.78   2.82  25.28     md0               0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00    0.00    0.00   0.00   0.00     sdh            1583.50  1631.70  216.50  115.90 13824.00  6970.00   125.11     1.56    4.73    5.36    3.55   0.43  14.41     sdi               0.00  1631.70    0.00  115.90     0.00  6970.00   120.28     0.21    1.77    0.00    1.77   0.28   3.25     dm-2              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00    0.00    0.00   0.00   0.00     dm-3              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00    0.00    0.00   0.00   0.00     dm-4              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00    0.00    0.00   0.00   0.00      sdi is the disk I last added. sdg is the SSD. The dmX are the partitions on LVM.


title: "echo 3 > /proc/sys/vm/drop_caches" - Permission denied as root

text: I am currently having some issues with the cache. It is a little too much right now so I wanted to clear it. I googled and found this little command: `sync && echo 3 > /proc/sys/vm/drop_caches`.   I am logged in as root over SSH (not using sudo). These are the attempts I made:               root@server: ~ # ll /proc/sys/vm/drop_caches     -rw-r--r-- 1 root root 0 15. Jan 20:21 /proc/sys/vm/drop_caches          root@server: ~ # echo 3 > /proc/sys/vm/drop_caches     -bash: /proc/sys/vm/drop_caches: Permission denied          root@server: ~ # sudo su -c "echo 3 > /proc/sys/vm/drop_caches"     bash: /proc/sys/vm/drop_caches: Permission denied          root@server: ~ # echo 3 | sudo tee /proc/sys/vm/drop_caches     tee: /proc/sys/vm/drop_caches: Permission denied     3      It is a remote machine running Debian. As far as I know there are some vCores in this machine and it uses Virtuozzo for the virtualization.   I really just want to clear the cache _(So I can only access it using SSH)_.   I also tried registering this as a cronjob. But it simply fails too!


title: How to install CentOS 6 via USB mass storage device?

text: I want to install CentOS 6.2 on a laptop (Thinkpad R40) which comes without CD/DVD-drive but with USB 2.0 ports. It seems that CentOS does not provide ready-to-use dd-able USB images for installation. Thus my question: How to install CentOS via a USB device (e.g. a 16 GB USB flash drive)? Regarding using different available iso-images as base: the laptop has net- access - but I want to make sure that the CentOS installer is not loading unchecked packages from the net during installation - perhaps a netinstall image does not check cryptographically signed packages during installation (as with the Fedora 14 installer). There is a CentOS InstallFromUSBkey which just provides outdated, cryptic and wrong information. Especially, the instructions for CentOS 6 are missing details and contain errors (10 MB for the first partition is not enough, `syslinux device` fails and what are they talking about grub?)


title: Some keyboard shortcuts do not work in Compiz

text: I've bound `Win-R` with the _Run Application_ dialog in Metacity. However, the shortcut doesn't work when switched to Compiz. The entry _Show the panel's "Run application" dialog box_ even doesn't appear in the _Keyboard Shortcuts_ dialog in Compiz. There are also other shortcuts that do not work in Compiz. I can add them using custom shortcuts, but I don't know the command line to popup the "Run Application" dialog. Why are there so many shortcut entries missing in Compiz? (~90 entries in Metacity compared to ~20 entries in Compiz) (OS: Debian Squeeze) **EDIT** Screenshot: Keyboard shortcuts list in Compiz ![Keyboard shortcuts list in Compiz wm](http://i.stack.imgur.com/E28fs.png) As you see, the list is very limited, most shortcuts set in Metacity are missing.


title: Detecting computer models , e.g the vendor

text: How can I detect the model of a computer, like Leveno or Sony? Is there any program can do this, for both PC & Laptop? (I just want to load a specific driver when the target model is detected.)


title: clear tmpfs in my case

text: I am on a **Ubuntu** machine. I have make a directory under **root** directory, by:               $ sudo mkdir /hello     $ sudo mkdir /hello/bye      Then I mount **tmpfs** with size 1024M to `/hello/bye` by:               $ sudo echo "tmpfs   /hello/bye   tmpfs   size=1024M,mode=0777  0  0" >> /etc/fstab     $ sudo mount -a      In future , **How to clear** `/hello/bye` (tmpfs) ?


title: vim horizontal line count

text: Using set number you can turn on vertical line count.   Is there also a command to turn on horizontal line count? I hate talking my hands away from typing and would like to be able to quickly address an area by column and row and past it starting at another column and row. As an example I can copy from col 12 line 14 to col 14 line 17 THEN pate is at col 20 line 16


title: Auto correct path when running a command from history?

text: I perform a recursive search to find a command I executed few days back and I want to run it. However that command should run from the path from where I ran it previously from and not where I currently am. Is it possible for `zsh`to figure this out and change the command to the full path and run from my current path? or maybe fork a process switch to the original path run it and come back?


title: mount freebsd slice partition under linux

text: I have under linux:                      Device   Boot      Start         End      Blocks   Id  System     /filename.img      *         63     1007999      503968+  a5  FreeBsd      Under above partition i have two slices: ufs filesystem and swap. I don't know, how I can determine mount offset to mount ufs partition.               mount -r -t ufs -o loop,offset=32256,ufstype=ufs2 filename.img /test/      dmesg output               ufs_read_super: bad magic number      It's not working.


title: Simple wrapper scripts spawning 100s of bash processes

text: I have this kind of GCC multilib wrapper set up:               #file: gcc     #!/usr/bin/env bash     gcc -m32 "$@"      which essentially just wraps a 64-bit multilib gcc to act as a non-multilib 32-bit gcc. When I build something (like binutils for example), this spawns hundreds of `bash` processes, until even `fork` fails. How can I work around this?


title: How to open a file in the last closed position in VI

text: I want to open a file which is closed in line xxx. So I can easily continue editing


title: Can I achieve functionality similar to interrupts in Linux userspace?

text: One of functionalities I miss the most from "small embedded" in Embedded Linux is the interrupts. A signal appears on a specific pin, or other interrupt source is triggered and whatever was done inside the CPU gets interrupted, and my function of interrupt handler is launched. In Linux everything is buffered, if something happens the system just goes about its own course and when (at last) given thread is brought to foreground, its wait-state expecting the external source ends, and its handler starts. The closest thing I know are the signals, which can trigger a handler interrupting normal flow of the thread, but still, the handler will not pick up the signal until the kernel brings the thread into foreground, which may be many milliseconds after the signal happened - and triggering the signals isn't as robust either; I need an app or a kernel module to send a signal, I can't just trivially attach it to a GPIO pin. How could I achieve a functionality similar to hardware interrupts within Linux userspace software - have a specific function launched or specific thread brought to foreground immediately after an externally sourced condition is triggered, without waiting for the process queue to bring my thread to foreground? If you feel this question is too broad, let's narrow it to a specific example: a Raspberry Pi board receives a signal on one of its GPIO pins (not necessarily arbitrary; if only some pins can do that, that's okay.) I want my userspace application to react to this event within least time possible, be it bringing it out of wait state, launching a handler function or any equivalent mechanism, but above all not waiting for the task queue to cycle through all pending processes before the handler is brought to foreground, but trigger it ASAP. (and specifically, when there is no signal, not leaving the system locked forever with the handler process occupying 100% CPU time polling the input and never yielding to the OS.) Is there such a mechanism?


title: Username conflicts on a central printer queue

text: We have just switched to a centralized print queue. The printer is setup with               lpadmin -p SPScolour -E -D "Sustainable Print Colour" -v lpd://xxx.yyy.com/colour      The IT people are saying my local username must match my central username. Of course the IT people are not that organized and I have a number of "central" usernames. Is there a way to specify the print queue username through an environment variable or some other trick? I can work around the username constraint by using `lp -U mycentralusername -d SPSColour foo.txt`. This isn't a complete solution since not all GUIs give you the option of specifying the print command. If I am willing to install a different printer for each user I can do               lpadmin -p SPScolour -E -D "Sustainable Print Colour" -v lpd://mycentralusername@xxx.yyy.com/colour      I have had no luck with setting lpoptions. I have tried               lpoptions -d SPScolour -o username=myusername     lp -d SPSColour foo.txt      which does not print. It looks like `lpoptions` takes a `-U` flag, but I cannot figure out how to use it.               lpoptions -U myusername -d SPSColour      gives me an error.


title: Speakers make popping sound when on battery power. What should I do?

text: I am running Linux Mint 11 on my notebook, which is basically a variation of Ubuntu. I have been hearing a popping noise in the speakers ever since I installed the OS, but just now realizing that the popping sound only happens on battery power. This noise is driving me insane and even happens when I mute the speakers. It sounds like: "pop" [30 sec pause] "pop pop". Please someone, anyone help me. Notebook: HP Pavilion DV6325US P/N: RV004UA OS: Linux Mint 11 (with current updates)


title: HAProxy should not forward an incoming request to down instance

text: In my scenario, I have 2 servers, both are communicating with HAProxy. When a request comes in, HAProxy splits the request and sends it to both servers, following a round robin method. If in any case my first instance goes down, at that time HAProxy should come to know that one of the servers are down and it should not forward any requests to that server. It should only communicate with the other server for every request. Can anybody tell me how I can configure my HAProxy for above scenario, please?


title: What are the minimum root filesystem applications that are required to fully boot linux?

text: It's a question about user space applications, but hear me out! 3 'applications', so to speak, are required to boot a funcitonal distro of Linux:   1. Bootloader - For embedded typically that's U-Boot, although not a hard requirement.   2. Kernel - That's pretty straightforward.   3. Root Filesystem - Can't boot to a shell w/out it. Contains the filesystem the kernel boots to, and where `init` is called form. My question is in regard to #3. If someone wanted to build an extremely minimal rootfs (for this question let's say no gui, shell only), what files/programs are required to boot to a shell?


title: Changing username but not home directory

text: Is it a bad idea to do `usermod -l login-name old-name` to change my username while leaving my home directory name intact? A few years ago my university changed my username, but since it didn't affect anything, I did not change my local username. Now in order to use our centralized printers, the local username must match the university username (or so they claim). The reason I don't want to change my home directory is twofold.   1. I think there are a number of scripts that have my username hardcoded into them.    2. I think a change in my home directory name might throw my backup and revision control systems into a state of chaos.


title: File no longer available when trying to edit in vim via <()

text: When working with mercurial, I frequently do things like               vim <(hg cat -r 42 somefile)      However, if I try this with a file larger than several hundred lines, I get a Read Error in vim, and only the first couple of hundred lines are included. If I use gvim instead of vim, I get an error like               E211: FIle "/proc/3546/fd/63" no longer available      Isn't this supposed to work? I don't know if it's relevant, but I've tried both in bash and zsh, with the same result, and I also tried               cat <(hg cat -r 42 somefile)      which prints the entire file as I would expect.


title: Not able to extend the size of an LVM logical volume

text: During RedHat installation, I created one volume group with two logical volumes in it.               Volume Group Name = VolGroup00     LVMs              = LogVol00 and LogVol01                    LogVol00 size = 48G     LogVol01 size = 81G      I have added extra 146GB hard drive. I added that drive as a physical volume and ran the command `pvs`:                 PV         VG         Fmt  Attr PSize   PFree       /dev/sda3  VolGroup00 lvm2 a-   132.00G      0       /dev/sdb5  VolGroup00 lvm2 a-   136.09G 136.09G      Now I'm trying to extend the size of `LogVol01` from 81GB to +200Gb using the command               lvextend /dev/VolGroup00/LogVol01 -l 100%VG      But it is giving me this error:               [root@APP ~]# lvextend /dev/VolGroup00/LogVol01 -l 100%VG       Extending logical volume LogVol01 to 268.09 GB       Insufficient free space: 5917 extents needed, but only 4355 available      How can I fix this and extend my volume?


title: How to set up FreeBSD for my region?

text: im currently installing FreeBSD. Im at the "Time Zone Selector" screen. I don't know what should i choose. Normally, since i live in Quebec (Canada), i choose Eastern time GMT -5, but there is no such option. Should i choose "Atlantic Ocean" or "America -- North And South" or UTC or something else? During the installation, i also had to choose which keyboard layout, i took French Canadian, but some of my keyboard's button dont give the expected result. There was no Canadian Multilingual option... How to set up Canadian Multilingual??


title: Linux sort second last column

text: I would like know how to sort the second last column ? It has the word "days=" in front of the number. I'm able to get the column with awk '{print $(NF-1)}', but sorting is wrong.                   457000      (test2) && (SGD||RMB||HKD||YEN)    days=5000    71         37622 (this is || test1)&&(SGD||HKD||RMB) days=630 40010          43944 (this is)&&(SGD||HKD) days=80 102732          79378 (this is||test2)&&(HKD||RMB)   days=800 205425       The result I'm looking for is                   43944 (this is)&&(SGD||HKD) days=80 102732          37622 (this is || test1)&&(SGD||HKD||RMB) days=630 40010          79378 (this is||test2)&&(HKD||RMB) days=800 205425         457000      (test2) && (SGD||RMB||HKD||YEN)    days=5000    71


title: Centos 6.2 static IP: only getting IPV6 address and need IPV4

text: I installed a Centos 6.2 min install. I have edited `/etc/sysconfig/network- scripts` and I have `ifcfg-eth0,eth1` I have tried to setup static IPs but I only get IPV6 address back on both adapters and can't ping anything since the rest of the network is IPV4. I have copied my working settings from another Centos 6 server I have setup and working. Not sure what to do next? I already added a line to say `NETWORKING_IPV6=no`


title: Incomplete factory update makes btrfs filesystem unusable?

text: After an incomplete update from the factory repo my opensuse 12.1 btrfs filesystem is unusable. I have plenty of disk space free but zero inodes. When I try to delete or create a file it gives me the error no space available? How can I fix this? Here is how I solved it: http://www.nrtm.de/index.php/2012/03/13/the-joys-of- btrfs-and-opensuse-or-no-space-left-on-device/


title: Output of `java -version` not matched by grep or awk

text: On my Linux machine, it isn't clear to me why if I do the following then I don't get only the version string ("1.5.0_32").               # java -version | grep version | awk '{print $NF}'     java version "1.5.0_32"     Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_32-b05)     Java HotSpot(TM) Server VM (build 1.5.0_32-b05, mixed mode)      Why don't `grep` or `awk` work? Just to show that grep and awk work on other example               # echo ' java version "1.5.0_32" ' | grep version  | awk '{print $NF}'     "1.5.0_32"


title: How to control the time that users spend on

text: I need a solution that allows me to control the time that each user spend on the computer, excluding idle time (some kind of parental control). I've tried _timekpr_ , but it doesn't work on Ubuntu 13.10. pam_time is not what I'm looking for... Here is how my situation looks like in practice: There are several user's accounts in the system, let's call them U1, U2 and U3. I would like to know how long and at what time each of them was active, BUT if i. e. U2 doesn't perform any operations (just idle logged in) or lock his account without logging off, it shouldn't be counted against the total time spent by him on the computer. If user exceed the time limit assigned to his account, I would like to be able to run a bash script (and the same when he tried to use a computer in some specified hours). My computer works as a server, so more than one user can use it at the same time. Users work in graphical mode (Unity, X Window System) without using the terminal. Is there any third-hand software, a system command, some suggestions what can I use developing my own solution, _et cetera_?


title: Why does this work: "cp image.bin /dev/mapper/loop0p1"?

text: Why does this work?               cp image.bin /dev/mapper/loop0p1      `image.bin` is a partition image. I have tried it and works, but why? Shouldn't a `dd` be used?


title: Install MultiUpload Extension in MediaWiki

text: I am trying to install "MultiUpload" mediawiki extension. I followed the installation instructions and added below code to my mediawiki "LocalSetting.php" file `require_once("/var/lib/mediawiki/extensions/MultiUpload/MultiUpload.php");` but when I tried to verify the installation by go to the webpage `http://myserverIP/wiki/index.php/Special:Version` It gave me "http error 500". However I have successfully installed "FCKeditor" extension by using the below command and it went on very well:               sudo apt-get install mediawiki-extensions     sudo mwenext ParserFunctions.php      My Apache error log shows:               [Tue Mar 20 13:40:18 2012] [error] [client 172.29.35.61] PHP Warning:  require_once(/var/lib/mediawiki/extensions/MultiUpload/MultiUpload.php): failed to open stream: No such file or directory in /etc/mediawiki/LocalSettings.php on line 142     [Tue Mar 20 13:40:18 2012] [error] [client 172.29.35.61] PHP Fatal error:  require_once(): Failed opening required '/var/lib/mediawiki/extensions/MultiUpload/MultiUpload.php' (include_path='/var/lib/mediawiki:/var/lib/mediawiki/includes:/var/lib/mediawiki/languages:.:/usr/share/php:/usr/share/pear') in /etc/mediawiki/LocalSettings.php on line 142     [Tue Mar 20 13:40:19 2012] [error] [client 172.29.35.61] PHP Warning:  require_once(/var/lib/mediawiki/extensions/MultiUpload/MultiUpload.php): failed to open stream: No such file or directory in /etc/mediawiki/LocalSettings.php on line 142     [Tue Mar 20 13:40:19 2012] [error] [client 172.29.35.61] PHP Fatal error:  require_once(): Failed opening required '/var/lib/mediawiki/extensions/MultiUpload/MultiUpload.php' (include_path='/var/lib/mediawiki:/var/lib/mediawiki/includes:/var/lib/mediawiki/languages:.:/usr/share/php:/usr/share/pear') in /etc/mediawiki/LocalSettings.php on line 142      My "MultiUpload" directory shows:               total 112     drwxrwxr-x 2 2010  500  4096 2009-06-10 15:57 .     drwxr-xr-x 3 root root  4096 2012-03-20 13:38 ..     -rw-rw-r-- 1 2010  500   788 2009-06-10 15:57 multiupload.js     -rw-rw-r-- 1 2010  500  1100 2009-06-10 15:57 README     -rw-rw-r-- 1 2010  500  2942 2009-06-10 15:57 SpecialMultipleUpload.alias.php     -rw-rw-r-- 1 2010  500 13314 2009-06-10 15:57 SpecialMultipleUpload.body.php     -rw-rw-r-- 1 2010  500 70689 2009-06-10 15:57 SpecialMultipleUpload.i18n.php     -rw-rw-r-- 1 2010  500  3188 2009-06-10 15:57 SpecialMultipleUpload.php      May I know how to troubleshoot this error and get this extension working on my mediawiki? I am using Ubuntu11.04, MediaWiki 1.15.5-3.


title: How to get GPU acceleration working for my old PC?

text: I am using an old PC Pentium4 2.4Ghz with nVidia GS 7900 AGP 256MB and I would like to support the video play from GPU. As far what I have read, the support for vdpau has come for nVidida 8 series. Is there any way to support playing from GPU using mplayer?


title: tcpdump not capturing http or tcp/ssl traffic

text: I have been trying to learn `tcpdump` and I am using this command to attempt to monitor my network:               sudo tcpdump -I -i en1      But this gives me a bunch of stuff I don't want, so I used this version to filter the packets:               sudo tcpdump -I -i en1 port 80 or 443      And it gives me nothing. I know you can't use your WiFi when using monitor mode, but I still can, so I think thats a sign something is wrong. I tried it with en0, but it couldn't go into monitor mode. What am I doing wrong? I am using a MacBook Pro with OS X 10.9.3, and I would like to be able to do this with `tcpdump`, or any other utility that's built into OS X.


title: touch and tar from a text file

text: Am trying to zip a certain number of files and am stuck at below point,                  ls -lrt /lag/cnn/*/*/*/adb.tar.gz | grep -nri ABC >> sample.txt      In sample.txt i got filesNames on which i have to do touch command to extract filesNames that i need to tar.                  touch -t '<time>' first & touch -t '<time>' last       So my question is , how can i implement this touch in sample.txt to extract what i need based on time and tar those files. Whether touch command and tar command can be added to the above command using pipe or should i do it separately.


title: Busybox ash script does not exit cleanly after executing cat; unable to get exit code

text: Consider the following script `wrapcat.sh` (a wrapper for cat) for illustrative purposes. It is run with busybox (ash) in an embedded Linux 2.6 box.               #!/bin/sh     cat $1      Under certain circumstances, this script will not always exit cleanly. For instance, when I run               $./wrapcat.sh /proc/pid/cmdline      for some `pid`, I will sometimes be dropped into a shell awaiting a command. After hitting return or the like, it terminates. My diagnosis is that `cat` is interrupted by some signal, and therefore the script does not exit cleanly (as I do not set any -e option). So I am interested in the return status of the `cat` command. I modify the script as follows:               #!/bin/sh     cat $1     echo $? # echo the exit status      However, the exit status is not echoed when the script fails to exit cleanly. I'd like to know why the `$?` exit status is not echoed (and perhaps more specifically why a clean exit doesn't always happen particularly when catting `/proc/pid/cmdline`). The same also sometimes occurs when catting `/proc/pid/auxv` and `/proc/pid/environ`. Relevant function in source: http://lxr.linux.no/#linux+v2.6.31/fs/proc/base.c#L253 I don't want to necessarily know how to 'fix' this, that can probably be done by setting the aforementioned -e option. Note: you will probably not be able to reproduce this in something like Ubuntu or Debian - the phenomenon may be specific to busybox ash, cat, or embedded Linux. You can, however, simulate it by interrupting a child process `sleep` run inside a script. E.g. run a script `s.sh`:               #!/bin/sh     sleep 1000     echo $?      Then `$./s.sh`, ctrl-z, `bg`, `disown %1` to run the script in it's own process. Now in `ps` you will see something like:               15610 pts/35   00:00:00 s.sh     15611 pts/35   00:00:00 sleep      If you go ahead and run `kill -2 15611` (on the _child_ process), you observe               $ 130 # the exit status, which does get printed     command line waits for next command without clean exit


title: Get screenshots of a Linux machine that I connect to remotely with PuTTY

text: My setup is this, I connected my Cent box via PuTTY on windows 7, I've Xming and using X11forwarding to have GNOME in windows. Now when I did `gnome- screenshot` in putty, I cannot have the CentOS current Screenshot. Why is this happening? Is there any reason? Like PID is linked with screen. I get screenshot of Windows screen. I need to get CentOS screenshot, which is connected through PuTTY. ![The below image is a screenshot which is blank](http://i.stack.imgur.com/ZJ3Oo.png)


title: Disable the external keyboard from a script

text: I have a udev rule for my external keyboard. I can catch events, and by running a script I can also reach udev env variables. Can I disable keyboard with udev? Or must I use a script to disable the keyboard in another way. There is a one way to disable keyboard with script to running `xinput` but it wants an "id". How can I get the id information for `xinput` from udev? or is there another effective way? Whole trace when I monitor udev for keyboard:               KERNEL[2563.037091] add      /devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2 (usb)     ACTION=add     BUSNUM=002     DEVICE=/proc/bus/usb/002/003     DEVNAME=bus/usb/002/003     DEVNUM=003     DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2     DEVTYPE=usb_device     MAJOR=189     MINOR=130     PRODUCT=1c4f/2/110     SEQNUM=1538     SUBSYSTEM=usb     TYPE=0/0/0     UDEV_LOG=3          KERNEL[2563.037837] add      /devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.0 (usb)     ACTION=add     DEVICE=/proc/bus/usb/002/003     DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.0     DEVTYPE=usb_interface     INTERFACE=3/1/1     MODALIAS=usb:v1C4Fp0002d0110dc00dsc00dp00ic03isc01ip01     PRODUCT=1c4f/2/110     SEQNUM=1539     SUBSYSTEM=usb     TYPE=0/0/0     UDEV_LOG=3          KERNEL[2563.038023] add      /devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.0/0003:1C4F:0002.0005 (hid)     ACTION=add     DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.0/0003:1C4F:0002.0005     HID_ID=0003:00001C4F:00000002     HID_NAME=SIGMACH1P USB Keykoard     HID_PHYS=usb-0000:09:00.0-2/input0     MODALIAS=hid:b0003v00001C4Fp00000002     SEQNUM=1540     SUBSYSTEM=hid     UDEV_LOG=3          KERNEL[2563.040754] add      /devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.0/input/input17 (input)     ACTION=add     DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.0/input/input17     EV=120013     KEY=1000000000007 ff800000000007ff febeffdff3cfffff fffffffffffffffe     LED=7     MODALIAS=input:b0003v1C4Fp0002e0110-e0,1,4,11,14,k71,72,73,74,75,77,79,7A,7B,7C,7D,7E,7F,80,81,82,83,84,85,86,87,88,89,8A,B7,B8,B9,BA,BB,BC,BD,BE,BF,C0,C1,C2,F0,ram4,l0,1,2,sfw     MSC=10     NAME="SIGMACH1P USB Keykoard"     PHYS="usb-0000:09:00.0-2/input0"     PRODUCT=3/1c4f/2/110     PROP=0     SEQNUM=1541     SUBSYSTEM=input     UDEV_LOG=3     UNIQ=""          KERNEL[2563.040970] add      /devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.0/input/input17/event6 (input)     ACTION=add     DEVNAME=input/event6     DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.0/input/input17/event6     MAJOR=13     MINOR=70     SEQNUM=1542     SUBSYSTEM=input     UDEV_LOG=3          KERNEL[2563.041090] add      /devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.0/0003:1C4F:0002.0005/hidraw/hidraw2 (hidraw)     ACTION=add     DEVNAME=hidraw2     DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.0/0003:1C4F:0002.0005/hidraw/hidraw2     MAJOR=252     MINOR=2     SEQNUM=1543     SUBSYSTEM=hidraw     UDEV_LOG=3          KERNEL[2563.041168] add      /devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.1 (usb)     ACTION=add     DEVICE=/proc/bus/usb/002/003     DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.1     DEVTYPE=usb_interface     INTERFACE=3/0/0     MODALIAS=usb:v1C4Fp0002d0110dc00dsc00dp00ic03isc00ip00     PRODUCT=1c4f/2/110     SEQNUM=1544     SUBSYSTEM=usb     TYPE=0/0/0     UDEV_LOG=3          KERNEL[2563.041309] add      /devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.1/0003:1C4F:0002.0006 (hid)     ACTION=add     DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.1/0003:1C4F:0002.0006     HID_ID=0003:00001C4F:00000002     HID_NAME=SIGMACH1P USB Keykoard     HID_PHYS=usb-0000:09:00.0-2/input1     MODALIAS=hid:b0003v00001C4Fp00000002     SEQNUM=1545     SUBSYSTEM=hid     UDEV_LOG=3          KERNEL[2563.044144] add      /devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.1/input/input18 (input)     ABS=100000000     ACTION=add     DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.1/input/input18     EV=1f     KEY=4837fff072ff32d bf54444600000000 1 20c100b17c000 267bfad941dfed 9e168000004400 10000002     MODALIAS=input:b0003v1C4Fp0002e0110-e0,1,2,3,4,k71,72,73,74,77,80,82,83,85,86,87,88,89,8A,8B,8C,8E,8F,90,96,98,9B,9C,9E,9F,A1,A3,A4,A5,A6,A7,A8,A9,AB,AC,AD,AE,B1,B2,B5,CE,CF,D0,D1,D2,D4,D8,D9,DB,E4,EA,EB,F1,100,161,162,166,16A,16E,172,174,176,178,179,17A,17B,17C,17D,17F,180,182,183,185,188,189,18C,18D,18E,18F,190,191,192,193,195,198,199,19A,1A0,1A1,1A2,1A3,1A4,1A5,1A6,1A7,1A8,1A9,1AA,1AB,1AC,1AD,1AE,1B0,1B1,1B7,1BA,r6,a20,m4,lsfw     MSC=10     NAME="SIGMACH1P USB Keykoard"     PHYS="usb-0000:09:00.0-2/input1"     PRODUCT=3/1c4f/2/110     PROP=0     REL=40     SEQNUM=1546     SUBSYSTEM=input     UDEV_LOG=3     UNIQ=""          KERNEL[2563.044365] add      /devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.1/input/input18/event7 (input)     ACTION=add     DEVNAME=input/event7     DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.1/input/input18/event7     MAJOR=13     MINOR=71     SEQNUM=1547     SUBSYSTEM=input     UDEV_LOG=3          KERNEL[2563.044560] add      /devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.1/0003:1C4F:0002.0006/hidraw/hidraw3 (hidraw)     ACTION=add     DEVNAME=hidraw3     DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.1/0003:1C4F:0002.0006/hidraw/hidraw3     MAJOR=252     MINOR=3     SEQNUM=1548     SUBSYSTEM=hidraw     UDEV_LOG=3          UDEV  [2563.066401] add      /devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2 (usb)     ACTION=add     BUSNUM=002     DEVICE=/proc/bus/usb/002/003     DEVNAME=/dev/bus/usb/002/003     DEVNUM=003     DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2     DEVTYPE=usb_device     ID_BUS=usb     ID_MODEL=USB_Keykoard     ID_MODEL_ENC=USB\x20Keykoard     ID_MODEL_ID=0002     ID_REVISION=0110     ID_SERIAL=SIGMACH1P_USB_Keykoard     ID_USB_INTERFACES=:030101:030000:     ID_VENDOR=SIGMACH1P     ID_VENDOR_ENC=SIGMACH1P     ID_VENDOR_ID=1c4f     MAJOR=189     MINOR=130     PRODUCT=1c4f/2/110     SEQNUM=1538     SUBSYSTEM=usb     TYPE=0/0/0     UDEV_LOG=3     USEC_INITIALIZED=2563048257          UDEV  [2563.071837] add      /devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.1 (usb)     ACTION=add     DEVICE=/proc/bus/usb/002/003     DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.1     DEVTYPE=usb_interface     INTERFACE=3/0/0     MODALIAS=usb:v1C4Fp0002d0110dc00dsc00dp00ic03isc00ip00     PRODUCT=1c4f/2/110     SEQNUM=1544     SUBSYSTEM=usb     TYPE=0/0/0     UDEV_LOG=3     USEC_INITIALIZED=2563068334          UDEV  [2563.072377] add      /devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.0 (usb)     ACTION=add     DEVICE=/proc/bus/usb/002/003     DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.0     DEVTYPE=usb_interface     INTERFACE=3/1/1     MODALIAS=usb:v1C4Fp0002d0110dc00dsc00dp00ic03isc01ip01     PRODUCT=1c4f/2/110     SEQNUM=1539     SUBSYSTEM=usb     TYPE=0/0/0     UDEV_LOG=3     USEC_INITIALIZED=2563068933          UDEV  [2563.079363] add      /devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.0/0003:1C4F:0002.0005 (hid)     ACTION=add     DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.0/0003:1C4F:0002.0005     HID_ID=0003:00001C4F:00000002     HID_NAME=SIGMACH1P USB Keykoard     HID_PHYS=usb-0000:09:00.0-2/input0     MODALIAS=hid:b0003v00001C4Fp00000002     SEQNUM=1540     SUBSYSTEM=hid     UDEV_LOG=3     USEC_INITIALIZED=2563074770          UDEV  [2563.080760] add      /devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.0/0003:1C4F:0002.0005/hidraw/hidraw2 (hidraw)     ACTION=add     DEVNAME=/dev/hidraw2     DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.0/0003:1C4F:0002.0005/hidraw/hidraw2     MAJOR=252     MINOR=2     SEQNUM=1543     SUBSYSTEM=hidraw     UDEV_LOG=3     USEC_INITIALIZED=2563080427          UDEV  [2563.084307] add      /devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.1/0003:1C4F:0002.0006 (hid)     ACTION=add     DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.1/0003:1C4F:0002.0006     HID_ID=0003:00001C4F:00000002     HID_NAME=SIGMACH1P USB Keykoard     HID_PHYS=usb-0000:09:00.0-2/input1     MODALIAS=hid:b0003v00001C4Fp00000002     SEQNUM=1545     SUBSYSTEM=hid     UDEV_LOG=3     USEC_INITIALIZED=2563073436          UDEV  [2563.085738] add      /devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.1/0003:1C4F:0002.0006/hidraw/hidraw3 (hidraw)     ACTION=add     DEVNAME=/dev/hidraw3     DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.1/0003:1C4F:0002.0006/hidraw/hidraw3     MAJOR=252     MINOR=3     SEQNUM=1548     SUBSYSTEM=hidraw     UDEV_LOG=3     USEC_INITIALIZED=2563085486          UDEV  [2563.238882] add      /devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.1/input/input18 (input)     ABS=100000000     ACTION=add     DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.1/input/input18     EV=1f     ID_BUS=usb     ID_INPUT=1     ID_INPUT_KEY=1     ID_MODEL=USB_Keykoard     ID_MODEL_ENC=USB\x20Keykoard     ID_MODEL_ID=0002     ID_PATH=pci-0000:09:00.0-usb-0:2:1.1     ID_PATH_TAG=pci-0000_09_00_0-usb-0_2_1_1     ID_REVISION=0110     ID_SERIAL=SIGMACH1P_USB_Keykoard     ID_TYPE=hid     ID_USB_DRIVER=usbhid     ID_USB_INTERFACES=:030101:030000:     ID_USB_INTERFACE_NUM=01     ID_VENDOR=SIGMACH1P     ID_VENDOR_ENC=SIGMACH1P     ID_VENDOR_ID=1c4f     KEY=4837fff072ff32d bf54444600000000 1 20c100b17c000 267bfad941dfed 9e168000004400 10000002     MODALIAS=input:b0003v1C4Fp0002e0110-e0,1,2,3,4,k71,72,73,74,77,80,82,83,85,86,87,88,89,8A,8B,8C,8E,8F,90,96,98,9B,9C,9E,9F,A1,A3,A4,A5,A6,A7,A8,A9,AB,AC,AD,AE,B1,B2,B5,CE,CF,D0,D1,D2,D4,D8,D9,DB,E4,EA,EB,F1,100,161,162,166,16A,16E,172,174,176,178,179,17A,17B,17C,17D,17F,180,182,183,185,188,189,18C,18D,18E,18F,190,191,192,193,195,198,199,19A,1A0,1A1,1A2,1A3,1A4,1A5,1A6,1A7,1A8,1A9,1AA,1AB,1AC,1AD,1AE,1B0,1B1,1B7,1BA,r6,a20,m4,lsfw     MSC=10     NAME="SIGMACH1P USB Keykoard"     PHYS="usb-0000:09:00.0-2/input1"     PRODUCT=3/1c4f/2/110     PROP=0     REL=40     SEQNUM=1546     SUBSYSTEM=input     UDEV_LOG=3     UNIQ=""     USEC_INITIALIZED=2563044149          UDEV  [2563.391000] add      /devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.0/input/input17 (input)     ACTION=add     DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.0/input/input17     EV=120013     ID_BUS=usb     ID_INPUT=1     ID_INPUT_KEY=1     ID_INPUT_KEYBOARD=1     ID_MODEL=USB_Keykoard     ID_MODEL_ENC=USB\x20Keykoard     ID_MODEL_ID=0002     ID_PATH=pci-0000:09:00.0-usb-0:2:1.0     ID_PATH_TAG=pci-0000_09_00_0-usb-0_2_1_0     ID_REVISION=0110     ID_SERIAL=SIGMACH1P_USB_Keykoard     ID_TYPE=hid     ID_USB_DRIVER=usbhid     ID_USB_INTERFACES=:030101:030000:     ID_USB_INTERFACE_NUM=00     ID_VENDOR=SIGMACH1P     ID_VENDOR_ENC=SIGMACH1P     ID_VENDOR_ID=1c4f     KEY=1000000000007 ff800000000007ff febeffdff3cfffff fffffffffffffffe     LED=7     MODALIAS=input:b0003v1C4Fp0002e0110-e0,1,4,11,14,k71,72,73,74,75,77,79,7A,7B,7C,7D,7E,7F,80,81,82,83,84,85,86,87,88,89,8A,B7,B8,B9,BA,BB,BC,BD,BE,BF,C0,C1,C2,F0,ram4,l0,1,2,sfw     MSC=10     NAME="SIGMACH1P USB Keykoard"     PHYS="usb-0000:09:00.0-2/input0"     PRODUCT=3/1c4f/2/110     PROP=0     SEQNUM=1541     SUBSYSTEM=input     UDEV_LOG=3     UNIQ=""     USEC_INITIALIZED=2563040766          UDEV  [2563.410790] add      /devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.1/input/input18/event7 (input)     ACTION=add     BACKSPACE=guess     DEVLINKS=/dev/input/by-id/usb-SIGMACH1P_USB_Keykoard-event-if01 /dev/input/by-path/pci-0000:09:00.0-usb-0:2:1.1-event     DEVNAME=/dev/input/event7     DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.1/input/input18/event7     ID_BUS=usb     ID_INPUT=1     ID_INPUT_KEY=1     ID_MODEL=USB_Keykoard     ID_MODEL_ENC=USB\x20Keykoard     ID_MODEL_ID=0002     ID_PATH=pci-0000:09:00.0-usb-0:2:1.1     ID_PATH_TAG=pci-0000_09_00_0-usb-0_2_1_1     ID_REVISION=0110     ID_SERIAL=SIGMACH1P_USB_Keykoard     ID_TYPE=hid     ID_USB_DRIVER=usbhid     ID_USB_INTERFACES=:030101:030000:     ID_USB_INTERFACE_NUM=01     ID_VENDOR=SIGMACH1P     ID_VENDOR_ENC=SIGMACH1P     ID_VENDOR_ID=1c4f     MAJOR=13     MINOR=71     SEQNUM=1547     SUBSYSTEM=input     UDEV_LOG=3     USEC_INITIALIZED=2563239989     XKBLAYOUT=tr     XKBMODEL=pc105     XKBOPTIONS=lv3:ralt_switch          UDEV  [2563.576817] add      /devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.0/input/input17/event6 (input)     ACTION=add     BACKSPACE=guess     DEVLINKS=/dev/input/by-id/usb-SIGMACH1P_USB_Keykoard-event-kbd /dev/input/by-path/pci-0000:09:00.0-usb-0:2:1.0-event-kbd     DEVNAME=/dev/input/event6     DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.0/input/input17/event6     ID_BUS=usb     ID_INPUT=1     ID_INPUT_KEY=1     ID_INPUT_KEYBOARD=1     ID_MODEL=USB_Keykoard     ID_MODEL_ENC=USB\x20Keykoard     ID_MODEL_ID=0002     ID_PATH=pci-0000:09:00.0-usb-0:2:1.0     ID_PATH_TAG=pci-0000_09_00_0-usb-0_2_1_0     ID_REVISION=0110     ID_SERIAL=SIGMACH1P_USB_Keykoard     ID_TYPE=hid     ID_USB_DRIVER=usbhid     ID_USB_INTERFACES=:030101:030000:     ID_USB_INTERFACE_NUM=00     ID_VENDOR=SIGMACH1P     ID_VENDOR_ENC=SIGMACH1P     ID_VENDOR_ID=1c4f     MAJOR=13     MINOR=70     SEQNUM=1542     SUBSYSTEM=input     UDEV_LOG=3     USEC_INITIALIZED=2563392826     XKBLAYOUT=tr     XKBMODEL=pc105     XKBOPTIONS=lv3:ralt_switch      EDIT FOR SHW POST System info Distributor ID: Debian Description: Debian GNU/Linux 7.2 (wheezy) Release: 7.2 Codename: wheezy udev version 175 Unbind keyboard syslog result               Jan 16 13:47:50  acpid: input device has been disconnected, fd 13     Jan 16 13:47:51  kernel: [  694.216123] usb 1-1.3: USB disconnect, device number 17     Jan 16 13:47:51  acpid: input device has been disconnected, fd 15     Jan 16 13:47:51  kernel: [  694.507848] usb 1-1.3: new low-speed USB device number 18 using ehci_hcd     Jan 16 13:47:51  kernel: [  694.606225] usb 1-1.3: New USB device found, idVendor=1c4f, idProduct=0002     Jan 16 13:47:51  kernel: [  694.606235] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0     Jan 16 13:47:51  kernel: [  694.606242] usb 1-1.3: Product: USB Keykoard     Jan 16 13:47:51  kernel: [  694.606246] usb 1-1.3: Manufacturer: SIGMACH1P     Jan 16 13:47:51  kernel: [  694.609792] input: SIGMACH1P USB Keykoard as /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.3/1-1.3:1.0/input/input57     Jan 16 13:47:51  kernel: [  694.610190] generic-usb 0003:1C4F:0002.0027: input,hidraw2: USB HID v1.10 Keyboard [SIGMACH1P USB Keykoard] on usb-0000:00:1a.0-1.3/input0     Jan 16 13:47:51  kernel: [  694.613248] input: SIGMACH1P USB Keykoard as /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.3/1-1.3:1.1/input/input58     Jan 16 13:47:51  kernel: [  694.613646] generic-usb 0003:1C4F:0002.0028: input,hidraw3: USB HID v1.10 Device [SIGMACH1P USB Keykoard] on usb-0000:00:1a.0-1.3/input1     Jan 16 13:47:51  mtp-probe: checking bus 1, device 18: "/sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.3"     Jan 16 13:47:51  mtp-probe: bus: 1, device: 18 was not an MTP device


title: Installing and using VNC for command-line purposes on FreeBSD

text: I am running a VPS with FreeBSD 8.3-RELEASE-p3 This is my first time using FBSD as a server, and as a newbie I locked myself out of su by taking my user out of wheel group. I have disabled the ability to login with 'root' from SSH in order to increase the security level of my server. I know that someVPS providers provide remote console control service that allows you to see what's going on the screen while booting and everything, but mine doesn't allow that. Will installing VNC for command-line use only, keep me unworried of making mistakes like taking myself out of 'wheel' and not being able to 'su'?


title: How to resize logical volume to fit filesystem

text: How can I resize logical volume to fit filesystem automagically?


title: perl one liner + how to match IP address that located in the first/sec field of file

text: the following perl one liner syntax verify if IP address in "$IP" match the IP ADDRESS in file                    perl -ne 'BEGIN{$IP=shift} print if /(^|\s)\Q$IP\E(\s|$)/;' $IP file      file have two fields as the following example               more file               192.9.200.1  172.19.2.100     10.23.1.10   34.12.0.1     45.2.11.1    192.9.200.1     .     .     .      is it possible to define the perl syntax to match the IP that exists in the first field or the second field ? - if yes what I need to change in my syntax for that? for example ( in case we want to match only the first field )                    perl -ne 'BEGIN{$IP=shift} print if /(^|\s)\Q$IP\E(\s|$)/;' 192.9.200.1 file      then it should to match the IP - 192.9.200.1 that exists in the first field of the line:                  "192.9.200.1  172.19.2.100"


title: How to change hard disk spin-down time on my WD MyBook Live?

text: I have a 2TB Western Digital MyBook Live. It works quite well and provides a web-based administration interface. There is an option to either enable or disable power saving mode, which spins down the drive when not in use. However, there is no option to control the amount of time that must elapse before the disk spins down. This drive runs an embedded build of the Linux kernel and I was able to gain root access (via SSH) to the device. There is probably an easy way to adjust the spin down time but I haven't been able to figure out what it is. Where would I begin looking to find such an option? (Configuration files, `/proc`, etc.) I have absolutely no idea if this helps, but `/dev/md1` is mounted on `/`. I'm guessing that `/dev/md` (which does exist) is the physical disk itself?


title: Is "ps -ef" deprecrated?

text: I was doing some work on a linux and the system admin told me that `ps -ef` is deprecated though it still works. I can't seem to find any documentation towards the same. Has `ps -ef` really been deprecated?


title: Wireless not working on very old PC on Debian

text: I have this really old **PC Toshiba Pro L10** running on 512 MB on RAM. I installed Debian 32 bit lxde spin off. Everything is working well except the wireless (`no wireless extensions`). Wired network connection works. My environment is this:               $ cat /etc/debian_version     7.5     $ uname -r     3.2.0-4-686-pae     $ iwconfig     l0       no wireless extensions.     eth0     no wireless extensions.     $ apt-cache policy wireless-tools     wireless-tools:       Installed: 30~pre9-8       Candidate: 30~pre9-8       Version table:      *** 30~pre9-8 0             100 /var/lib/dpkg/status     $ lspci -v     00:00.0 Host bridge: Intel Corporation 82852/82855 GM/GME/PM/GMV Processor to I/O Controller (rev 02)         Subsystem: Toshiba America Info Systems Device ff31         Flags: bus master, fast devsel, latency 0         Memory at <unassigned> (32-bit, prefetchable)         Capabilities: [40] Vendor Specific Information: Len=05 <?>         Kernel driver in use: agpgart-intel          00:00.1 System peripheral: Intel Corporation 82852/82855 GM/GME/PM/GMV Processor to I/O Controller (rev 02)         Subsystem: Toshiba America Info Systems Device ff31         Flags: bus master, fast devsel, latency 0          00:00.3 System peripheral: Intel Corporation 82852/82855 GM/GME/PM/GMV Processor to I/O Controller (rev 02)         Subsystem: Toshiba America Info Systems Device ff31         Flags: bus master, fast devsel, latency 0          00:02.0 VGA compatible controller: Intel Corporation 82852/855GM Integrated Graphics Device (rev 02) (prog-if 00 [VGA controller])         Subsystem: Toshiba America Info Systems Device ff31         Flags: bus master, fast devsel, latency 0, IRQ 6         Memory at e8000000 (32-bit, prefetchable) [size=128M]         Memory at e0000000 (32-bit, non-prefetchable) [size=512K]         I/O ports at 1800 [size=8]         Expansion ROM at <unassigned> [disabled]         Capabilities: [d0] Power Management version 1         Kernel driver in use: i915          00:02.1 Display controller: Intel Corporation 82852/855GM Integrated Graphics Device (rev 02)         Subsystem: Toshiba America Info Systems Device ff31         Flags: bus master, fast devsel, latency 0         Memory at f0000000 (32-bit, prefetchable) [size=128M]         Memory at e0080000 (32-bit, non-prefetchable) [size=512K]         Capabilities: [d0] Power Management version 1          00:1d.0 USB controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #1 (rev 03) (prog-if 00 [UHCI])         Subsystem: Toshiba America Info Systems Device ff31         Flags: bus master, medium devsel, latency 0, IRQ 6         I/O ports at 1820 [size=32]         Kernel driver in use: uhci_hcd          00:1d.1 USB controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #2 (rev 03) (prog-if 00 [UHCI])         Subsystem: Toshiba America Info Systems Device ff31         Flags: bus master, medium devsel, latency 0, IRQ 6         I/O ports at 1840 [size=32]         Kernel driver in use: uhci_hcd          00:1d.7 USB controller: Intel Corporation 82801DB/DBM (ICH4/ICH4-M) USB2 EHCI Controller (rev 03) (prog-if 20 [EHCI])         Subsystem: Toshiba America Info Systems Device ff31         Flags: bus master, medium devsel, latency 0, IRQ 10         Memory at e0100000 (32-bit, non-prefetchable) [size=1K]         Capabilities: [50] Power Management version 2         Capabilities: [58] Debug port: BAR=1 offset=0080         Kernel driver in use: ehci_hcd          00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev 83) (prog-if 00 [Normal decode])         Flags: bus master, fast devsel, latency 0         Bus: primary=00, secondary=02, subordinate=06, sec-latency=64         I/O behind bridge: 00003000-00003fff         Memory behind bridge: e0200000-e04fffff         Prefetchable memory behind bridge: 24000000-27ffffff          00:1f.0 ISA bridge: Intel Corporation 82801DBM (ICH4-M) LPC Interface Bridge (rev 03)         Flags: bus master, medium devsel, latency 0          00:1f.1 IDE interface: Intel Corporation 82801DBM (ICH4-M) IDE Controller (rev 03) (prog-if 8a [Master SecP PriP])         Subsystem: Toshiba America Info Systems Device ff31         Flags: bus master, medium devsel, latency 0, IRQ 6         I/O ports at 01f0 [size=8]         I/O ports at 03f4 [size=1]         I/O ports at 0170 [size=8]         I/O ports at 0374 [size=1]         I/O ports at 1810 [size=16]         Memory at 20000000 (32-bit, non-prefetchable) [size=1K]         Kernel driver in use: ata_piix          00:1f.3 SMBus: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) SMBus Controller (rev 03)         Subsystem: Toshiba America Info Systems Device ff31         Flags: medium devsel, IRQ 11         I/O ports at 1860 [size=32]         Kernel driver in use: i801_smbus          00:1f.5 Multimedia audio controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Audio Controller (rev 03)         Subsystem: Toshiba America Info Systems Device ff31         Flags: bus master, medium devsel, latency 0, IRQ 11         I/O ports at 1c00 [size=256]         I/O ports at 1880 [size=64]         Memory at e0100c00 (32-bit, non-prefetchable) [size=512]         Memory at e0100800 (32-bit, non-prefetchable) [size=256]         Capabilities: [50] Power Management version 2         Kernel driver in use: snd_intel8x0          00:1f.6 Modem: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Modem Controller (rev 03) (prog-if 00 [Generic])         Subsystem: Toshiba America Info Systems Device ff31         Flags: bus master, medium devsel, latency 0, IRQ 11         I/O ports at 2400 [size=256]         I/O ports at 2000 [size=128]         Capabilities: [50] Power Management version 2         Kernel driver in use: snd_intel8x0m          02:01.0 CardBus bridge: Texas Instruments PCI1410 PC card Cardbus Controller (rev 02)         Subsystem: Toshiba America Info Systems Device ff31         Flags: bus master, medium devsel, latency 168, IRQ 10         Memory at e0400000 (32-bit, non-prefetchable) [size=4K]         Bus: primary=02, secondary=03, subordinate=06, sec-latency=176         Memory window 0: 24000000-27ffffff (prefetchable)         Memory window 1: 28000000-2bffffff         I/O window 0: 00003400-000034ff         I/O window 1: 00003000-000030ff         16-bit legacy interface ports at 0001         Kernel driver in use: yenta_cardbus          02:02.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)         Subsystem: Toshiba America Info Systems Device ff31         Flags: bus master, medium devsel, latency 64, IRQ 6         I/O ports at 3800 [size=256]         Memory at e0402000 (32-bit, non-prefetchable) [size=256]         Capabilities: [50] Power Management version 2         Kernel driver in use: 8139too          02:04.0 Network controller: Intel Corporation PRO/Wireless 2200BG [Calexico2] Network Connection (rev 05)         Subsystem: Intel Corporation Device 2741         Flags: medium devsel, IRQ 11         Memory at e0401000 (32-bit, non-prefetchable) [size=4K]         Capabilities: [dc] Power Management version 2


title: What customizations have you done on your shell profile to increase productivity?

text: I know some people have some startup scripts and some people personalise the prompt. One developer uses short aliases for the long path he often visits and the frequent commands he runs. What are all the effective customization you have done on your UNIX profile to increase productivity and ease of use?


title: Processing bash variable with sed

text: Been banging my head off a wall on this bash variable LATLNG contains a latitude & longitude value in brackets like so `(53.3096,-6.28396)` I want to parse these into a variable called LAT and LON which I'm trying to do via sed like so `LAT=$(sed "s/(\\(.*\\),\\(.*\\))/\1/g" "$LATLNG")`   `LON=$(sed "s/(\\(.*\\),\\(.*\\))/\2/g" "$LATLNG")` However, I get the following error: `sed: can't read (53.3096,-6.28396): No such file or directory` I'm obviously doing something silly here but it's very late and I cant see what it is. I've tried several other variations without luck too.


title: Partition manager that can handle LVM?

text: I have been looking but neither Gparted nor KDE Partition Manager can handle LVM. Working with the command line is probably fine but it would be clearer to have a GUI tool here. Does such thing exist?


title: Reset running process when certain ammount of memory is consumed

text: I'm running a Hydra on Rasppberry PI. There were some problems with the program, but aside from these, there is a hidden memory leak in the program. The source is pretty big and really can't find the problem. Unfortunatelly, upon reaching memory limit, the program doesn't crash - instead it returns bunch of error messages. When I say bunch, I mean hundreds. ![enter image description here](http://i.stack.imgur.com/aKhd3.png) So I thought the if I can't un-allocate the memory within the program, I might need to reset whole process. **So I need to:**   1. Guard the process resource usage   2. Stop the process **gracefully** (similar to `Ctrl`+`C`, the program says " _received signal 2_ " then)   3. Start the process again I must do this until fix the program to die on errors - or not to produce them in the first place. * * * If you know hydra and you're curious about the errors I've found at least something in the code:               [ERROR] Fork for children failed: Cannot allocate memory     [ERROR] socketpair creation failed: Too many open files      The second part of the errors comes from `perror` C system function. It's sort of last error.


title: BURG menu error

text: I installed Ubuntu 10.10 recently and installed BURG (bootloader based on GRUB). However, the boot menu seems to have swapped Vista and Windows Recovery mode; so to go to Vista I need to select the 'recovery mode'. How can I fix this?


title: I have an environment variable for LANG set in ~/.profile but it is not getting set

text: I want to set the locale. I have this in my ~/.profile               #language     export LANG=en_GB.utf8     export TESTING123=en_GB.utf8      But when I type:               echo $LANG $TESTING123      I get (LANG not set, but TESTING123 is set )               en_US.utf8 en_GB.utf8      If I do `export LANG=en_GB.utf8` directly in the shell it all works               #export LANG=en_GB.utf8     #echo $LANG     en_GB.utf8     #locale     LANG=en_GB.utf8     LANGUAGE=     LC_CTYPE="en_GB.utf8"     LC_NUMERIC="en_GB.utf8"     LC_TIME="en_GB.utf8"     LC_COLLATE="en_GB.utf8"     LC_MONETARY="en_GB.utf8"     LC_MESSAGES="en_GB.utf8"     LC_PAPER="en_GB.utf8"     LC_NAME="en_GB.utf8"     LC_ADDRESS="en_GB.utf8"     LC_TELEPHONE="en_GB.utf8"     LC_MEASUREMENT="en_GB.utf8"     LC_IDENTIFICATION="en_GB.utf8"     LC_ALL=      * * * system is Debian 7.2, shell is bash.


How do I associate applications with KDE Activities? It doesn't seem obvious how it works. Are there any tricks?


title: How to edit command line in full screen editor in ZSH?

text: In bash, using vi mode, if I hit `Esc`,`v`, my current command line is opened in the editor specified by `$EDITOR` and I am able to edit it in full screen before 'saving' the command to be returned to the shell and executed. How can I achieve similar behaviour in zsh? Hitting `v` in command mode results in a bell an has no apparent effect, despite the `EDITOR` environment variable being set.


title: How can I check for bad blocks on an LVM physical volume?

text: When you're using ext4, you can check for badblocks with the command `e2fsck -c /dev/sda1 # or whatever`. This will "blacklist" the blocks by adding them to the bad block inode. What is the equivalent of this for an LVM2 physical volume? The filesystem on it is ext4, but presumably, the bad blocks that are detected will become invalid as the underlying LVM setup moves data around on the physical disk. In other words, how can I check for bad blocks to not use in LVM?


title: Equivalent of full control, modify and write in linux

text: What is the equivalent of assigning _Full control_ , _Modify_ and _Write_ permission, in Windows, to a particular user and group, in Linux? `chgrp`, `chmod` and `chown` seems quite limited in this case.


title: gdb-multiarch command not found

text: I have installed QEMU in RHEL for running the assembly programs in ARM. I have successfully installed QEMU and ARM. However, for debugging we are thinking to use GDB. I want to install the **GDB-Multiarch** in RHEL. I have installed GDB and when I run the command **GDB** I am getting the GDB shell successfully. However, I need to use the **GDB-Multiarch** and I am not able to run this command. To successfully run an assembly program, I need to execute the below command.               qemu-system-arm -S -s -M versatilepb -daemonize -m 128M -d in_asm,cpu,exec -kernel hello_world.bin ; gdb-multiarch --batch --command=hello_world.gdb      In the above command, I am getting the error as gdb-multiarch command as not found. I am really new to this environment and I would appreciate the help.