title: base64 encoded e-mails and compression

text: I sent an e-mail which included almost 2500 characters of text and one attached 60KiB PNG file. This text included number 185 eight times. However, after the e-mail was encoded to base64 and sent, I'm able to find only three "MTg1"("MTg1" is "185" in base64 encoding) strings from e-mail source. How to explain this? According to e-mail header, content type is "text/plain; charset=UTF-8" and content transfer encoding is "base64".


title: econf fails when installing pth

text: I'm just starting out with Gentoo and I'm getting a bit stuck installing programs with Portage. It's wonderful and automatic except when it isn't. Many of the programs I try to install (git, gedit, chrome, nautilus) eventually depend on pth, whatever that is. But it fails with an econf error:                  ERROR: dev-libs/pth-2.0.7-r3::gentoo failed (configure phase):          econf failed             Call stack:                 ebuild.sh, line   93:  Called src_configure               environment, line 2881:  Called econf '--disable-static'          phase-helpers.sh, line  577:  Called die        The specific snippet of code:                     die "econf failed"             If you need support, post the output of `emerge --info '=dev-libs/pth-2.0.7-r3::gentoo'`,        the complete build log and the output of `emerge -pqv '=dev-libs/pth-2.0.7-r3::gentoo'`.        The complete build log is located at '/var/tmp/portage/dev-libs/pth-2.0.7-r3/temp/build.log'.        The ebuild environment file is located at '/var/tmp/portage/dev-libs/pth-2.0.7-r3/temp/environment'.        Working directory: '/var/tmp/portage/dev-libs/pth-2.0.7-r3/work/pth-2.0.7'      Here is the ebuild line               [ebuild  N    ] dev-libs/pth-2.0.7-r3  USE="-debug -static-libs"      and the emerge info I put on pastebin because of its length. Buildlog:                * Package:    dev-libs/pth-2.0.7-r3      * Repository: gentoo      * Maintainer: crypto@gentoo.org      * USE:        abi_x86_64 amd64 elibc_glibc kernel_linux multilib userland_GNU      * FEATURES:   preserve-libs sandbox userpriv usersandbox     >>> Unpacking source...     >>> Unpacking pth-2.0.7.tar.gz to /var/tmp/portage/dev-libs/pth-2.0.7-r3/work     >>> Source unpacked in /var/tmp/portage/dev-libs/pth-2.0.7-r3/work     >>> Preparing source in /var/tmp/portage/dev-libs/pth-2.0.7-r3/work/pth-2.0.7 ...      * Applying pth-2.0.5-parallelfix.patch ...                              [ ok ]      * Applying pth-2.0.6-ldflags.patch ...                                  [ ok ]      * Applying pth-2.0.6-sigstack.patch ...                                 [ ok ]      * Applying pth-2.0.7-parallel-install.patch ...                         [ ok ]      * Applying pth-2.0.7-ia64.patch ...                                     [ ok ]      * Applying pth-2.0.7-kernel-3.patch ...                                 [ ok ]      * Replacing obsolete head/tail with POSIX compliant ones      *  - fixed aclocal.m4      *  - fixed configure      * Running elibtoolize in: pth-2.0.7/      *   Applying portage/1.5.10 patch ...      *   Applying max_cmd_len/1.5.20 patch ...      *   Applying sed/1.5.6 patch ...      *   Applying as-needed/1.5 patch ...      *   Applying target-nm/2.4.2 patch ...     >>> Source prepared.     >>> Configuring source in /var/tmp/portage/dev-libs/pth-2.0.7-r3/work/pth-2.0.7 ...      * econf: updating pth-2.0.7/config.sub with /usr/share/gnuconfig/config.sub      * econf: updating pth-2.0.7/config.guess with /usr/share/gnuconfig/config.guess     ./configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --libdir=/usr/lib64 --disable-static     ./configure: line 286: /tmp/autoconf.25970: Permission denied     ./configure: line 297: /tmp/autoconf.25970: Permission denied     ./configure: line 310: /tmp/autoconf.25970: No such file or directory      * ERROR: dev-libs/pth-2.0.7-r3::gentoo failed (configure phase):      *   econf failed      *       * Call stack:      *          ebuild.sh, line   93:  Called src_configure      *        environment, line 2887:  Called econf '--disable-static'      *   phase-helpers.sh, line  577:  Called die      * The specific snippet of code:      *              die "econf failed"      *       * If you need support, post the output of `emerge --info '=dev-libs/pth-2.0.7-r3::gentoo'`,      * the complete build log and the output of `emerge -pqv '=dev-libs/pth-2.0.7-r3::gentoo'`.      * The complete build log is located at '/var/tmp/portage/dev-libs/pth-2.0.7-r3/temp/build.log'.      * The ebuild environment file is located at '/var/tmp/portage/dev-libs/pth-2.0.7-r3/temp/environment'.      * Working directory: '/var/tmp/portage/dev-libs/pth-2.0.7-r3/work/pth-2.0.7'      * S: '/var/tmp/portage/dev-libs/pth-2.0.7-r3/work/pth-2.0.7'      What is going wrong here, and how do fix it?


title: Linux Mint (XFCE) on Acer Veriton - using one monitor, Mint thinks I have two?

text: I've installed a fresh version of Linux Mint 16 (XFCE) on an Acer Veriton desktop. It seems to work correctly, however, I have a "display within a display". I.e. I have a full screen display, with the task bar at the bottom, and then an inner display at ~1024 pixels. When I go to the Display properties, Mint tells me that I have two displays - a "Laptop" display (1024x768) and a "Plain Tree Systems inc. 17in" (1280x1024). When I highlight either of these displays, a black label indicating "Laptop" appears on the inner display and a label indicating "Plain Tree" etc indicates the outer (full screen) display. I only have the 17" monitor. It's not a laptop, nor do I have a second screen. It's just a single VGA cable from the Veriton to my monitor. When I untick "Use this output" on the laptop screen, it shows the "inner" display only and loses task bar etc. When I untick the "Use this output" on the Plain Tree screen, random bits happen - the monitor says "no input", then sometimes flickers back on and works as I want it to... but sometimes it just seems to crash completely and I have to restart the machine. At one point I even had to reinstall Linux because I then couldn't boot. Sounds like there might be a problem with the graphics card I guess, but it's onboard. I'm no expert with Linux either I'm afraid.


title: Problems uploading a file via WebDAV?

text:
I've configured on my Linux server (SLES11) with IHS Webserver with WebDAV enabled. A file upload via `curl` is successful using a URL like this:               $ curl --insecure --upload-file testfile.txt \         https://<URL>.com/upload/hro/ -u hro:$HRO_WEBDAV_PASSWORD      Resulting in this output:               <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">          <title>201 Created</title>
Created

Resource /upload/hro/testfile.txt has been created.

     <address>IBM_HTTP_Server Server at <URL> Port 443</address>      If I try this with "localhost" instead of the URL it doesn't worked. I get a SSL Error:               $ curl --insecure --upload-file testfile.txt \         https://localhost/upload/hro/ -u hro:$HRO_WEBDAV_PASSWORD      Resulting in this:               curl: (51) SSL peer certificate or SSH remote key was not OK      This is coherent because the certificate is signed for the url not for "localhost". But I have used the option `--insecure` and I've intended for this through the use of this option to ignore this failure. ### Questions   * What should I do to use `localhost` for `curl`?    * Is there no option for this script to use the localhost URL?


title: Why wouldn't a symlink to a symlink work?

