title: HDI: Dim the screen beyond the typical maximum?

text: I'm on a Dell Latitude E6320, and the screen doesn't get very dim. It's way too bright even when it's dimmed as far as Ubuntu will let it. How do I dim it more? For example, when you have this problem on a windows system, you can install a program like Dimmer (http://www.mylittlehost.com/dimmer.aspx) that overlays a black over your whole display (and you can configure the opacity, allowing you to dim the screen beyond the normal max). Is there any way to deal with a too- bright screen in linux?" Thank you!


title: Installing Skype on Debian x64

text: I am new to Linux and I'm trying to install Skype using this manual. I successfully download the package using the command:               wget -O skype-install.deb http://www.skype.com/go/getskype-linux-deb-64      but when I try to install the package I get some errors about dependencies:               root@102:~# dpkg -i skype-install.deb     (Reading database ... 27918 files and directories currently installed.)     Preparing to replace skype 4.0.0.8-1 (using skype-install.deb) ...     Unpacking replacement skype ...     dpkg: dependency problems prevent configuration of skype:      skype depends on lib32stdc++6 (>= 4.1.1-21); however:       Package lib32stdc++6 is not installed.      skype depends on lib32asound2 (>> 1.0.14); however:       Package lib32asound2 is not installed.      skype depends on ia32-libs; however:       Package ia32-libs is not installed.      skype depends on libc6-i386 (>= 2.7-1); however:       Package libc6-i386 is not installed.      skype depends on lib32gcc1 (>= 1:4.1.1-21+ia32.libs.1.19); however:       Package lib32gcc1 is not installed.      skype depends on ia32-libs-gtk; however:       Package ia32-libs-gtk is not installed.     dpkg: error processing skype (--install):      dependency problems - leaving unconfigured     Errors were encountered while processing:      skype      How can I fix this?


title: RAM usage doesn't add up? (Free+used < total)

text: Lately I've been noticing that my monitoring script which reads from /proc/meminfo and /proc/<pid> has been showing odd readings, where several hundred MB seem to be missing. htop is showing the same discrepancy:               CPU: 36.9% sys:  7.6% low:  0.0%                        Tasks: 123; 1 running     Mem:1750M used:1568M buffers:20M cache:87M              Load average: 0.90 1.33 1.33      Swp:1787M used:184M                                     Uptime: 1 day, 00:28:22       PID USER      PRI  NI  VIRT   RES   SHR S CPU% MEM%   TIME+  Command      3455 rena       20   0 1221M  312M 20464 S 14.0 17.8  1h20:26 /usr/lib/firefox/firefox      1428 root       20   0  327M  100M  6236 S  7.0  5.7  1h28:52 /usr/bin/X :0 -auth /var/run/lightdm/root/:0 -nol     14012 rena       20   0  630M 26400  5264 S  0.0  1.5  0:14.20 /usr/bin/python /usr/bin/sonata --toggle      2562 rena       20   0  914M 21100 10904 S  0.0  1.2  3:59.50 xfce4-terminal --role "Terminal" --hide-menubar -      2492 rena       20   0  379M 20528  3312 S  0.0  1.1  0:03.53 pcmanfm --desktop --profile lubuntu      Memory used is 1568M, but the top 5 processes aren't using anywhere near that: 312+100+26+21+20+20(buffers)+87(cache) = 586M. So 982M are missing somewhere? OS is Lubuntu 12.04 AMD64. Contents of `/proc/meminfo`:               MemTotal:        1792540 kB     MemFree:           67824 kB     Buffers:           17084 kB     Cached:           109624 kB     SwapCached:        69600 kB     Active:           436880 kB     Inactive:         245756 kB     Active(anon):     402348 kB     Inactive(anon):   169616 kB     Active(file):      34532 kB     Inactive(file):    76140 kB     Unevictable:       13456 kB     Mlocked:           13456 kB     SwapTotal:       1830908 kB     SwapFree:        1632380 kB     Dirty:                40 kB     Writeback:             0 kB     AnonPages:        515492 kB     Mapped:            46852 kB     Shmem:              3308 kB     Slab:             875752 kB     SReclaimable:      19108 kB     SUnreclaim:       856644 kB     KernelStack:        2688 kB     PageTables:        19468 kB     NFS_Unstable:          0 kB     Bounce:                0 kB     WritebackTmp:          0 kB     CommitLimit:     2727176 kB     Committed_AS:    1741500 kB     VmallocTotal:   34359738367 kB     VmallocUsed:      285612 kB     VmallocChunk:   34359436336 kB     HardwareCorrupted:     0 kB     AnonHugePages:         0 kB     HugePages_Total:       0     HugePages_Free:        0     HugePages_Rsvd:        0     HugePages_Surp:        0     Hugepagesize:       2048 kB     DirectMap4k:     1551232 kB     DirectMap2M:      282624 kB      Head of slabtop (by size):                Active / Total Objects (% used)    : 1859056 / 1873931 (99.2%)      Active / Total Slabs (% used)      : 115960 / 115960 (100.0%)      Active / Total Caches (% used)     : 76 / 108 (70.4%)      Active / Total Size (% used)       : 906258.20K / 909988.65K (99.6%)      Minimum / Average / Maximum Object : 0.01K / 0.49K / 8.00K            OBJS ACTIVE  USE OBJ SIZE  SLABS OBJ/SLAB CACHE SIZE NAME                        1640475 1640475 100%    0.53K 109365       15    874920K idr_layer_cache       4941   4628  93%    0.86K    549        9      4392K ext4_inode_cache      19068  13243  69%    0.19K    908       21      3632K dentry       6034   5325  88%    0.55K    431       14      3448K inode_cache      20272  20272 100%    0.14K    724       28      2896K sysfs_dir_cache


title: Preventing tar from using too much CPU and disk (old laptop crashes if 100%)

text: I want to backup 1 terabyte of data to an external disk. I am using this command: `tar cf /media/MYDISK/backup.tar mydata` PROBLEM: My poor laptop freezes and crashes whenever I use 100% CPU or 100% disk _(if you want to react about this pleasewrite here)_. So I want to stay at around 50% CPU and 50% disk max. My question: How to throttle CPU and disk with the `tar` command? Rsync has a --bwlimit option, but I want an archive because 1) there are many small files 2) I prefer to manage a single file rather a tree. That's why I use `tar`.


