Opensuse 11.4 very slow on 8 GB RAM i5 processor

**EDIT :** This is when top is run with "M" . ![Top with "M"](http://i.stack.imgur.com/hYU9y.png) Snapshot when Eclipse starts ( using "iotop") ![When eclipse starts](http://i.stack.imgur.com/pATJa.png) Snapshot when Eclipse building workspace ![When building workspace](http://i.stack.imgur.com/zBVcR.png) After Eclipse has done its thing ![Done with building workspace](http://i.stack.imgur.com/VLnRF.png) **Its as slow as before and brings everything to a halt :(** I have a OpenSuse 11.4 64 bit installed. Earlier the system was fast. Now Eclipse takes forever to open and then takes 5 minutes to build workspace ( No kidding! ) . Here is how top looks on the system when opening eclipse :               Tasks: 181 total,   1 running, 180 sleeping,   0 stopped,   0 zombie     Cpu(s):  5.3%us,  1.6%sy,  0.0%ni, 57.2%id, 35.8%wa,  0.0%hi,  0.2%si,  0.0%st     Mem:   8099348k total,  8046104k used,    53244k free,    46904k buffers     Swap:  2103292k total,        0k used,  2103292k free,  7055848k cached            PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                                1778 root      20   0  137m  19m  10m S    4  0.3   0:04.92 Xorg                                                                                1 root      20   0 12460  864  724 S    0  0.0   0:00.88 init                                                                                2 root      20   0     0    0    0 S    0  0.0   0:00.00 kthreadd                                                                                3 root      20   0     0    0    0 S    0  0.0   0:00.10 ksoftirqd/0                                                                                4 root      20   0     0    0    0 S    0  0.0   0:00.00 kworker/0:0                                                                                5 root      20   0     0    0    0 S    0  0.0   0:00.00 kworker/u:0                                                                                6 root      RT   0     0    0    0 S    0  0.0   0:00.00 migration/0                                                                                7 root      RT   0     0    0    0 S    0  0.0   0:00.00 watchdog/0                                                                                8 root      RT   0     0    0    0 S    0  0.0   0:00.00 migration/1                                                                                9 root      20   0     0    0    0 S    0  0.0   0:00.44 kworker/1:0                                                                                10 root      20   0     0    0    0 S    0  0.0   0:00.00 ksoftirqd/1                                                                                11 root      20   0     0    0    0 S    0  0.0   0:00.58 kworker/0:1                                                                                12 root      RT   0     0    0    0 S    0  0.0   0:00.00 watchdog/1                                                                                13 root      RT   0     0    0    0 S    0  0.0   0:00.00 migration/2                                                                                14 root      20   0     0    0    0 S    0  0.0   0:00.00 kworker/2:0                                                                                15 root      20   0     0    0    0 S    0  0.0   0:00.01 ksoftirqd/2                                                                                16 root      RT   0     0    0    0 S    0  0.0   0:00.00 watchdog/2                                                                                17 root      RT   0     0    0    0 S    0  0.0   0:00.00 migration/3                                                                                18 root      20   0     0    0    0 S    0  0.0   0:00.00 kworker/3:0                                                                                19 root      20   0     0    0    0 S    0  0.0   0:00.01 ksoftirqd/3                                                                                20 root      RT   0     0    0    0 S    0  0.0   0:00.00 watchdog/3                                                                                21 root       0 -20     0    0    0 S    0  0.0   0:00.00 cpuset                                                                                22 root       0 -20     0    0    0 S    0  0.0   0:00.00 khelper                                                                                23 root       0 -20     0    0    0 S    0  0.0   0:00.00 netns                                                                                24 root      20   0     0    0    0 S    0  0.0   0:00.00 sync_supers                                                                                25 root      20   0     0    0    0 S    0  0.0   0:00.00 bdi-default                                                                                26 root       0 -20     0    0    0 S    0  0.0   0:00.00 kintegrityd                                                                                27 root       0 -20     0    0    0 S    0  0.0   0:00.00 kblockd                                                                                28 root       0 -20     0    0    0 S    0  0.0   0:00.00 kacpid                                                                                29 root       0 -20     0    0    0 S    0  0.0   0:00.00 kacpi_notify                                                                                30 root       0 -20     0    0    0 S    0  0.0   0:00.00 kacpi_hotplug                                                                                31 root       0 -20     0    0    0 S    0  0.0   0:00.00 ata_sff                                                                                32 root      20   0     0    0    0 S    0  0.0   0:00.00 khubd                                                                                33 root      20   0     0    0    0 S    0  0.0   0:00.00 kseriod                                                                                34 root       0 -20     0    0    0 S    0  0.0   0:00.00 md                                                                                35 root       0 -20     0    0    0 S    0  0.0   0:00.00 kondemand                                                                                36 root      20   0     0    0    0 S    0  0.0   0:00.00 khungtaskd                                                                                37 root      20   0     0    0    0 S    0  0.0   0:01.15 kswapd0                                                                                38 root      25   5     0    0    0 S    0  0.0   0:00.00 ksmd                                                                                39 root      20   0     0    0    0 S    0  0.0   0:00.00 fsnotify_mark                                                                                40 root       0 -20     0    0    0 S    0  0.0   0:00.00 aio                                                                                41 root       0 -20     0    0    0 S    0  0.0   0:00.00 crypto                                                                                45 root       0 -20     0    0    0 S    0  0.0   0:00.00 kthrotld        I have only Eclipse running at this point of time and while Eclipse takes its own sweet time :( , even the browser does not open. Why is the system crawling ? Any help would be great Thanks.


wicd - no connection after boot, have to restart manually?

I'm using version 1.7.1_pre20120127 with python 2.7.2:               [U] net-misc/wicd          Available versions:  1.7.0 (~)1.7.0-r1 1.7.1_beta2-r4 (~)1.7.1_pre20111210-r1 1.7.1_pre20120127 (~)1.7.1_pre20120127-r1 (~)1.7.1 (~)1.7.1-r1 {X ambiance +gtk ioctl libnotify mac4lin ncurses nls +pm-utils}          Installed versions:  1.7.1_pre20120127(01:42:42 PM 02/29/2012)(X gtk libnotify ncurses nls pm-utils -ioctl -mac4lin)          Homepage:            http://wicd.sourceforge.net/          Description:         A lightweight wired and wireless network manager for Linux      If I add wicd to the `defaults` runlevel, it always ask for root password after boot. But if I add it to the `boot` runlevel, there is no connection (both wired and wireless):               2012/02/29 21:13:36 :: Using wired interface...eth0     2012/02/29 21:13:41 :: Autoconnecting...     2012/02/29 21:13:41 :: Attempting to autoconnect with wired interface...     2012/02/29 21:13:41 :: Putting interface down     2012/02/29 21:13:41 :: Releasing DHCP leases...     2012/02/29 21:13:41 :: Setting false IP...     2012/02/29 21:13:41 :: Flushing the routing table...     2012/02/29 21:13:41 :: Putting interface up...     2012/02/29 21:13:44 :: Running DHCP with hostname gentoo     2012/02/29 21:13:44 :: dhcpcd[2699]: version 5.2.12 starting     2012/02/29 21:13:44 ::     2012/02/29 21:13:44 :: /lib/dhcpcd/dhcpcd-hooks/20-resolv.conf: line 64: /etc/resolv.conf: Permission denied     2012/02/29 21:13:44 ::     2012/02/29 21:13:44 :: chmod: changing permissions of `/etc/resolv.conf': Operation not permitted     2012/02/29 21:13:44 ::     2012/02/29 21:13:44 :: dhcpcd[2699]: eth0: broadcasting for a lease     2012/02/29 21:13:44 ::     2012/02/29 21:13:44 :: dhcpcd[2699]: eth0: offered 192.168.15.36 from 192.168.15.1     2012/02/29 21:13:44 ::     2012/02/29 21:13:44 :: dhcpcd[2699]: eth0: acknowledged 192.168.15.36 from 192.168.15.1     2012/02/29 21:13:44 ::     2012/02/29 21:13:44 :: dhcpcd[2699]: eth0: checking for 192.168.15.36     2012/02/29 21:13:44 ::     2012/02/29 14:13:48 :: dhcpcd[2699]: eth0: leased 192.168.15.36 for 600 seconds     2012/02/29 14:13:48 ::     2012/02/29 14:13:48 :: /lib/dhcpcd/dhcpcd-hooks/20-resolv.conf: line 64: /etc/resolv.conf: Permission denied     2012/02/29 14:13:48 ::     2012/02/29 14:13:48 :: chmod: changing permissions of `/etc/resolv.conf': Operation not permitted     2012/02/29 14:13:48 ::     2012/02/29 14:13:48 :: dhcpcd[2699]: forked to background, child pid 2769     2012/02/29 14:13:48 ::     2012/02/29 14:13:48 ::     2012/02/29 14:13:48 :: DHCP connection successful     2012/02/29 14:13:48 :: Connecting thread exiting.     2012/02/29 14:13:49 :: No wired connection present, attempting to autoconnect to wireless network       You see the "Permission denied" error because I marked `/etc/resolv.conf` as immutable. Pay attention to the last line. and here's the logs when manually restarting wicd:               2012/02/29 14:15:37 :: Using wired interface...eth0     2012/02/29 14:15:43 :: Autoconnecting...     2012/02/29 14:15:43 :: Putting interface downAttempting to autoconnect with wired interface...     2012/02/29 14:15:43 ::     2012/02/29 14:15:43 :: Releasing DHCP leases...     2012/02/29 14:15:43 :: Setting false IP...     2012/02/29 14:15:43 :: Flushing the routing table...     2012/02/29 14:15:43 :: Putting interface up...     2012/02/29 14:15:45 :: Running DHCP with hostname gentoo     2012/02/29 14:15:45 :: dhcpcd[3471]: version 5.2.12 starting     2012/02/29 14:15:45 ::     2012/02/29 14:15:45 :: /lib/dhcpcd/dhcpcd-hooks/20-resolv.conf: line 64: /etc/resolv.conf: Permission denied     2012/02/29 14:15:45 ::     2012/02/29 14:15:45 :: chmod: changing permissions of `/etc/resolv.conf': Operation not permitted     2012/02/29 14:15:45 ::     2012/02/29 14:15:45 :: dhcpcd[3471]: eth0: broadcasting for a lease     2012/02/29 14:15:45 ::     2012/02/29 14:15:50 :: dhcpcd[3471]: eth0: offered 192.168.15.36 from 192.168.15.1     2012/02/29 14:15:50 ::     2012/02/29 14:15:50 :: dhcpcd[3471]: eth0: acknowledged 192.168.15.36 from 192.168.15.1     2012/02/29 14:15:50 ::     2012/02/29 14:15:50 :: dhcpcd[3471]: eth0: checking for 192.168.15.36     2012/02/29 14:15:50 ::     2012/02/29 14:15:56 :: dhcpcd[3471]: eth0: leased 192.168.15.36 for 600 seconds     2012/02/29 14:15:56 ::     2012/02/29 14:15:56 :: /lib/dhcpcd/dhcpcd-hooks/20-resolv.conf: line 64: /etc/resolv.conf: Permission denied     2012/02/29 14:15:56 ::     2012/02/29 14:15:56 :: chmod: changing permissions of `/etc/resolv.conf': Operation not permitted     2012/02/29 14:15:56 ::     2012/02/29 14:15:56 :: dhcpcd[3471]: forked to background, child pid 3502     2012/02/29 14:15:56 ::     2012/02/29 14:15:56 ::     2012/02/29 14:15:56 :: DHCP connection successful     2012/02/29 14:15:56 :: Connecting thread exiting.     2012/02/29 14:16:00 :: Sending connection attempt result success      This problem is similar to: https://bbs.archlinux.org/viewtopic.php?id=121589, but the hardware clock is right and I can't found any script related to `ntpdate` in `/etc/wicd/scripts/postconnect/`. Any ideas? * * * **UPDATE: Fri Mar 2 16:36:12 ICT 2012** `dhcpcd` and `wpa_supplicant` are already removed from the `default` runlevel:               gentoo ~ # rc-update -v show | grep dhcpcd                    dhcpcd |                                      gentoo ~ # rc-update -v show | grep wpa            wpa_supplicant |                    `net.eth0` is deleted:               gentoo ~ # rc-update -v show | grep eth0                  net.eth0 |                  * * * **Reply to Kyle Jones:** > To check if your configuration disagrees with the setting of your hardware > clock, run >   >   >     date; /sbin/hwclock --show >                 # date; hwclock --show     Sun Mar  4 11:41:53 ICT 2012     Sun 04 Mar 2012 11:41:54 AM ICT  -0.697282 seconds          # grep -v ^# /etc/conf.d/hwclock | sed '/^[ \t]*$/d'     clock="UTC"     clock_systohc="NO"     clock_hctosys="NO"     clock_args=""      * * * **UPDATE Tue Mar 6 09:49:14 ICT 2012** Today, the logs say "successful" but `wicd` cannot connect to any network:               Putting interface up...     Running DHCP with hostname gentoo     dhcpcd[5063]: version 5.2.12 starting          dhcpcd[5063]: eth0: broadcasting for a lease          dhcpcd[5063]: eth0: offered 192.168.15.36 from 192.168.15.1          dhcpcd[5063]: eth0: acknowledged 192.168.15.36 from 192.168.15.1          dhcpcd[5063]: eth0: checking for 192.168.15.36          dhcpcd[5063]: eth0: leased 192.168.15.36 for 600 seconds          dhcpcd[5063]: forked to background, child pid 5094               DHCP connection successful     Connecting thread exiting.     Sending connection attempt result success      `wicd-gtk` shows "Not connected" and `eth0` has no IP:               eth0      Link encap:Ethernet  HWaddr 00:13:a9:4f:84:44                 UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:1860 errors:0 dropped:2 overruns:0 frame:0               TX packets:301 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:205470 (200.6 KiB)  TX bytes:34017 (33.2 KiB)               Interrupt:16


Is there a way to GLOBALLY set the DEFAULT keyserver for gpg on Debian?

I am not asking for per-request of a key, I know how to do that, but I want a chosen alternative gpg keyserver to be defaulted to, when no specific keyserver is specified in a request then-on-out. Any ideas?


Show established samba mounts

`showmount` only list me NFS mounts. I also want such a list for samba shares. How can this be done?


How can I run byobu from xterm at starting?

I set up byobu auto run with the command `byobu-enable`. It's great when I log in from terminal or ssh, but how can I make xterm attach to it automatically ? (mate-terminal from Linux mint especially)


Debian squeeze (stable) broken packages after installing something from wheezy (testing)

root@server:/home/ante# apt-get install build-essential     Reading package lists... Done     Building dependency tree            Reading state information... Done     Some packages could not be installed. This may mean that you have     requested an impossible situation or if you are using the unstable     distribution that some required packages have not yet been created     or been moved out of Incoming.     The following information may help to resolve the situation:          The following packages have unmet dependencies:      build-essential : Depends: libc6-dev but it is not going to be installed or                                 libc-dev                        Depends: g++ (>= 4:4.4.3) but it is not going to be installed     E: Broken packages      I tried installing libv8-dev from wheezy, running squeeze. The install went smooth, no extra dependencies required really. I created an `/etc/apt/apt.conf` file specifying that stable was my default source. I then ran an `apt-get update` followed by an `apt-get upgrade`. Then I decided to install lua and saw lua5.2 using `apt-cache search`. I installed, removed wheezy links from sources.list and uninstalled lua. The order might be incorrect because it seems my libc6 was updated and loads of packages uninstalled. Now I'm left with this message. Is there a way of avoiding reinstalling everything? I seem to have gotten libc6 2.13-26 instead of 2.11.3-3.


How can I influence which Virtual Display (X Server) is shown after boot?

I'm trying to build an info display (or Digital Signage Monitor) with Raspberry Pi running Raspbian (so a Debian distro). I need to start two X servers, where one is showing the content (through Iceweasel) and the other is an optional WLAN configuration GUI. The latter should only be shown after pressing the corresponding `Shift`+`Alt`+`Fn` combination. Otherwise Iceweasel should ALWAYS be displayed. I have two simple scripts starting Iceweasel and the WLAN config. On boot, I log user Pi into terminals tty1 and tty2 (in `/etc/inittab`). After login (in `/home/pi/.bash_profile`) I start two X servers, depending on the terminal I am on. Here's the code in `.bash_profile`:               if [ $(tty) == /dev/tty1 ]; then     startx /home/pi/scripts/autostart -- :0     fi          if [ $(tty) == /dev/tty2 ]; then     startx /home/pi/scripts/wlanconfig -- :1     fi      I want to have two virtual desktops without a window manager showing only Iceweasel or WLAN config. This works so far, the only problem is that sometimes Iceweasel starts is displayed and sometimes the config GUI. The `:0` or `:1` argument obviously doesn't influence the start priority. I need Iceweasel to always be displayed. I am an experienced Windows user, but have my problems understanding some of the Linux concepts.


Checksum on Network drive is really slow

I want to check if a bunch of files have copied without problem to a network drive. I am not able to ssh to the network drive, but I am able to mount it using FTP. The number of files is about 220, and the size of the files is about 300 mbytes. The network connection is relatively fast at a maximum of 10 mbyte per second. When I mount the network drive and do something like: find . -iname '*.filetype' | xargs -I {} cksum {} >> ${tmp}/filename.txt It takes about 15 minutes per file to calculate the checksum. Can I speed up this process?


Cron task starts at 5:30 and runs every 5 mins once

I want to run a crontab cron job which start at 5:30 AM and runs every 5 mins. How do i set it up in Linux? I am able to give like below. But how do i make it 5:30 ?               */05 5-16 * * *


What is the difference between env and printenv?

What is the difference between these two commands (env, printenv), which both shows the environment variables? They output same contents by default except '_'. And any historical reasons for two commands instead of one?


preventing the screen from being cleared when exiting an ssh session

I have rdist set up to push out some of my dot files to all the remote machines that I need to ssh into. I also have zsh as my default shell on all of those machines. When I ssh into a machine and then exit, the screen is cleared. I find this behavior bothersome. My attempt to prevent this behavior was to comment out the `/usr/bin/clear` line in my `.logout` file. I then dist'd this updated file out to all the remote machines. The trouble is, that didn't work. I am unsure about this, but I thought `.logout` was for csh, but I don't have a `.zlogout` (or `.bash_logout` either, for that matter). There's nothing in any of my other dot files (e.g., `.zshrc`, `.zshenv`) that seems like it would cause the screen to clear. When I ssh into a remote machine, then `exec zsh` (in order to get a "fresh" shell session), then the terminal will not clear upon exiting the ssh session. But otherwise, the problem persists - on any machine that I connect to, the screen clears upon exiting. For what it's worth, I don't appear to have the same problem when I set my default shell on the remote machines to bash. So I assume the problem is with zsh. I checked the dot files to make sure they got dist'd correctly (they did). Aside from this, I'm running out of ideas... why does my terminal keep getting cleared when exiting ssh? edit: I found the source of the problem: There is a `/etc/zlogout` file on many of the remote machines. I don't have sudo privileges on many of these machines and I don't want to globally affect users; is there a way to override the functionality in `/etc/zlogout`? Simply making a `$HOME/.zlogout` file doesn't seem to work.


How to trace system calls being invoked after typing command?

This question is relevant to the question of 'what happens when we type a simple command on shell?' I posted earlier. (I thought it would be better to post it seperately. But if not, please let me know.) I learned from the previous question that the shell built-in commands are treated specially and normal external commands are executed on child process. This time, I would like to trace system calls such as fork, clone, or execve to monitor what really happend after typing command. But I can only trace an execve call `execve("bin/ls",,,) = 0` when I execute `strace` like this way.               strace -etrace=execve,clone ls      That means, as I guess, I can only monitor system calls which are called after a child process is created. To monitor all system calls related to creating new process, What I have to do? To invoke command with `bash -c` like `strace -etrace=execve,clone bash -c '{ ls; }'` would be helpful in this case?


Reporting cpu hogs

Once in a while some program (ok, usually it's firefox) will start eating up nearly 100% of a processor's cpu time, heating up the processor and driving down by laptop's battery life. Since it's not bad enough to impact performance, I usually don't notice for a while, so I'd like to change this: Is there a utility that **monitors process cpu usage and popus up an alert** if some process is using a lot of cpu time for an extended period of time (e.g., more than 30 seconds)? I can probably rig something up with ps or top, sed and a bunch of pipes, but I'm hoping there's a more direct way to do it. **Edit:** On second thought, what I'm really after is power usage. So any instrumentation specifically targeted at estimating power consumption is of particular interest. I'm on OS X 10.8, but welcome Linux-specific solutions as well.


How to record every transaction using Bash

I have a file with debit credit and withdrawal transactions. I need a bash script that records the balance after every transaction. So file is like this:               D:11/02/12:1000.50     C:11/03/12:300     W:11/05/12:95.50     D:11/10/12:125     C:11/20/12:265.50      where D = debit, C = credit, and W = withdrawal The output needs to be like this:               11/02/12 1000.50     11/03/12 700.50     11/05/12 605.00      and so on. I have done it in `awk` and but cannot figure that out how to write in `bash`. Any advice or sample would be greatly appreciated.


How to set up file permissions/ownership for FTP/Apache/PHP on CentOS

I have basic understanding of `chmod` and CentOS file permissions. 777 stands for 111111111 and `rwx` for each root, group, user, etc. What I can't get my head around is setting up Apache, FTP and PHP to all work together correctly. I have a proFTPd server and Apache server. How should I setup the permissions on the proFTPd server so that Apache server can read and execute the PHP files? On my initial setup, the files uploaded by FTP cannot be read by Apache. Should I put the FTP user and the apache server into a group? How does the permission system work (FTP-Apache-PHP) on standard hosting systems?


Route OpenVPN clients to another different OpenVPN server

I have this scenario..   1. Server(Primary) with a multiple OpenVPN connections (so server is connected as a client to multiple OpenVPN servers.. lets say secondary servers)   2. This server runs OpenVPN server as well Now what I need is Client will connect to that OpenVPN(Primary)server with username/pass.. depending on that username the server will route all traffic for that client to specified (secondary)OpenVPN server Is there a way howto do this using `iptables`? Thank You


How to search for packages that are no longer available for installation?

I can't re-install packages that fulfill at least one of the following criteria:   * Custom-made packages   * Packages created by **alien** package (e.g. `alien --install pkg.rpm`)   * Packages installed from some repository that is no longer available   * Packages installed from some repository, but is no longer available there   * Packages whose repositories have been removed from " **/etc/apt/sources.list** " How do I list any of these packages?


What is the meaning of Scratchbox2?

Somewhere i heard the term 'Scratchbox2'. Why this is used? what is the exact meaning of this? What is the advantages over Scratchbox 1?


USB hard drive won't remount after power outage

My home server has a USB hard drive plugged to it. Once in a while, the breakers jump or there are power outages. Since my server is a laptop, it keeps chugging along, but the rest of the hardware (network, periphericals) do a power cycle. My hard drive is set to auto-mount in fstab, but after a power outage, the drive remains listed, but isn't accessible. I get IO errors when trying to access it, and why I try to unmount it, I get "umount: mount disagrees with the fstab". **Calling`mount -a` or rebooting fixes the problem.** This did not happen with Linux Mint, but it does with this minimal Lubuntu install. How can I solve it?               UUID=bb14889e-70de-45f4-882a-5ef45708d283 /media/external1      ext4    defaults,errors=remount-ro,nobootwait 0       1


How to copy files nested in directories that match a pattern?

I'm looking to copy files from subdirectories that match this pattern               vendor/plugin/*/tasks/*.rake      into a folder               lib/tasks      I think that this could be done several ways, but wanted to see if a guru could come up with something slick! Thanks in advance :-)


Show output on another "screen" and return to normal when done

I want a similar behavior as `less` `vim` `nano` etc. uses. Is this possible to achieve with bash?


Using vim to view the contents of a directory file

As I understand, in Linux directories are mostly normal files w/ some special handling (e.g. 'rm' a file is ok; 'rm' a dir will complain w/o -r). When I execute the following bash commands:               mkdir foo; touch foo/f1.txt; touch foo/f2.txt; vim foo      Vim shows the contents of the foo directory-file as:               " ============================================================================     " Netrw Directory Listing                                        (netrw v136)     "   /home/capdigi/foo     "   Sorted by      name     "   Sort sequence: [\/]$,\<core\%(\.\d\+\)\=\>,\.h$,\.c$,\.cpp$,*,\.o$,\.obj$,\.info$,\.swp$,\.bak$,\~$     "   Quick Help: <F1>:help  -:go up dir  D:delete  R:rename  s:sort-by  x:exec     " ============================================================================     ../     f1.txt     f2.txt      My questions are: **1) Why is netrw used in the context of this example?** According to http://www.vim.org/scripts/script.php?script_id=1075, netrw "supports reading and writing files across networks". Is this just the component that vim uses for uniform local/network directory access? **2) Why is netrw needed at all?** Since directories are "mostly" normal files, can't they just be opened as a normal file without any intermediary layer? Aka why all the fanciness?


Why doesnt ctrl+d work with this?

I wanted a simple way to process text in my clipboard without having to create a file. I tried using the following line:               awk '{print $1}' <(cat)      but I couldn't send cat the EOF character using ctrl+d like I normally do. I have a feeling it has something to do with a conflict of the file descriptor its creating to hold the data from cat, but I'm not entirely sure. In the interim I'm using here documents, but its ugly.               awk '{print $1}' <<KITTENMITTENStextblahKITTENMITTENS      The problem is it needs to be rather portable (across CLI commands). Any idea on a more elegant solution? Know why the cat line doesnt work?


chroot fails with --userspec when chroot is i686

I'm experiencing a problem with `chroot`... I'm running on Arch Linux x86_64. I have a 64 bit chroot and a 32 bit chroot. They are identical except that one is 32 bit and one is 64 bit. I can enter either of them using `chroot /path/to/chroot`. No problems. If I want to do that as a specific user the command is:               chroot --userspec=user:group /path/to/chroot      This also works fine for the 64 bit chroot. However it fails for the 32 bit chroot. It fails with status 125 and the message `chroot: invalid user` Also, doing `chroot --userspec=uid:gid /path/to/chroot` works fine in both 32 and 64 bit chroots (`uid` and `gid` are the numeric ids of the required user and group). I don't know if I am doing something wrong. is there anyone who has a 32 bit chroot and can see if the above can be reproduced ? All commands are issued as root. The user and group used for the userspec argument need to be defined inside the chroot. Or if I am missing something please I would appreciate knowing where I am going wrong. Update: I am using a work around for this problem. Assuming `$user` has the `user:group` I want (e.g. `john:users`), I do this:               u=$(echo $user | awk -F ":" '{print $1}')     g=$(echo $user | awk -F ":" '{print $2}')     uid=$(grep $u /opt/chroot32/etc/passwd | awk -F ":" '{print $3}')     gid=$(grep $g /opt/chroot32/etc/group  | awk -F ":" '{print $3}')     echo "Using $uid:$gid in place of $user"     chroot --userspec="$uid:$gid" /opt/chroot32      This works - it looks up the desired `user:group` inside the chroot's passwd and group files and then uses those for the chroot. And the above workaround is not necessary when accessing a 64 bit chroot. Thanks.


Do I need to format a CF before installing Linux?

I recently purchased an 8GB Patriot CF card, like this one . I also have a Syba CF/Sata adapter. I put these together into my mini-itx computer (connected via Sata cables, not USB) and booted an IPCop install. After going through all the options it gets to the point of creating the partitions and it returns an error saying it cannot partition the drive and then restarts. I thought maybe I would have to format the CF card before I can install Linux, however when I use the Syba Sata converter with the USB cable option on my main PC (which runs Win7) I cannot format the drive. It detects it as a Mass Storage Device, but gives me no options to do anything (it does not even appear to let me transfer files). Do I need to format the CF card before I can install IPCop v2.0.3 on it? Or is there potentially an issue with the CF card I purchased?


Using gdm to manage xdmcp authentication over VNC

I've followed a few guides in order to enable XDMCP over VNC, however the end result is an ugly, if functional, default X login screen. It is not utilizing gdm for the authentication process, and I think it would look significantly more professional if it were. This guide helped me the most: http://blog.sarah- happy.ca/2010/10/ubuntu-1010-vnc-login-screen.html but I also used this guide as a reference: http://www.ibm.com/developerworks/opensource/library/os- multiuserloginsvnc/index.html?ca=drs-&utm_source=dlvr.it&utm_medium=twitter I am using Fedora 17 Beta, and my goal is to be able to allow multiple users of a single host computer through VNC, with each user receiving a unique desktop that is independent of the other users. Therefore, when a new VNC session is started, it connects to XDM to allow them to login. Everything is working flawlessly except for the login screen looking like it's from the year 1980.


Linux freezing randomly

My Computer has been freezing **a lot** lately, and with no apparent reason.   It freezes even if my usage is 3% CPU and 9% RAM. I was using Windows 8 until I decided I'd try to move on to linux, so I installed a so-called beginner friendly distro, which was Ubuntu 14.04 .. I've struggled with it for 2 months thinking that I'm just not used to linux and that I would find it naturally difficult the first few weeks, but I faced lots of problems that I didn't face the first time I _really_ used linux (8 months ago). It was **really** slow, and after some researching, I adopted the idea that Ubuntu 14.04 wasn't really **that** stable, so I decided I'd download a less resource-heavy distro, so I installed Arch Linux (which is what I'm using to type this now) with GNOME. I'm not having any of the problems I used to have in Ubuntu, except for this mostly annoying freeze that happens to be absolutely random .. My Fan is working correctly, so it's not temperature, and my drivers are up- to-date (they're the same ones I used on Windows, which I had no problem at all with). Note that: The Whole OS just freezes, and when I was once able to Alt+F2 (to get to the run-a-command dialog) and managed to type in a command (I was struggling with the keyboard to type) and hit Enter, I got the message: No enough memory .. ? Which is pretty unexpected because I'm using a minimal system (arch linux) with only one application running .. ### Edit: Here's my /etc/fstab file               #      # /etc/fstab: static file system information     #     # <file system> <dir>   <type>  <options>   <dump>  <pass>     # /dev/sda3     UUID=2268132b-7cfa-4c55-b773-467c4f691e83   /           ext4        rw,relatime,data=ordered    0 1          /dev/disk/by-uuid/2236F90308C55145 /mnt/2236F90308C55145 auto nosuid,nodev,nofail,x-gvfs-show,user 0 0     /dev/disk/by-uuid/4FF142A03DACFA48 /mnt/4FF142A03DACFA48 auto nosuid,nodev,nofail,x-gvfs-show,user 0 0      ### lsblk outputs ..               NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT     fd0      2:0    1     4K  0 disk      sda      8:0    0 298.1G  0 disk      ├─sda1   8:1    0  69.9G  0 part /mnt/2236F90308C55145     ├─sda2   8:2    0  59.2G  0 part /mnt/4FF142A03DACFA48     ├─sda3   8:3    0  90.3G  0 part /     └─sda4   8:4    0  78.7G  0 part      sr0     11:0    1  1024M  0 rom


Unable to use ztemf 190A from Aircel in Linux Mint 13

I have installed Linux Lint 13 Mate 32 bit edition. I am not able to use my zte mf 190a 3g datacard given by Aircel as there is no driver for this. I do not know anything about Linux. Modem is shown as a cd drive: feb 05 2012 (having Windows installer only) and zte mmc storage (not opening). I am keen to use Linux Mint, but I need a help to get my modem working.


Adding null bytes to a file using dd

I have an img file which I had cloned from a disk of my RISC PC using `dd`:               dd if=/dev/hdb of=RISCPC.IMG      The size around 2GB. I want to add 512 null bytes to the start and end of the file. What's the best way to do this using `dd`?


LIRC does not start after reboot

If I compile LIRC with `this patched lirc` followed by install using `make install` it works fine and launches without any error. However, after a reboot the same command fails with following error :               root@NAS:~# lircd --device=/dev/ttyACM0 --driver=usb_irtoy     lircd: can't open or create /var/run/lirc/lircd.pid     lircd: No such file or directory     root@NAS:~#      Any ideas what could be the reason for this ?


Difference between 'cd' and 'cd ~'

I am wondering, if **cd** alone sends me to my home folder and **cd ~** does the same, why was the ~ added in the first place then? Is it something specific to BASH or would they behave differently in another Shell?


Is there any tool to view live statistics about a Radeon GPU?

I've checked out GPU usage monitoring (CUDA), but are there similar tools for AMD/ATI cards? Or kind of universal tools? I want to check out if my applications use the 256 MB of RAM of the video card at all, since I've seen applications that uses lots system memory, while they should rather use the video cards. `glxinfo` does not provide the information I'm looking for, but maybe you will ask if I have HW Acceleration:               $ glxinfo | grep render     direct rendering: Yes     OpenGL renderer string: Gallium 0.4 on ATI RV515      The info about the card:               03:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] RV515 [Radeon X1300/X1550] (prog-if 00 [VGA controller])         Subsystem: VISIONTEK Device 2352         Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-         Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-         Latency: 0, Cache Line Size: 16 bytes         Interrupt: pin A routed to IRQ 19         Region 0: Memory at d0000000 (64-bit, prefetchable) [size=256M]         Region 2: Memory at bffe0000 (64-bit, non-prefetchable) [size=64K]         Region 4: I/O ports at e000 [size=256]         Expansion ROM at bffc0000 [disabled] [size=128K]         Capabilities: [50] Power Management version 2             Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)             Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-         Capabilities: [58] Express (v1) Endpoint, MSI 00             DevCap: MaxPayload 128 bytes, PhantFunc 0, Latency L0s <4us, L1 unlimited                 ExtTag+ AttnBtn- AttnInd- PwrInd- RBE- FLReset-             DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-                 RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop+                 MaxPayload 128 bytes, MaxReadReq 128 bytes             DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr- TransPend-             LnkCap: Port #0, Speed 2.5GT/s, Width x16, ASPM L0s L1, Latency L0 <64ns, L1 <1us                 ClockPM- Surprise- LLActRep- BwNot-             LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- Retrain- CommClk-                 ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-             LnkSta: Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-         Capabilities: [80] MSI: Enable- Count=1/1 Maskable- 64bit+             Address: 0000000000000000  Data: 0000         Kernel driver in use: radeon      I know there is Process Explorer in Windows, and it works with my card so the thing is Linux Kernel - driver/module - tool.


Need to Adjust Screen Edge of an HDMI-connected TV

I have a Linux Mint Debian Edition device that I'm connecting to my Sony Bravia TV via HDMI. The resolution of both screens are 1920x1080. But when I connect them via HDMI cable, the PC screen is edged correctly with no off-screen edges, but the TV has off-screen edges on its four directions (top, bottom, left, right). How to do I adjust the screen alignment so it fits correctly? Can't do that from TV since the adjustment options are greyed out: "these settings don't support connected signal" or something to that effect. I had the same problem before with Windows 8, but I used Intel HD Graphics 4000 settings to adjust the edge of the connected display, how do I do that on Linux since Intel doesn't have similar software for it.


Setting running process affinity with taskset fails

I'm attempting to limit a process to a given number of CPU cores. According to the taskset man page and this documentation, the following should work:               [fedora@dfarrell-opendaylight-cbench-devel ~]$ taskset -pc 0 <PID>     pid 24395's current affinity list: 0-3     pid 24395's new affinity list: 0      To put it simply - this doesn't work. Putting the process under load and watching `top`, it sits around 350% CPU usage (same as without taskset). It should max out at 100%. I can properly set affinity via `taskset -c 0 <cmd to start process>` at process spawn time. Using `cpulimit -p <PID> -l 99` also kinda-works. In both cases, putting the process under the same load results in it maxing out at 100% CPU usage. What's going wrong here?


How to keep dotfiles system-agnostic?

Due to work I have recently started using OS X and have set it up using homebrew in order to get a similar experience as with Linux. However, there are quite a few differences in their settings. Some only need to be in place on one system. As my dotfiles live in a git repository, I was wondering what kind of switch I could set in place, so that some configs are only read for Linux system and other for OS X. As to dotfiles, I am referring, among other, to `.bash_profiles` or `.bash_alias`.


Formating Mail Body data into html table format

I have a hive query result in tab separated format. I am storing it into a file like               query="select Name, age from table;"     echo $query | hive > test.csv      Now I want to send it in mail using **mutt** command in tabular format. I am using command:               mutt -e -n "set Content-Type:text/html" -s"This is my mail" <test.csv      It shows result in mail body as tab separated format I want to make it in tabular format. query result is in test file like this. and this is appear in mail body               NAME    ssingh     AGE    20      Currently It is separated by Tab and I want to convert it in html table format in mail body Now I am able to generate data in excel 2003 format. Can we convert the excel data into HTML table and send it in mail body using mutt.


Is my approach to performance testing in Linux environment correct?

I want to do performance testing in a Linux environment for a C++ application. I need to measure the CPU & Memory usage of the application. This application is a multi-threaded application. In this requirement I came across two Tools/Utilities (`sar` and `top`). My problem now is if I want to monitor CPU usage, by user, I can use the `top` utility for this but I'm not sure if this is available in the `sar` utility. If I'm wrong on my approach please direct me to the correct path on how to do performance testing in the Linux environment. As an end note, I use PuTTY to login to the remote Linux machine though any GUI based tool will not help me. Any help will be of great use to me.


New md array is auto-read-only and has resync=PENDING

I've created a new md array with the following command:               mdadm --create /dev/md1 -l 1 -n 2 /dev/sd[ed]1      But now `/proc/mdstat` shows the array as "auto-read-only" with resync=PENDING:               ~ # cat /proc/mdstat      Personalities : [raid1]      md1 : active (auto-read-only) raid1 sde1[1] sdd1[0]           976630336 blocks super 1.2 [2/2] [UU]             resync=PENDING          md0 : active raid1 sdb1[0] sdc1[1]           1953511936 blocks [2/2] [UU]          unused devices: <none>      According to this site I can fix this with:               mdadm --readwrite /dev/md1      And that does work:               ~ # mdadm --readwrite /dev/md1     ~ # cat /proc/mdstat      Personalities : [raid1]      md1 : active raid1 sde1[1] sdd1[0]           976630336 blocks super 1.2 [2/2] [UU]           [>....................]  resync =  0.0% (54400/976630336) finish=598.2min speed=27200K/sec          md0 : active raid1 sdb1[0] sdc1[1]           1953511936 blocks [2/2] [UU]          unused devices: <none>      But I still would like to know what is going on here, and I can't find any real information about that. Does anyone know why the array defaults to this state? EDIT: added dmesg output:               ~ # grep kernel /var/log/syslog.1      Nov 13 10:03:44 iserv kernel: [160446.860113] e1000: eth1 NIC Link is Down     Nov 13 10:04:48 iserv kernel: [160511.017666] e1000: eth1 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX/TX     Nov 13 20:12:40 iserv kernel: [196982.775186]  sda: sda1     Nov 13 20:12:59 iserv kernel: [197001.598187]  sdd: sdd1     Nov 13 20:13:13 iserv kernel: [197016.344939]  sde: sde1     Nov 13 20:14:05 iserv kernel: [197067.520825] md: bind<sdd1>     Nov 13 20:14:05 iserv kernel: [197067.521263] md: bind<sde1>     Nov 13 20:14:05 iserv kernel: [197067.670215] md/raid1:md1: not clean -- starting background reconstruction     Nov 13 20:14:05 iserv kernel: [197067.670219] md/raid1:md1: active with 2 out of 2 mirrors     Nov 13 20:14:05 iserv kernel: [197067.670246] md1: detected capacity change from 0 to 1000069464064     Nov 13 20:14:05 iserv kernel: [197067.675101]  md1: unknown partition table     Nov 13 20:24:10 iserv kernel: [197672.572128] md: md1 switched to read-write mode.     Nov 13 20:24:10 iserv kernel: [197672.572269] md: resync of RAID array md1     Nov 13 20:24:10 iserv kernel: [197672.572273] md: minimum _guaranteed_  speed: 1000 KB/sec/disk.     Nov 13 20:24:10 iserv kernel: [197672.572275] md: using maximum available idle IO bandwidth (but not more than 200000 KB/sec) for resync.     Nov 13 20:24:10 iserv kernel: [197672.572280] md: using 128k window, over a total of 976630336k.


Schemes for linux tty and xterm

I actually prefer the font and colorscheme used when I'm in a tty terminal. After I start up a window manager, the colorscheme and font are completely different when I'm in xterm -- which is expected. I just don't know how to make xterm look like a tty. I diffed the results from printenv for when I'm using a tty and when I'm using xterm:               1,3c1,3     < XDG_VTNR=2     < MANPATH=:/usr/local/texlive/2013/texmf-dist/doc/man     < XDG_SESSION_ID=c15     ---     > XDG_VTNR=1     > MANPATH=:/usr/local/texlive/2013/texmf-dist/doc/man:/usr/local/texlive/2013/texmf-dist/doc/man     > XDG_SESSION_ID=c1     5c5     < TERM=linux     ---     > TERM=xterm     7c7,8     < rvm_stored_umask=0022     ---     > WINDOWID=33554445     > XTERM_SHELL=/bin/bash     14,15c15     < rvm_loaded_flag=1     ---     22a23,24     > XTERM_LOCALE=en_US.UTF-8     > XTERM_VERSION=XTerm(303)     24c26     < SHLVL=1     ---     > SHLVL=4     29c31,33     < INFOPATH=:/usr/local/texlive/2013/texmf-dist/doc/info     ---     > WINDOWPATH=1     > INFOPATH=:/usr/local/texlive/2013/texmf-dist/doc/info:/usr/local/texlive/2013/texmf-dist/doc/info     > DISPLAY=:0     32d35     < rvm_user_install_flag=1     33a37


umask changes to 0002 after cd

I've noticed an odd behavior on my Ubuntu 12.04 LTS system. This is my first experience with Ubuntu; previously I used Fedora and never had this problem. I have set my umask in .bashrc to 0027. But it automatically changes to 0002 every time I cd into another directory. It doesn't matter what directory I go in to; every directory change results in the umask changing.               bbrown@cs:~$ umask     0027     bbrown@cs:~$ cd /     bbrown@cs:/$ umask     0002     bbrown@cs:/$ umask 027     bbrown@cs:/$ cd /var/log     bbrown@cs:/var/log$ umask     0002      It even happens if I just use `cd` without a directory:               bbrown@cs:/var/log$ cd     bbrown@cs:~$ umask 027     bbrown@cs:~$ umask     0027     bbrown@cs:~$ cd     bbrown@cs:~$ umask     0002      I've searched through some other discussion boards. A similar question was asked on Stack Overflow with no resolution. I have no special ACLs on any of these directories.               bbrown@cs:/var/log$ getfacl /     getfacl: Removing leading '/' from absolute path names     # file: .     # owner: root     # group: root     user::rwx     group::r-x     other::r-x          bbrown@cs:/var/log$ getfacl /var/log     getfacl: Removing leading '/' from absolute path names     # file: usr/bin     # owner: root     # group: root     user::rwx     group::r-x     other::r-x      Filesystems are ext4 with no ACL mounting options:               bbrown@cs:/var/log$ more /etc/fstab     # <file system> <mount point>   <type>  <options>       <dump>  <pass>     proc            /proc           proc    nodev,noexec,nosuid 0       0     /dev/mapper/vg0-root /               ext4    errors=remount-ro 0       1     # /boot was on /dev/vda1 during installation     UUID=0da490ac-183d-45cd-a490-5d7ac3663337 /boot           ext2    defaults        0       2     /dev/mapper/vg0-export /export         ext4    defaults        0       2     /dev/mapper/vg0-home /home           ext4    defaults        0       2     /dev/mapper/vg0-var /var            ext4    defaults        0       2     /dev/mapper/vg0-mysql /var/lib/mysql  ext4    defaults        0       2     /dev/mapper/vg0-pgsql /var/lib/postgresql ext4    defaults        0       2     /dev/mapper/vg0-swap none            swap    sw              0       0      The csh does not exhibit this behavior; it's bash only as far as I can tell. What's going on and how do I disable this? ## Update I copied bash from my Fedora 13 system and put it in my home directory. That version does not exhibit the problem.               bbrown@cs:~$ /bin/bash --version     GNU bash, version 4.2.24(1)-release (x86_64-pc-linux-gnu)     Copyright (C) 2011 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.     bbrown@cs:~$ ls -l /bin/bash     -rwxr-xr-x 1 root root 955024 Apr  3 08:58 /bin/bash     bbrown@cs:~$ ls -l ./bash     -rwxr-xr-x 1 bbrown bbrown 904664 Sep 11 13:02 ./bash     bbrown@cs:~$ ./bash --version     GNU bash, version 4.1.7(1)-release (x86_64-redhat-linux-gnu)     Copyright (C) 2009 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.     bbrown@cs:~$ exec ./bash     bbrown@cs:~$ umask     0027     bbrown@cs:~$ cd /     bbrown@cs:/$ umask     0027      As requested, here's the output of `type cd`:               bbrown@cs:~$ type cd     cd is a function     cd ()      {          if builtin cd "$@"; then             [[ -n "${rvm_current_rvmrc:-}" && "$*" == "." ]] && rvm_current_rvmrc="" || true;             __rvm_do_with_env_before;             __rvm_project_rvmrc;             __rvm_after_cd;             __rvm_do_with_env_after;             return 0;         else             return $?;         fi     }      That's telling. RVM has taken control of the `cd` command. That's annoying, but it certainly explains what's going on.


Split command output by linebreak?

I have a command returning multiple lines. For further processing I need to process each single line of those lines. My current code works by modifying the IFS (Internal Field Separator):               ROWS=$(some command returning multiple lines)          O=$IFS #save original IFS     IFS=$(echo -en "\n\b") # set IFS to linebreak          for ROW in ${ROWS[@]}     do       echo "$ROW"     done          IFS=$O #restore old IFS      I am wondering, is there a better way to access the single lines of the multiple lines output, one without modifying the IFS? Especially the readability of my script gets bad by modifying the IFS. Update: I have troubles to get the answers working, e.g the one from choroba:               while IFS= read -r line ; do         let var+=line #line 42     done << $(sqlite3 -list -nullvalue NULL -separator ',' /var/log/asterisk/master.db "${QUERY}")     echo "$var" # line 44      gives me               ./bla.sh: row 44: Warning: here-document at line 43 delimited by end-of-file (wanted `$(sqlite3 -list -nullvalue NULL -separator , /var/log/asterisk/master.db ${QUERY})')     ./bla.sh: row 42: let: echo "": syntax error: invalid arithmetic operator. (error causing character is \"""\").      Anyone can help me with this? Thanks!


Why does `cp -a . /dir` copy contents instead of directory?

I wanted to copy a directory that I was presently in. I tried `cp -a . ~/xyz` It copied the contents of the directory, yet this worked: `cp -a "$(pwd)" ~/xyz`   _[As desired, this copied the directory wrapping the contents as well.]_ Dot seemed to be doing what Splat would do... Why doesn't `.` work?


How to list similar lines?

The delimiters could be: " "; "_" INPUT:               foo#foo_ehh113#The password of user 111 will expire within the next seven d     foo#foo_ehh204#The password of user 111 will expire within the next seven d     sadf#sadf this is a sample_text     foo#foo_ehh204#The password of user 222 will expire within the next seven da     foo - moreeee test     foo#foo_ehh113#The password of user 222 will expire within the next seven da     foo#foo_ehh113#The password of user 333 will expire within the next seven day     ldr#ldr_another sample text     foo#foo_ehh204#The password of user 333 will expire within the next seven day      OUTPUT:               foo#foo_ehh113#The password of user 111 will expire within the next seven d     foo#foo_ehh204#The password of user 111 will expire within the next seven d     foo#foo_ehh204#The password of user 222 will expire within the next seven da     foo#foo_ehh113#The password of user 222 will expire within the next seven da     foo#foo_ehh113#The password of user 333 will expire within the next seven day     foo#foo_ehh204#The password of user 333 will expire within the next seven day      So similar words in the given lines are ex.:               The     password     of     user     will     expire     within     the      **My question:** are there any methods to only OUTPUT the lines that are similar to an extent? Ex. they match by 8 words   Are there any shell scripts that can detect this?


Sort by regular expressions

I've got a set of POSIX regular expressions*               ^BEGIN:VCARD\r$     ^VERSION[^A-Z]     ^FN[^A-Z]     ^N[^A-Z]     ^NICKNAME[^A-Z]     ^EMAIL[^A-Z]     ^X-\([A-Z-]*\)     ^TEL[^A-Z]     ^ADR[^A-Z]     ^ORG[^A-Z]     ^TITLE[^A-Z]     ^BDAY[^A-Z]     ^URL[^A-Z]     ^ROLE[^A-Z]     ^NOTE[^A-Z]     ^END:VCARD\r$      and a file with lines which each match one of the regular expressions:               BEGIN:VCARD     VERSION:3.0     N:Doe;Jane;;Ms;     URL:http://janedoe.com/     EMAIL:jdoe@example.org     EMAIL:jane.doe@janedoe.com     BDAY:1970-01-01     X-JABBER:jane.doe@example.org     X-ICQ:1234567890     END:VCARD      I'd like to sort these lines according to   1. the line number of the regex match (so that lines starting with FN comes before lines starting with N),   2. the match group (so that X-ABC comes before X-DEF) Ideally, the other parts of the lines should not be sorted (so the sequence of lines which start with EMAIL should be left alone). The expected result should therefore be:               BEGIN:VCARD     VERSION:3.0     N:Doe;Jane;;Ms;     EMAIL:jdoe@example.org     EMAIL:jane.doe@janedoe.com     X-ICQ:1234567890     X-JABBER:jane.doe@example.org     BDAY:1970-01-01     URL:http://janedoe.com/     END:VCARD      Is there an existing tool to do this? Edit: Resulting implementation based on Lars Rohrbach's answer. * This is the sequence of vCard properties in a Gmail contacts export file.


Mounting a multi-partition (GPT/HFS+) USB 2.0 harddrive on Debian

I have a 3TB USB 2.0 hard-drive which has two HFS+ (Mac) partitions using GUID partition table for the partition records. It was partitioned with Mac OS Disk Utility. How can I mount these partitions on a Debian system, specifically a Netgear ReadyNAS? Running `mount -t hfsplus /dev/sda1 /mnt/usbtemp/` reports the following: _mount: /dev/sda1 is not a valid block device_ Running `fdisk -l` raises the following issue: _WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted._ Running `parted /dev/sda print` reports the following: _Error: Unable to open /dev/sda - unrecognised disk label.   Information: Don't forget to update /etc/fstab, if necessary._ Is it possible to mount these partitions on my Debian system?


debian wireless networking through terminal

I'm starting to use the wmii windows manager and I want certain pieces of information to display on a status bar. If I were to want to display the ESSID for the network, I would have to find it through some shell command. I already know I can find the ESSID by issuing the command               iwconfig wlan0 | grep -o "ESSID:\"[a-zA-Z]*\""      but that requires you to be a super user? So my questions are:   1. how can I find the ESSID without any superuser privileges?   2. is there some terminal command which gives me some gui for selecting the wireless connections? Or do I always have to do something like iwconfig wlan0 essid X key Y ? I'm looking for some simple interface like the one that exists on gnome. edit: i messed up the regex


amarok displays wrong time for ogg files

I am running **Amarok 2.5.0** on **Fedora 16** and it is displaying the wrong time for all **ogg** audio files. Is there a way to fix this issue?


Rewrite a Vim function to a one-line map

This works:               nmap <silent> <S-t> :call InventTab()<CR>     function InventTab()         set expandtab!         if &expandtab             retab             echo 'spaces'         else             retab!             echo 'tabs'         endif     endfunction      I've tried to change it to a one-liner:               nmap <silent> <S-t> :set expandtab!<CR>:if &expandtab<CR>:retab<CR>:echo 'spaces'<CR>:else<CR>:retab!<CR>:echo 'tabs'<CR>:endif<CR>      The problem now is that it it insists on printing "Press ENTER or type command to continue" afterwards. If I add another `<CR>` it doesn't do that anymore, but then the `echo` output is cleared. How should I write this to make sure I see the output but no extra stuff? Result (see the accepted answer for details):               nmap <silent> <S-t> :set expandtab! ^V| if &expandtab ^V| retab ^V| echo 'spaces' ^V| else ^V| retab! ^V| echo 'tabs' ^V| endif<CR>


SED : Delete 4 line above and below 5 line after pattern match

I have Hugh file with following details :               define host{             use                     generic-host            ; Name of host template to use             host_name               ServerA_172.29.16.102             alias                   ServerA_172.29.16.102             address                 172.29.16.102             check_command           check-host-alive             max_check_attempts      3             notification_interval   120             notification_period     24x7             }                    define host{             use                     generic-host            ; Name of host template to use             host_name               ServerB_172.29.16.103             alias                   ServerB_172.29.16.103             address                 172.29.16.103             check_command           check-host-alive             max_check_attempts      3             notification_interval   120             notification_period     24x7             }      What I want, Search `"address 172.29.16.102"` and Delete 4 line above and after 5 line . I have tried following with sed but not work               sed '$N;$N;N;/address                 172.29.16.102/,+5d' hosts


How do I change file/directory permission of a nfs mounted directory, so I access files as user?

On a Ubuntu computer I mounted a directory from another computer using the following line in the `fstab`:               12.34.56.78:/space/Images /mnt/space/images nfs rsize=16384,wsize=16384,rw,auto,nolock 0 0      When working inside this mounted directory I only can work with superuser rights, and even the attempt to change them with               sudo chgrp -R linuxuser Images/      resulted in errors of the type:               chgrp: changing group of `file': Invalid argument      How can I mount the partition instead, so I can work in it as a normal user (without using `sudo` even for a `ls`)? **Additional information:**   * On the server side I followed this example.   * The user and their IDs are different on server and client.


rc.local hang on bootup

My `rc.local` is stuck in an infinite loop since I accidentally put a wrong I/O redirection in and it's executing itself over and over again. I'm on Red Hat 6.5 and would like to know how I can start the machine without the `rc.local` being run so that I may fix the problem? It is also on a virtual machine and not a physical machine with VMware.


How do I connect a 3G dongle using systemd?

At startup, usb-modeswitch automatically switches the dongle to modem mode and the device shows itself as 12d1:1506. After this, a script should run, connecting to the Internet. I am not sure about using /etc/rc.local since Arch has moved to pure systemd. How to I express this dependency (run a script only after the device has switched) in systemd terms? Udev rules cannot run long scripts, and mine is.


Generate new name for moved file to prevent overwriting?

How can I generate a new name for a file if there's an existing file With that same name? In a Desktop environment a new name is generated my appending a number to the end of the file name, but how can this be accomplished from the command line? I'm using the Android operating system with Busybox.


How do I properly re-install an OS to the same partitions after failing for the first time?

I have Ubuntu installed. I created 2 more partitions for Linux Arch and failed to install it due to choosing the wrong packages via package manager. It will work on my computer for sure (it already did). So I'm going to re-install it. The reason I created 2 partitions (/boot and main /) for Arch is that I'm on UEFI system and it's x64 also. That's a must. So do I have to remove all the files from these 2 partitions before re- installing Arch or can I just re-install it without it? If case I have to remove them, how would I do that? Just `mount` them (partitions) while I'm on Ubuntu and remove via `rm -r` all the files in them?


Linux + how to verify mirror configuration on linux red-hat

I have an IBM blade server and we've installed _RedHat Linux_ on the machine. How can we check if we have both disks running as a mirror, or if everything is only running on a single disk? What commands can I use to discover this?


How to list files and folders that are not maintained by any DEB package

I am in the process of moving my files from one Debian machine to another so that I can use the old machine for a different purpose. I do not want to miss any file because I will be formatting the old machine's hard drive irrecoverably. Thinking about this more, I realized that all of the files and folders that I need to copy are the ones that are not maintained by any installed Debian package. Is there a simple way to list such files and folders?


Process calling getaddrinfo() at boot gets permanently stuck with bad /etc/resolv.conf?

I'm running `pianod`, a Pandora client/server, on a Raspberry Pi with Arch Linux ARM. I have `pianod` set up to run as a service at boot. It starts up before the network stack, so `getaddrinfo()` fails. This should be okay; `pianod` is setup to retry network login every 60 seconds. (Aside: I tried obvious things to get `systemd` to wait for the network stack before starting `pianod`, but it wasn't working. On the `systemd` list, I was advised that really I should just try to make my process behave well if network isn't available, a perspective I can appreciate. There are other hacks to make my process sleep during boot, etc.. I'd be interested if there is such a hack that's actually standard for some reason, but would prefer a clean solution.) Despite `pianod` retrying network every 60 seconds after initial fail on boot, `getaddrinfo()` persists in returning `EAI_NONAME`. If I restart the process manually everything works. The issue seems to be that on the first call to `getaddrinfo()` on boot, `res_init()` is called and tries to load `/etc/resolv.conf`. Since DHCP hasn't initialized that file with proper DNS information yet (?), this loads bad DNS (localhost I think) information into the process's global `_res` variable. The process is then stuck with `EAI_NONAME`. Adding a manual re-call to `res_init()` to reload DNS info after failed `getaddrinfo()` calls makes the thing work, i.e. `getaddrinfo()` succeeds on the first login retry 60 s after boot. BUT... I'm pretty surprised that this is an issue. I have another service that does essentially the same thing and doesn't seem to need the manual `res_init()`. The other process does a bit more `fork()`, but I don't see where it would escape from the bad `_res` global. In general I'm surprised Linux is setup to have this issue. So I felt like I should ask around what I might be missing here. Does my interpretation sound correct? If so, why is this not handled better upstream? If not, what more should I look into? Are there better standard ways to handle this? _UPDATE: as requested, here's the current service unit description._ I have tried adding `After=network.target` as well as `Requires`. From what the `systemd` folks said, these aren't reliable from one distro to the next...               [Unit]     Description=Pandora Client Daemon     After=syslog.target          [Service]     EnvironmentFile=/etc/pianod.env     ExecStart=/usr/sbin/pianod $INITSCRIPT $USERFILE $PORT $LOGGING -nroot     Restart=on-abort          [Install]     WantedBy=multi-user.target


Mysql synonym drop and create

I am running into the issue that, when the script is run, the MySql section of it isn't working or is droping the synonym. Is there something else i need to put into the command to have it log into the MySql server and do everything that is stated.               #! /bin/bash          #Subject: Please stage the following TFL09143 Locator Bulletin to all TF90 staging environments:#                    #########################################################################     # This next section is to go to mysql server and make changes.          #     # you can drop and create synonyms                                      #     # truncate a table and insert into a different one.                     #     # you will be able to verify the counts to the different locations      #     #########################################################################          $ mysql -h=app03-bsi -u "" -p ""  "TF90BPS" -bse "drop_view TF90.BTXADDR drop_view TF90.BTXSUPB CREATE_VIEW TF90.BTXADDR FOR TF90BP.TFBPS2.BTXADDR CREATE_VIEW TF90.BTXSUPB FOR TF90BP.TFBPS3.BTXSUPB TRUNCATE TABLE TF90BP.TFBPS3.BTXSUPB SELECT (*) FROM TF90BP.TFBPS2.BTXSUPB; select count (*) from TF90BP.TF90.BTXADDR select count(*) from TF90BPS.TF90.BTXADDR; select count(*) from TF90BP.TF90.BTXSUPB; select count(*) from TF90BPS.TF90.BTXSUPB;"          $ mysql -h=app03-bsi -u "" -p ""  "TF90LMS" -bse "drop_view TF90.BTXADDR drop_view TF90.BTXSUPB CREATE_VIEW TF90.BTXADDR FOR TF90LM.TFBPS2.BTXADDR CREATE_VIEW TF90.BTXSUPB FOR TF90LM.TFBPS3.BTXSUPB; TRUNCATE TABLE TF90LM.TFLMS2.BTXADDR;TRUNCATE TABLE TF90LM.TFLMS3.BTXSUPB;INSERT INTO TF90LM.TFLMS3.BTXSUPB SELECT * FROM TF90LM.TFLMS2.BTXSUPB;Verify select count(*) from TF90LM.TF90.BTXADDR;select count(*) from TF90LMS.TF90.BTXADDR;select count(*) from TF90LM.TF90.BTXSUPB;select count(*) from TF90LMS.TF90.BTXSUPB"          $ mysql -h=app03-bsi -u "" -p ""  "TF90NCS" -bse "drop_view TF90.BTXADDR  drop_view TF90.BTXSUPB CREATE_VIEW TF90.BTXADDR FOR TF90NC.TFBPS2.BTXADDR CREATE_VIEW TF90.BTXSUPB FOR TF90NC.TFBPS3.BTXSUPB; TRUNCATE TABLE TF90NC.TFNCS2.BTXADDR; TRUNCATE TABLE TF90NC.TFNCS3.BTXSUPB; INSERT INTO TF90NC.TFNCS3.BTXSUPB SELECT * FROM TF90NC.TFNCS2.BTXSUPB; Verify select count(*) from TF90NC.TF90.BTXADDR; select count(*) from TF90NCS.TF90.BTXADDR;select count(*) from TF90NC.TF90.BTXSUPB;select count(*) from TF90NCS.TF90.BTXSUPB"          $ mysql -h=app03-bsi -u "" -p ""  "TF90PVS" -bse "drop_view TF90.BTXADDR drop_view TF90.BTXSUPB CREATE_VIEW TF90.BTXADDR FOR TF90PV.TFBPS2.BTXADDR CREATE_VIEW TF90.BTXSUPB FOR TF90PV.TFBPS3.BTXSUPB; TRUNCATE TABLE TF90PV.TFPVS2.BTXADDR;TRUNCATE TABLE TF90PV.TFPVS3.BTXSUPB;INSERT INTO TF90PV.TFPVS3.BTXSUPB SELECT * FROM TF90PV.TFPVS2.BTXSUPB;Verify select count(*) from TF90PV.TF90.BTXADDR;select count(*) from TF90PVS.TF90.BTXADDR;select count(*) from TF90PV.TF90.BTXSUPB;select count(*) from TF90PVS.TF90.BTXSUPB"          #TFL09143 Staging#          cd \\ntsrv\common\To\IT-CERT-TEST\TFL09143 #change to mapped network drive           cp -p TFL09143.pkg /d:/tf90/code_stg /tf90bp/code_stg /tf90lm/code_stg /tf90pv/code_stg           InvalidInput="true"           if [ $# -eq 0 ] ; then         echo "This script sets up TF90 Staging"         echo -n "Which production do you want to run? (RB/TaxLocator/Cyclic)"         read ProductionDistro     else         ProductionDistro="$1"     fi          while [ "$InvalidInput" = "true" ]     do         if [ "$ProductionDistro" = "RB" -o "$ProductionDistro" = "TaxLocator" -o "$ProductionDistro" = "Cyclic" ] ; then                         InvalidInput="false"             break         else              echo "You have entered an error"             echo "You must type RB or TaxLocator or Cyclic"             echo "you typed $ProductionDistro"             echo "This script sets up TF90 Staging"             read ProductionDistro         fi     done          InvalidInput="true"          if [ $# -eq 0 ] ; then         echo "This script sets up RB TF90 Staging"         echo -n "Which Element do you want to run? (TF90/TF90BP/TF90LM/TF90PV/ALL)"         read ElementDistro     else         ElementDistro="$1"     fi              while [ "$InvalidInput" = "true" ]     do         if [ "$ElementDistro" = "TF90" -o "$ElementDistro" = "TF90BP" -o "$ElementDistro" = "TF90LM" -o "$ElementDistro" = "TF90PV" -o "$ElementDistro" = "ALL" ] ; then             InvalidInput="false"             break         else              echo "You have entered an error"             echo "You must type TF90 or TF90BP or TF90LM or TF90PV"             echo "you typed $ElementDistro"             echo "This script sets up TF90 Staging"             read ElementDistro         fi               done           if [ "$ElementDistro" = "TF90" ] ; then              cd /d/tf90/code_stg         vim TFL09143.pkg         export var=TF90_CONNECT_STRING=DSN=TF90NCS;export Description=TF90NCS;export Trusted_Connection=Yes;export WSID=APP03-         BSI;export DATABASE=TF90NCS;         export DATASET=DEFAULT         yum install -y ../TFL09143.pkg     fi          if [ "$ElementDistro" = "$TF90BP" ] ; then         cd /d/tf90bp/code_stg         vim TFL09143.pkg         export TF90_CONNECT_STRING=DSN=TF90BPS;export Description=TF90BPS;export Trusted_Connection=Yes;export WSID=APP03-         BSI;export DATABASE=TF90BPS;         yum install -y ../TFL09143.pkg     fi          if [ "$ElementDistro" = "$TF90LM" ] ; then         cd /d/tf90lm/code_stg         vim TFL09143.pkg          export TF90_CONNECT_STRING=DSN=TF90LMS;export Description=TF90LMS;export Trusted_Connection=Yes;export WSID=APP03-         BSI;export DATABASE=TF90LMS;         yum install -y ../TFL09143.pkg      fi          if [ "$ElementDistro" = "TF90PV" ] ; then         cd /d/tf90pv/code_stg         vim TFL09143.pkg         export TF90_CONNECT_STRING=DSN=TF90PVS;Description=TF90PVS;Trusted_Connection=Yes;WSID=APP03-         BSI;DATABASE=TF90PVS;         yum install -y ../TFL09143.pkg     fi          exit 0


Nvidia Update Problem On Debian 7 Stable

New User Here Guys bear with me! Specs:   Debian Stable Weezy Gnome 3 edition 64 bit   Video Card: Nvidia GTS 250,   CPU: AMD Phenon X4 Quad core History:   All was going so well, back-ports was added, contrib non-free components were added, multimedia repos were added, Kenerl was updated from 3.2 to 3.14 no problem with that either. Problem came when I tried updating my driver for my nvidia card. Heres is the last command before the issue began.               apt-get -t wheezy-backports install nvidia-kernel-dkms nvidia-glx build-essential nvidia-settings nvidia-xconfig      Upon a system reboot I boot into a command prompt no matter which kernel I pick(3.2 or 3.14) Someone told me to create a new file in `/etc/X11/xorg.conf.d/20-nvidia.conf/` with the following contents:               Section "Device"     Identifier "My GPU"     Driver "nvidia"     EndSection      Or something along those lines( typing this from memory right now ) I also tried editing the main xorg.conf by changing the Identifier from: `Identifier "Device0"` to: `Identifier "My GPU"` to no effect, I still boot into a command prompt after making the changes and rebooting. I dont know what to do next. Im new to debian and really need some help because I dont want to go back to windows if I dont need to. Im typing this on windows now because I have no choice in the matter. Can someone bring me back to linux? Thanks in advance!


How to get Flash to work with webkit gtk3 on Fedora?

I have Fedora 20 with the following packages:   * flash-plugin-11.2.202.359-release.i386   * flash-plugin-11.2.202.359-release.x86_64   * webkitgtk-2.2.7-1.fc20.x86_64   * webkitgtk3-2.2.7-1.fc20.x86_64   * libwebkit2gtk-2.2.7-1.fc20.x86_64 Flash is loaded with webkit-gtk2 (tried with /usr/libexec/webkitgtk/GtkLauncher) but not with webkit-gtk3 (/usr/libexec/webkitgtk3/GtkLauncher). There is no error message.


Setting up a Gentoo Repository on a Debian Host

I have a debian host, on which i want to setup a private Gentoo Repository for my college. I have started syncing the repository by a simple bash script whose snippet is as follows :               RSYNC="/usr/bin/rsync"     OPTS="--quiet --recursive --links --perms --times -D --delete --timeout=300"     SRC="rsync://rsync.de.gentoo.org/gentoo-portage"     DST="      What else I need to do for setting up the repository? Thanks in advance for the help.


How can I modify route table?

I don't want to delete or add, just want to modify one rule. Is there such a command or do I have to resort to Delete and Add ? Computer is running Debian 6.


How to shutdown with consolekit without sysvinit (but with systemd)

I have systemd (and no sysvinit) installed on a Arch Linux box. However, I cannot shutdown/reboot with consolekit (dbus interface). `# systemctl {shutdown,reboot}` work just fine, so I guess it's because consolekit doesn't know how to contact the `pid 1` process.


How can I source the bashrc file every time I 'clear'

This might be a bad idea. The more I think about it the more I come to the realization that I probably shouldn't do it... but I've been trying and failing so I REALLY want to know how to do it, even if it's a bad idea. What I want is for the bashrc file to be sourced every time I run the `clear` command. The reason for this is completely materialistic. I have system information echoed out when I source bashrc and it's cool to me and I'd like that to be at the top every time I clear.   I've tried to set up some aliases for `clear` but I keep running into infinite loops. The obvious fix is to change the aliases to something else besides clear so that I can run the clear command in the alias without interfering but I type clear so often that it's kind of ingrained in my brain at this point. I'd like to be able to type clear and make it clear AND source the bashrc file.


Reloading the $PATH from the GUI terminal

My machine is running Fedora 16 x86_64 I am trying to figure out why I can not get my GUI terminal window to refresh the path. I recently added a new location to the path (in `.bash_profile`), after closing the GUI terminal and reopening it, the new location is still not showing. When I go to `tty2` the new path is listed. I closed the GUI terminal and reopened again to find the new path entry still is not in the path being used. I did not reboot but I am trying to:   1. avoid rebooting   2. figure out what I need to do so that I do not run into this problem again


Krunner equivalent in XFCE?

I like Krunner, but nowadays I prefer to use XFCE instead of KDE. Is there any XFCE app that is equivalent or similar to Krunner?


Is there any way to install freeBSD from Debian?

I know that one can install Debian from (AFAIK) any Linux computer using debootstrap. Is there any way to do the same for freeBSD or do I need to make a CDROM?


Why doesn't this Hello World X11 code run on NetBSD?

I am on a brand new 5.1 NetBSD box. I copied the "Hello World" code from here `rosettacode.org` The code compiles with this command:               cc -I /usr/X11R7/include -L /usr/X11R7/lib -lX11 helloworld.c      When I run `a.out`, I get the following error:               Shared object "libX11.so.6" not found      I confirmed that `/usr/X11R7/lib/libX11.so.6` does exist. ldd output:               ./a.out:         -lX11.6 => not found         -c.12 => /usr/lib/libc.so.12      How do I properly link against X11 on NetBSD?


Avoid display blanking under X

I have an Ubuntu Linux box (12.04). I can't prevent the screen blanking under X. I have tried the command `xset s off`, inserted the command line kernel parameter `acpi=off` in grub at kernel boot. Changed `xorg.conf`. Then used the GUI tool in Ubuntu's "Monitor Preferences", the tool "Power Management". I uninstalled `gnome-screensaver` and `xscreensaver`. Nothing has worked and I don't know what to do anymore. How can I disable screen blanking under X?


Give user permissions to all files and folders

I want to have a user who has access to all the files and folders on the system. This is for the purpose of using RSYNC on a local machine to backup a remote machine. At the moment we are using the user `backups` and although we have added this user to the groups `sudo` and `admin` rsync still returns messages like: > rsync: opendir "/location/to/folder" failed: Permission denied (13) > > rsync: send_files failed to open "/location/to/file": Permission denied (13) Any idea how we give the user `backups` permission to access everything (short of adding the user to all groups ever - the remote server we are trying to backup is a dedicated hosting server where every account has its own user on the system). Thanks for any help.


How to interpret the explicit references to GNU in the LSB specifications?

The LSB is a specification, and as such, should be provider neutral. But it contains many “hard‑coded” reference to GNU at many places. Ex. the ELF Linux's specific entries `PT_GNU_STACK`, `PT_GNU_RELRO` and al., or with some libraries like `libgcc_s`. How these explicit references to GNU in the LSB should be interpreted?   * Is it there for historical reasons (like the `MZ` magic in one of the Windows executable formats)?   * Is it there to designate GNU as a unique provider for some parts of conforming systems?   * Is it there as an acknowledgement of some role played (currently or in the paste) without any particular mandate? I would not have asked this questions, if the references did not appeared in a standard specification, I mean, the questions should be understood in this particular context.


How i create application B that would be able to communicate with running application A?

I have background application **A**. I want to create application **B** to configure application **A** on the fly. So, how can I detect if **A** is running and send some messages to **A**?


Virtualbox, mounting guest directory on host computer

Is there a way to mount a directory residing on my VB guest (linux) on my host (linux)? I know I can do it the other way around with the shared folders feature on Virtualbox, but is there a way to do it this way? I'd really like to actually mount the directory. Not use samba, or something similar to that.


Fedora 16 desktop missing workspaces, Applications and Desktop menus at top of window

My last system was Fedora 12, and I don't recall doing anything special to get Applications Places Desktop at the top and having multiple workspaces (also switchable at the top). I can't find any of this in my new Fedora 16 installation - what am I missing?


Control + Function Key association in Emacs

I am trying to associate the keyboard shortcut `Control` + `F10` with `gud- step` in GUD in Emacs. I thought the following would do the trick, but it doesn't:               (define-key gud-mode-map '[C-f10] 'gud-step)      ## Update My mistake. The above actually **works**. Sorry for the confusion. Instead of deleting the question, we can close this thread in case anybody ever needs to set up a similar keyboard shortcut.


How do I run uTorrent?

I just downloaded the uTorrent archive from their website and unpacked it. Inside were:   * docs   * utserver   * webui.zip `utserver` is an executable, so I'm guessing that's what I'm supposed to run, but when I double-click it nothing happens. What should I do? I'm using Fedora 15


GNU Screen and Emacs

I upgraded recently to OpenSuSE 12.1 from 11.3 and now when I open any files in emacs from inside a screen session, I get a blank buffer. Let's say I open it as:               emacs myFile.txt      it will open to an empty buffer, not the file, and when I attempt to save something, it will ask for a file name to write to. This worked before the upgrade. I assume screen is the issue here since emacs works fine outside of screen. Is there something I'm missing in the screen settings or is this a bug in something?


How can I make my home Linux most closely resemble the Linux used at my school?

We have to ssh into our school's server to make sure our programming assignments work on the system that will be used to test them by the teacher. It's running RHEL 6.2. When I test my program on my Mac running RHEL 6.2 in VirtualBox, I get different results than the school's. Are there any steps I can take to get my RHEL running similarly enough to the school's so that we get the same results, or are there too many variables for it to be plausible (hardware, root settings, etc)? EDIT: The programming is in C++ for an Operating Systems class. We're working with system calls and whatnot. It's using tcsh, g++...other than that I'm not sure what else you'd need to know? This is my first unix/linux class.


/boot too small to upgrade

Trying to upgrade from F15 to F17. I need to find a way to increase /boot size without destroying data. Details: I tried upgrading using preupgrade process and via booting from Net iso on USB and both lead to the same thing: and 'Error' message in the first package (filesystem) transaction indicating the installer needs (about) 1GB more on / Cannot proceed with the install. I also tried the trick of reducing the avail space in /boot to < 100M to trigger a network load of the installer image... but that leads to a series of mirror http/404 messages and no progress. I'd like to not have to nuke everything, yet again, just to do an upgrade. I would have thought that, by now, this issue would have drawn a more elegant solution than continually trying to guess how big /boot will have to be for the next upgrade. (unsnark) I have 4GB freespace on /dev/sdb but it is not contiguous with sdb1 (/boot): the process of shrinking the LVM volume released space at the end and not the beginning of sdb:               > df -kl | grep boot:      /dev/sdb1 3064704 300520 2764184 10% /boot      (note that what is now in /boot is irrelevant since 1G > 300 MB: I have to increase the volume size) fdisk:               /dev/sdb1   *        2048     6146047     3072000   83  Linux     /dev/sdb2         6146048   612354047   303104000   8e  Linux LVM      cfdisk:                                      Pri/Log   Free Space                           1.05*        sdb1        Boot        Primary   ext4                              3145.73*        sdb2                    Primary   LVM2_member                     310378.50*                                Pri/Log   Free Space                        4474.28*      Edit: After attempting to use gparted, watching it crash in horror, and eventually yanking and replacing the drive, I created a 15 GB boot partition (FCS!), reinstalling F15 and all my files. _Then_ preupgrade to F17 succeeded. I accepted the preferred answer assuming that it would have worked had it not destroyed my harddrive ;)


Accidentally removed dev-libs/mpc from Gentoo

It seems I accidentally removed `dev-libs/mpc` instead of `media-sound/mpc`. Now I can't compile anything (including a replacement `dev-libs/mpc`) because in doing so I apparently murdered GCC. How does one fix something like this?


Distro- lightweight and easy to install

Ubuntu was too slow on my computer and Arch installation had many problems too. Which distro do you recommend to me that's lightweight as well as easy to install?


Fedora 14 Xen virtual machine does not detect network

I'm trying to create a para-virt Fedora 14 Xen vm on a host running CentOS 5.5. The VM appears to initially install correctly (the installer finds `eth0` and can access the installation media). But when I restart the VM after the installation is completed the VM no longer sees any network, only lo. The VM does have one network connection according to virt-manager. The host is running CentOS 5.5 64bit - completely up-to-date The VM I am tring to install is F14 64bit (installing only the minimal group) Update: After taking a look at this again, I think the problem has to do with my network setup. In the server I have two NICs (eth0, eth1) that I've bonded together (bond0). I'm guessing that I need to make changes to xen so it recognizes the bonded NICs, though I don't know why the guest gets a network interface during installation.


crypt() on different machines

Because of a hardware issue i need to migrate many virtual users to a new machine. Their passwords stored in MySQL encrypted with `ENCRYPT` which using `crypt()`eventually. Maybe it's my fault but `salt` wasn't added when passwords were stored so they're totally random. My basic idea was to dump the database then import it. When i tried to store the same string in the same machine with `ENCRYPT` it gave me different results. Will users' passwords work on the new machine? Update on environment and encrypting method:   * The old machine is running Debian Etch with MySQL 5.0   * New machine will run Debian Squeeze with MySQL 5.1   * The encrypting method is MySQL's default `ENCRYPT`   * Salt wasn't added originally   * I don't know the passwords Thank you for your feedback, fabrik


How do I find on which physical device a folder is located?

Specifically: I did `sudo mkdir /work`, and would like to verify it indeed sits on my harddrive and not mapped to some other drive. How do I check where this folder is physically located?


Looking for tools to build minimal linux desktop

Increasingly I am dissatisfied by the fact, that configuring my linux _desktop_ usually means removing bloat instead of adding and tweaking features. I have come to the conclusion that I would rather begin with something very minimal and then add packages I learn about that provide additional functionality. So I am **looking for either a very minimal desktop distribution or even better a tool to build such a distribution**. Or in other words I want to **replace the package manager with a pre-runtime build tool**. A package manager won't hurt but I am looking for a distribution that focuses on advanced upfront configuration instead of a huge package repository I have looked at various minimal desktop distributions but they all appear to solve different problems, e.g. are designed to run on older hardware or run from cd/stick/ramfs. But I don't want a minimal distribution because my I have old hardware but because I want to know what purpose the various parts play. Running from main memory doesn't help there either, I want something minimal _and_ simple. Since it appears there are no distributions that are designed for the kind of minimalism I have in mind an obvious choice would be to build Linux From Scratch. However while I want the build process to be highly customization it also has to be automated because I will have to run it quite a few times until I have a system I am satisfied with. While a tool for lfs exists that can automate the build process it's not really integral part. Basically it extracts the steps required to build the system from the documentation and then does it automatically. I am looking for something a little more robust and advanced and also don't feel like editing xml. After a bit of searching I found Buildroot which is intended to build _embedded_ distributions but also allows the installation of X11. Before building a toolchain and then a rootfs the build can be configured using `make menuconfig` just like Linux. This looks exacly like what I had in mind, except that it is intended for cross compiling for embedded systems. What I currently have in mind is using buildroot but first ripping out all the embedded specific part replacing them with the respective parts from lfs. Lot's of work. Also there are some problems with buildroot most importantly (as it appears from my limiting testing) just enabling an additional package results in the hole thing being rebuild from scratch, but for trivial changes I would like to avoid that. Before I make that time investment I will continue my search for a desktop distribution with a _pre-installation_ build tool like buildroot, are an alternative to/fork of buildroot intended for building desktop distributions. **Edit:** The answers so far point me to distributions like e.g. Gentoo, which is what I am currently using. But I am _looking for an alternative_ to distributions like Gentoo, Arch, Debian etc. as these distributions are not minimal enough. Also one has to customize these distributions after installation. I want something that can be customized before installation. While all of the mentioned distributions are fine distribution they are not what I am looking for. What I am looking for is **"buildroot for desktop"**. If you do not know what buildroot is then you probably won't be able to provide an answer which satisfies me. Also I don't think that this question is subjective. I simply can not find anything that comes close to my needs and am therefor asking you to point me to projects that might provide at least parts of what I need.


Powertop strange results

I have installed Ubuntu 11.04 and battery life decreased by 2 times. Powertop documentation says that there should be 3 wakeups per second, I have 800-900. I think it's very strange because I didn't touch any settings except for disabling nvidia graphic card. ![enter image description here](http://i.stack.imgur.com/MwgSv.png) How can i improve battery life?


Fastest way combine many files into one (tar czf is too slow)

Currently I'm running `tar czf` to combine backup files. The files are in a specific directory. But the number of files is growing. Using `tzr czf` takes too much time (more than 20 minutes and counting). I need to combine the files more quickly and in a scalable fashion. I've found `genisoimage`, `readom` and `mkisofs`. But I don't know which is fastest and what the limitations are for each of them.


Errors when working with stackoverflow, when connecting through squid proxy

I get errors when using Squid 3.1.10 proxy under Linux Slackware 14.0. My squid.conf has 5674 lines, so I can't put it into the question, using pastebin: http://pastebin.com/3jjKNVvu ## Problem description When reviewing a post, and clicking approve button, the system hangs, but not always. The same happens when submitting an answer or a comment. My investigations of the issue: I am reviewing a post and clicking approve (I approved 1 edit before, and everything was ok). In firebug after I approve the 2-nd edit, I get the following: ![enter image description here](http://i.stack.imgur.com/75ejH.png) `/vote/approve` keeps spinning forever, until I get the popup: ![enter image description here](http://i.stack.imgur.com/lUOBw.png) And this status in firebug: `NetworkError: 504 Gateway Time-out - http://stackoverflow.com/suggested- edit/977221/vote/approve` It is related to proxy - when I don't use it, no errors occur. Unfortunately, squid.conf has so many parameters, that I don't know, what are related to the problem. What should I do to fix?


bash multi line command with comments after the continuation character

Consider               echo \ # this is a comment     foo      This gives:               $ sh foo.sh      # this is a comment     foo.sh: line 2: foo: command not found      After some searching on the web, I found a solution by DigitalRoss on sister site Stack Overflow. So one can do               echo `: this is a comment` \     foo      or alternatively               echo $(: this is a comment) \     foo      However, DigitalRoss didn't explain why these solutions work. I'd appreciate an explanation. He replied with a comment "There used to be a shell goto command which branched to labels specified like : here. The goto is gone but you can still use the : whatever syntax ... : is a sort of parsed comment now.", but I'd like more details and context, including a discussion of portability. Of course, if anyone has other solutions, that would be good too. See also the earlier question How to comment multi-line commands in shell scripts?.


vim - better colors so comments aren't dark blue?

Mostly I edit ruby files, although shell script file comments are also `#` Currently my comments show as dark blue on black which is really hard to read. See screenshot. How can I change their color? I'm willing to conside different schemas for all colors though I do like the black background as a base. ![enter image description here](http://i.stack.imgur.com/7TlPT.png)


How can I run as another user?

This is the bash code that should be runned. So first it substitutes the user to openproject and than runs all the code               su openproject -c "bash -l"      cd ~/openproject     git checkout Gemfile.lock     git pull          bundle install     RAILS_ENV="production" bundle exec rake db:migrate     RAILS_ENV="production" bundle exec rake db:seed     RAILS_ENV="production" bundle exec rake assets:precompile      I have tried chnaging the above script into this:               su - openproject -c "cd ~openproject/openproject"          su - openproject -c "git checkout stable"          su - openproject -c "git checkout Gemfile.lock"     su - openproject -c "git pull"          su - openproject -c "bundle install"          su - openproject -c "RAILS_ENV="production" bundle exec rake db:migrate"     su - openproject -c "RAILS_ENV="production" bundle exec rake db:seed"     su - openproject -c "RAILS_ENV="production" bundle exec rake assets:precompile"      but this does not run properly and at every steps asks for password. How can the translated script be improved so it works? **UPDATE 1:** After receiving sugestions about this I am the point where the code has been modified into:               cd ~openproject/openproject          sudo -u openproject git checkout stable          sudo -u openproject git checkout Gemfile.lock     sudo -u openproject git pull          # the output is good thill here     sudo -u openproject bundle install          sudo -u openproject RAILS_ENV="production" bundle exec rake db:migrate     sudo -u openproject RAILS_ENV="production" bundle exec rake db:seed     sudo -u openproject RAILS_ENV="production" bundle exec rake assets:precompile      The output is ok till the line that states so into the code. From there I get 4 error > sudo: bundle: command not found **UPDATE 2:** After trying the suggestion from Dmitry Vasilyanov I found that if i insert the -i it will simulate as user login. However this is not the final way to do it. If I run `echo $PATH` after logging in as openproject the ouput is `/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/openproject/.rvm/bin` If I run `echo $PATH` after `su openproject -c "bash -l"` the output is `/home/openproject/.rvm/gems/ruby-2.1.0/bin:/home/openproject/.rvm/gems/ruby-2.1.0@global/bin:/home/openproject/.rvm/rubies/ruby-2.1.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/openproject/.rvm/bin`


Compare two numbers read from a file

I have a script that reads a file with a standard format where the 9th word is a number. I am trying to compare the number that is read from the file. I am able to read the line correctly and it works exactly as I want it to. But I get an error that says :               ./age.sh: line 8: [: age: integer expression expected      Here is my script:               #!/bin/bash     if [ -f $1 ] ;     then         while read -r LINE || [[ -n $LINE ]]; do             name=$( echo $LINE | cut -d " " -f1 -f2)             ago=$( echo $LINE | cut -d " " -f9)                  echo "$name ----- $age"             if [ $ago -gt 30 ] ; then                 echo "You get a discount"             fi         done < $1         else             echo "No file found"     fi      Here is a sample input file               #FirstName LastName SuperheroName Powers Weapons City Enemy isOutOfEarth Age     Bruce Wayne Batman Martial_arts No_Guns Gowtham Joker No 31     Clark Kent Superman Extreme_strength None Metropolitan Lex_Luther Yes 32     Oliver Queen Green_arrow Accuracy Bow_and_Arrow Star_city Cupid No 30


Is there a log for sshd where I can see who has used ssh to access my PC?

I am running the OpenSSH daemon (sshd) on CrunchBang Linux, and I want to see a history of who (i.e. IP address) has logged in using SSH.


Where to find a list of device drivers supported by linux?

I have read here that `linux` supports a large number of device drivers and by extension, it also supports a large number of devices connected via the `USB` port. Excerpt from that site: > Linux today supports more hardware devices than any other operating system > in the history of the world. It does this using a development model > significantly different from the familiar Windows device driver model. Is there a list of all the different devices which are supported by `linux`? and/or list of devices which are connected via `USB` and supported by linux`? This is different from just finding out which device drivers are currently supported in a given distribution by using the commands `lsmod`, `lspci` and `dmesg | grep <string>` as the distribution providers only support few common drivers out of all the drivers supported by `linux`.


control apache referrer to restrict downloads in htaccess file

i want to restrict a file server just for people come from an specific URL: `http://graymind.ir` how should i config `.htaccess` file to do this. sorry but i didn't find an answer in sites search.