text: I've run into a weird issue when installing SWI-Prolog using homebrew on my OSX 10.9 box. I'm trying to debug it to figure out whose bug it is (SWI- Prolog's, homebrew's, or OSX's), so I can report it appropriately and get it fixed. The `swipl` in my path is `/usr/local/bin/swipl` which symlinks to `/usr/local/Cellar/swi-prolog/6.2.3/bin/swipl` which symlinks to `/usr/local/Cellar/swi- prolog/6.2.3/lib/swipl-6.2.3/bin/x86_64-darwin13.0.0/swipl`.               % which swipl     /usr/local/bin/swipl     % find /usr/local -name swipl -exec ls -l {} \;     lrwxr-xr-x  1 rampion  admin  36 Oct 23 20:54 /usr/local/bin/swipl -> ../Cellar/swi-prolog/6.2.3/bin/swipl     lrwxr-xr-x  1 rampion  admin  48 Oct 23 20:54 /usr/local/Cellar/swi-prolog/6.2.3/bin/swipl -> ../lib/swipl-6.2.3/bin/x86_64-darwin13.0.0/swipl     -r-xr-xr-x  1 rampion  admin  8760 Oct 23 20:54 /usr/local/Cellar/swi-prolog/6.2.3/lib/swipl-6.2.3/bin/x86_64-darwin13.0.0/swipl      I can run the actual executable in `/usr/local/Cellar/swi- prolog/6.2.3/lib/swipl-6.2.3/bin/x86_64-darwin13.0.0/swipl`:               % /usr/local/Cellar/swi-prolog/6.2.3/lib/swipl-6.2.3/bin/x86_64-darwin13.0.0/swipl     Welcome to SWI-Prolog (Multi-threaded, 64 bits, Version 6.2.3)     ...      And I can use the symlink at `/usr/local/Cellar/swi-prolog/6.2.3/bin/swipl`:               % /usr/local/Cellar/swi-prolog/6.2.3/bin/swipl     Welcome to SWI-Prolog (Multi-threaded, 64 bits, Version 6.2.3)     ...      But when I try to use the symlink at `/usr/local/bin/swipl`, which just symlinks to the other symlink, I get an error:               % /usr/local/bin/swipl     Abort trap: 6     % echo $?     134      I can also make my own symlinks to `/usr/local/Cellar/swi- prolog/6.2.3/lib/swipl-6.2.3/bin/x86_64-darwin13.0.0/swipl`, and they work:               % ln -s /usr/local/Cellar/swi-prolog/6.2.3/lib/swipl-6.2.3/bin/x86_64-darwin13.0.0/swipl swipl.0     % ./swipl.0      Welcome to SWI-Prolog (Multi-threaded, 64 bits, Version 6.2.3)     ...      And my own symlinks to `/usr/local/Cellar/swi-prolog/6.2.3/bin/swipl`, and they fail:               % ln -s /usr/local/Cellar/swi-prolog/6.2.3/bin/swipl swipl.1     % ./swipl.1     Abort trap: 6     % echo $?     134      So I have no idea what's going wrong. Why would a symlink to a file work, but a symlink to a symlink to a file fail?


title: Internal microphone not working.. again (Fedora 20, KDE, HP 8460p)

text: Unfortunately I have yet another "adventure" with my internal microphone. Everything is un-muted in alsamixer, as well as in pavucontrol. It is not the first time it stopped working, but now - for good. System: HP 8460p (Webcam and micro are on one wire and cam is working, so I don't think it is hardware problem. I've tried to use it on Ubuntu (with Unity) and Lubuntu to check if this is not kmixer's or Pulseaudio's fault. No luck so far, but when it happened previously I couldn't get it to work there also. alsa-info: alsa-info


title: Custom crontab does not work (FreeBSD)

text: I created file crontab.custom with:               */1 * * * * /home/username/data/www/run.sh        And `run.sh` contains:               php script.php        After this I run this command `crontab crontab.custom`. Now `crontab -l` returns my task. I restarted cron with `/etc/rc.d/cron restart`, but `script.php` is not called. What should I do to make it work?


title: Find package that uses a specific shell command

text: I believe I have installed multiple packages that use the same shell command to run. I know one of them, but I only vaguely recall installing the other and thus cannot uninstall it. I believe they're causing issues with each other, so I need to uninstall the one that I can't remember. Is there a simple way to find which package is invoked using a certain shell command? This is on RHEL 6.5.


title: Iptables to redirect DNS lookup IP and Port

text: I have discovered that my ISP (verizon) is intercepting all DNS traffic on port 53. Using iptables, I want to redirect all DNS lookup traffic to a specific IP and Port (5353). Any attempt for my computer to connect to another computer on port 53 should be redirected to 23.226.230.72:5353. To verify the DNS server and port I'm trying to use, I have run this command.               ~$ dig +short serverfault.com @23.226.230.72 -p5353     198.252.206.16      This is the iptables rule I'm trying to use.               iptables -t nat -A OUTPUT -p udp -m udp --dport 53 -j DNAT --to-destination 23.226.230.72:5353      After adding that rule, all DNS lookups are not found. Website pings return `unknown host`. Webpages say 'Server Not Found'.               ~$ mtr serverfault.com     Failed to resolve host: Name or service not known      **I want my DNS to lookups to be pulled from 23.226.230.72:5353. How can I make the iptables rule work?** **EDIT** Demonstration of DNS (port 53) interception by my ISP. Trace output from dig to 23.226.230.72 via port 5353, and then port 53.               ~$ dig +trace stackexchange.com @23.226.230.72 -p5353          ; <<>> DiG 9.9.5-3-Ubuntu <<>> +trace stackexchange.com @23.226.230.72 -p5353     ;; global options: +cmd     .           86395   IN  NS  ns7.opennic.glue.     .           86395   IN  NS  ns4.opennic.glue.     .           86395   IN  NS  ns3.opennic.glue.     .           86395   IN  NS  ns5.opennic.glue.     .           86395   IN  NS  ns2.opennic.glue.     .           86395   IN  NS  ns10.opennic.glue.     .           86395   IN  NS  ns1.opennic.glue.     .           86395   IN  NS  ns6.opennic.glue.     .           86395   IN  NS  ns8.opennic.glue.     dig: couldn't get address for 'ns8.opennic.glue': no more               ~$ dig +trace stackexchange.com @23.226.230.72 -p53          ; <<>> DiG 9.9.5-3-Ubuntu <<>> +trace stackexchange.com @23.226.230.72 -p53     ;; global options: +cmd     .           7440    IN  NS  f.root-servers.net.     .           7440    IN  NS  d.root-servers.net.     .           7440    IN  NS  j.root-servers.net.     .           7440    IN  NS  i.root-servers.net.     .           7440    IN  NS  g.root-servers.net.     .           7440    IN  NS  k.root-servers.net.     .           7440    IN  NS  a.root-servers.net.     .           7440    IN  NS  h.root-servers.net.     .           7440    IN  NS  e.root-servers.net.     .           7440    IN  NS  m.root-servers.net.     .           7440    IN  NS  c.root-servers.net.     .           7440    IN  NS  b.root-servers.net.     .           7440    IN  NS  l.root-servers.net.     ;; Received 239 bytes from 23.226.230.72#53(23.226.230.72) in 2948 ms          stackexchange.com.  215 IN  A   198.252.206.16     ;; Received 62 bytes from 192.228.79.201#53(b.root-servers.net) in 116 ms      My current iptables. `iptables-save`               ~# iptables-save     # Generated by iptables-save v1.4.21 on Tue Jul 15 23:06:52 2014     *mangle     :PREROUTING ACCEPT [79950528:41742899703]     :INPUT ACCEPT [78748282:41360159554]     :FORWARD ACCEPT [13:5427]     :OUTPUT ACCEPT [85455483:57472640071]     :POSTROUTING ACCEPT [85480442:57475512901]     -A POSTROUTING -o lxcbr0 -p udp -m udp --dport 68 -j CHECKSUM --checksum-fill     COMMIT     # Completed on Tue Jul 15 23:06:52 2014     # Generated by iptables-save v1.4.21 on Tue Jul 15 23:06:52 2014     *nat     :PREROUTING ACCEPT [71:18713]     :INPUT ACCEPT [7:474]     :OUTPUT ACCEPT [109:7855]     :POSTROUTING ACCEPT [109:7855]     :DOCKER - [0:0]     -A PREROUTING -m addrtype --dst-type LOCAL -j DOCKER     -A OUTPUT ! -d 127.0.0.0/8 -m addrtype --dst-type LOCAL -j DOCKER     -A POSTROUTING -s 172.17.0.0/16 ! -d 172.17.0.0/16 -j MASQUERADE     -A POSTROUTING -s 10.0.3.0/24 ! -d 10.0.3.0/24 -j MASQUERADE     COMMIT     # Completed on Tue Jul 15 23:06:52 2014     # Generated by iptables-save v1.4.21 on Tue Jul 15 23:06:52 2014     *filter     :INPUT ACCEPT [78748139:41360144354]     :FORWARD ACCEPT [13:5427]     :OUTPUT ACCEPT [85454926:57472600172]     :fail2ban-ssh - [0:0]     :fail2ban-vsftpd - [0:0]     -A INPUT -p tcp -m multiport --dports 21,20,990,989 -j fail2ban-vsftpd     -A INPUT -p tcp -m multiport --dports 22,6622 -j fail2ban-ssh     -A INPUT -i lxcbr0 -p tcp -m tcp --dport 53 -j ACCEPT     -A INPUT -i lxcbr0 -p udp -m udp --dport 53 -j ACCEPT     -A INPUT -i lxcbr0 -p tcp -m tcp --dport 67 -j ACCEPT     -A INPUT -i lxcbr0 -p udp -m udp --dport 67 -j ACCEPT     -A FORWARD -o docker0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT     -A FORWARD -i docker0 ! -o docker0 -j ACCEPT     -A FORWARD -i docker0 -o docker0 -j ACCEPT     -A FORWARD -o lxcbr0 -j ACCEPT     -A FORWARD -i lxcbr0 -j ACCEPT     -A fail2ban-ssh -j RETURN     -A fail2ban-vsftpd -j RETURN     COMMIT


title: I've just purchased a VPS: What are the first things I should do to keep it secure

text: So I've just purchased a VPS to mess around with and host some of my sites. I've changed the password to a 15 digit alphanumeric string via SSH, but I would like to know what basic security measures I should take to begin with. For example, should I continue to use root to login - I've a faint memory of being told this is a bad thing.


title: How do I use inotify or named pipes over SSHFS?

text: Thanks `sshfs` magic, I can mount my home dir from a remote server with               sshfs user@server:/home/user ~/remote      Optimistically, I thought I'd set a local `inotify`-hook on `~/remote/logFile` (in the `sshfs` mount) so a local program can react to remote log changes.               cd ~/remote     touch logFile                                # create remote file     inotifywait logFile &                        # set up local inotify-hook     ssh user@server -x touch /home/user/logFile  # touch file from remote      _Nothing happens_. `inotifywait` is silent unless I `touch` the file locally. Writing to a named pipe fails similarly. **Why is this?   How can I bridge this gap?** I _could_ run `inotifywait` on the remote, hack up a file system change serialisation strategy and maintain a connection to the local, but then I'm _basically reimplementing SSHFS_. And it completely kills the abstraction.


title: Can I rewrite drive designations with grub?

text: I am trying to install Qubes from a USB stick. Unfortunately it seems that there's some hardcoding taking place in the boot process, so after I have put the ISO on the stick it still looks to mount `/dev/sr0`, and after it can't find it, the boot process freezes. Is it possible to remap the USB stick as the sr0 with grub that is used by `unetbootin`?


title: How to check whether certain port is opened or block on any other servers from a dev box?

text: I am trying to connect to one of our staging Cassandra servers on port 9042 and 9160 here in our company from a dev box.. Through the code, I am not able to connect to it... The program gets hanged at my SELECT query.. So I am wondering is there any way to figure out from my dev box whether these two ports are either blocked on my Cassandra staging servers or not? Below is the Cassandra staging server url which I am trying to connect from my dev box - `sc-host01.vip.slc.qa.host.com` And my dev box machine url is - `username-dyn-vm1-4.phx-os1.tratus.dev.host.com` Can anyone tell me how to figure out what can be the possible reason to which I am not able to connect to it.. How to check from my dev box whether these ports are opened or not on my Cassandra staging servers? **Update:-** This is what I got when I ran nmap -               ubuntu@username-dyn-vm1-4:~/build$ nmap -p T:9160 sc-host01.vip.slc.qa.host.com          Starting Nmap 6.00 ( http://nmap.org ) at 2013-10-13 20:01 UTC     Nmap scan report for sc-host01.vip.slc.qa.host.com (10.109.107.64)     Host is up (0.0037s latency).     rDNS record for 10.109.107.64: stgcass01-1.vip.slc.qa.host.com     PORT     STATE SERVICE     9160/tcp open  apani1          Nmap done: 1 IP address (1 host up) scanned in 0.19 seconds     ubuntu@username-dyn-vm1-48493:~/build$ nmap -p T:9042 sc-host01.vip.slc.qa.host.com          Starting Nmap 6.00 ( http://nmap.org ) at 2013-10-13 20:02 UTC     Nmap scan report for sc-host01.vip.slc.qa.host.com (10.109.107.64)     Host is up (0.0049s latency).     rDNS record for 10.109.107.64: stgcass01-1.vip.slc.qa.host.com     PORT     STATE SERVICE     9042/tcp open  unknown          Nmap done: 1 IP address (1 host up) scanned in 0.11 seconds      Does that mean port is opened correctly and there is no problem? And with telnet I get this -               ubuntu@username-dyn-vm1-4:~/build$ telnet sc-host01.vip.slc.qa.host.com 9042     Trying 10.109.107.64...     Connected to stgcass01-1.vip.slc.qa.host.com.     Escape character is '^]'.     ^CConnection closed by foreign host.          ubuntu@username-dyn-vm1-4:~/build$ telnet sc-host01.vip.slc.qa.host.com 9160     Trying 10.109.107.64...     Connected to stgcass01-1.vip.slc.qa.host.com.


title: How do I display the name of my audio card driver from the command line in Lubuntu 11.10?

text: I am running Lubuntu 11.10 and I want to display my Audio / Sound Card Driver from the command line.


title: Switch VI to use backspace key instead of Control+H for backspace?

text: I'm on Solaris 10 and by default `vi` version SVR4.0, Solaris 2.5.0 is installed. The system was set up so that when I ssh to it `Control+H` does backspace, and backspace outputs `^?` I added `stty erase '^?'` into `.profile` so that in the terminal the backspace key works correctly now. However when I use vi it still is outputting the `^?` character. Normally I would type `:set nocompatible` to fix this but it gives me               compatible: No such option - 'set all' gives all option values      `set all` gives me               noautoindent            nomodelines                     noshowmode     autoprint               nonumber                        noslowopen     noautowrite             nonovice                        tabstop=8     nobeautify              nooptimize                      taglength=0     directory=/var/tmp      paragraphs=IPLPPPQPP LIpplpipnpptags=tags /usr/lib/tags     noedcompatible          prompt                          tagstack     noerrorbells            noreadonly                      term=xterm     noexrc                  redraw                          noterse     flash                   remap                           timeout     hardtabs=8              report=5                        ttytype=xterm     noignorecase            scroll=33                       warn     nolisp                  sections=NHSHH HUuhsh+c         window=66     nolist                  shell=/bin/ksh                  wrapscan     magic                   shiftwidth=8                    wrapmargin=0     mesg                    noshowmatch                     nowriteany      I'm guessing that this version of `vi` is too old and that I need either a newer version or `vim` if I want to use `set nocompatible`, but I'm wondering **is there another way to get`vi` to use backspace for backspacing without having to load vim?**


title: any utility on centos 6 to sound an alarm when power is low

text: Is there an application that will set an audible alarm when the battery goes low on a centos 6 IBM 430 machine? Details of the problem here: I have set it hibernate when battery is low. However, it does not hibernate possibly because most of the time I am working in a full screen windows VM that prevents it from going to hibernate when I try to do it manually. Since I am not able to see the battery levels (I am working in a full screen windows VM), the nmachine switches off when battery goes low. So I lose all my data and in one instance, the VMs (I am running windows and ubuntu) got corrupted.


title: Where can I get the "kernel-default-debuginfo" package for SLES 11?

text: I'm using SLES 11 SP2 x86_64 and I want to install `kernel-default-debuginfo` package. But, I couldn't find it anywhere on the Novel website. Where can I find the mentioned package?


title: Problem with maximizing windows on extended desktop (2 monitors)

text: I'm running Mint 11, with Compiz activated. I have extended desktop over 2 monitors. But I have issues when I need to maximize windows - it's stretched over 2 monitors, not inside one. I know that worked before installing ATI Catalyst. Any idea how to fix it? Is this a Compiz issue or?


title: Change Linux boot logo

text: I want to change the penguin logo that appears on boot. I looked into it and found this command:               pngtopnm nelogo.png | ppmquant -fs223| pnmtoplainpnm > logo_linux_clut224.ppm      But when I tried it I got this error message: > unrecognized option `-fs223'   >  pnmtoplainpnm: EOF / read error reading magic number What did I do wrong? How can I replace the boot logo?


title: How can I tell if no_root_squash is enabled from an NFS client without mounting the share?

text: Obviously, I can look at `/etc/exports` on the NFS server-side to see if `no_root_squash` is enabled, but is there a way I can check this from the NFS client-side without actually mounting the share? Running `showmount -e myserver` and `rpcinfo -p myserver` from the NFS client don't help. I'm using CentOS 6.


title: Building paths robustly

text: Say I have several variables in a shell script (e.g. in zsh):               FOLDER_1, FOLDER_2, etc.      These variables refer to folders descending from `/`. For example, if I have a path `/home/me/stuff/items` the variables would be:               FOLDER_1='home'     FOLDER_2='me'     FOLDER_3='stuff'      Now, say that I want to build back the corresponding path by concatenating the variables. One possible way is to build the path as follows:               PATH=$FOLDER_1/$FOLDER_2/$FOLDER_3/      However, say that some of the variables `FOLDER_i` come with trailing forward slashes, while others don't (and we don't know which) e.g.               FOLDER_1='home'     FOLDER_2='stuff/'     FOLDER_3='items'      My question is: **How could I build the path robustly?** (e.g. avoiding double slashes, and adding them where they need to be). I thought one way to do this is to add the `/` always between pairs of variables, and then delete any duplicates with `sed`, but I can't make it to work (I am not sure I am handling `/` correctly in `sed`). Also, **am I reinventing the wheel**? (i.e. is there any built-in that does this already?). Finallly, if the variables are in an **array** , e.g. `FOLDERS`, would it be possible to do this without looping? (or alternatively, by looping but without knowing how many `FOLDERS` there are in the array).


title: Error during yum update

text: CentOS 6.3 Recently I've started getting the following error on my CentOS VPS when running `yum update`:               [user@foo1 ~]# yum update     Loaded plugins: fastestmirror     Loading mirror speeds from cached hostfile     epel/metalink                                            |  11 kB     00:00     Traceback (most recent call last):       File "/usr/bin/yum", line 29, in <module>         yummain.user_main(sys.argv[1:], exit_code=True)       File "/usr/share/yum-cli/yummain.py", line 285, in user_main         errcode = main(args)       File "/usr/share/yum-cli/yummain.py", line 136, in main         result, resultmsgs = base.doCommands()       File "/usr/share/yum-cli/cli.py", line 434, in doCommands         self._getTs(needTsRemove)       File "/usr/lib/python2.6/site-packages/yum/depsolve.py", line 99, in _getTs         self._getTsInfo(remove_only)       File "/usr/lib/python2.6/site-packages/yum/depsolve.py", line 110, in _getTsInfo         pkgSack = self.pkgSack       File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 897, in <lambda>         pkgSack = property(fget=lambda self: self._getSacks(),       File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 682, in _getSacks         self.repos.populateSack(which=repos)       File "/usr/lib/python2.6/site-packages/yum/repos.py", line 265, in populateSack         self.doSetup()       File "/usr/lib/python2.6/site-packages/yum/repos.py", line 92, in doSetup         self.ayum.plugins.run('postreposetup')       File "/usr/lib/python2.6/site-packages/yum/plugins.py", line 184, in run         func(conduitcls(self, self.base, conf, **kwargs))       File "/usr/lib/yum-plugins/fastestmirror.py", line 202, in postreposetup_hook         all_urls = FastestMirror(all_urls).get_mirrorlist()       File "/usr/lib/yum-plugins/fastestmirror.py", line 369, in get_mirrorlist         self._poll_mirrors()       File "/usr/lib/yum-plugins/fastestmirror.py", line 413, in _poll_mirrors         pollThread.start()       File "/usr/lib/python2.6/threading.py", line 474, in start         _start_new_thread(self.__bootstrap, ())     thread.error: can't start new thread      I've tried `yum clean all` but that doesn't seem to help. The VPS doesn't have a lot of memory to begin with but I'm not seeing it at a substantially low value:               [user@foo ~]# free                  total       used       free     shared    buffers     cached     Mem:        262144     109904     152240          0          0          0     -/+ buffers/cache:     109904     152240      If I reboot the system, it works fine (for awhile... then the issue returns again a few hours later). Any thoughts? What can I do to troubleshoot this?


title: What is the difference between declare and typeset

text: Can anyone explain difference between declare and typeset with real life examples .


title: My laptop is not able to recover from suspend and hibernate

text: I have a acer aspire 5750G laptop. I am running ubuntu 11.04. The `uname -a` reads the following: > Linux admin-Aspire-5750G 2.6.38-13-generic-pae #56-Ubuntu SMP Tue Feb 14 > 14:32:30 UTC 2012 i686 i686 i386 GNU/Linux Whenever the wakes up from suspend or hibernate, it shows a blank screen. Same thing happens when the lid is closed and opened later. What should I do to fix this? **Edit#1:** I have the `pm-utils` installed. I could suspend using `pm- suspend`. When I press any key to wake up, the machine wakes up but hangs. It does not respond to any keyboard or mouse keys after wake up. What could be wrong here?


title: Why dialog doesn't support emacs shell on Debian?

text: Dialog is a utility that provides dialog boxes from shell scripts, you may have seen them in aptitude during upgrades. When i use Emacs shell (`M-x shell`) and type `sudo aptitude safe-upgrade`, i get the following error several times:               debconf: unable to initialize frontend: Dialog     debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)     debconf: falling back to frontend: Readline      Why doesn't Dialog work with Emacs shell? And should i use some substitute?


title: ">/dev/null 2>&1" in `if` statement

text: I don't understand the below `if` condition. I know that `/dev/null 2 > &1` is sending output to error stream (please correct me if I am wrong). But I don't get it when it is in an `if` condition               if /usr/bin/egrep -e "$param1" -e "$param2" -e "param3" ${file} > /dev/null 2>&1     then      bla bla


title: What is the purpose of xargs -I command?

text: I'm Unix noob, can you explain what this command does:               files=(this_is_filename)     for filename in ${files[@]}; do        ls -t1 ../htory/$filename* |         head -1 |         xargs -I fname cp -p fname ../htory2/somefile.CSV     done      Especially this part of this command               xargs -I fname cp -p fname ../htory2/somefile.CSV


title: Apache mod_auth_kerb: "Key table entry not found"

text: I want to use the Apache Module "mod_auth_kerb" to implement SSO for a Webapplication. With the following config:               <VirtualHost 10.5.3.200:443>          #Proxy     <Proxy *>     Order deny,allow     Allow from all     </Proxy>     ProxyPass /elasticsearch/ http://127.0.0.1:9200/     ProxyPassReverse /elasticsearch/ http://127.0.0.1:9200/          #Server Config     ServerName spufi002.ads.ktag.ch     ServerAdmin "sm-linux@ag.ch"     DocumentRoot /srv/www/htdocs/kibana/     ErrorLog /var/log/apache2/error_log     TransferLog /var/log/apache2/access_log     SSLEngine on     SSLProtocol all -SSLv2 -SSLv3     SSLCipherSuite ALL:!aNULL:!eNULL:!SSLv2:!LOW:!EXP:!MD5:@STRENGTH     SSLCertificateFile /etc/apache2/ssl.crt/server.crt     SSLCertificateKeyFile /etc/apache2/ssl.key/server.key     <Files ~ "\.(cgi|shtml|phtml|php3?)$">     SSLOptions +StdEnvVars     </Files>     <Directory "/srv/www/cgi-bin">     SSLOptions +StdEnvVars     </Directory>     CustomLog /var/log/apache2/ssl_request_log   ssl_combined     <Directory "/srv/www/htdocs/kibana">          #Authentication     AuthType Kerberos     AuthName "SPNEGO"     KrbAuthRealms ADS.KTAG.CH     Krb5Keytab /etc/krb5.keytab     KrbMethodNegotiate on     KrbServiceName http     KrbMethodK5Passwd on     KrbLocalUserMapping On     Require user abnn ABNN tloi TLOI pwix PWIX rhe6 RHE6 dwav DWAV     options Indexes FollowSymLinks     AllowOverride None     Order allow,deny     Allow from all     </Directory>     </VirtualHost>      Without the Kerberos Stuff I can access the website. With the Kerberos part a login box pops up, but I can't login. I get the following error (Apache2.2 error_log):               [Tue Mar 18 13:58:34 2014] [error] [client 10.5.4.12] failed to verify krb5 credentials: Key table entry not found, referer: https://spufi002/      Any Ideas?


title: CUPS denies access to printer

text: I've got a printer hooked up to my workstation (running PCLINUXOS2012) by USB. All was well until the last time I tried to apply updates to the packages - it went rather pear shaped - lots of upgrade packages were no longer available from the repositories (this may be coincidental to the printing problem). Since then, only root can see the printer via CUPS unless I make it available to others:               [colin@localhost ~]$ lpq     lpq: error - no default destination available.     [colin@localhost ~]$ su     Password:     [root@localhost colin]# lpq     HP-Deskjet-F4200-series is ready     no entries     [root@localhost colin]# lpadmin -p HP-Deskjet-F4200-series -u allow:all     [root@localhost colin]# su colin -c lpq     HP-Deskjet-F4200-series is ready     no entries     [root@localhost colin]#      (but this does not change the cupsd.conf - hence needs to be re-applied each time the system is rebooted). How do I make the change permanent? (Coincidentally, the tool used to configure printers accessed from drakconf (PCLinuxos Control centre) now bombs out with the message "The program terminated abnormally). cupsd.conf below, apologies for repodrucing it in it's entirety, but the running version clearly does not match the documentation supplied (which, for example, reports that 'Browsing' can be 'Yes' or 'No', but nothing get's logged for a value of 'on'). I would have expected the lines below the comments to make the printer available to all - but this does not appear to be the case.               LogLevel warn     SystemGroup lpadmin root     Group sys     User lp     Port 631     Listen /var/run/cups/cups.sock     Browsing On     BrowseAddress @LOCAL     BrowseOrder allow,deny     # this line to make printers 'browseable'....     BrowseAllow all     BrowseLocalProtocols CUPS dnssd     DefaultAuthType Basic          <Location />       Order allow,deny       # this to allow access to the web frontend....       Allow all     </Location>          <Location /admin/conf>       AuthType Default       Require user @SYSTEM     </Location>          <Policy default>       <Limit Create-Job Print-Job Print-URI Validate-Job>         # and this one to allow submission of print jobs...         Allow all         Order deny,allow       </Limit>       <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job CUPS-Move-Job CUPS-Get-Document>          Require user @OWNER @SYSTEM          Order deny,allow        </Limit>        <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default CUPS-Get-Devices>           AuthType Default           Require user @SYSTEM           Order deny,allow        </Limit>        <Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After CUPS-Accept-Jobs CUPS-Reject-Jobs>            AuthType Default            Require user @SYSTEM            Order deny,allow        </Limit>        <Limit Cancel-Job CUPS-Authenticate-Job>            Require user @OWNER @SYSTEM            Order deny,allow        </Limit>        <Limit All>            Order deny,allow        </Limit>     </Policy>          <Policy authenticated>        <Limit Create-Job Print-Job Print-URI Validate-Job>           AuthType Default           Order deny,allow     </Limit>     <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job CUPS-Move-Job CUPS-Get-Document>         AuthType Default         Require user @OWNER @SYSTEM         Order deny,allow      </Limit>      <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default>          AuthType Default          Require user @SYSTEM          Order deny,allow       </Limit>       <Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After CUPS-Accept-Jobs CUPS-Reject-Jobs>          AuthType Default          Require user @SYSTEM          Order deny,allow       </Limit>       <Limit Cancel-Job CUPS-Authenticate-Job>          AuthType Default          Require user @OWNER @SYSTEM          Order deny,allow       </Limit>       <Limit All>         Order deny,allow       </Limit>     </Policy>


title: Practical tasks to learn shell scripting

text: I'm looking for some common problems in unix system administration and ways that shell scripting can solve them. Completely for self-educational purposes. Also I'd like to know how would you go about learning shell scripting.


title: Can I copy text from one file by shell?

text: Can I copy text to the clipboard from one file by shell? and I want to paste it to Browser later.


title: Ubuntu screen is small in VMware

text: I have installed Ubuntu at VMware. But I have a problem, and I do not know how to solve it. When I have the virtual machine as a window, to can at the same time have access to my windows at my host operating system (Windows 8), Ubuntu vm has a very small desktop, and I cannot work at that. I mean if the VMware window is 1000*500 px, my ubuntu desktop may be 500*300, instead of 1000*500, and all the other space in the window is black. When I make the guest operating system full screen, then Ubuntu's desktop becomes normal and take the whole screen. Do you know why is that, and how I can fix it?


title: SFTP chroot jail/access based on wildcard

text: I want to give a list of people SFTP access to /webdocs/ABC* where they will read-write access to only directories that match this wildcard. How do I do this? Can I create a chroot jaill or some other method via SFTP so that these users only see/access the wildcard match?


title: Custom Ubuntu distro and ubuntu software center

text: I have a little problem with building custom Ubuntu distro. When i change the name in lsb-release, software center wont start due to unrecognised distro name. Now, i know that somne python file in software center is refering to lsb-release to check for the release id, but what i whant to do is to make a fake lsb-release file and make software center refer to that file in order to get the distro id, but i dont know how to do that. Can anyone help me with that?


title: Does using epub2pdf pose a potential security risk? Is there an alternative?

text: epub2pdf is a fairly platform-independent program. Based on Java, it executes without a hitch on my machine, with no dependencies. However, strangely enough, the program requires an active internet connection to work properly. I didn't realize this at first, and _the program's website gives no indication of the fact that, as such, the program is just a front-end for an 'online' converter._ Is that normal? Isn't that kind of an invasion of privacy? Why would this program _need_ to make HTTP connections to external servers? Furthermore, this program isn't available in the Debian/Ubuntu repositories. Would that have anything to do with this issue? Can someone suggest an alternative? This is the error it gives when you run it without an internet connection:               me@ROOROO:~/epub2pdf$ ./epub2pdf.sh adventures_in_dev_null.epub      epub2pdf v0.5 - Copyright (C) 2010  Brendan C. Lefebvre     This program comes with ABSOLUTELY NO WARRANTY.     This is free software, and you are welcome to redistribute it     under certain conditions.     See file 'COPYING' for full license and warranty details.               Registered font families: courier, helvetica, symbol, times, times-roman, zapfdingbats     Default font set to helvetica     Default font base size set to 12.0pt     Default monospace font: courier     Monospace base size: 10.0pt     Default paragraph alignment: left     Margins (top right bottom left): 4.00mm 4.00mm 4.00mm 4.00mm      Page size (w x h): 90.00mm x 115.00mm     Converting ~/epub2pdf/adventures_in_dev_null.epub     java.net.UnknownHostException: www.daisy.org             at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:175)             at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:384)             at java.net.Socket.connect(Socket.java:546)             at java.net.Socket.connect(Socket.java:495)             at sun.net.NetworkClient.doConnect(NetworkClient.java:178)             at sun.net.www.http.HttpClient.openServer(HttpClient.java:409)             at sun.net.www.http.HttpClient.openServer(HttpClient.java:530)             at sun.net.www.http.HttpClient.<init>(HttpClient.java:240)             at sun.net.www.http.HttpClient.New(HttpClient.java:321)             at sun.net.www.http.HttpClient.New(HttpClient.java:338)             at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:935)             at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:876)             at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:801)             at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1139)             at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)             at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)             at org.apache.xerces.impl.XMLEntityManager.startDTDEntity(Unknown Source)             at org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(Unknown Source)             at org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown Source)             at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)             at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)             at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)             at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)             at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)             at com.amphisoft.epub.metadata.Ncx.fromFile(Unknown Source)             at com.amphisoft.epub.Epub.populateMemberFields(Unknown Source)             at com.amphisoft.epub.Epub.setFile(Unknown Source)             at com.amphisoft.epub.Epub.setFile(Unknown Source)             at com.amphisoft.epub.Epub.fromFile(Unknown Source)             at com.amphisoft.epub2pdf.Converter.convert(Unknown Source)             at com.amphisoft.epub2pdf.Converter.main(Unknown Source)             at com.amphisoft.epub2pdf.Epub2Pdf.main(Unknown Source)     Writing PDF to /home/user/adventures_in_dev_null.pdf     Processing 22 HTML file(s):      .java.net.UnknownHostException: www.w3.org             at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:175)             at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:384)             at java.net.Socket.connect(Socket.java:546)             at java.net.Socket.connect(Socket.java:495)             at sun.net.NetworkClient.doConnect(NetworkClient.java:178)             at sun.net.www.http.HttpClient.openServer(HttpClient.java:409)             at sun.net.www.http.HttpClient.openServer(HttpClient.java:530)             at sun.net.www.http.HttpClient.<init>(HttpClient.java:240)             at sun.net.www.http.HttpClient.New(HttpClient.java:321)             at sun.net.www.http.HttpClient.New(HttpClient.java:338)             at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:935)             at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:876)             at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:801)             at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1139)             at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:654)             at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(XMLEntityManager.java:1292)             at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(XMLEntityManager.java:1229)             at com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.startPE(XMLDTDScannerImpl.java:699)             at com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.skipSeparator(XMLDTDScannerImpl.java:2046)             at com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.scanDecls(XMLDTDScannerImpl.java:2009)                 at com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.scanDTDExternalSubset(XMLDTDScannerImpl.java:297)             at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.dispatch(XMLDocumentScannerImpl.java:1178)             at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.next(XMLDocumentScannerImpl.java:1065)             at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:978)             at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:625)             at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:116)             at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:488)             at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:819)             at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:748)             at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)             at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1208)             at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:525)             at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:357)             at org.apache.xml.resolver.tools.ResolvingXMLFilter.parse(ResolvingXMLFilter.java:141)             at com.amphisoft.epub2pdf.content.XhtmlHandler.parseXhtml(Unknown Source)             at com.amphisoft.epub2pdf.content.XhtmlHandler.<init>(Unknown Source)             at com.amphisoft.epub2pdf.content.XhtmlHandler.process(Unknown Source)             at com.amphisoft.epub2pdf.Converter.convert(Unknown Source)             at com.amphisoft.epub2pdf.Converter.main(Unknown Source)             at com.amphisoft.epub2pdf.Epub2Pdf.main(Unknown Source)     Exception converting adventures_in_dev_null.epub:             ExceptionConverter at:     Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0             at com.amphisoft.epub2pdf.Converter.main(Unknown Source)             at com.amphisoft.epub2pdf.Epub2Pdf.main(Unknown Source)


title: Hosts file modification not used

text: I added an entry to my hosts file for the development of a website. I put a new line in `/etc/hosts`               xx.xx.xx.xx www.mysite.com      But even after a reboot when I use chrome or firefox the host name is not resolved to the IP I put in the file. I'm running Fedora 14 x86_64.


title: Can't upgrade "filesystem" package in Arch

text: I was unable to upgrade filesystem to latest version, `/lib` and `/lib64` exists. And I can't just remove the link, otherwise all binaries would fail to run, Any thought?               # pacman -S filesystem     :: filesystem is in IgnorePkg/IgnoreGroup. Install anyway? [Y/n]      resolving dependencies...     looking for inter-conflicts...          Targets (1): filesystem-2013.01-3          Total Installed Size:   0.31 MiB     Net Upgrade Size:       0.21 MiB          Proceed with installation? [Y/n]      (1/1) checking package integrity                          [###############################] 100%     (1/1) loading package files                               [###############################] 100%     (1/1) checking for file conflicts                         [###############################] 100%     error: failed to commit transaction (conflicting files)     filesystem: /lib exists in filesystem     filesystem: /lib64 exists in filesystem     Errors occurred, no packages were upgraded.


title: How can you move (or copy) all files to a directory with the same filename prefix?

text: **Using Bash** So let's say I have a bunch of files randomly placed in a parent directory `~/src`, I want to grab all the files matching a certain suffix and move (or copy) them to a `~/dist` directory. Let's assume for this purpose that all filenames have this naming convention:               <filename_prefix>.<filename_suffix>      I found out that this was a quick way to get all files with a particular `filename_suffix` and put them in a dist folder:               mkdir ~/dst     find source -name "*.xxx" -exec mv -i {} -t ~/dst \;      Now a step further... how can I use the output of find, in this case `filename`, and use the `filename_prefix` to generate a directory of the same name in `~/dist` and then move (or copy) all the files with that prefix into the appropriate directory?               mkdir ~/dst     find source -name "*.xrt,*.ini,*.moo" -exec mv -i {} -t ~/dst \;      Essentially, how do I change the above command (or maybe use another command), to create a structure like this **(OUTPUT)**               ~/dist/people/people.xrt     ~/dist/games/games.xrt     ~/dist/games/games.moo     ~/dist/games/games.ini     ~/dist/monkeys/monkeys.ini     ~/dist/monkeys/monkeys.xrt      from a directory tree like this? **(INPUT)**               ~/src/xrt/people.xrt     ~/src/xrt/games.xrt     ~/src/conf/games.ini     ~/src/pack/monkeys.xrt     ~/src/e344/games.moo     ~/src/e344/monkeys.moo     ~/src/en-us/monkeys.ini


title: php mail not working in rhel server?

text: I have installed roundcube mail and when it tried to use installer which uses php mail it is loading for 5 to 10 minutes and then telling me 'ok' but no mail comes to me. smtp_port is 25 host is localhost in my php.ini file


title: Is there any way to control the light value of the Apple logo on a MacBook?

text: I'd like to mess around a bit with controlling the Apple logo on the outside of my MacBook Pro from Ubuntu. (I'd like to hook it up to my music and have it light up and down with the decibels :]) Does anyone know what this device is and how I could control it? Is it a device in `/sys/devices`?


title: Is there a general rule for tracking an error?

text: I would like to start with an example here just to make it easy to convey my question. I have uncommented the following line from the /etc/pam.d/su file               auth   required   pam_wheel.so use_uid      thus making it mandatory for a user to be a member of the wheel group to run the `su` command. Then I have tried the following :               [ssam@centos ~]$ su     Password:      su: incorrect password      Here the user `ssam` is **not** a member of the wheel group so the access is denied, the way things should go! But I had a feeling that the error message shown here is a bit inappropriate, because I have indeed entered the right password for the root. For some user who is genuine, it would take a while to figure out what actual problem is(hopefully). In cases as shown above and in general, what should be the first step to start with when troubleshooting a Linux system?


title: Sorting down processes by memory usage

text: I am able to see the list of all the processes and the memory via               ps aux       and going through the VSZ and RSS Is there a way to sort down the output of this command by the descending order on RSS value ? PS : This is a newbie question as I am very much new to Unix/Linux.


title: User-specific virtual machines in VirtualBox

text: Is it possible to start many VMs created by different users on the same Linux host? I want to start four virtual machines with my own user name and start four with another user name at the same time on the same host.


title: How to add 'open folder as root' in Elementary OS file manager context menu?

text: Here it is the solution in order to add the 'open terminal here' into the context menu of Elementary OS' file manager (generically called 'Files' - the executable is `pantheon-files`). For that specific demand, the idea is to create the file `/usr/share/contractor/terminal.contract` and add something like               [Contractor Entry]     Name=Open Terminal here     Icon=terminal     Description=Open Terminal here     MimeType=inode;application/x-sh;application/x-executable;     Exec=pantheon-terminal -d %U     Gettext-Domain=pantheon-terminal      But how to adapt that and have a model to add other commands, namely - following my order of priorities - 'open folder as root'?


title: How to print (Cups, lpr, whatever...) in grayscale in a _generic_ way?

text: Problem: E.g. Cups just offers options to manage colors. Unfortunately they are specific to the manufacturers model. I.e. xerox is using e.g. "XRXColor, BW", Dell "ColorModel, KGray" etc... I am looking for a tool which offers a unified interface to the printserver to print grayscale.


title: Display X applications on an Android system

text: Host system: Android 3.2.1 Honeycomb   Chroot system: Debian Testing lxde   Hardware: Asus eee pad transformer tablet nvidia arm architecture Note 1: The Debian system boots on this hardware, thus it has adequate graphical drivers. Note 2: I am looking for a way to do this without VNC. 1) What do I need to install on the host system to run the chroot system's Midori browser so that it is displayed on the host Android GUI? I want to do it like this:               root-chroot@localhost$: export DISPLAY=:0.0       root-chroot@localhost$: midori


title: Tar overwrites read only files

text: I created directory `test`, created file `1.txt` in `test`, wrote 'Before' in this file. Then I went               cd ..      and used the command:               tar -cvzf ./test.tgz ./test      Then I entered the test dir again. Opened the `1.txt` file again. Changed content to "After". I saved the file and changed chmod to read only by executing:               chmod -w ./1.txt      So for now my `1.txt` is read only. Then I go up               cd ..      and extract the `test.tgz` archive.               tar -xvzf ./test.tgz      Then I go again to test dir, do               cat 1.txt      and get "Before". It is not logical that this happens, since the file was set to be read-only. Why does it happen?


title: Is unix good with many users/groups?

text: If I have 10,000 webapps on my server and I'd like enhanced permissions and make a user for every app (`/var/www/NAME` will have a matching `/tmp/www/NAME`), will everything be fine or will problems occur when I have 10k users?


title: dir-color failure in html and css files in several terminals

text: I use several types of terminals in my Slackware 13 distribution: xterm, rxvt, Konsole, and xfce's terminal emulator (Terminal 0.4.6). All of them read my .dir_colors file and, for the most part assign colors to file-types as I wish. The exception are html files and css files, (e.g. blah.html and blee.css). The rxvt terminal has no problems, but none of the other terminals will colorize these files properly. The terminal emulator displays: `[00:33mblee.css`, (the first character looks like a small 2x2 array of 1's and 0's in a box. The above is cut-and-paste from the terminal.). Konsole displays: `33mblah.html`. xterm doesn't even try to colorize html and css files, but leaves them white (default text color). What is going on?


title: Best way to swap filenames

text: I need to swap filenames of two files (`file` and `file_1`). I'm using the following code for it.               mv file .phfile     mv file_1 file     mv .phfile file      This works but is very buggy, It sometimes even results in loss of data. Is there a better way to do this?


title: GNU/Linux (Debian): detecting hard-disks mappings?

text: Let's suppose you have two hard-disks:   * one internal (boots GNU/Linux);   * one external (USB). "fdisk -l" detects both, but will not tell you which is /dev/sda and which is /dev/sdb. "lsusb" will tell you there is an external USB device connected, but will not tell you whether it has been mapped to /dev/sda or /dev/sdb. How can you be get such information from your system? Thanks.


title: Quick way to host a webserver on localhost

text: I'd like to make the contents of a folder available at `http://localhost:PORT/`, temporarily. A very basic http server. I already know about,                $ python -m SimpleHttpServer       or ( this seems like the new way )                $ python -m http.server       but I'm looking for alternate command-line methods.


When I start a graphical application from a terminal running bash, that application is somehow connected to that bash session. For example, when the applications dumps some text it will appear in the bash session it is started from. Also, some applications will get closed when i close the terminal using the close button, but not when i close the terminal by exiting the bash session using the exit command or CTRL+D. How is a graphical application started from a bash session connected to that bash session? bonus question: How can I inspect this connection? probably also manipulate?


title: How to install IBM DB2 Database Driver on Ubuntu for Node.js

text: I need assistance installing IBM DB2 drivers onto Ubuntu. Using Ubuntu 14.04, I'm attempting to create a simple web page that gets served by the node.js server-side framework. A server-side-javascript will be making a simple query to an IBM db2 9.5 database located on a windows server (within the same LAN as the Ubuntu machine). I got node.js installed on Ubuntu 14.04 using this command:               sudo apt-get install nodejs nodejs-legacy npm      Then, unnecessarily, I added ODBC support with this command:               sudo apt-get install git unixodbc unixodbc-dev ; git clone git://github.com/wankdanker/node-odbc.git ; cd node-odbc ; node-gyp configure build ; npm install odbc      After this, I discovered there was a npm for getting IBM DB2 accessible from node.js A prerequisite, though, is that I must first download and install the IBM DB2 driver onto Ubuntu. From the IBM website, I downloaded a file named:               v9.5fp10_linuxx64_dsdriver.tar.gz      I found these instructions for installing the IBM DB2 driver. The instructions state: > On Linux and UNIX operating systems, IBM Data Server Driver Package is > installed by running the **installDSDriver** command. However, the v9.5fp10_linuxx64_dsdriver.tar.gz file-archive doesn't contain any command called **installDSDriver** and Ubuntu doesn't natively know this command. Where and how can I execute this **installDSDriver** command?


title: Recovery of data on raid5+lvm reiserfs partition, after raid5 problems

text: I've got a server with 3 sata hard drives. Each has 2 partitions: one small is part of /dev/md0, a raid1 array (/boot), rest is part of a raid5 array (/dev/md1), which is an lvm physical volume. Inside it are 3 (IIRC) logical volumes. One of these is a reiserfs 3.6 fs holding about 100gigs of data. Yesterday this server crashed. At power up, SMART told me that one of the drives was dead. He was indeed making very bad noises. So I removed the failed drive, and tried to restart the system on the 2 remaining disks. Which failed. With a live cd, I started it and tried to restart the array. Unfortunately, mdadm refused to do so, because it thought one of the 2 remaining disks was failed also. So, following advice found at How to recover a crashed Linux md RAID5 array? that looked like it could apply to my situation, I did something that was probably just plain stupid: I ran               mdadm --create /dev/md1 --assume-clean -l5 -n3 -c64 /dev/sd[ab]2 missing      Now, I can actually start this array, but the lvm tools (vgscan, vgdisplay, pvck) cannot find anything related to lvm on the array, and I'm completely unable to get to my data. Did I just wipe all the lvm metadata? My feeling is that actual data is still there, undamaged (apart from lvm metadata). Is there a chance to get the data back? How? **UPDATE:** Following advice from psusi (below), I tried each of the following ways of re- creating the array:               mdadm --create /dev/md1 --assume-clean -l5 -n3 -c64 /dev/sda2 /dev/sdb2 missing     mdadm --create /dev/md1 --assume-clean -l5 -n3 -c64 /dev/sdb2 /dev/sda2 missing     mdadm --create /dev/md1 --assume-clean -l5 -n3 -c64 /dev/sda2 missing /dev/sdb2     mdadm --create /dev/md1 --assume-clean -l5 -n3 -c64 /dev/sdb2 missing /dev/sda2     mdadm --create /dev/md1 --assume-clean -l5 -n3 -c64 missing /dev/sda2 /dev/sdb2     mdadm --create /dev/md1 --assume-clean -l5 -n3 -c64 missing /dev/sdb2 /dev/sda2          mdadm --create /dev/md1 --assume-clean -l5 -n3 -c512 /dev/sda2 /dev/sdb2 missing     mdadm --create /dev/md1 --assume-clean -l5 -n3 -c512 /dev/sdb2 /dev/sda2 missing     mdadm --create /dev/md1 --assume-clean -l5 -n3 -c512 /dev/sda2 missing /dev/sdb2     mdadm --create /dev/md1 --assume-clean -l5 -n3 -c512 /dev/sdb2 missing /dev/sda2     mdadm --create /dev/md1 --assume-clean -l5 -n3 -c512 missing /dev/sda2 /dev/sdb2     mdadm --create /dev/md1 --assume-clean -l5 -n3 -c512 missing /dev/sdb2 /dev/sda2      Which is basically all possible orders, both with -c64 and -c512. After each test, I ran a vgscan. None found anything. Maybe I should not use vgscan but some other tool? **UPDATE 2:** I gave a try at reconnecting the failed hard drive. And miracle, it seems to somewhat work. At least, enough to examine it:               root@debian:~# mdadm --examine /dev/sda2     /dev/sda2:               Magic : a92b4efc             Version : 0.90.00                UUID : 1f5462ab:6945560d:019b01a5:914dd464       Creation Time : Fri Oct 17 12:40:40 2008          Raid Level : raid5       Used Dev Size : 160015360 (152.60 GiB 163.86 GB)          Array Size : 320030720 (305.21 GiB 327.71 GB)        Raid Devices : 3       Total Devices : 3     Preferred Minor : 1              Update Time : Tue Apr 12 08:15:03 2011               State : active      Active Devices : 3     Working Devices : 3      Failed Devices : 0       Spare Devices : 0            Checksum : 64d514fb - correct              Events : 137                   Layout : left-symmetric          Chunk Size : 64K                Number   Major   Minor   RaidDevice State     this     0       8        2        0      active sync   /dev/sda2        0     0       8        2        0      active sync   /dev/sda2        1     1       8       18        1      active sync   /dev/sdb2        2     2       8       34        2      active sync   /dev/sdc2      So, is there a way to copy this superblock to the other 2 devices, so that I can start the array "properly"?


title: rpm and deb fileformat are blocked by my ISP. How to install software?

text: I have a very peculiar problem, Just be patient with what I am saying and then see what all suggestion you can give me. I have situation where my ISP has blocked .rpm and .deb files to be downloaded. I am already using a proxy to access the Internet. So any chance of me updating via Internet is bleak. One peculiar thing though - I am able to download .rpm of Google chrome but any other source or site or software I try I am blocked off. Also I have to work on unregistered RHEL 6 - Already had hard time setting it up with 3rd party repository and then now I am faced with this restriction. So I want to ask for suggestion as to what I can do. I will list a few things I thought, tell what you think and also suggest if you have some.   1. I can download the software repo from different ISP and use it offline. Repos which addresses to a local location is allowed by yum.   2. I can download .tar ( and derivatives) from this ISP. So do you know any software repository which give me only .tar(or similar) flies for the software? I searched but couldn't find any.   3. Try other package management - different flavor of linux. I am trying different linux - like Arch Linux, Puppy linux(though wont serve my purpose) etc.   4. Your suggestion. Please. Thanks for reply and for reading / hanging on this long.


title: merge txt files with similar name

text: I have thousands of `.txt` files in directory. Their names are:               ch14.ta_20452_206652_15-84.txt     ch14.ta_20452_206652_786-14.txt     ch14.ta_20452_206652_77-85.txt     ch14.ta_20452_206652_81-78.txt     ch2.ta_16903_17204-41-44.txt     ch2.ta_16903_17204-2-46.txt     ch2.ta_16903_17204-61-47.txt     ch2.ta_16903_17204-73-52.txt      I want to merge files with the similar beginning of the name (exp: `ch14.ta_20452_206652` or `ch2.ta_16903_17204`) into one txt. Tried to do it manually with:               cat *ch14.ta_20452_206652* > ch14.ta_20452_206652.txt      But it's impossible and driving me crazy. Hope that someone could help me


title: How do I check what 'normal' users are there on the system?

text: I want to find out what 'normal' users are available on a system. By normal, I mean those who are manually created, not those like **sshd** or **gdm**.


title: Escape sequences in output of script called from ncurses application

text: I'm currently running mcabber as my Jabber client (which uses ncurses) in a tmux session on my homeserver. Locally i run iTerm2 as a terminal emulator, which supports the triggering of growl notifications through character escape sequences e.g. `echo "\e]9;foobar\007"` makes iTerm2 send a Growl message with the text "foobar". However, when in a tmux session, the escape sequences get eaten up. Therefore using the proprietary character escape sequence \Ptmux can be used like this: `echo "\ePtmux;\e\e]9;foobar\007\e\\"` to trigger a growl message from within a tmux session. However, when I use this in my mcabber event script that gets fired when a new message is received, no notification is triggerd, as if the echo is send to the wrong terminal. I suppose this has to do with that mcabber which triggers the script is a ncurses application so the output from my normal bash script gets lost and iTerm 2 does never see it. I also tried calling smcup without success before echoing accoring to some ideas I discovered               tput smcup     echo "\ePtmux;\e\e]9;$FROM: $MSG\007\e\\"     tput rmcup      I suppose this does not work as the issue is not switching back to the "real terminal window", but more directing the output at the ncurses window. Any ideas on this one?


title: Using vim/gvim as editor for Thunderbird

text: Is there a way to use vim/gvim as an editor for thunderbird? There was an add- on for it but it is now very out of date.


title: FreeBSD's kernel is 'locked'?

text: I happened to talk to a Mac Genius on the subject of viruses. He mentioned that the FreeBSD kernel on which the Mac OS is based is 'locked' and therefore no viruses can ever harm my Mac. I didn't quite understand what he meant. Could someone explain?


title: How can I tell if my wifi dongle has access-point capabilities?

text: I have a Realtek 8191SU USB wifi dongle for use on my Raspberry Pi. I'm trying to set up a wifi access point using this tutorial. However, I'm running into a few errors, and I suspect it might be because my dongle does not support running as an access point. Is there a way to tell if this has access point capabilities? ### EDIT Is there a generic way, similar to `lsusb` or `ifconfig`, that can provide information on any wifi dongle?


title: Automatic version number management

text: There are multiple points in the code where the version number of a package/software is appearing, like on the About page, in headers of files, in the code itself where the version variable is defined. What are the best practices to keep that version number in sync automatically? Any option to increment the number with every new build/packaging?


title: Bash: iterate with variable on the lines of `ls -1` output

text: In a simple cycle like the following               for f in $(ls -1) ;             do             something     done      I would like to store each _line_ of the output of `ls -1` in the variable `f`. Is there a way to do this without setting `IFS=$'\n'`?


title: Does initramfs use /etc/fstab?

text: The way I understand it, initramfs is responsible for loading the "real" root filesystem. Now, there are two places where we define that root. First we put an entry in `/etc/fstab`. Second, we put the device on the kernel boot commands e.g. `root=/dev/sda1`. Which one does initramfs use to determine where is the root filesystem? If it uses the root kernel parameter, why do we have an entry in `/etc/fstab`? The second option, (it reads `/etc/fstab`), is quite illogical because the `/etc/fstab` file is on the very root device that initramfs is trying to mount in the first place. Very confusing stuff.


title: How do I fix the argument received from getopt?

text: I have the following commands in my script:               set -- `getopt -q agvc:l:t:i: "$@"`      ...           while [ -n "$1" ]      do      -i) TIME_GAP_BOOT=$2      shift ;;           ...      sleep $TIME_GAP_BOOT      When invoking the script with `-i 2`, I get the error               sleep: invalid time interval `\'2\''      What am I doing wrong? How do I correctly format the argument?


title: Apply fadeout effect to video at multiple places

text: I have a video of 12 seconds, frame rate is 30 frames per second. I want to apply fade out effect to video on multiple places, for example from second 3rd to 4th and from second 7th to 8th. Have a look at this command.               ffmpeg -i video.mp4 -strict experimental -vf fade=type=out:start_frame=91:nb_frames=29  -y final_out.mp4       Above command adds fade out effect from 3rd to 4th second properly, Now I have fired following command               ffmpeg -i video.mp4 -strict experimental -vf fade=type=out:start_frame=91:nb_frames=29 fade=type=out:start_frame=211:nb_frames=29 -y final_out.mp4     and     ffmpeg -i video.mp4 -strict experimental -vf fade=type=out:start_frame=91:nb_frames=29 -y final_out.mp4 fade=type=out:start_frame=211:nb_frames=29      None of them are working, throwing following exception               [NULL @ 0x2dc83a0] Unable to find a suitable output format for 'fade=type=out:start_frame=211:nb_frames=29'     fade=type=out:start_frame=211:nb_frames=29: Invalid argument      I was following this documentation. Is there any way to apply fade out effect on multiple time slices ?? Thanks in advance


title: nvidia-cuda-toolkit 4.0 gone from Debian repositories

text: I can't find the following packages in Debian testing: http://packages.debian.org/source/sid/nvidia-cuda-toolkit No more than month ago when I was setting another CUDA box and they were there, now there's only version 3.2 of the toolkit. My sources.list:               deb http://debian.linuxmint.com/latest testing main contrib non-free     deb http://security.debian.org/ testing/updates main contrib non-free     deb http://www.debian-multimedia.org testing main non-free


title: Difference between cat and '>' to zero out a file

text: Are these two commands any different on how they go about zero-ing out files? Is the latter a shorter way of doing the former? What is happening behind the scenes? Both               $ cat /dev/null > file.txt          $ > file.txt       yield               -rw-r--r--  1 user  wheel  0 May 18 10:33 file.txt


title: What's the point of using "x$START_DAEMON" = "xyes" here? (the heading x)

text: This was part of fetchmail deamon script, `if [ ! "x$START_DAEMON" = "xyes" -a ! "$1" = "status" ]; then` What's the point of using `x$START_DAEMON = "xyes"`, why not just use `$START_DAEMON = "yes"` ?


title: AltGr keys don't work with Ubuntu in VirtualBox

text: I just installed VirtualBox (from Oracle) in Windows 7, and created a virtual machine with latest Ubuntu. Here in Firefox I can use the left Ctrl key, while the right one doesn't have any effect. However, I can't use the AltGr key (also known as Right Alt) to produce e.g. curly braces like {} (I pasted that via Ctrl V). In a terminal window I can switch the "Input method" to "Multipress", and then I can use AltGr to type e.g. {}, which is how I produced those characters for this posting. However, with "Multipress" the Ctrl keys seem to have no effect whatsoever. So in order to e.g. type Ctrl D I have to right click and switch the "Input method" to "System (IBus (Intelligent Input Bus))". Then AltGr does not work. I tried specifying the compose key in the system settings keyboard layout. With that, neither Ctrl nor AltGr worked. Here's what xmodmap reports:               [~]     $ xmodmap -pke | grep -i control     keycode  37 = Control_L NoSymbol Control_L     keycode 105 = Control_R NoSymbol Control_R     [~]     $ xmodmap -pke | grep -i alt     keycode  64 = Alt_L Meta_L Alt_L Meta_L     keycode 204 = NoSymbol Alt_L NoSymbol Alt_L     [~]     $ _      How can I fix this? Additional info: the keyboard is a standard PC keyboard, a Logitech K120, with Norwegian layout. Also, I first tried asking this question over at the Superuser site but no response after 2 days...


title: How to make FreeBSD variant of cal start weeks on mondays?

text: Can week start day be changed in `cal` output? Is it hardcoded? Notice: not the `ncal`.


title: Birth is empty on ext4

text: I was just reading up on the `Birth` section of `stat` and it appears ext4 should support it, but even a file I just created leaves it empty.                ~  % touch test                                                       slave-iv      ~  % stat test.pl                                                     slave-iv       File: ‘test.pl’       Size: 173             Blocks: 8          IO Block: 4096   regular file     Device: 903h/2307d      Inode: 41943086    Links: 1     Access: (0600/-rw-------)  Uid: ( 1000/xenoterracide)   Gid: (  100/   users)     Access: 2012-09-22 18:22:16.924634497 -0500     Modify: 2012-09-22 18:22:16.924634497 -0500     Change: 2012-09-22 18:22:16.947967935 -0500      Birth: -           ~  % sudo tune2fs -l /dev/md3 | psp4                                  slave-iv     tune2fs 1.42.5 (29-Jul-2012)     Filesystem volume name:   home     Last mounted on:          /home     Filesystem UUID:          ab2e39fb-acdd-416a-9e10-b501498056de     Filesystem magic number:  0xEF53     Filesystem revision #:    1 (dynamic)     Filesystem features:      has_journal ext_attr resize_inode dir_index filetype needs_recovery extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize     Filesystem flags:         signed_directory_hash      Default mount options:    journal_data     Filesystem state:         clean     Errors behavior:          Continue     Filesystem OS type:       Linux     Inode count:              59736064     Block count:              238920960     Reserved block count:     11946048     Free blocks:              34486248     Free inodes:              59610013     First block:              0     Block size:               4096     Fragment size:            4096     Reserved GDT blocks:      967     Blocks per group:         32768     Fragments per group:      32768     Inodes per group:         8192     Inode blocks per group:   512     RAID stride:              128     RAID stripe width:        256     Flex block group size:    16     Filesystem created:       Mon May 31 20:36:30 2010     Last mount time:          Sat Oct  6 11:01:01 2012     Last write time:          Sat Oct  6 11:01:01 2012     Mount count:              14     Maximum mount count:      34     Last checked:             Tue Jul 10 08:26:37 2012     Check interval:           15552000 (6 months)     Next check after:         Sun Jan  6 07:26:37 2013     Lifetime writes:          7255 GB     Reserved blocks uid:      0 (user root)     Reserved blocks gid:      0 (group root)     First inode:              11     Inode size:           256     Required extra isize:     28     Desired extra isize:      28     Journal inode:            8     First orphan inode:       55313243     Default directory hash:   half_md4     Directory Hash Seed:      442c66e8-8b67-4a8c-92a6-2e2d0c220044     Journal backup:           inode blocks      Why doesn't my `ext4` partition populate this field?


title: chmod - change permissions on a file

text: I have a Python virtualenv, and the Python executable is located in the `/bin` directory. In this virtualenv I'll have to execute some unsafe code, that can damage my system. I tried to `chmod a-r` on the virtualenv, and now nobody can write there, but its parent directory is now unprotected.   So I thought I could change permissions on `/bin/python`, so that it can write nowhere, how can I do this?   I tried `chmod a-r bin/python` but it is still allowed to remove files and directories even outside the env.


title: Mount printers at /dev/usb and still use CUPS

text: Due to a new version of CUPS, I suddenly lost the direct path to my printers that was previously available under `/dev/usb/lpXXX`. I used this to print directly from the command line. `echo "test" > /dev/usb/lp0`. After searching I found a way to fix this, by commenting out `blacklist usblp` in `/etc/modprobe.d/blacklist.conf`. This indeed works, but if I do so CUPS will no longer be able to communicate with any printer (and I do need that). So how can I have some sort of direct path to my printer, and still have CUPS working? NOTE: some of the (receipt) printers are not recognized by CUPS, so `lpr` will not work for those.


title: Installing glibc 2.3 for mysql server

text: I need to install mysql server and client for a project of mine so I downloaded the MySQL-client-5.1.61-1.glibc23.i386.rpm for the client and MySQL-server-5.1.61-1.glibc23.i386.rpm for the server. I followed the instructions on the mysql site and it says I need the glibc 2.3 libraries and what I try to install it gives me among other: libc.so.6(GLIBC_2.3) is needed by MySQL-client-5.1.61-1.glibc23.i386 I didn't find a way to install it online and I don't really know how to build/compile it myself.. What to do? How do I easily install glibc 2.3? *using Ubuntu 10.10


title: Inconsistencies between redirecting input from file, here docs, and here strings

text: Why is this inconsistent? I would expect here docs and here strings to be functionally equivalent to redirecting input from a file.               $ bash --version     GNU bash, version 4.1.2(1)-release (x86_64-unknown-linux-gnu)     ...      # Expected output: Prints each item from list.               $ for server in $(<servers.txt); do echo ${server}; done     server1     server2     server3     $      # Unexpected output: Prints nothing.               $ for server in $(<<EOF     > server1     > server2     > server3     > EOF     > ); do echo ${server}; done     $      # Unexpected output: Prints nothing.               $ for server in $(<<<"server1     > server2     > server3"); do echo ${server}; done     $      * * * Edit: I traced bash while using an input redirector, and again with a here string. Here's the difference in behavior between the two: # Input redirector               $ echo $(<servers.txt)          ...     31929 open("servers.txt", O_RDONLY)     = 3     31929 read(3, "server1\nserver2\nserver3\n", 128) = 24     31929 write(1, "server1\nserver2\nserver3\n", 24) = 24     ...      This spawns child process 31929, which opens servers.txt as FD 3 and writes it to stdout. # Here string               $ echo $(<<<"server1     > server2     > server3")          ...     31990 open("/tmp/sh-thd-106091305575", O_WRONLY|O_CREAT|O_EXCL|O_TRUNC, 0600) = 3     31990 write(3, "server1\nserver2\nserver3", 23) = 23     31990 write(3, "\n", 1)                 = 1     31990 open("/tmp/sh-thd-106091305575", O_RDONLY) = 4     31990 close(3)                          = 0     31990 unlink("/tmp/sh-thd-106091305575") = 0     31990 fcntl(0, F_GETFD)                 = 0     31990 fcntl(0, F_DUPFD, 10)             = 10     31990 fcntl(0, F_GETFD)                 = 0     31990 fcntl(10, F_SETFD, FD_CLOEXEC)    = 0     31990 dup2(4, 0)                        = 0     31990 close(4)                          = 0     31990 dup2(10, 0)                       = 0     31990 fcntl(10, F_GETFD)                = 0x1 (flags FD_CLOEXEC)     31990 close(10)     ...      Several steps are performed here:   1. Child process 31990 is spawned   2. The here string is written to /tmp/sh-thd-106091305575   3. /tmp/sh-thd-106091305575 is opened as read-only (FD 4)   4. /tmp/sh-thd-106091305575 is unlinked (so when FD 4 is closed it will be deleted)   5. stdin is duped to FD 10   6. FD 4 (the temp file containing our here string) is duped to FD 0 (stdin) This is where a process -- in this case the bash subshell -- would act on stdin   7. FD 4 is closed and FD 10 is duped back to FD 0 The surprising thing is that this ever happens in the input redirector example:               31929 write(1, "server1\nserver2\nserver3\n", 24) = 24      I suspect that bash has special behavior for this case. Will probably need to dig into the source for a definitive answer.


title: Which strategy suits best a user with a scientific background like me? (Linux Desktop, Dual Boot, Virtualization)/ (Fedora? Arch? Win?)

text: First of all,   1. I've a scientific background and my professional work involves scientific computation: Lots of Python, Matlab, C/C++, TeX, Git, Java apps and some Julia, Parallel computing, web development and other every day works.   2. I like command-line and scripts. I like the manifest of simplicity as Arch claims. But I afraid that this cause me a lots of time and I don't know whether this minor joy worth it or not.   3. I've been with Linux since 2003, However I'm not more than a intermediate user (at most) so I'm not definitely an Admin or sth comparable. Unfortunately I've been away from Linux during the last 3 years and now I'm temptation to come back and get familiar again.   4. Being stable is a must have feature since I am usually involved with something else other than maintaining or tweaking OS. But I love the ability to customize the OS. stable for me doesn't means no hang or no reboot. I want a solution which I could rely on for a while, a solution which OS acts more like a tool not a constant target of fix (I know this is very much based on my experience...). I want to install my OS once, configure it once in while and just update it after then without any breaking compatibility or widespread bugs or problems. I'm comfortable with Windows, I've even adopted PowerShell+Cygwin and lots of unix-like solutions, Python, TeXLive, Git, Java are working (but not as clean as Linux) I've even "pushed" myself to use a bit of C# for power-shell command-lets (to resemble bash script, btw I don't like .NET). In fact Windows is doing the job but I like a first hand experience and better solution. I think It might worth it to get more power/flexibility/clear maintenance with a little effort/time. These different and even contradicting desires make it hard for me to decide a good strategy for my new machine. I like to come back to the Linux world but I'm afraid of putting a lot of time there. And since I've been away for a while I don't have enough information about the current condition of Linux desktop. Currently I've these options: A. Using Linux and Windows as dual boot alongside each other. B. Using Windows (as host) and installing Linux on a virtual machine C. Using Windows, forgetting about Linux and try equivalent solutions and configs in windows world. about the distro I also have same conflicts, I had been primary a Fedora user.... Ubuntu? I've still many doubts...Debian seems far from edge, sid? I don't know....I love Arch philosophy of being simple but never tried it (and again I'm afraid of possible time, is it really time consuming?),... So please help me with my decision, what do you suggest? p.s. I didn't have a good experience with virtual machines in the past, lots of problems, it might be changed now but currently I think installing Linux in a VM isn't a good idea. Thanks # **UPDATE: (according to goldilocks comment)** ## What is my primary research background? I'm a PhD student and I'm working on Digital Signal Processing (Department EECS: Communication Systems) Most of my works are primarily mathematics, simulation (numerical computation) and publishing (TeX and Vector Graphics). My Primary developing/simulation/app environments are:   * MATLAB   * Python   * C/C++   * TeX   * Research Suits such as (Docear based on Java, Zotero, ....)   * PDF   * Git I've also some interests and hobbyes such as Julia, Java, Web Development (Drupal, HTML/CSS, XAMP,...),... ## Why I'm not completely satisfied with Windows? I've experienced Linux before.   1. Python, TeXLive, Java and even MATLAB have much better performance in Linux than windows.   2. I like and I need many batch and automated tasks which again can be done much better in Linux world. (Most of apps has a command line interface, python scripts and bash scripts are easy to develop. Windows is not comparable in this case at all even with their promising object based PowerShell, simply it's not POSIX)   3. I want a simplified and open strategy for maintaining my OS (e.g. having config text files instead of complicated registery and closed configurations). I like and I want to have access to all of my OS corners. This provide better maintenance and debug and fix capabilities.   4. Security (I'm get tired of AV,SandBoxes,VirtualEnvironments,Firewalls,ALETS....)   5. I'm a Geek, I'm curious! Linux offers me better performance and maintenance in many areas. But my doubt is about stability of Linux (as I mentioned). I've no problem in putting time to customize my OS, to Search, to Ask and to Learn but I doubt the stability of a Linux OS with frequent updates and configurations for a desktop user (Stability of Linux server is good, OK). ## About Distros I'm agree with you about the distro. There is not much difference between them but consider Arch-Linux with Fedora as an example. There are substantial differences from maintenance point of view (As it seems, I don't have any experience with Arch and this is why I'm asking here). ## Putting Time for your Linux As I said I don't have any problems with user interface of Linux or command lines or manuals etc. These are things which I actually love. I'm afraid of putting LOTS OF TIME in Fixing Buggy and Broken Packages/OS. Consider this example: I've installed Fedora (SUSE) and I want to adapt KDE(Gnome) as my primary DE, but the default configuration provided in precompiled packages is very buggy and fail prone. OK, this is Linux, it's almost POSIX and I can do a lot, blah blah blah I agree! But I don't like to put "a lots of" time in these part of daily maintenance job. OK now my Linux OS performs stable and I'm busy with my software and daily jobs now I want to update the OS to the newer release....e.g. from Fedora 20 to Fedora 21, the OS is upgraded and BANG! lot of packages don't work, many primary OS functionalities are broken you have to put one or two day to solve all these problems. This is just a scenario, What I'm asking is this: How probable such scenario happens in Linux nowadays (for a intermediate user)? Two three years ago when I was using Fedora it was probable.


title: Gnome 3 crashes while creating new Password Keyring

text: I'm using Sabayon 10 with Gnome 3. The problem is Gnome crashes and restarts when I try to create new Password Keyring. Passwords and Keys > + > Password Keyring > 'typing name & passwords' > CRASH I cannot create that so can't log on to online accounts. The OS is clean, installed yesterday, no more desktops on it, but Fluxbox. Do you have any ideas how to fix it? \--- EDIT --- Using MATE I see `Can't communicate with gnome-keyring-daemon`.


title: Ubuntu One on Linux Mint won't install: Depends: libnautilus-extension1a

text: The full error I'm experiencing when I try to install Ubuntu One on my Linux Mint 13 OS is "ubuntuone-client-gnome: Depends: libnautilus-extension1a (>= 1:2.91) but 1:3.4.2-0ubuntu5 is to be installed" I need the files from Ubuntu One on my Mint build, so I was hoping someone could give me a hand with getting Ubuntu One installed.


title: Is a virtual console considered a process running on the OS kernel?

text: A terminal emulator is a program/process running in the GUI of an OS. A linux kernel offers 7 virtual consoles. Is a virtual console also a process running on the OS kernel?


title: Create bash completion script to autocomplete paths after is-equal sign?

text: I want to create a bash completion script which recognises arguments of the form `--arg` and `--some-arg=file`. After reading this tutorial and some examples in `/usr/share/bash_completion/completions/`, I've written the following script (to save time at typing some flags with Chromium):               _chromium()      {         local cur prev opts         COMPREPLY=()         cur="${COMP_WORDS[COMP_CWORD]}"         prev="${COMP_WORDS[COMP_CWORD-1]}"              # Some interesting options         opts="     --disable-web-security     --easy-off-store-extension-install     --incognito     --load-extension=     --pack-extension=     --pack-extension-key=     --user-data-dir=     "         # Handle --xxxxxx=file         if [[ ${cur} == "--"*"=" ]] ; then             # Removed failures (is my logic OK?)             return 0         fi              # Handle other options         if [[ ${cur} == -* ]] ; then             COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )             return 0         fi     }     complete -F _chromium chromium      I saved it to `~/bash_completions/chromium`, and created a symlink using `sudo ln -s ~/bash_completions/chromium /usr/share/bash_completion/completions/chromium`.   Then I loaded it using `. /usr/share/bash_completions/completions/chromium`. Now, I'm experiencing two problems:   * `chromium --u<TAB>` expands to `chromium --user-data-dir=<SPACE>` (I don't want the space).   * Paths (directories and files) are not completed any more. How can I solve these problems?


title: Why `which tmux` and `sudo which tmux` return 2 different values?

text: ssh bobby@tony:~$ which tmux                                                                             /usr/bin/tmux     ssh bobby@tony:~$ sudo which tmux                                                                        /usr/local/bin/tmux     ssh bobby@tony:~$ echo $PATH                                                                             /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/git/bin:/usr/local/sbin:/usr/local/sbin     ssh bobby@tony:~$ sudo echo $PATH                                                                        /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/git/bin:/usr/local/sbin:/usr/local/sbin      Anyone knows what's going on here? Why does `sudo which tmux` return /usr/local/bin/tmux instead of /usr/bin/tmux? PS: I have 2 versions of tmux installed (one in /usr/bin and the other in /usr/local/bin).


title: I cannot install "unifdef" on CentOS 6

text: After I ran `yum install unifdef` I got "No package unifdef available" I already added all sources. (Base, contrib, Debuginfo, Extras, Plus and Updates)


title: Xvfb or Firefox throwing errors & gratuitously logging

text: per the answer to this question, I'm running Xvfb to make a virtual display so firefox will run on my CentOS server. (I don't need to see firefox or do any actual key or screen input/output with firefox-- it just needs to run so Selenium can drive it.) I'm trying to figure out why Xvfb (or firefox) is throwing a bunch of errors. I start up Xvfb with this command:               Xvfb :1 -screen 0 1024x768x24 &      And immediately after I start it, a couple of error messages are echoed back to the screen (oddly, they appear after the shell prompt):               [root@host /home/lm/cron]# Xvfb :1 -screen 0 1024x768x24 &                    [1] 9214     [root@host /home/lm/cron]# expected keysym, got XF86TouchpadOn: line 120 of inet     expected keysym, got XF86TouchpadOff: line 121 of inet      And many more errors show up in the Selenium log show up when I run my Selenium test script:               5 XSELINUXs still allocated at reset     SCREEN: 0 objects of 176 bytes = 0 total bytes 0 private allocs     DEVICE: 4 objects of 48 bytes = 192 total bytes 0 private allocs     CLIENT: 0 objects of 144 bytes = 0 total bytes 0 private allocs     WINDOW: 0 objects of 48 bytes = 0 total bytes 0 private allocs     PIXMAP: 1 objects of 16 bytes = 16 total bytes 0 private allocs     GC: 0 objects of 56 bytes = 0 total bytes 0 private allocs     CURSOR: 0 objects of 8 bytes = 0 total bytes 0 private allocs     CURSOR_BITS: 0 objects of 8 bytes = 0 total bytes 0 private allocs     DBE_WINDOW: 0 objects of 24 bytes = 0 total bytes 0 private allocs     TOTAL: 5 objects, 208 bytes, 0 allocs     4 DEVICEs still allocated at reset     DEVICE: 4 objects of 48 bytes = 192 total bytes 0 private allocs     CLIENT: 0 objects of 144 bytes = 0 total bytes 0 private allocs     WINDOW: 0 objects of 48 bytes = 0 total bytes 0 private allocs     PIXMAP: 1 objects of 16 bytes = 16 total bytes 0 private allocs     GC: 0 objects of 56 bytes = 0 total bytes 0 private allocs     CURSOR: 0 objects of 8 bytes = 0 total bytes 0 private allocs     CURSOR_BITS: 0 objects of 8 bytes = 0 total bytes 0 private allocs     DBE_WINDOW: 0 objects of 24 bytes = 0 total bytes 0 private allocs     TOTAL: 5 objects, 208 bytes, 0 allocs     1 PIXMAPs still allocated at reset     PIXMAP: 1 objects of 16 bytes = 16 total bytes 0 private allocs     GC: 0 objects of 56 bytes = 0 total bytes 0 private allocs     CURSOR: 0 objects of 8 bytes = 0 total bytes 0 private allocs     CURSOR_BITS: 0 objects of 8 bytes = 0 total bytes 0 private allocs     DBE_WINDOW: 0 objects of 24 bytes = 0 total bytes 0 private allocs     TOTAL: 1 objects, 16 bytes, 0 allocs     14:33:47.919 INFO - Done: /session/1330284794945     expected keysym, got XF86TouchpadOn: line 120 of inet     expected keysym, got XF86TouchpadOff: line 121 of inet      Now, here's the funny part, despite ALL of this mess, everything is working: Selenium is talking to firefox property, firefox is doing what it's supposed to and passing it back to Selenium, etc. I just want to know if (a) I should be worried about all these messages/errors, and (b) how can I clean this up? (It actually appears to me that most of this is some kind of verbose logging info about 'allocs'-- which I'd like to turn off-- and then those 'expected keysym' messages are exceptions being thrown.)


title: Getting a list of WiFi networks nearby when the adapter is in AP mode

text: I am trying to get a list of wireless networks nearby while the adapter is acting as an access point but iwlist returns the following error:               $ sudo iwlist wlan0 scan     wlan0     Interface doesn't support scanning : Operation not supported      Is there another way of getting this list, perhaps with another utility? My Tomato powered WRT54 seems to be able to achieve this (listing nearby APs while the device itself is set up as an AP), so I'm curious how I could replicate that behaviour. Thanks.


title: egrep part required for svn hook script

text: I am trying to write a pre commit hook script to Enforcing tag naming convention like `< application>_ < project >_ < version>_ < iteration>` this using a shell script can anyone guide me to a doc/link something which I can go through and can create one. I have already gone through many links but didn't work for me I am trying something like this               ERROR=$SVNLOOK changed $REPO -t $REV |$EGREP "^A.+?/([a-z0-9_]+)/tags/\1-[0-9]+.[0-9]+.[0-9]+(.[0-9]+)?-(dev|rc[0-9]+|final)/.*$" |$WC -l      Need help in regex (EGREP) part so that I can create it.               #!/bin/sh          REPO="$1"     REV="$2"     ERROR=0     SVNLOOK=/usr/bin/svnlook          AWK=/bin/awk     GREP=/bin/grep     EGREP=/bin/egrep     WC=/usr/bin/wc               ERROR=`$SVNLOOK changed $REPO -t $REV |$EGREP -i "^A.+/tags/.+$" |$WC -l`     if [ $ERROR -ne 0 ]     then            ERROR=`$SVNLOOK changed $REPO -t $REV |$EGREP "^A.+?/([a-z0-9_]+)/tags/\1-[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?-(dev|rc[0-9]+|final)/.*$" |$WC -l`       if [ $ERROR -eq 0 ]       then         echo "Tag isn't in the correct format" 1>&2         exit 1       fi      **Example** : FV_SSE-MAY-14_2.1.0_03 Where: Application = FV Project = SSE-MAY-14 Version = 2.1.0 Iteration = 03


title: Evalute passed in variable in bash

text: Is there a way to pass in a variable as an argument to a bash script and have it evaluated scoped by the bash script? **Given** :               # cat /path/to/file/of/host/names     bob     tom     joe     etc...               # dofor     FILE=$1     shift     CMD=$*          while read host; do         # recursively turns "ssh \$host hostname" from $@ into:         # ssh bob hostname         # ssh tom hostname         # ssh joe hostname         # etc...         eval $CMD     done < $FILE      **When** :               # dofor /path/to/file/of/host/names "ssh \$host hostname"      **Then** : I'd receive the output from running `ssh host hostname` for each hostname listed in /path/to/file/of/host/names. e.g.:               bob.example.com     tom.example.com     joe.example.com     etc...


title: Deleting user directories with . in name

text: I have directories with usernames as "firstname.lastname" and firstname.middle.lastname in one directory. Is there a way to delete directories with "." in name under current directory. I need to run this on several servers and trying to find a way to do it with find. I read the man page for the find but couldn't find any good solution for it.