title: Assigning mouse keys to keyboard

text: Is it possible to assign mouse keys (left click 1, middle click 2, right click 3, etc) to keyboard keys by modifying a file in `/etc/X11/xorg.conf.d`? If so, how can I do that?


title: Cron job - permission denied creating a file

text: I have a cron job:               #!/bin/bash      fn=db.backup.$(date +%m-%d-%y).sql     mysqldump -uMyUsr -pMyPass --add-drop-table dbName> $fn     find ./ -name '*.Z' -type f -mtime +7 -exec rm -f {} \;      I get an error:               /backup.sh: line 3: db.backup.10-24-12.sql: Permission denied     db.backup.10-24-12.sql: No such file or directory     find: ./conf: Permission denied     find: ./pd: Permission denied      It looks like whatever process is running cron doesn't have permissions to create a file or to run 'find' command.


title: how to find offset of one binary file inside another?

text: I have two binary files.   One of few hundreds kilos and other of few gigabytes.   I want to know whether the whole, smaller, file is contained within the larger one and if so then what is the offset from the start of the larger file.   I am interested only in exact matches i.e. whether the whole file is contained by the another.   Both files are binary.   Is there any existing tool/one-liner that does that ?


title: monitor files (ala tail -f) in an entire directory (even new ones)

text: I normally watch many logs in a directory doing `tail -f directory/*`. The problem is that a new log is created after that, it will not show in the screen (because `*` was expanded already). Is there a way to monitor every file in a directory, even those that are created after the process has started?


title: Host home.lan.home.lan not found: 4(NOTIMP) error in bind9 (DNS)

text: I have been following this guide to set up a DNS server using `bind9` on Ubuntu 12.04, but after all the configuration, when I run `host -l home.lan` I get the following error:               ; Transfer failed.     Host home.lan.home.lan not found: 4(NOTIMP)     ; Transfer failed.      The name of my Ubuntu Server is `dnsserver` and has IP address `192.168.0.254`, and I have another 3 hosts on the network (`webserver` with IP address `192.168.0.12`, `owncloud` with IP address `192.168.0.14` and the router, `192.168.0.1`). Following are all my configuration files. ## Config files `/etc/bind/named.conf.options`               options {             directory "/var/cache/bind";                  // If there is a firewall between you and nameservers you want             // to talk to, you may need to fix the firewall to allow multiple             // ports to talk.  See http://www.kb.cert.org/vuls/id/800113                  // If your ISP provided one or more IP addresses for stable             // nameservers, you probably want to use them as forwarders.             // Uncomment the following block, and insert the addresses replacing             // the all-0's placeholder.                  forwarders {               8.8.8.8;               4.4.4.4;             };                  //========================================================================             // If BIND logs error messages about the root key being expired,             // you will need to update your keys.  See https://www.isc.org/bind-keys             //========================================================================             dnssec-validation auto;                  auth-nxdomain no;    # conform to RFC1035             listen-on-v6 { any; };     };      `/etc/network/interfaces`               # This file describes the network interfaces available on your system     # and how to activate them. For more information, see interfaces(5).          # The loopback network interface     auto lo     iface lo inet loopback          # The primary network interface     auto eth0     iface eth0 inet static     address 192.168.0.254     netmask 255.255.255.0     gateway 192.168.0.1     network 192.168.0.0     broadcast 192.168.0.255     dns-nameservers 127.0.0.1     dns-search home.lan     dns-domain home.lan      `/etc/bind/named.conf.local`               //     // Do any local configuration here     //          // Consider adding the 1918 zones here, if they are not used in your     // organization     //include "/etc/bind/zones.rfc1918";          zone "home.lan" IN {         type master;         file "/etc/bind/zones/home.lan.db";     };          zone "0.168.192.in-addr.arpa" {         type master;         file "/etc/bind/zones/rev.0.168.192.in-addr.arpa";     };      `/etc/bind/zones/home.lan.db`               ; Use semicolons to add comments.     ; Host-to-IP Address DNS Pointers for home.lan     ; Note: The extra “.” at the end of the domain names are important.          ; The following parameters set when DNS records will expire, etc.     ; Importantly, the serial number must always be iterated upward to prevent     ; undesirable consequences. A good format to use is YYYYMMDDII where     ; the II index is in case you make more that one change in the same day.     $ORIGIN .     $TTL 86400      ; 1 day     home.lan. IN SOA dnsserver.home.lan. hostmaster.home.lan. (         2008080901 ; serial         8H ; refresh         4H ; retry         4W ; expire         1D ; minimum     )          ; NS indicates that dnsserver is the name server on home.lan     ; MX indicates that dnsserver is (also) the mail server on home.lan     home.lan. IN NS dnsserver.home.lan.     home.lan. IN MX 10 dnsserver.home.lan.          $ORIGIN home.lan.          ; Set the address for localhost.home.lan     localhost    IN A 127.0.0.1          ; Set the hostnames in alphabetical order     dnsserver    IN A 192.168.0.254     owncloud     IN A 192.168.0.14     router       IN A 192.168.0.1     webserver    IN A 192.168.0.12      `/etc/bind/zones/rev.0.168.192.in-addr.arpa`               ; IP Address-to-Host DNS Pointers for the 192.168.0 subnet     @ IN SOA dnsserver.home.lan. hostmaster.home.lan. (         2008080901 ; serial         8H ; refresh         4H ; retry         4W ; expire         1D ; minimum     )     ; define the authoritative name server                IN NS dnsserver.home.lan.     ; our hosts, in numeric order     1         IN PTR router.home.lan.     12        IN PTR webserver.home.lan.     14        IN PTR owncloud.home.lan.     254       IN PTR dnsserver.home.lan.      Can you spot my mistake? **Update** Reverse DNS seems not to be working either. The output of `named-checkzone home.lan /etc/bind/zones/rev.0.168.192.in-addr.arpa` is the following:               /etc/bind/zones/rev.0.168.192.in-addr.arpa:2: SOA record not at top of zone (0.168.192.in-addr.arpa.home.lan)     /etc/bind/zones/rev.0.168.192.in-addr.arpa:10: no TTL specified; zone rejected     /etc/bind/zones/rev.0.168.192.in-addr.arpa:12: no TTL specified; zone rejected     /etc/bind/zones/rev.0.168.192.in-addr.arpa:13: no TTL specified; zone rejected     /etc/bind/zones/rev.0.168.192.in-addr.arpa:14: no TTL specified; zone rejected     /etc/bind/zones/rev.0.168.192.in-addr.arpa:15: no TTL specified; zone rejected     zone home.lan/IN: loading from master file /etc/bind/zones/rev.0.168.192.in-addr.arpa failed: not at top of zone     zone home.lan/IN: not loaded due to errors.`


title: Installing Maya 2014 : "./setup" returns "/Setup is a directory" instead of running installer?

text: I hope this is posted on the right site, if not I apologize. Im currently installing (or trying to install) my Autodesk 3d Packages on my new LinuxMint installation. Im brand-new to linux, but so far I always managed to get everything done without greater distractions. Now however, I fear my limited knowledge has found its limits. Im following the Guide for installing Autodesk Maya provided by Autodesk (as found here), but I'm stuck at step 3:   * Type ./setup and press Enter.  Which returned this:                   gh057@JARVIS ~/Downloads/Maya_2014 $ su -         Password:          JARVIS ~ # ./setup         -su: ./setup: No such file or directory         JARVIS ~ # cd /home/gh057/Downloads/Maya_2014         JARVIS Maya_2014 # ./setup         -su: ./setup: No such file or directory         JARVIS Maya_2014 # ./Setup         -su: ./Setup: Is a directory         JARVIS Maya_2014 #       at which point I go: "You don't say?!" and cluelessly stare at the screen. Im confident this is just the result of my limited knowledge of the system, so I would appreciate any help you can throw my way :)


title: Tail -f the most recent log file

text: In a few spots I got this to work               ls -rt /path/to/log/file/ | tail -1 | xargs tail -f      But I can't figure out why it won't always work   (This is quick fix until I get the log rolling fixed here)


title: GRUB no longer can boot the machine (different error messages)

text: When I boot from GRUB, I get various error messages from GRUB, apparently at random : "invalid arch independent ELF magic" or "incompatible license" or "file not found". I can boot from the rescue DVD and then the main disk, /dev/sda, seems OK. I can fsck it (no error), I can mount, it can even use it as root (from the rescue DVD, boot with root=/dev/sda1). But the machine cannot reboot without the DVD rescue. What I tried (without any success):   * `grub-install /dev/sda` No error but the problem stays the same   * Boot repair no error message but not better aftwerwards. You can check its report   * removing the kernel and reinstalling it   * removing GRUB, moving /boot/grub and reinstalling it Debian stable "wheezy". I am not aware of any external recent event (no upgrade, no physical problem on the hardware). The PC has a few years, no UEFI, a regular Dell BIOS. Versions of grub:               % dpkg -l 'grub*'     Desired=Unknown/Install/Remove/Purge/Hold     | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend     |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)     ||/ Name                   Version          Architecture     Description     +++-======================-================-================-==================================================     un  grub                   <none>                            (no description available)     ii  grub-common            1.99-27+deb7u1   i386             GRand Unified Bootloader (common files)     un  grub-coreboot          <none>                            (no description available)     un  grub-doc               <none>                            (no description available)     un  grub-efi               <none>                            (no description available)     un  grub-efi-amd64         <none>                            (no description available)     un  grub-efi-ia32          <none>                            (no description available)     un  grub-emu               <none>                            (no description available)     un  grub-ieee1275          <none>                            (no description available)     un  grub-legacy            <none>                            (no description available)     un  grub-legacy-doc        <none>                            (no description available)     un  grub-linuxbios         <none>                            (no description available)     ii  grub-pc                1.99-27+deb7u1   i386             GRand Unified Bootloader, version 2 (PC/BIOS versi     ii  grub-pc-bin            1.99-27+deb7u1   i386             GRand Unified Bootloader, version 2 (PC/BIOS binar     un  grub-yeeloong          <none>                            (no description available)     un  grub2                  <none>                            (no description available)     ii  grub2-common           1.99-27+deb7u1   i386             GRand Unified Bootloader (common files for version


title: About ncurses header file

text: I' running Fedora 15 (32-bit). But I can`t compile and run an ncurses program. Also, colours are not working in the terminal. What can I do to fix this?


title: How can I get an Ubuntu 12.04 box to do an aptitude update; aptitude upgrade?

text: I did an `aptitude apt-get` and then `aptitude upgrade`, on an Ubuntu 12.04 box, and got:               root@li393-189:~# aptitude upgrade     Resolving dependencies...                     The following packages will be upgraded:       accountsservice apache2 apache2-mpm-prefork apache2-utils apache2.2-bin        apache2.2-common apparmor apport apt-transport-https apt-utils bind9-host        dmsetup dnsutils icedtea-6-jre-cacao icedtea-6-jre-jamvm initramfs-tools        initramfs-tools-bin iptables isc-dhcp-client isc-dhcp-common        postfix-doc python-apport python-problem-report rsyslog sudo       ubuntu-minimal udev upstart     The following partially installed packages will be configured:       apt     The following packages are RECOMMENDED but will NOT be installed:       firefox-locale-en libssl-doc     76 packages upgraded, 0 newly installed, 0 to remove and 9 not upgraded.     Need to get 4,168 kB/60.3 MB of archives. After unpacking 1,225 kB will be used.     Do you want to continue? [Y/n/?] Y     Get: 1 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main libdevmapper1.02.1 i386 2:1.02.48-4ubuntu7.3 [67.4 kB]     Get: 2 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main dmsetup i386 2:1.02.48-4ubuntu7.3 [36.9 kB]     Get: 3 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main libxml2 i386 2.7.8.dfsg-5.1ubuntu4.4 [662 kB]     Get: 4 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main rsyslog i386 5.8.6-1ubuntu8.1 [431 kB]     Get: 5 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main bind9-host i386 1:9.8.1.dfsg.P1-4ubuntu0.6 [54.0 kB]     Get: 6 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main dnsutils i386 1:9.8.1.dfsg.P1-4ubuntu0.6 [143 kB]     Get: 7 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main libisc83 i386 1:9.8.1.dfsg.P1-4ubuntu0.6 [161 kB]     Get: 8 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main libdns81 i386 1:9.8.1.dfsg.P1-4ubuntu0.6 [705 kB]     Get: 9 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main libisccc80 i386 1:9.8.1.dfsg.P1-4ubuntu0.6 [18.0 kB]     Get: 10 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main libisccfg82 i386 1:9.8.1.dfsg.P1-4ubuntu0.6 [40.3 kB]     Get: 11 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main liblwres80 i386 1:9.8.1.dfsg.P1-4ubuntu0.6 [38.8 kB]     Get: 12 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main libbind9-80 i386 1:9.8.1.dfsg.P1-4ubuntu0.6 [24.4 kB]     Get: 13 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main libruby1.8 i386 1.8.7.352-2ubuntu1.2 [1,787 kB]     Fetched 4,168 kB in 0s (11.4 MB/s)      Extracting templates from packages: 100%     Preconfiguring packages ...     postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_create_maildirsize=yes     postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_maildir_extended=yes     postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_create_maildirsize=yes     postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_maildir_extended=yes     postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_create_maildirsize=yes     postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_maildir_extended=yes     Setting up apt (0.8.16~exp12ubuntu10.10) ...     gpg: error while loading shared librariesgpg: error while loading shared libraries: libgdbm.so.2: cannot open shared object file: No such file or directory     : libgdbm.so.2: cannot open shared object file: No such file or directory     dpkg: error processing apt (--configure):      subprocess installed post-installation script returned error exit status 127     No apport report written because MaxReports is reached already                                                                   Errors were encountered while processing:      apt     E: Sub-process /usr/bin/dpkg returned an error code (1)     A package failed to install.  Trying to recover:     Setting up apt (0.8.16~exp12ubuntu10.10) ...     gpg: error while loading shared libraries: libgdbm.so.2: cannot open shared object file: No such file or directory     gpg: error while loading shared libraries: libgdbm.so.2: cannot open shared object file: No such file or directory     dpkg: error processing apt (--configure):      subprocess installed post-installation script returned error exit status 127     Errors were encountered while processing:      apt       How can I address this error and both upgrade to the latest Ubuntu 12.04 release, and then upgrade the distribution to the latest 12.10 release?


title: ubuntu: sudo find / -type d -exec chmod -Rf a-wr {} \; the user can't login

text: I used ubuntu 12.04 (32bit).Today,I mistakes a command is executed: # WARNING **DO NOT EXECUTE THIS COMMAND:**               sudo find / -type d -exec chmod -Rf a-wr {} \;      I can't login system;The System is only one user,disable the root.Who knows how to solve?


title: wine in Xmonad is not tiling

text: I'm using `Wine` application in `Xmonad`. But it is not tiling like other applications. Can this be configured, that `Wine` will tile like other applications?


title: Install Arch Linux without overriding MBR

text: In my PC I have Linux mint XFCE & Windows XP professional. I intend to replace Windows XP with Arch-Linux. But I don't want to override Linux Mint MBR, I want to boot into Arch-Linux using `sudo update-grub` from Linux mint.


title: Can't install Linux Mint Cinnamon nor Ubuntu while switchable graphics turned on

text: I've got Lenovo G500 intel i5 with switchable graphics (Intel and AMD Radeon HD 8579M). When I try to install Linux Mint Petra Cinnamon, when switchable graphics are on by the bios, live CD can't start Xserver and crashes (blue screen. "want to see log files?" etc.). I have tried to install Ubuntu (Saucy Salamander) too and got only black screen (can't get to command line interface). I have managed to install Mint Cinnamon with turning off switchable graphics. After that I tried to install a working desktop while SG on. Ubuntu crashed, KDE Plasma works only in fallback mode. While switchable graphics are turned on, only Xubuntu works. On Xubuntu I had tried to install `fglrx` via distribution packages, installers and `apt-get`, but my every attempt has been failed. There is no buildpkg for AMD driver Ubuntu/Saucy               amd-catalyst-13.4-linux-x86.x86_64.run      nor in               amd-catalyst-13.11-beta_V9.4-linux-x86.x86_64.run      I tried to add repository, but it doesn't seem to work:               sudo add-apt-repository ppa:xorg-edgers/ppa     sudo apt-get update     sudo apt-get install fglrx-installer          E: could not locate the package      Right now I uninstalled every bit of `fglrx` and turned off SG. I'm now using Cinnamon.


title: How to show console color in Emacs shell

text: When I run a command by `smart-compile`, I get string like this.               [32mYour bundle is complete![0m     [32mIt was installed into ./vendor/bundle[0m      I think `[32m` and `[0m` represent color in console. Is three way to treat these strings as a color, same as console?


title: How can I run gdb in one machine and run kgdb kernel in another machine?

text: I want to run two machine:   1. debugged machine: compiled kernel with kgdb option.   2. debugger machine: for running gdb How can I debug machine 1 from machine 2?


title: How to mount an NTFS drive as utf8 over NFS

text: ### Question How to mount a nfs share (NTFS formatted fileystem) as `utf8` in `CentOS 6.5`? ### What I tried               mount -o iocharset=utf8       mount -o nfs=utf8       mount -o utf8=1     mount -o utf8      ### Problem: When I create a file on my unix drive containing umlauts(äöü) and export that file to my NFS share I see _broken_ characters in Windows (e.g. `A¼`) The broken characters are only in the filename - not in the content. Is it possible that the locale settings are wrong?   `LC_* = "en_US.UTF-8"`   Tried also `de_DE.UTF-8` When I create a file on windows in the share with umlauts, it is displayed as `?` in unix. I guess there is a problem with the locale settings. ### Default LC Settings               LANG=en_US.UTF-8     LC_CTYPE="en_US.UTF-8"     LC_NUMERIC="en_US.UTF-8"     LC_TIME="en_US.UTF-8"     LC_COLLATE="en_US.UTF-8"     LC_MONETARY="en_US.UTF-8"     LC_MESSAGES="en_US.UTF-8"     LC_PAPER="en_US.UTF-8"     LC_NAME="en_US.UTF-8"     LC_ADDRESS="en_US.UTF-8"     LC_TELEPHONE="en_US.UTF-8"     LC_MEASUREMENT="en_US.UTF-8"     LC_IDENTIFICATION="en_US.UTF-8"     LC_ALL=      ### locale -a | grep de_DE               de_DE     de_DE@euro     de_DE.iso88591     de_DE.iso885915@euro     de_DE.utf8      Tried all - no improvement.


title: Why, still in modern GUI-based Linux distros, is it common to use the command line?

text: Is the command line a popular choice thing, or do I have something wrong here? In modern Linux there's dozens of fresh, robust, 3-D rendered GUIs, graphical- based APIs, and desktop interfaces that could easily implement the commands entered in to the command interpretor text-based UI on the GUI through a more robust featured program that encompasses GUI elements better. What I am trying to say is, why is the command-line still so popularly used in 2013? I mean I can agree that before both the memory in computers was so minimal that a fancy GUI would be starving the main memory, but nowadays memory DOES come cheap, GUIs are 3-D, we have mobile power machines getting better every day so to speak, so why are we still punching commands in to interpretor parsing terminal UI emulations? Why isn't there a more robust and graphical way to implement the commands, only through a more modern GUI? For example, how about "ls" or "list" as a button that will generate a table view of data, or "umount" implemented in a button that generates a table view of current mount points? Overall, why doesn't a more modern implementation of the command interpretor come in to play, featuring the exact same control and capabilities just in a more convenient decor? PS: I should add this here as well ... I'm not saying **every** command should be implemented with a GUI-based program with fancy widgets and such. I'm just saying that I figured we'd have a makeover of the command-line, or maybe that some ideas can be better expressed, optimized, managed, or cycled through easier with visual aspects than just "words". No means to start an argument, but to find out why nothing has diverted this way over so many years and advancements of graphics in operating systems/software.


title: Opensuse 11.4 very slow on 8 GB RAM i5 processor

text: **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.


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

text: 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


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

text: 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?


title: Show established samba mounts

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


title: How can I run byobu from xterm at starting?

text: 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)


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

text: 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.


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

text: 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.


title: Checksum on Network drive is really slow

text: 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?


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

text: 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 * * *


title: What is the difference between env and printenv?

text: 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?


title: preventing the screen from being cleared when exiting an ssh session

text: 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.


title: How to trace system calls being invoked after typing command?

text: 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?


title: Reporting cpu hogs

text: 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.


title: How to record every transaction using Bash

text: 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.


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

text: 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?


title: Route OpenVPN clients to another different OpenVPN server

text: 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


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

text: 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?


title: What is the meaning of Scratchbox2?

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


title: USB hard drive won't remount after power outage

text: 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


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

text: 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 :-)


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

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


title: Using vim to view the contents of a directory file

text: 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?


title: Why doesnt ctrl+d work with this?

text: 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?


title: chroot fails with --userspec when chroot is i686

text: 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.


title: Do I need to format a CF before installing Linux?

text: 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?


title: Using gdm to manage xdmcp authentication over VNC

text: 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.


title: Linux freezing randomly

text: 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


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

text: 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.


title: Adding null bytes to a file using dd

text: 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`?


title: LIRC does not start after reboot

text: 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 ?


title: Difference between 'cd' and 'cd ~'

text: 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?


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

text: 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.


title: Need to Adjust Screen Edge of an HDMI-connected TV

text: 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.


title: Setting running process affinity with taskset fails

text: 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?


title: How to keep dotfiles system-agnostic?

text: 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`.


title: Formating Mail Body data into html table format

text: 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.


title: Is my approach to performance testing in Linux environment correct?

text: 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.


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

text: 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.


title: Schemes for linux tty and xterm

text: 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


title: umask changes to 0002 after cd

text: 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.


title: Split command output by linebreak?

text: 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!


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

text: 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?


title: How to list similar lines?

text: 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?


title: Sort by regular expressions

text: 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.


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

text: 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?


title: debian wireless networking through terminal

text: 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


title: amarok displays wrong time for ogg files

text: 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?


title: Rewrite a Vim function to a one-line map

text: 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>


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

text: 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


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

text: 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.


title: rc.local hang on bootup

text: 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.


title: How do I connect a 3G dongle using systemd?

text: 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.


title: Generate new name for moved file to prevent overwriting?

text: 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.


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

text: 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?


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

text: 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?


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

text: 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?


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

text: 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