title: Docker - Force to Use AUFS Instead of BTRFS

text: I am having significant problems using Docker on my BTRFS filesystem, and I suspect that is due to a lack of stability with the BTRFS driver. I would rather figure out how to switch the fs driver than ask multiple questions about the problems I have been having. Originally it would fill my hard drive with about 4 builds of any Dockerfile and deleting images and containers would not help (and this is with ~80GB of space left); I also had to delete BTRFS subvolumes from `/var/lib/docker/btrfs/subvolumes`. Now I have a still-more- annoying problem where no images can be pulled because a file or directory exists (in a location which is completely removed first). So because these problems have been so cryptic and un-Googleable, I'd like to just force the driver to be AUFS. How do I go about doing this? I am using 64-bit Arch Linux. Any guidance or pointers in the right direction would be greatly appreciated.


title: how to set and use multiple parameters in single environmental variable in fish shell

text: I want to use following in `fish` shell:               $ export arm='ARCH=arm CROSS_COMPILE=arm-eabi-'     $ make $arm       This works fine in `bash/zsh` but _not_ on `fish` shell. But if I execute the following in `fish` shell:               $env tmp=arm make      this works fine. Can someone please help me with this?


title: How do I pg_upgrade my database on Arch Linux?

text: I was running postgres 8.4 on arch but now have 9 installed I want to use `pg_upgrade` to upgrade but I don't know what all the options I have to use are, and all the directories that I have to point it to. I think it asks for a previous pg binary directory... but that's gone. Will it still work? I've no important data, just play db's I just want to know how to do it. I also realize this is borderline serverfault, but I feel it has as much to do with arch's install process and paths, so I thought I'd ask here.


title: Is there a way to dynamically refresh the less command?

text: I like the `watch` command, but it has its limitations. I'm curious to know whether I could mimic the functionality of `watch` with `less`. I'm mainly looking for the ability to scroll through my directory as it dynamically gets modified via a running script.


title: git archive fatal: Operation not supported by protocol

text: I can do `git clone` like so ...                git clone https://github.com/stackforge/puppet-heat.git      ... with no problems. But I want to exclude all the git meta stuff that comes with the cloning, so I figured I would use `git clone` but I get this error:               $ git archive --remote=https://github.com/stackforge/puppet-heat.git      fatal: Operation not supported by protocol.      Anyone know why or what I am doing wrong?


title: Yum update crashing my OpenVPN tunnels

text: I have 100's of CentOS 5.10 clients that I access through a OpenVPN connection. I have internal repo that they use for updates. However some of my clients have some serious issues pulling packages from the internal repo. I have time out issues on some clients while running "yum repolist", also I have tried to run "yum -y update" on a few of these clients and watched the OpenVPN tunnels just fall apart, only to re-establish a connection later. What could be going on here? Is yum being greedy with bandwidth?


title: Yum not working

text: When I try to execute yum I get this: ![enter image description here](http://i.stack.imgur.com/q8VIm.png) My guess is I need to start the Ethernet connection because I cant ping and this is what what we do with SL6. I'm new to CentOS that is why I ask. I've already run `service start network` but it still does not work. ### UPDATE #1 Here's the output from `ifconfig`.           ![ss of ifconfig output](http://i.stack.imgur.com/bUXj2.png)


title: What's the difference between "realpath" and "readlink -f"

text: I've read a lot about `realpath` command and how it has been deprecated with the `readlink -f` being now recommended. I have also seen in some places that the reason why realpath was introduced was for the lack of such functionality in readlink and that once it has been introduced, realpath was no longer needed and its support discontinued by most OS vendors. The reason for my question is that I've also seen many people recommending `readlink -f` as a command "pretty much similar" to `realpath`, and that is what is bothering me, because no one elaborates on that "pretty much similar" part. What are the actual differences?


title: Why do I need 3 git repositories for ikiwiki if I want to commit locally

text: If I have a local ikiwiki on my laptop I need a "repository" directory (`mywiki.git` - a bare repository), a "scrdir" (`myiki` a git repository) and a place where the produced html files go ("destdir") to run it properly from a web browser locally. However if I also want to work with a text editor and git on the command line I need to setup a third git repository say `mywiki.local` ("working clone"). Which puhes to `mywiki.git` which in turn triggers a `post-update` hook to push to the scrdir and rebuild the html pages, as illustrated in the following picture: ![Workflow](http://i.stack.imgur.com/NGdVR.png) With this approach, I need **three** almost identical directories on my laptop just to run one wiki, i.e. it occupies three times the disk space instead of just once. What is the reason behind this? Is there a safe way to circumvent this if you are just working on one machine, to reduce it to just two or even better one directory?


title: Creating yum .repo file from a remote repo using rpm

text: This command (from the install page for Varnish 3.x):               rpm --nosignature -i http://repo.varnish-cache.org/redhat/varnish-3.0/el6/noarch/varnish-release/varnish-release-3.0-1.el6.noarch.rpm      appears to generates `varnish.repo` in `/etc/yum.repos.d/` containing               [varnish-3.0]     name=Varnish 3.0 for Enterprise Linux el6 - $basearch     baseurl=http://repo.varnish-cache.org/redhat/varnish-3.0/el6/$basearch     enabled=1     gpgcheck=0     #gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-VARNISH      I'm looking at configuring a local rpm package server, and wondering how this can be setup? The `.rpm` file above is binary, `-i` implies " _Display package information ..._ " and `\--nosignature` implies " _Don’t verify package or header signatures when reading_ ", and I'm unclear how or what generates the `varnish.repo` file. The man page for `rpm` does not have a reference to `.repo` and I'm not sure what this function/parameter is called.


simple question: "need a way to proxify a port" I have a linux server and have a proxy server on another machine. My linux server needs connect to port 'x' on ip 'y' Is it possible to create iptables rule or another way to: when my linux server tries to connect to port 'x' on ip 'y' uses my proxy server on another machine? In other words, I need to my server's ip changes when it needs to connect port 'x' on ip 'y' by using another proxy server machine.


title: How to install latest catfish in ubuntu 10.04

text: I was trying to install the **latest** catfish from https://launchpad.net/catfish-search/+download on my Ubuntu 10.04 (need this version at the moment, nothing more recent) The version in apt-get for Ubuntu 10.04 is not sufficient for me at the moment. Unzipping the archive and doing what is described in the INSTALL file. but when trying to launch catfish, the following appears:               :~$ catfish     Traceback (most recent call last):       File "bin/catfish.py", line 24, in <module>         from gi.repository import GObject     ImportError: No module named gi.repository      So I tried to install http://packages.ubuntu.com/precise/python3-gi but I can't find this via `aptitude` or `synaptic`. What to do?


title: How to change encoding from Non-ISO extended-ASCII text, with CRLF line terminators to UTF-8?

text: I have a txt file :               $ file -i x.txt     x.txt: text/plain; charset=unknown-8bit     $ file x.txt      x.txt: Non-ISO extended-ASCII text, with CRLF line terminators      And there are some characters that are incorrectly encoded :               trwa³y, sta³y, usuwaæ      How can I change this file's encoding to UTF-8 ? I have tried the following way so far :               $ iconv -f ASCII -t UTF-8 x.txt                     puiconv: illegal input sequence at position 4      Maybe I should somehow use `extended ASCII` ( `high ASCII` ) but cannot find it in `iconv`'s encoding list.


title: How do I interpret an entry about cron in Gnome System Log Viewer

text: Apologies if this turns out to be a trivial question. I am trying to set up a regular backup of my files prior to installing Fedora 19 instead of my current Fedora 12. In November 2013 I started a trial, backing up some small files into my home directory as a first test that I had got it right. This has happily done this backup every three days ever since (I didn't want to wait too long to see if it worked). I have now bought an exterior drive for the backups, and want to test the scheme again in the same way on to the new drive, before I commit all my files to it. The problem is that I cannot remember how I set up the schedule -- it must have seemed so obvious then that I did not make any notes. This is the relevant entry in my Gnome System Log Viewer for cron for the latest backup: Jan 7 16:56:01 SN031568820668 CROND[7361]: (Harry) CMD (/home/Harry/fredx.sh #JOB_ID_2) So my question is: please how do I interpret this and does this give any clue as to how to set it up? If not, how should I go about it? This is the content of fred.x:               #!/bin/sh     DISPLAY=:0.0     testrsync/trial_bak.sh      And this is what is in trial_bak.sh, edited to suit the external drive, I hope:               #!/bin/bash     # Adated from: http://webgnuru.com/linux/rsync_incremental.php     #  Website Backup Script     #======================================================================     # Define Variables     # Todays date in ISO-8601 format e.g. 2013-10-19:     DAY0=`date -I`      # Yesterdays date in ISO-8601 format:     DAY1=`date -I -d "1 day ago"`     # The source directory:     SRC="/home/Harry/testrsync/bravo/"     # The target directory:     #TRG="/home/Harry/testrsync/backups/$DAY0"     TRG="/media/CA6C321E6C32062B/$DAY0"     # The link destination directory:     #LNK="/home/Harry/testrsync/backups/$DAY1"     LNK="/media/CA6C321E6C32062B/$DAY1"     #The rsync options:     OPT="-avh --delete --link-dest=$LNK"     #======================================================================     #Execute the backup     rsync $OPT $SRC $TRG     #Delete old backups cyclically     # for my tests I am going to use a three day cycle     DAY4=`date -I -d "4 days ago"`     #Delete the backup from 4 days ago, if it exists     if [ -d /home/Harry/testrsync/backups/$DAY4 ]     then     rm -r /home/Harry/testrsync/backups/$DAY4     fi     zenity --info --text='Backup complete' --title="Backup Test"      I think the zenity line does not do anything. Here is a listing of the /home/Harry/testrsync/backups directory: 2013-11-02 2013-11-13 2013-11-26 2013-12-11 2013-12-27 2014-01-05 2013-11-03 2013-11-19 2013-12-02 2013-12-18 2013-12-29 2014-01-06 2013-11-05 2013-11-20 2013-12-10 2013-12-21 2014-01-04 2014-01-07


title: Log files corrupted with NUL characters and text from other processes

text: I am running Wind River Linux 4.3 on an embedded Freescale single board computer (SBC). Output from `uname -a`:               Linux ge101 2.6.34.10-myname-grsec-WR4.3.0.0_cgl #1 SMP PREEMPT Mon Aug 26 01:35:35 PDT 2013 ppc ppc ppc GNU/Linux      There are several modules / processes running and creating log files that I am interested in collecting:   1. A kernel module logging to /var/log/messages   2. A userspace application which is having its stdout redirected to a log file. This application is automatically started upon bootup by an init.d script. The script does this by the following: `nohup ${executable_name} -C ${configfile_name} >> ${logfile} 2>&1 &`   3. This same userspace application writes other data to a separate file on the SBC's filesystem.   4. A Python script using the `logging` module to write to a log file. I am seeing a bizarre problem where these 4 log files occasionally are "corrupted" in the following way:   * Anywhere between 78-309 NUL characters are inserted into the log file   * Text from another log file (40 or so lines) gets inserted into it   * When this happens, there is a chunk of data missing from the log file Additionally, there are some instances where only the NUL characters are inserted, and no text from other logs gets intermingled in. In a log file on the order of 100k lines, this behavior occurs 7-9 times. The NUL characters by themselves would be fairly easy to remove during post- processing. However, the unexpected data showing up from other files is breaking parsing scripts. And of course, the missing chunk of data is the most troublesome. Does anyone know what might cause this bizarre behavior to occur?


title: search fitting ipv6 address for MAC-Address in neighbours

text: I have a list of possible to ip6 addresses converted MAC-addresses, that could be found in the output of               ping6 ff02::1%wlan0      possible mac addresses are for example:               66:70:02:75:80:fe, 64:70:02:74:80:fe, 66:70:02:74:80:ff      each of them would lead to a Link-local ip6 address beginning with `fe80::` and inserted `FF:FE` in the middle so `66:70:02:75:80:fe` would lead to `fe80::6670:2ff:fe75:80fe` I would like to create a script that gives out the matching LinkLocal address for a list of MAC adddresses like:               $ find-in-macs 66:70:02:75:80:fe 64:70:02:74:80:fe 66:70:02:74:80:ff      and the output:               matching IP6: fe80::6670:2ff:fe75:80fe      that script `find-in-macs` could look like this:               #!/bin/bash     mac_to_ipv6 () {       IFS=':'; set $1; unset IFS       ipv6_address="fe80::$(printf %02x $((0x$1 ^ 2)))$2:${3}ff:fe$4:$5$6"       echo $ipv6_address     }               for i do         echo checking $i         ping6 ff02::1%wlan0|grep mac_to_ipv6 $i     done


title: Vim powerline with broken encoding

text: I trying to learn using vim, I am enjoining a lot, but I copied the vimrc from github and I would like to understand what is causing the break of powerline encoding. .![Snapshot of my vim](http://i.stack.imgur.com/jmnKa.png)   1. In the vimrc file I have: `set encoding=utf-8`   2. I cleared the PowerLine cache   3. My vim version doesn't show the `\--with-features=big` flag. Could this be the problem and if yes, how can I fix it?


title: how to loop through arguments in a bash script

text: I would like to write a bash script with unknown amount of arguments. How can I walk through these arguments and do something with them? A wrong attempt would look like this:               #!/bin/bash     for i in $args; do          echo $i     done


title: Convert MAC address to Link-local address with bash

text: How can I convert a Mac address into an ipv6 Link-Local address? you have to add `fe80::` at the start and insert `ff:fe` in the middle furthermore all leading zeros must be stripped


title: How similar are Android and QNX?

text: The root of the question is really: "Can you run the Android OS on a BlackBerry PlayBook?" Since one is a Linux derivative and the other is a Unix derivative, it seems a natural fit for here.


title: rm -rf all files and all hidden files w/o . & .. error?

text: `rm -rf /some/path/*` deletes all non-hidden files in that dir (and subdirs). `rm -rf /some/path/.*` deletes all hidden files in that dir (but not subdirs) and also gives the following error/warning:               rm: cannot remove directory: `/some/dir/.'     rm: cannot remove directory: `/some/dir/..'      What is the proper way to remove all hidden and non-hidden files and folders recursively in a target directory and also not receive the warning/error about `.` and `..`?


title: How to switch tags via awesome API

text: I've been digging around in the API documentation, and I'm having limited sucess switching tags from within awesome-client. Basically, I can switch tags with:               awful.tag.viewidx(2)      But that is relative not absolute. From looking in my rc.lua, looks like what I need is:               local screen = mouse.screen     awful.tag.viewonly(tags[screen][2])      But I get the following error instead:               attempt to index field '?' (a nil value)      What is the most concise way of changing tags (preferably one command) to an absolute tag number. Alternatively, how can I find the current tag?


title: want the last line when duplicate awk?

text: I have the file:               key value          blah blah     blah blah     blahblah     man1 boy1     blah blah     man1 boy2     man1 boy1      I do this to remove duplicate lines:               awk '/man1/ { print $1,$2} ' file | awk '!x[$0]++'      and the command take the first line and ignore other lines               man1 boy1      man1 boy2      but I want to ignore all lines except the last line:               man1 boy2      man1 boy1      as ramesh said I want something like:               cat filename     blah blah     blah blah     blahblah     man1 boy1     blah blah     man1 boy2     man1 boy1     man1 boy2     man1 boy3     man1 boy4     man1 boy2      the desired output               man1 boy1     man1 boy3     man1 boy4     man1 boy2


title: DHCP server not responding to requests from KVM guest

text: I've setup a DHCP server on my Debian server (Proxmox) so that I can provision IPs to my KVM guests on the server automatically. For some reason the DHCP server (isc-dhcp-server) isn't responding to requests for an IP. The DHCP server is set to listen to a bridge interface I've created called vmbr1 and I know requests are getting through to the host from the KVM guest as I've tested it through `dhcpdump -i vmbr1`. I've obviously made a mistake somewhere, can anyone spot it? I've included my configuration files below. **dhcp.conf file:**               ddns-update-style none;     deny declines;     deny bootp;     default-lease-time 600;     max-lease-time 7200;     log-facility local7;     subnet 192.168.0.0 netmask 255.255.255.224 {          interface vmbr1;          option routers 192.168.0.5;          option broadcast-address 192.168.0.31;          option ntp-servers 192.168.0.101;          option domain-name-servers 192.168.0.101;          option netbios-name-servers 192.168.0.101;          option netbios-node-type 2;          default-lease-time 86400;          max-lease-time 86400;          #vmbr1ipv4           host 104 {hardware ethernet 1A:27:59:82:39:8E;fixed-address 95.141.36.124;}     }      **isc-dhcp-server file:**               # Defaults for isc-dhcp-server initscript     # sourced by /etc/init.d/isc-dhcp-server     # installed at /etc/default/isc-dhcp-server by the maintainer scripts          #     # This is a POSIX shell fragment     #          # Path to dhcpd's config file (default: /etc/dhcp/dhcpd.conf).     #DHCPD_CONF=/etc/dhcp/dhcpd.conf          # Path to dhcpd's PID file (default: /var/run/dhcpd.pid).     #DHCPD_PID=/var/run/dhcpd.pid          # Additional options to start dhcpd with.     #       Don't use options -cf or -pf here; use DHCPD_CONF/ DHCPD_PID instead     #OPTIONS=""          # On what interfaces should the DHCP server (dhcpd) serve DHCP requests?     #       Separate multiple interfaces with spaces, e.g. "eth0 eth1".     INTERFACES="vmbr1"      **interfaces file on host:**               # network interface settings     auto lo     iface lo inet loopback          auto eth0     iface eth0 inet manual          auto vmbr0     iface vmbr0 inet static             address  95.141.36.188             netmask  255.255.255.0             gateway  95.141.36.1             broadcast  95.141.36.255             bridge_ports eth0             bridge_stp off             bridge_fd 0             network 95.141.36.0             bridge_maxwait 0          auto vmbr1     iface vmbr1 inet static             address  192.168.0.5             netmask  255.255.255.224             bridge_ports none             bridge_stp off             bridge_fd 0      **Example request from KVM guest to host server through vmbr1 using`dhcpdump -i vmbr1`:**                 TIME: 2014-05-28 21:40:14.232         IP: 0.0.0.0 (1a:27:59:82:39:8e) > 255.255.255.255 (ff:ff:ff:ff:ff:ff)         OP: 1 (BOOTPREQUEST)      HTYPE: 1 (Ethernet)       HLEN: 6       HOPS: 0        XID: 599fa654       SECS: 0      FLAGS: 0     CIADDR: 0.0.0.0     YIADDR: 0.0.0.0     SIADDR: 0.0.0.0     GIADDR: 0.0.0.0     CHADDR: 1a:27:59:82:39:8e:00:00:00:00:00:00:00:00:00:00      SNAME: .      FNAME: .     OPTION:  53 (  1) DHCP message type         1 (DHCPDISCOVER)     OPTION:  55 (  8) Parameter Request List      1 (Subnet mask)                              28 (Broadcast address)                               2 (Time offset)                               3 (Routers)                              15 (Domainname)                               6 (DNS server)                              12 (Host name)                              42 (NTP servers)          OPTION:  60 (  3) Vendor class identifier   d-i     ---------------------------------------------------------------------------      Output from `dhcpd`               Internet Systems Consortium DHCP Server 4.2.2     Copyright 2004-2011 Internet Systems Consortium.     All rights reserved.     For info, please visit https://www.isc.org/software/dhcp/     WARNING: Host declarations are global.  They are not limited to the scope you declared them in.     Wrote 0 deleted host decls to leases file.     Wrote 0 new dynamic host decls to leases file.     Wrote 0 leases to leases file.     Listening on LPF/vmbr1/fa:98:02:e0:1c:28/192.168.0.0/27     Sending on   LPF/vmbr1/fa:98:02:e0:1c:28/192.168.0.0/27     Sending on   Socket/fallback/fallback-net     There's already a DHCP server running.      Hopefully I've included enough information to help aid in a resolution. Many thanks!


title: Samba instructions work on CentOS 6.5, but not CentOS 6.3 - permissions in Windows are different

text: I followed these instructions to install Samba on both a CentOS 6.3 OS and a CentOS 6.5 OS. http://rbgeek.wordpress.com/2012/05/25/how-to-install-samba-server-on- centos-6/ It only seemed to work on the 6.5. I've built 4 of these in 6.5, and am very familiar with the setup. When I did the exact same thing in 6.3, I wasn't able to view the files in Windows at UNC path \192.168.245.132\MyShare. But I am in all 4 of my 6.5 machines. What could be wrong? The only major difference on these OS's was the fact that the 6.3 had Selinux installed and it was set to "enforcing" (turned on). So I disabled it. In the 6.5 version, I installed it but it was disabled by default.               # DISABLE SELINUX (BEFORE ACCESSING UNC PATH ON WINDOWS)          [root@localhost i2b2-1.6]# sudo nano /etc/selinux/config          # OLD VALUE:          # This file controls the state of SELinux on the system.     # SELINUX= can take one of these three values:     #     enforcing - SELinux security policy is enforced.     #     permissive - SELinux prints warnings instead of enforcing.     #     disabled - No SELinux policy is loaded.     SELINUX=enforcing     # SELINUXTYPE= can take one of these two values:     #     targeted - Targeted processes are protected,     #     mls - Multi Level Security protection.     SELINUXTYPE=targeted          # NEW VALUE:          # This file controls the state of SELinux on the system.     # SELINUX= can take one of these three values:     #     enforcing - SELinux security policy is enforced.     #     permissive - SELinux prints warnings instead of enforcing.     #     disabled - No SELinux policy is loaded.     SELINUX=disabled     # SELINUXTYPE= can take one of these two values:     #     targeted - Targeted processes are protected,     #     mls - Multi Level Security protection.     SELINUXTYPE=targeted          [root@localhost i2b2-1.6]# sudo service smb restart     Shutting down SMB services:                                [  OK  ]     Starting SMB services:                                     [  OK  ]     [root@localhost i2b2-1.6]# sudo service nmb restart     Shutting down NMB services:                                [  OK  ]     Starting NMB services:                                     [  OK  ]     [root@localhost i2b2-1.6]#      This is a picture from the 6.5 security of the "MyShare" folder (aka /samba/share/). ![enter image description here](http://i.stack.imgur.com/BWzC4.jpg) Picture from 6.3 install. ![enter image description here](http://i.stack.imgur.com/GHIqD.jpg) # EDIT: Now this is interesting. My share directory (/samba/share/) has a "." (dot) at the end of the permissions on 6.3 (non-working OS), and has a 3 following the permissions bits.               [root@localhost share]# ls -la     total 12     drwsrwsrwx. 3 root root 4096 May 27 18:42 .     drwxrwxrwx. 3 root root 4096 May 27 17:48 ..     drwxrwxrwx. 6 root root 4096 May 27 19:03 quick_install      The share directory (/samba/share/) does not have a "." (dot) at the end of the permissions on 6.5 (working OS), and has a 4 (not a 3) following the permission bits.               [root@localhost share]# ls -la     total 16     drwxrwxrwx 4 root root 4096 May 22 01:02 .     drwxr-xr-x 3 root root 4096 May 19 00:28 ..     drwsrwsrwt 2 root root 4096 May 23 00:37 certs     drwxr-xr-x 6 root root 4096 May 19 01:05 quick_install      http://superuser.com/questions/230559/what-does-the-dot-mean-at-the-end-of-rw- r-r-how-do-you-set-it-with-chmod Question is, how do I remove it. I had to disable Selenix after this directory was created. How do I fix this? # EDIT #2: Getting closer. Here is a reference, which wasn't 100% helpful. http://superuser.com/questions/191903/how-do-i-remove-any-selinux-context-or- acl This is called a SELinux ACL, not to be confused with the ligament from a lot of football injuries. The only problem is that I might have to restart the samba file share and reboot. But not sure.               [root@localhost share]# setfacl --help     setfacl 2.2.49 -- set file access control lists     Usage: setfacl [-bkndRLP] { -m|-M|-x|-X ... } file ...       -m, --modify=acl        modify the current ACL(s) of file(s)       -M, --modify-file=file  read ACL entries to modify from file       -x, --remove=acl        remove entries from the ACL(s) of file(s)       -X, --remove-file=file  read ACL entries to remove from file       -b, --remove-all        remove all extended ACL entries       -k, --remove-default    remove the default ACL           --set=acl           set the ACL of file(s), replacing the current ACL           --set-file=file     read ACL entries to set from file           --mask              do recalculate the effective rights mask       -n, --no-mask           don't recalculate the effective rights mask       -d, --default           operations apply to the default ACL       -R, --recursive         recurse into subdirectories       -L, --logical           logical walk, follow symbolic links       -P, --physical          physical walk, do not follow symbolic links           --restore=file      restore ACLs (inverse of `getfacl -R')           --test              test mode (ACLs are not modified)       -v, --version           print version and exit       -h, --help              this help text     [root@localhost share]#


title: Can I Share Localhost With Other Users Of My Linux Box?

text: Firstly, I admit I am a Linux / Apache nOOb, so I would really appreciate it if your answers are in plain English (smile) Is the apache localhost server available to all Linux accounts? If I use my Linux admin account to set up a web app in the /var/www/ directory, can people logged into other Linux accounts use that web app too by just typing in http://www.localhost/ in their web browsers? (I am talking about people who are at that computer, not people trying to access it over the internet). **The Scenario:** I will be setting up a web-based Point Of Sale (pos) system on a computer at one of our brick and mortar retail stores. (There is not internet access there). There will be two LINUX user accounts on that computer. One for me (the administrator) and one for the Sales People ("Sales"). So how should I set up apache so that the sales people can login to the Linux "Sales" user account and use the web-based app? By default, if the web app files are in the /var/www/ directory, can all Linux user accounts browse them in their web browsers just by going to `http://localhost/` Or do I need to do something else? (like set up a public_html directory ???)


title: Driver not showing in /sys/bus tree

text: I'm trying to bind the "rt3572sta" to a USB device that previously had the "rt2800usb" driver bound to it. I ran this:               $ sudo sh -c "echo [device-bus-id] > /sys/bus/usb/drivers/rt2800usb/unbind"      Where `[device-bus-id]` was 1-7. I then went to bind it to the "rt3572sta" driver, but for some reason that was not in `/sys/bus/usb/drivers`. How do I make it show up?


title: How to find in Linux if mule is running

text: When I try to get the status of `Mule` service in linux by this:               service mule status      I get this:               Usage: /etc/init.d/mule {start|stop|restart}      Apparently, mule service doesn't support status. How can I see that Mule is running then?


title: Debian experimental package refuses to install?

text: I keep getting this error:               ./binary: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by ./binary)      I tried the instructions here: http://superuser.com/questions/537683/how-to-fix-lib-x86-64-linux-gnu-libc- so-6-version-glibc-2-14-not-found But when I run `sudo apt-get -t experimental install libc6` it says the newest version is already installed, even though it clearly isn't because a) I just added experimental, and b) I still get that same error every frigging time I try to do anything. Is there any way I can get it to install? EDIT: To confirm that the experimental version isn't installed:               libc6:       Installed: 2.13-38       Candidate: 2.13-38


title: What's the difference between pkill and killall?

text: I know that `pkill` has more filtering rules than `killall`. My question is, what is the difference between:               pkill [signal] name      and               killall [signal] name      I've read that `killall` is more effective and kill all processes and subprocesses (and recursively) that match with `name` program. `pkill` doesn't do this too?


title: Why is Mono 3.x available specifically for OpenSuse and not other Linux (like Ubuntu)

text: The Mono download page has a download for OpenSuse but not any other version of Linux. Why is that, is OpenSuse better suited for Mono for some reason than say Ubuntu? We're developing on Macs using 3.2.5 and currently deploying to an Ubuntu (12.04) server using Mono 2.10. And notice some differences, especially artifacts in ServiceStack's razor engine but otherwise mostly ok. I tried installing 3.2.4 the long way around however the site just cashes on Ubuntu so had to roll that back to 2.10. I now need to rebuild the server anyway and would like to know if OpenSuse is the better image for us to use this time...?


title: SSH proxy laptop

text: I run a simple ssh proxy and I am always on the move with my laptop. Having to restart it every time I open the lid and connect to the internet.               sshpass -p password ssh -D 9999 root@myvpsip      Is it possible to have it start when my internet does then stop when the internet connection is terminated?               Network Manger     Cinnamon DE     Arch Linux x64


title: Native linux installation on another drive, alongside Windows 7

text: I have Windows 7 on my `C:` (primary) drive. Can I install another hard drive, and put Linux on it to ensure that there will be no conflicts?


title: Edit tree to output in custom format?

text: I'd like to get a custom output from the `tree` command, but unlike this question, I don't have a fixed format. I'd like to be able to give the command the format in an argument (for instance perhaps `-f=y`, `-f=yaml`,`-f=xml`,`-f=~/myformat.fmt`). Obviously this is a huge undertaking, but I feel it would be a good way to get to explore how some of the linux commands work under the hood, along with stretching my programming skills. Where should I start if I want to edit (and I presume compile etc) 'native' Linux commands? Are they baked in?


title: Debian installer - customize busybox and live system/environment

text: I'm trying to reinstall Debian on a netbook and do it without sloppy tricks so that I can repeat the process if necessary. Specifically, I'm trying to customize the installer to include the wifi firmware for the network adapter (non-free, so I had to include it manually) which I did successfully (by placing the deb in the `firmware` folder in the iso's root) but I still need to have some way to limit the download speed while the installer runs. I normally use `wondershaper` for this, so I tried placing the deb in the `pool/main/w/wondershaper` folder but that obviously doesn't work (as that directory is for what gets installed in the final system). So I tried to see if I could somehow run it from the installer terminal, but busybox doesn't even include `ifconfig` in the standard debian build, so I need to replace that busybox. No searching so far has yielded any clues as to what goes into the live installer system ( **not** the _installed_ system but the one the installer runs on top of). I've googled and searched the debian wikis but they don't seem to have information on how to modify what gets loaded here. Searching the iso also yields no answers as the only `busybox` is the package that goes into the installed system. The instructions mention the `.disk` directory in the iso's root, which has inclusion and exclusion lists for packages, but they aren't for what gets loaded during installation. Searching SE also yields no specifics on this question. To be clear, I do **not** want to automate anything aka preseed the installer (which is what I understand preseeding is). Also, I know how to get the desired busybox build (their ftp has prebuilt binaries that include what I need), so no problems there, I just don't know where to put it. Here's some links I've read:   * DebianInstaller/Modify/CD   * installer hooks   * modifying the iso   * DebianCustomCD   * DebianInstaller Modify   * customize and pack a debian image   * Installation of my custom debian iso failed   * How to custom build debian's busybox?   * What packages are installed by default in Debian? Is there a term for that set? Why some of those packages are `automatically installed` and some not?   * How to create a custom debian liveCD (customize which packages are preinstalled)? **tl;dr: How does one customize the system/environment that gets loaded during the debian installation?**


title: Force Firefox to remember passwords on particular sites

text: Usually, when I log into a website with `username` and `password`, Firefox asks whether it should remember the login details. When I click yes, next time I visit the website, the username and password fields are pre-filled, so that I can just click "OK" But on some websites, I don't get the option to remember the password, and the `username` and `password` fields are empty. Alternatively, only the username field is pre-filled, while the password field is empty. Is there a way to override this, so that I can always choose to save the passwords? # UPDATE: Preferably, I would like to achieve this without having to install yet another addon. I don't understand how websites tell the browser to not remember passwords, but whatever it is, it should be configurable. Perhaps via `userContent.css` and `userChrome.css` ?


title: Is there a Microsoft Publisher equivalent for LMDE?

text: I am running Linux Mint Debian Edition (LMDE) and I need a program like Microsoft Publisher that I can make fliers and pamphlets with. Is there a program like that available? Is it free?


title: Bash globbing and argument passing

text: I have the following simplified bash script               #!/bin/bash          files=("$@")          if [ "X$files" = "X" ]; then       files=$HOME/print/*.pdf;     fi          for file in "${files[@]}"; do       ls "$file";     done      If I pass arguments (file names) as parameters this script will print the proper file names. On the other hand, if I don't pass arguments, it will print               /home/user/print/*.pdf: No such file or directory      Why are the file names not expanded in this case, and how do I fix it? Note that I use the `files=("$@")` and `"${files[@]}"` constructs because I read that it is to be preferred over the usual "files=$*".


title: Can't set background wallpaper in Gnome 3

text: I am using Debian Testing and Gnome Flashback (but it behaves the same in standard Gnome Shell). It gives me plain white background, and I can't set my own. Also, the settings dialog for background looks funny: ![enter image description here](http://i.stack.imgur.com/zvYB2.png) Any ideas? Edit: I have noticed I got background image back when I turned off "Nautilus controlling desktop". Of course, I no longer see desktop icons this way. Update: I have installed Ubuntu (with Unity), keeping my /home partition. The same problem appears in Unity! I can't set desktop background.


title: How to record an interactice socat TCP/TLS session?

text: Socat is great for interactively testing line based human readable protocols like HTTP or IMAP. For example:               $ socat -d -d READLINE,history=$HOME/s.hist openssl:host:port,crnl,cafile=some.ca      For better analyzing I need to capture such an interactive session - i.e. the bytes received and sent. Just hardcopying the terminal output via e.g. `tux` is not enough, because client/server parts are not marked and characters like '\t' are lost/silently converted. Using `tcpdump` to capture helps only for unencrypted connections. Thus my question. The answer does not have to be socat-based. If another tool is better suited for that use case I would like to read about it. Bonus points for a solution where   * time stamps are recorded as well   * one can chose between interleaved recording (client/server side) or logging to separate files


title: Configure sendmail to send only

text: I want to configure sendmail only to send emails – not to listen and receive. In `/etc/mail/sendmail.conf` I’ve got:               DAEMON_MODE="None";     QUEUE_MODE="Daemon";      Iptables are disabled (temporarily; only for this test) But in `/var/log/mail/mail.log`               Nov 18 13:40:04 novy sm-msp-queue[13548]: rAIC9RiF012445: to=user@mydomain.com, ctladdr=root (0/0), delay=00:30:37, xdelay=00:00:00, mailer=relay, pri=390130, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]      When I set in `/etc/mail/sendmail.conf` `DAEMON_MODE="Daemon";` e-mails are successfully sent. Is that needed – to listen?


title: How to kill all processes that don't have specific parent process?

text: A parent process should always be running with N children process. I would like to run a script which will show/kill all children processes that don't have a parent process.               $ ps faux | grep process.pl     root 37140  0.3  0.1  61160 724   /process.pl [child]     root 22079 10.2  0.3 127332 64620 /process.pl [master]     root 22081  0.3  0.1  84752 26084   \_ /process.pl [child]


title: Unable to SSH into Puppy Linux, even though SSHD is running

text: I installed OpenSSH client and server on my Puppy Linux computer. That computer is behind a router. I tried to `ssh` into it over the internet (outside the router) but it times out. Also doesn't work if I try to `ssh` from the computer itself. `telnet` didn't work either, but I can successfully ping the computer.               sh-4.1# ssh [ip address]      hangs for a minute, then shows:               sh-4.1# ssh: connect to host [ip address] port 22: Connection timed out      I know `sshd` is running:               sh-4.1# ps | grep -i sshd     sh-4.1# 24312 root      0:00 /usr/sbin/sshd      The firewall icon on the taskbar in Puppy says "Firewall OFF". How do I check if ports are in use or blocked?


title: Midnight Commander: file size format

text: When dealing with large files in MC, I have difficulties counting the digits to get the order of magnitude of the file size (hundreds of MB, or tens of GB, etc.). Sometimes, I use the trick to press `insert` key, which highlights the file and shows the file size in a nicely formatted way (i.e. 123,456,789), which makes it a thousand times more readable. I am wondering if/how I could set up MC to show the file size in this format by default, in the `size` column. I assume, this has nothing to do with `locale`


title: How to differentiate USB flash drive and CD-ROM?

text: I want to differentiate an USB flash drive and a CD-ROM. My requirement is when I connect to a system only the CD-ROM should work, but not the USB key.


title: How to complete a script to move selective files and directories in a filesystem to another (dump) path in a different filesystem?

text: 1) There is a filesystem, say FS1, having below files and directories :               drwx------    2         256 Jun 20 05:47 recovery_scripts     drwx------    2         256 Jun 20 05:47 sqllib     -rw-------    1           1 Jun 20 05:47 dummy     drwx------    2         256 Jun 20 05:47 lost+found     -rw-------    1           1 Jun 20 05:48 test     -rw-------    1           1 Jun 20 07:38 LAES201D.LOG      2) I want to move specific files and directories to another filesystem, say FS2, viz. :               drwx------    2         256 Jun 20 05:47 recovery_scripts     drwx------    2         256 Jun 20 05:47 sqllib     -rw-------    1           1 Jun 20 05:47 dummy     -rw-------    1           1 Jun 20 07:38 LAES201D.LOG      3) Rest of the files should remain in FS1 itself :               drwx------    2         256 Jun 20 05:47 lost+found     -rw-------    1           1 Jun 20 05:48 test      4) I want to come up with a script for the same. Please help.


title: Error unzipping file through ksh, unzip works through bash

text: I have an auto-generated zipfile `foo.zip` on a Red Hat server that needs to be extracted to a particular location `/bar`. This is done through an install script using ksh. When the script executes `unzip foo.zip -d /bar`, the following error is logged:               caution: zipfile comment truncated     missing 3232546375 bytes in zipfile     attempt to seek before beginning of zipfile      Executing the same command in bash extracts the zipfile without errors. Running `unzip -t foo.zip` gives me zero errors. What can be causing this?


title: Count number of sessions and email as a body

text: I want to create a script to achieve followings : 1.login to Essbase MaxL               essmsh -l admin password on localhost;      2.Count the number of lines in the output of command display session all;               display session all; | wc -l  < /filepath/filename.ext       3.Email the the counted number of lines to a set of recipients as email-body like below : **Total number of Sessions = bla-number**               display session all; | wc -l   > file.tmp     mailx -s "Subject" emailaddresses < file.tmp     rm file.tmp      how we can get all 3 through a single script ? **EDIT** Based on Casey's answer, the single script now I have :               #!/bin/bash          #Maxl zone starts.....     essmsh -l admin password -s localhost -i << EOF          spool on to 'output.txt';     display session all;     spool off;          EOF     #Maxl zone ends.....          wc -l output.txt  > file.tmp           mailx -s "Subject" emailaddresses < file.tmp     rm file.tmp


title: Why lfs couldn't use original host environment variables?

text: From the lfs doc: > The exec env -i.../bin/bash command in the .bash_profile replaces the > running shell with a new one with a completely empty environment, except for > the HOME, TERM, and PS1 variables. This ensures that no unwanted and > potentially hazardous environment variables from the host system leak into > the build environment. The technique used here achieves the goal of ensuring > a clean environment. What case will cause that problem? Is there any simple example?


title: Why does terminal cursor flash briefly

text: I am using Fedora 20, and whenever a new line opens in the command line terminal, the cursor, which is a solid black rectangle, flashes on and off about ten times, then remains steady. I think I have read somewhere that I can do something useful during the flashing period, but I have forgotten what it was, or where to find the reference again; or am I just imagining it? Please can someone confirm or explain this? In response to @sim's query about the terminal emulator:               [Harry@localhost ~]$ echo $TERM     xterm-256color     [Harry@localhost ~]$


title: What's the difference between various $TERM variables?

text: I tried vt100, vt102, vt220, and xterm by using `top`. But I can't find their difference. Is there any other term type? What's their difference?


title: On the command line, can I redirect output to a file WITHOUT >, >>, or | operators?

text: I am attempting to run a command on a CentOS virtual machine, and the API that I am using to run this command does not seem to allow the >, >>, or | operators. Also, I must use fully qualified paths for commands (eg. /bin/ls instead of just ls). I want to be able to send the output of a certain command to a file. How can I do this under these conditions? I could in theory execute a script that will do the redirect in a "proper" shell, but that's a pretty inconvenient option here.


title: Convert a .jpg to a one page .pdf at a certain location

text: I'm looking to convert a .jpg into a .pdf, where the .jpg is positioned at a certain coordinate say 30 pixels and centered. Right now I'm just using: `convert image.jpg image.pdf`


title: Limiting write rate of a device

text: How does one go about limiting the write/read rate of a device, E.G., USB drive, SD card? Motivation behind this question is covered here (superuser.com).


title: GParted LiveCD: Is there a version with a 64-bit kernel?

text: I'm trying to chroot with the GParted LiveCD onto an existing 64-bit system, attempting to fix grub.


title: How to make system startup to not wait on particular systemd service start

text: I have few virtual machines running under libvirt, and they are stared on the host system startup. This is controlled by libvirtd.service systemd configuration. This delays the availability of the host system tty until all the virtual guests are started. How should I configure systemd to not wait on successful start of libvirtd, and leave it to start in the background?


title: How to Add rules to IP Filter (Firewall in SCO)

text: I need to add a rule ( **allow any to any port 22** ) to my firewall, so that I can `ssh` remotely into my machine. I have had a look in the SCO OSR600 Documentation and I cannot find anything in there that will help me. **Update** I have managed to enable `ipfstat`:               #ipfstat enable      And now my firewall is active, I just need to add rules now. But where do I find the rules text file?


title: Set alias which doesn't send specified text?

text: **EDIT** I set a alias task in `~/.bashrc`. The following:               alias join="clear; screen -ls; screen -rx [<ID_OF_THE_RUNNING_SCREEN> quit]"      If i the task `join` is executed, the following has to pre-fill my commandline: `screen -rx` I will add `[<ID_OF_THE_RUNNING_SCREEN>] quit`. -- How does I have to edit the alias, that this will be my result? --


title: Send Fax with GSM modem on hylafax?

text: I have a couple of questions related to using a GSM modem for faxing.   1. I wanted to know if it's possible to send faxes with the hylafax-server from a GSM modem?   2. If possible can you please explain how one would go about setting this up and demonstrating how it would work?   3. Does this work well? Is it robust or does it work sporadically?


I have problem with postfix on debian after upgrading from squeeze to wheezy. Postfix was configured to sign messages using dkim-filter. Before update, everything was working flawlessly, now it fails on connection with service (tcp or unix sockets). I thought that maybe it was because of debian switch to opendkim, so I removed dkim-filter and installed opendkim - same problem. I even tried setting unix file socket connection instead of tcp option - same problem: `postfix/smtpd: warning: connect to Milter service unix:/var/run/opendkim/opendkim.sock: No such file or directory` or (with tcp/ip): `postfix/cleanup: warning: connect to Milter service inet:localhost:8891: Connection refused` I checked twice - socket file exists and service was listening on port 8891. What can I do to fix this?


title: How to launch a program in text only mode if it support silent running

text: I have got a java program, which support text file input and auto running, can i put it in background running without GUI ? It prompt cannot set display. while there is no concern to view the display, it can just run the file input and finish the job. any idea?


title: Suspend and edit previous single line commands

text: Say I want to modify the latter of some concatenated command line options, is it possible without killing the first command? Specifically I have compile and run scripts executed thusly:               > compile ; run      The compile is in progress (half way through two hour duration), but new information tells me I don't really want the "run" command to run anymore (it launches a lot of background processes I don't want to go clean up). Is there a way to accomplish this adjustment or should I just be smarter about how I string together commands in the future?


title: Looking for App - Productivity measurement

text: I'm looking for an application which logs my productivity, i.e. logging how long I've been working using LibreOffice, Firefox, or whatever. My request is similar to this: https://productivity.stackexchange.com/questions/3803/time- tracking-software-to-measure-when-im-active-or-idle-on-my-computer-i-e But unfortunately none of them works completely offline ( no data being sent to company XYZ) and is available for scientific linux.


title: Audio CD source plugin for .wav files . Linux

text: I have a CD which contains a number of .wav files. When I try to open one I get: > The playback of this movie requires a Audio CD source plugin which is not > installed. Can someone please sent me a link to what I should download and install to play these files? My OS is Scientific Linux 32 bit .


title: Debian can't reboot and asking for root password (maintenance)

text: I'm experienced some file system errors on Debian (seems caused by RAID controller). Files system now seems fixed. I reinstalled broken packages with some broken config files. System boots normally. All services working. Problem is if try reboot machine last message is something "unmounting all file systems". And after this message system asking for root password (looks like maintenance mode). How to solve this ? Maybe something wrong with initscripts ? Any suggestions ? EDIT: For me it looks like software problem.


title: Wrong number of 'clicks' from mouse & drops click and hold, then picks it up again

text: The issue I am experiencing is the same as the one in this post. This is happening on two different machines, using two different models of mice. While both mice are Logitech, one is a wireless 2-button w/scroll wheel and the other is wired 4-button w/trackball. Both machines are running Ubuntu, though the one with the 2-button mouse has 12.04 on it and the one with the 4-button has 14.04. The big difference between the issue I have and the post I linked, is that his issue started after installing an Nvidia driver. The 12.04 machine uses and Nvidia driver, the 14.04 doesn't. The major strangeness is that the mouse behavior began (on both machines) seemingly without change to either system. I have intentionally NOT updated the 12.04 machine for many months now and have not installed any new software on it. On the 14.04 machine, the behavior began while 12.04 was still on it... I was hoping a distribution upgrade would fix things. No big surprise, it didn't. In fact it is now worse on the 14.04 machine. I tried adding an xorg.conf file, with configurations to enable 3-button emulation, and while 3-button, trackball scrolling, etc. now work, the click, double click, triple click, and 'dropping' the left click & hold are still present.               Section "InputClass"         Identifier  "Marble Mouse"         MatchProduct "Logitech USB Trackball"         MatchIsPointer "on"         MatchDevicePath "/dev/input/event*"         Driver "evdev"         Option "ButtonMapping" "1 2 3 4 5 6 7 8 9"         Option "EmulateWheel" "true"         Option "EmulateWheelButton" "8"         Option "ZAxisMapping" "4 5"         Option "XAxisMapping" "6 7"         Option "Emulate3Buttons" "true"     EndSection      The above is from the Ubuntu Wiki. I created an `xorg.conf` file because no `50-marblemouse.conf` file existed. Can anyone shed any new light on this issue? Thank you for your time!


title: rtorrent: 'Tracker Timeout' caused by IPtables

text: I'm trying to secure my rtorrent-running-homeserver with IPtables. With the aim to allow only incoming connections to the rtorrent port 6890 and 5292 for ftp (both are forwarded by the router), I wrote the following rules:               # Allows all Connections from localhost (necessary for scgi port 5000 of rtorrent):     iptables -A INPUT -s 127.0.0.1 -p tcp -j ACCEPT      iptables -A INPUT -s 127.0.0.1 -p udp -j ACCEPT               # Allows all Connections from 192.168.2.* (local network) and 192.168.10.* (local vpn network)     iptables -A INPUT -s 192.168.2.0/24 -p tcp -j ACCEPT     iptables -A INPUT -s 192.168.10.0/24 -p tcp -j ACCEPT               # Allows all input-Connections on port 6890 (rtorrent) and 5292 (ftp)     iptables -A INPUT -p tcp --dport 6890 -j ACCEPT     iptables -A INPUT -p tcp --dport 5292 -j ACCEPT               # Blocks everything else     iptables -A INPUT -p tcp -j DROP      If the rules are active, I get the error `'Tracker: Timeout was reached'`. Without everything is running like a charm. So it seems to blame on my iptables-rules. Is there anyone who may help?


title: How to do integer & float calculations, in bash or other languages/frameworks?

text: Using `echo "20+5"` literally produces the text "`20+5`" What command can I use to get the numeric sum, e.g. `25` in this case. Also, what's the easiest way to do it just using bash for floating point, e.g.   `echo $((3224/3807.0))` gives `0` :( Using either the basic command shell ('command line') itself or through using languages that are available at the command line.


title: Multiply 2 array index variables shell programming

text: How do i multiply 2 array index variables given the following               foo=(1 2)     bar=(0.1 0.2)          foobar=$((foo[1]*price[1])) # this is wrong          echo "$foobar"      Current output : `0` Correct/Expected output : `0.4`


title: Divide a variable by a number?

text: Basically I need to convert centimetres to inches which I am trying to do by diving the area in centimetres by 2.54. But I just cannot get this to work.               echo "please enter width and then height"          read width     read height          area=$(($width * $height))     inchesarea=$((area / 2.54))          echo $area     echo $inchesarea      Should I be using `bc` for this?


title: Reading package lists...Error!

text: When I run `sudo apt-get update` I get this error:               Reading package lists... Error!     E: Unable to parse package file /var/lib/dpkg/status (1)     E: The package lists or status file could not be parsed or opened.      What each line is saying and how to solve it? I'm running Linux Mint 17 Qiana Cinnamon in VMWare Workstation 10.0.2.


title: "mount: / is busy" when trying to mount as read-only so that I can run zerofree

text: I am trying to run `zerofree` on Ubuntu 11.04 so that I can compact the VirtualBox vdi image using:               VBoxManage modifyhd Ubuntu.vdi --compact      In order to run `zerofree` the disk image has be mounted as read-only. I'm following these instructions which says to use this to remount as read-only from the recovery mode (Drop to root shell prompt):               mount -n -o remount,ro -t ext2 /dev/sda1 /      But when I do this I get the error:               mount: / is busy      Any ideas on how to do this? **Follow up** : Following Jari's answer and this post by running these commands resolves the issue.               service rsyslog stop     service network-manager stop     killall dhclient


title: Starting at a runlevel with no networking, but networking starts

text: I am running LMDE, a distro based on debian testing. First, neither upstart nor systemd is installed on my computer. I run sysv-rc-conf and uncheck all the services. I then shutdown, reboot and during boot set the runlevel to 5 ( via grub menu ) When boot finishes I check the runlevel what is printed is : N 5. I try to ping google, and it succeeds. ifconfig shows eth0 and lo. The contents of /etc/rc5.d is:               K01anacron         K01fancontrol     K01minidlna           K01rmnologin          K01sudo             K02xdm     K01atd             K01fetchmail      K01minissdpd          K01rsync              K01timidity         K03acpid     K01autokey         K01gdomap         K01motd               K01samba              K01virtualbox       K03dbus     K01binfmt-support  K01gpm            K01nethack-common     K01samba-ad-dc        K01webmin           K03postgresql     K01bluetooth       K01gpsd           K01nfs-kernel-server  K01saned              K01xinetd           K05rsyslog     K01bootlogs        K01hddtemp        K01nmbd               K01sendmail           K02avahi-daemon     K07nfs-common     K01cgroupfs-mount  K01hyperestraier  K01ntp                K01slashem-common     K02cups             K07portmap     K01cpufrequtils    K01irkerhook-lxc  K01openvpn            K01smartmontools      K02exim4            README     K01cron            K01jetty          K01pcscd              K01smbd               K02gdm3     K01cups-browsed    K01lirc           K01plymouth           K01speech-dispatcher  K02kdm     K01dirmngr         K01loadcpufreq    K01pulseaudio         K01ssh                K02network-manager     K01dovecot         K01lxc            K01rc.local           K01stunnel4           K02winbind      So why does networking start for me?


title: How can I add Mageia 2 to my YUMI MultiBoot USB Drive?

text: After a bit of googling I read that YUMI can handle Mageia from the Mageia forums.   Unfortunately after trying YUMI there doesn't seem to be any support for Mageia.   I asked on the official Mageia forums and received no reply, so I thought I'd ask here! My YUMI USB drive has:               Ubuntu 12.4.1 x86_64 DVD     Linux Mint 13 x86_64 DVD (Cinnamon)     Fedora 17 x86_64 Live (KDE)      All working correctly. I really want to add Mageia 2 to this list! A bit unsure where to start though? I've tried XBoot which after bringing up the boot menu, refused to load any of the distributions (halted at `cmain()` - even though they worked in VirtualBox?). MultiSystem refuses to recognize my FAT32 formatted USB drive mounted in /media within Ubuntu.   So I'm left with YUMI and trying to get Mageia 2 working with it! Can anybody point me in the right direction please?


title: Sending binary data to gets()

text: I have a victim program (with a buffer overrun vulnerability): it uses gets() to write into a fixed-sized buffer. Suppose I put shellcode into a file SC. Then I run               $ ./victim < SC     Input your data:      $      The reason the shellcode does not seem to work is this: SC is redirected to the victim, injects the shellcode, causes a shell to spawn, but the spawned shell finds its stdin is closed, so immediately exits. I tried `expect` for the injection, but `expect` bombs after the shell spawns. It seems like the only practical way is to get the shellcode into my mouse's paste buffer so I can inject it while retaining the keyboard as the input device. But I have no idea how to get binary data into my paste buffer. Any ideas on how to get around this issue?


title: spawning multiple Background processes

text: I have a file which has `2,000,000` lines in it. I am running some commands for each line. I was trying to achieve some parallelism using `GNU-parallel` and `swift` as discussed here. However, I got an interesting idea from one of my friends. He was suggesting to spawn multiple processes in the server since the server is pretty powerful. I was thinking if I use an index for each line of file, I could spawn multiple processes based on the `totallines mod number_of_processes`. For example, **if line_numbers are 1,11 and 21, it will be sent to first process and if line numbers are 2,12 and 22 it will be sent to second process so on.** To achieve the above, I was going through background processes in shell scripting. In most of the tutorials/links, they are appending an `&` to the command and telling that a background process will be spawned by the computer. I am finding it little difficult to understand this concept.


title: how to get the return value of wpa_supplicant?

text: My question is really simple I want to get the return value of the command `wpa_supplicant`, when connected to the internet, to know that I am connected or not with a shell script.


title: Cron job not executing

text: I'm trying to use `cron` for the first time, and I'm stuck. I'm using Ubuntu 10.10, and the following is my `/etc/crontab` file. The only modification that I've made is appending the last line. I've verified that `cron` is running, and the other jobs here run, but the last one does not.               # /etc/crontab: system-wide crontab     # Unlike any other crontab you don't have to run the `crontab'     # command to install the new version when you edit this file     # and files in /etc/cron.d. These files also have username fields,     # that none of the other crontabs do.          SHELL=/bin/sh     PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin          # m h dom mon dow user  command     17 *    * * *   root    cd / && run-parts --report /etc/cron.hourly     25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )     47 6    * * 7   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )     52 6    1 * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )     #     21 22   * * *   root    /etc/mycron/myscript.sh > /home/me/stuff/log/cron.log      I've checked `$ sudo grep CRON /var/log/syslog` and found evidence of the hourly jobs, but nothing for the new job. I've looked for `cron.allow` and `cron.deny` files, but they don't seem to exist on my machine. Being fairly new to Linux, and completely new to `cron` and `crontab` there are so many things that I might be doing wrong, I appreciate any suggestions.


title: How do I unset a variable in bash

text: I have tried the following command to set Proxy on `yaourt`:               export ALL_PROXY=http://proxy.example.com:8080      The question is how to unset the proxy on `yaourt`? In general how can I unset the value of a variable in current bash shell?


title: How to run the EDKnrc code

text: I have installed the EGSnrc code on a LINUX system and want to use the EDKnrc code for a "dose distribution" in the spherical Phantom, how can I run this code? can this code is run by the GUI similar to BEAMnrc?


title: IPTables 1.4.7 dropped allowed packet

text: When looking in the `/var/log/messages` file I found this line: > May 23 10:56:02 localhost kernel: IP4T Invalid TCP flags IN=eth0 OUT= > MAC=70:5a:b6:ec:95:6b:00:23:48:ad:b0:a4:08:00 SRC=A.B.C.D DST=192.168.1.27 > LEN=40 TOS=0x00 PREC=0x00 TTL=116 ID=27653 DF PROTO=TCP SPT=443 DPT=58520 > WINDOW=0 RES=0x00 ACK RST URGP=0 I have these `iptables` rules in the `filter` table:               Chain INPUT (policy DROP 0 packets, 0 bytes)     num      pkts      bytes target     prot opt in     out     source               destination     1           0        0 TCPFlagsCheck  tcp  --  *      *       0.0.0.0/0            0.0.0.0/0     2           0        0 ACCEPT     tcp  --  eth0   *       0.0.0.0/0            192.168.1.27        tcp spt:80 state ESTABLISHED     3           0        0 ACCEPT     tcp  --  eth0   *       0.0.0.0/0            192.168.1.27        tcp spt:443 state ESTABLISHED     4           0        0 ACCEPT     udp  --  eth0   *       192.168.1.1          192.168.1.27        udp spt:53     5           0        0 LOG        all  --  *      *       0.0.0.0/0            0.0.0.0/0           LOG flags 0 level 4          Chain FORWARD (policy DROP 0 packets, 0 bytes)     num      pkts      bytes target     prot opt in     out     source               destination          Chain OUTPUT (policy DROP 0 packets, 0 bytes)     num      pkts      bytes target     prot opt in     out     source               destination     1           0        0 TCPFlagsCheck  tcp  --  *      *       0.0.0.0/0            0.0.0.0/0     2           0        0 ACCEPT     tcp  --  *      eth0    192.168.1.27         0.0.0.0/0           tcp dpt:80 state NEW,ESTABLISHED     3           0        0 ACCEPT     tcp  --  *      eth0    192.168.1.27         0.0.0.0/0           tcp dpt:443 state NEW,ESTABLISHED     4           0        0 ACCEPT     udp  --  *      eth0    192.168.1.27         192.168.1.1         udp dpt:53     5           0        0 LOG        all  --  *      *       0.0.0.0/0            0.0.0.0/0           LOG flags 0 level 4          Chain TCPFlagsCheck (2 references)     num      pkts      bytes target     prot opt in     out     source               destination     1           0        0 RETURN     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp flags:0x3F/0x10 /* R ACK */     2           0        0 RETURN     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp flags:0x3F/0x18 /* R ACK PSH */     3           0        0 RETURN     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp flags:0x3F/0x12 /* R SYN ACK */     4           0        0 RETURN     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp flags:0x3F/0x02 /* R SYN */     5           0        0 RETURN     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp flags:0x3F/0x04 /* R RST */     6           0        0 RETURN     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp flags:0x3F/0x11 /* R ACK FIN */     7           0        0 RETURN     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp flags:0x3F/0x19 /* R ACK PSH FIN */     8           0        0 RETURN     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp flags:0x3F/0x14 /* R ACK RST */     9           0        0 RETURN     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp flags:0x3F/0x01 /* R FIN */     10          0        0 LOG        tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           LOG flags 0 level 4 prefix `IP4T Invalid TCP flags '     11          0        0 DROP       tcp  --  *      *       0.0.0.0/0            0.0.0.0/0      I had doubts so I wrote the same command to check if the rule is correct:               $ iptables -A TCPFlagsCheck -j RETURN -p tcp --tcp-flags ALL ACK,RST \         -m comment --comment "R ACK RST"      and this creates:               12          0        0 RETURN     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp flags:0x3F/0x14 /* R ACK RST */      Why was this packet dropped?


title: linux + perl + replace any WORD in file with special characters with condition

text: Example1 work fine when I want to replace OLD_TEXT with NEW_TEXT ( its replace also all special characters as $@^%)(_+`:; etc ..)                 example1            export OLD_TEXT='$$OLD_WORD$$'       export NEW_TEXT='$$NEW_WORD$$'                 perl -pe 'next if /^#/; s/\Q$ENV{OLD_TEXT}\E/$1$ENV{NEW_TEXT}$2/g' file       on example2 I add the "[[:^alnum:]]" in the perl syntax in order to ignore TEXT that start with alpha numeric characters or end with alpha numric characters but as all see it doesn't work why? remark: alpha numric characters means numbers OR [a-z][A-Z] Real Example                #example2 on LINUX machine:                 more file            ABC$$OLD_WORD$$ABC       $$OLD_WORD$$      .                  perl -pe 'next if /^#/; s/(\Q|[[:^alnum:]])$ENV{OLD_TEXT}(\E|[[:^alnum:]])/$1$ENV{NEW_TEXT}$2/g' file               $$NEW_WORD$$ABC$$$NEW_WORD$$$$$NEW_WORD$$OLD_$$NEW_WORD$$WORD$$$NEW_WORD$$$$$NEW_WORD$$ABC      . Example what I should get:                 more file                 ABC$$OLD_WORD$$ABC       $$NEW_WORD$$


title: What -A INPUT -j REJECT --reject-with icmp-host-prohibited Iptables line does exactly?

text: What do the following lines do? I have been reading redhat iptables documentation but can't figure it out. ... -j REJECT **--reject-with icmp-host-prohibited**   ... -j REJECT **--reject-with icmp-host-prohibited**


title: What's the difference between LPIC-1 version 3.5 with version 4.0.0?

text: Can someone please explain to me what's difference in chapter headings on _LPIC-1_ version 3.5 and LPIC-1 version 4.0.0 ? May introduce me some good and comprehensive book relate to LPIC-1 version 4.0.0 or any other recent version.


title: How to restore a system?

text: I have a disk image from Acronis True Image 2011. My original disk, of 40 GBs, had 2 partitions, 1 for FS and 1 for swap, but it started to fail. I've tried to make a backup, which finished with some read errors. Then, I've tried to restore it in a 160 GB disk, selecting the 2 partitions, and MBR and track 0. The thing is that it is not booting, I only see a `_` in the screen and nothing happens. The question is if it is possible to re-install Debian, and then copy ALL the `/*` files, to get my programs and data back, or is more difficult than that.


title: Change Initramfs script

text: I made RAID 0 by `mdadm'`ing partition located on dmraid VIA VT6421 and Western Digital hdd. Installed Ubuntu on that RAID. Now, when I boot, I get `(initramfs)` ash prompt. There, I have to write               mdadm --stop /dev/md1     mdadm --assemble --scan      And hit `Ctrl`+`D` to resume. Then Ubuntu loads normally. I'd like to change that behavior to save my time. So, I need to change some script located in `/scripts` directory of initial ramdisk. But everything I know about `initramfs` is that it is gzipped. I looked into `update-initramfs` but didn't find the clue yet. Also, I'm afraid doing something there unless I know what I'm doing. How do I change my initramfs script? UPD: Now I know I should               gunzip -c initrd.img-3.13.0-24-generic | cpio -id      Then make my changes and recreate it with               find . | cpio -o | gzip -c >/boot/initrd.new.img-3.13.0-24-generic      But I still don't know which scripts I should edit. UPD2: `sudo parted -l`               $ sudo parted -l     Model: JetFlash Transcend 32GB (scsi)     Disk /dev/sda: 32,1GB     Sector size (logical/physical): 512B/512B     Partition Table: msdos          Number  Start  End     Size    Type     File system  Flags      1      131kB  32,1GB  32,1GB  primary  fat32        boot, lba               Model: WD My Passport 074A (scsi)     Disk /dev/sdb: 1000GB     Sector size (logical/physical): 512B/512B     Partition Table: msdos          Number  Start   End     Size    Type     File system  Flags      1      1049kB  1000GB  1000GB  primary  ntfs               Model: ATA WDC WD1600JS-22M (scsi)     Disk /dev/sdc: 160GB     Sector size (logical/physical): 512B/512B     Partition Table: msdos          Number  Start   End    Size   Type     File system     Flags      1      1049kB  160GB  160GB  primary  linux-swap(v1)               Error: Can't have a partition outside the disk!                                     Model: ATA WDC WD5000AAKS-0 (scsi)     Disk /dev/sde: 500GB     Sector size (logical/physical): 512B/512B     Partition Table: msdos          Number  Start  End  Size  Type  File system  Flags               Error: /dev/mapper/via_ecedbfaihb6: unrecognised disk label                         Model: Linux device-mapper (linear) (dm)     Disk /dev/mapper/via_ecedbfaihb5: 524MB     Sector size (logical/physical): 512B/512B     Partition Table: loop          Number  Start  End    Size   File system  Flags      1      0,00B  524MB  524MB  ext4               Error: Can't have a partition outside the disk!                                     Model: Linux device-mapper (linear) (dm)     Disk /dev/mapper/via_ecedbfaihb2: 167GB     Sector size (logical/physical): 512B/512B     Partition Table: loop          Number  Start  End    Size   File system  Flags      1      0,00B  167GB  167GB  ntfs               Model: Linux device-mapper (linear) (dm)     Disk /dev/mapper/via_ecedbfaihb1: 367MB     Sector size (logical/physical): 512B/512B     Partition Table: loop          Number  Start  End    Size   File system  Flags      1      0,00B  367MB  367MB  ntfs               Error: Can't have a partition outside the disk!                                     Model: Linux Software RAID Array (md)     Disk /dev/md1: 320GB     Sector size (logical/physical): 512B/512B     Partition Table: msdos          Number  Start   End     Size    Type     File system     Flags      1      1049kB  6494MB  6493MB  primary  linux-swap(v1)      2      6494MB  27,5GB  21,0GB  primary  ext4      3      27,5GB  320GB   293GB   primary  ext4      Transcription:   * `/dev/sda` & `/dev/sdb` each of 500GB is fakeraid named `via_ecedbfaihb`,    * Win8.1 reserved partition on `via_ecedbfaihb1` (390MB),    * Win 8.1 system partition on `via_ecedbfaihb2` (160GB),    * extended partition `via_ecedbfaihb3`,    * linux boot partition `via_ecedbfaihb5` (500MB),    * mdadm 1st partition `via_ecedbfaihb6` (159GB),    * data partition `via_ecedbfaihb7` with the rest of space   * `/dev/sdc1` mdadm second partition (159GB),    * `/dev/md1` made of via_ecedbfaihb6 and sdc1,    * `/dev/md1p1` swap (6GB),    * `/dev/md1p2` extended,    * `/dev/md1p5` root (20GB),    * `/dev/md1p6` home (~300GB)


title: X11 forwarding over ssh

text: I used to log into a remote server on our corporate network using Xephyr and ssh using the following command               Xephyr :0 -ac -br -screen 950x540 | xterm -bg black -fg white -display :0 -e ssh -Yf jidicula@lxsim gnome-session &      where :0 is the display from ENV. This used to work for me, however I got upgraded to a new mac pro machine and this no longer works for me. Would someone be able to help me with this. I understand what this is doing and I made sure to have Xephyr and XQuartz on my new machine so I am kinda baffled as to why this no longer works.


title: how to escape unusual/uniq characters from expect scripts?

text: in expect script I can set any command or character to run it on remote machine but the sad thing is that expect cant send the same character as they defined in the expect script for example I want to run this line from expect script in order to change IP address from **10.10.10.10** to **1.1.1.1**                   expect #  {send "perl -i -pe 's/\Q10.10.10.10\E/1.1.1.1/' /etc/hosts\r"}      but when I run the expect screen actually I see this line runing on the console:                  [root@localhost ~]# perl -i -pe 's/Q10.10.10.10E/1.1.1.1/' /etc/hosts      pay attention that the backslash before Q and before E was Disappeared so I wonder hoW to escape those characters from expect script? so expect will run the same line on the console as following                  [root@localhost ~]# perl -i -pe 's/\Q10.10.10.10\E/1.1.1.1/' /etc/hosts        * REMARK set a backslash "\" before backslash doesn’t help!!! my script:                #!/bin/ksh           #      expect=`cat << EOF      set timeout -1      spawn  ssh  192.9.200.10             expect {                      ")?"   { send "yes\r"  ; exp_continue  }                           word:  {send secret1\r}                   }       expect #  {send "perl -i -pe 's/\\Q10.10.10.10\\E/1.1.1.1/' /etc/hosts\r"}       expect #    {send exit\r}       expect eof       EOF`                 expect -c  "$expect"       RESULTS ( after I run my script: )                  spawn ssh 192.9.200.10         root@'192.9.200.10 s password:         Last login: Sun Aug  4 22:46:53 2013 from 192.9.200.10          [root@localhost ~]# perl -i -pe 's/Q10.10.10.10E/1.1.1.1/' /etc/hosts         [root@localhost ~]# exit         logout              Connection to 192.9.200.10  closed.


title: Restricting who can send to an email address

text: I'd like to do so that only certain From: addresses can send to an email address (mailing list) on an Ubuntu system running Postfix. Understanding the Postfix the manuals are requires a lot of knowledge, so I'm hoping to get a complete recipe I can use. Currently this is what I have:               /etc/postfix/main.cf:     smtpd_recipient_restrictions =       check_recipient_access hash:/etc/postfix/protected_destinations     smtpd_restriction_classes = insiders_only     insiders_only = check_sender_access hash:/etc/postfix/insiders, reject          /etc/postfix/protected_destinations:     protected.list@example.com insiders_only          /etc/postfix/insiders:     allowed.user@example.com OK     another.allowed.user@example.com OK      This gives:               fatal: parameter "smtpd_recipient_restrictions": specify at least one working instance of: check_relay_domains, reject_unauth_destination, reject, defer or defer_if_permit      I am open to any suggestions. It doesn't have to be Postfix. It can be procmail or any other standard solution. Note: the recipient is a mailing list, and thus does not have a user account on the system account. So any solution must work without an account. **Edit: The mailing list is currently implemented like below. (By the way, is there a way to put all the recipients of the list in a separate newline- separated file, because they are many.)**               /etc/postfix/virtual:     protected.list@example.com user1@example.com, user2.example.com, ...


title: Lazy regex using Bash

text: I'm trying to match just the text contained within the HTML tags using Bash's built-in regex function:               string=' foo'     regex=' (.+?)'     [[ $string =~ $regex ]]     echo "${BASH_REMATCH[1]}"      But the match keeps capturing `foo</span>`. The internet is so crowded with examples of sed and grep that I haven't found much documentation on Bash's own regex.


title: Linux Mint 15 does not Hibernate

text: I just did an install of Linux Mint 15 Olivia with Cinnamon, and it's been running fine so far. However, I just tried to hibernate the system by doing Menu -> Quit -> Hibernate, and it just brings me to the lock screen. When I log back in however, I think I can tell it's trying to hibernate as it disconnects from my wireless. Has anyone else had/solved this issue? Edit: It's a Lenovo X201t, and `uname -r` gives `3.8.0-19-generic`. Edit2: Using integrated graphics, Intel HD 3000. 6GB of RAM and SWAP.


title: kdm.log getting filled with odd errors

text: So for some reason when kdm is started, or a user log outs kdm will put 30,000+ lines of errors like this into /var/log/kdm.log. It trys to read every file in / and will but a error in the log for every line in those files. I'm not sure what is telling it to read files in / but as you can imagine this is getting rather out of hand. I know I could just logrotate them out but I would rather fix the core of the problem. Here is the kdm version info               # yum info kdm.x86_64      Loaded plugins: langpacks, puppetverify     Installed Packages     Name        : kdm     Arch        : x86_64     Version     : 4.11.3     Release     : 1.fc19     Size        : 1.5 M     Repo        : installed     From repo   : BASE_REPO     Summary     : The KDE login manager     URL         : https://projects.kde.org/projects/kde/kde-workspace     License     : GPLv2     Description : KDM provides the graphical login screen, shown shortly after boot up,                 : log out, and when user switching.      Here is parts of the log file.               "KConfigIni: In file /jmxsh-R5.jar, line 3722: " Invalid entry (missing '=')      "KConfigIni: In file /jmxsh-R5.jar, line 3723: " Invalid entry (missing ']')      "KConfigIni: In file /jmxsh-R5.jar, line 3724: " "Invalid escape sequence "\K"."      "KConfigIni: In file /jmxsh-R5.jar, line 3724: " "Invalid escape sequence "\b"."      "KConfigIni: In file /jmxsh-R5.jar, line 3726: " Invalid entry (empty key)      "KConfigIni: In file /jmxsh-R5.jar, line 3727: " Invalid entry (missing '=')      "KConfigIni: In file /jmxsh-R5.jar, line 3728: " Invalid entry (missing '=')      "KConfigIni: In file /jmxsh-R5.jar, line 3729: " Invalid entry (missing '=')      "KConfigIni: In file /jmxsh-R5.jar, line 3730: " Invalid entry (missing '=')      "KConfigIni: In file /jmxsh-R5.jar, line 3731: " "Invalid escape sequence "\%"."      "KConfigIni: In file /.readahead, line 893: " Invalid entry (missing '=')      "KConfigIni: In file /.readahead, line 894: " Invalid group header.      "KConfigIni: In file /.readahead, line 895: " Invalid entry (missing '=')      "KConfigIni: In file /.readahead, line 896: " Invalid entry (missing '=')      "KConfigIni: In file /.readahead, line 897: " Invalid entry (missing '=')      "KConfigIni: In file /.readahead, line 898: " Invalid entry (missing '=')      "KConfigIni: In file /.readahead, line 899: " Invalid entry (missing '=')      "KConfigIni: In file /.readahead, line 900: " Invalid entry (missing '=')       I have also already tried to update it to the latest version and I get the same results.


title: F20 Unable to hibernate, /sys/power/disk disabled

text: When I try to hibernate with `systemctl hibernate`, the unit `systemd- hibernate.service` enters failed state and I get the following entries in my journal:               Feb 09 14:18:14 pike systemd[1]: Starting Sleep.     Feb 09 14:18:14 pike systemd[1]: Reached target Sleep.     Feb 09 14:18:14 pike systemd[1]: Starting Hibernate...     Feb 09 14:18:14 pike systemd-sleep[2284]: Failed to write mode to /sys/power/disk: Operation not permitted     Feb 09 14:18:14 pike systemd[1]: systemd-hibernate.service: main process exited, code=exited, status=1/FAILURE     Feb 09 14:18:14 pike systemd[1]: Failed to start Hibernate.     Feb 09 14:18:14 pike systemd[1]: Dependency failed for Hibernate.     Feb 09 14:18:14 pike systemd[1]: Service sleep.target is not needed anymore. Stopping.     Feb 09 14:18:14 pike systemd[1]: Unit systemd-hibernate.service entered failed state.     Feb 09 14:18:14 pike systemd[1]: Stopping Sleep.     Feb 09 14:18:14 pike systemd[1]: Stopped target Sleep.      Indeed `cat /sys/power/disk` tells me:               [root@pike ~]# cat /sys/power/disk     [disabled]      My swap looks like this:               [root@pike ~]# swapon -s     Filename                Type        Size    Used    Priority     /dev/dm-0                               partition   16383996    0   -1      It is on the LVM and is called `/dev/fedora/swap`. My RAM size is 16248756 bytes, so the image should fit into swap. Suspend-to-RAM works as expected, and with other distros (Ubuntu, Arch) I was able to hibernate previously. How can I find out why `/sys/power/disk` is [disabled]?


title: SSH into servers each with different subdomain over one IP

text: I have several Ubuntu VMs (bridged) behind a router that I want to access remotely. I've also got an nginx reverse proxy that handles the port 80 traffic like this: sub1.example.com -> server1 via 192.1.168.1:81 sub2.example.com -> server2 via 192.1.168.2:82 sub3.example.com -> server3 via 192.1.168.3:83 Is there some kind of server that can proxy ssh sessions to each of these servers so that I could use only `ssh user@sub1.example.com`, `ssh user@sub2.example.com`, etc.? I'm aware of the alternative of specifying the port `ssh -p2022 user@sub1.example.com` to access the correct server but I would prefer the succinctness that a proxy could provide. **Edit:** Each of my servers can be listening on different ports.


title: How do I make find follow most, but not all, symbolic links?

text: My OS and home directory are on an SSD. I store some large files on a hard disk, and symlink from my home directory to the hard disk (eg. ~/Videos/Films is a symlink to /mnt/hdd/Films). I also have a number of Wine prefixes, each of which has dosdevices/z: symlinked to /. So, if I used find without -L, it will miss everything that's on the hard disk. But if I use find with -L, it ends up in a loop due to Wine's symlink to /. Is there any sensible way of resolving this, so that find searches where I want it to? Intuitively, I'm wanting something along the lines of "follow symlinks, unless they're under a directory called dosdevices". "Follow symlinks that are to something on the hard disk" would work too.


title: Boot Repair taking a very long time, stuck on "Create a BootInfo summary"

text: I moved my Linux Mint installation to a new HD since the old one was becoming a little unstable. I'm running Boot Repair from a live CD to get Grub configured, and everything else finished very quickly. But now it's been on "Create a BootInfo summary (url)" for like 45 minutes. Is this normal? If not, what can I do about it?


title: Does "rpm --test" verifies the dependencies too?

text: The manual only says "--test" only checks for conflicts:               hostname:~/foo# rpm -ivh --test jdk-6u2-linux-i586.rpm     Preparing...                ################# [100%]     hostname:~/foo #      **Our question:** does it checks for dependencies too?


title: sed first n occurrences result set between 2 tags / patterns

text: I have a big XML file and I get all occurrences between 2 tags: Here is what I do:               sed -n '/<tag>/,/<\/tag>/p' file.xml      And I need to filter to get only first N occurrences. I've tried with l param but it was not enough :( So any one knows how to get N matched occurrences from all resultset? For Example. Here the xml file content :               <?xml version="1.0" encoding="UTF-8"?>     <root>     <tag>      <t1>john</t1>      <t2>john</t2>      <t3>john</t3>     </tag>     <tag>      <t1>john</t1>      <t2>john</t2>      <t3>john</t3>     </tag>     <tag>      <t1>john</t1>      <t2>john</t2>      <t3>john</t3>     </tag>     <tag>      <t1>john</t1>      <t2>john</t2>      <t3>john</t3>     </tag>     </root>           sed -n '/<tag>/,/<\/tag>/p' file.xml       returns all elements. So the goal is to filter to get the First n matched patterns ( Elements are multi-line) If n = 2 then result =:               <tag>      <t1>john</t1>      <t2>john</t2>      <t3>john</t3>     </tag>     <tag>      <t1>john</t1>      <t2>john</t2>      <t3>john</t3>     </tag>


title: Trying to load file to device via serial to USB adapter

text: So I have this device, and it's pretty old. It only has a serial interface. I have a cord that connects to it, and then to the serial port of a computer. This cord is plugged into a serial to usb adapter. I'm fairly certain it is attached, as I can use `picocom` to talk to it. Or, at least, I can listen to it. dmesg gives:               dmesg | grep tty     [    0.000000] console [tty0] enabled     [15037.544085] usb 3-3: pl2303 converter now attached to ttyUSB0      What I need to do is this: In my browser (and unfortunately, there's no way around this) there's a java applet which will connect to it and write the file appropriately. Unfortunately, it looks mainly for USB connections, and for whatever reason isn't seeing the device. I'll be honest: I know very little about serial ports and how they work, especially within a linux setting. So my question is: How do I hook this up and what do I do to it to make firefox/the java applet within firefox see it properly?


title: How To Convert .run Installer to .deb Installer?

text: I'm running Ubuntu 14.04. I have many 3rd party system libraries which I use for projects, but managing library installation is difficult. Some libraries are .deb files, some are built from source (which I then create a .deb from), and some are .run files. My goal is to have my own personal repository which hosts these 3rd party system libraries in the form of .deb files. My issue is converting .run files into .deb files. I've tried using checkinstall to run the .deb file (specifically the UEye camera drivers found here ), hoping that checkinstall would capture the modifications to my filesystem, but unfortunately that was a disaster. Are there any clean ways to turn .run files into .deb files?


title: A layman's explanation for "Everything is a file" — what differs from Windows?

text: I know that "Everything is a file" means that even devices have their filename and path in Unix and Unix-like systems, and that this allows for common tools to be used on a variety of resources regardless of their nature. But I can't contrast that to Windows, the only other OS I have worked with. I have read some articles about the concept, but I think they are somewhat uneasy to grasp for non-developers. A layman's explanation is what people need! For example, when I want to copy a file to CF card that is attached to a card reader, I will use something like               zcat name_of_file > /dev/sdb      In Windows, I think the card reader will appear as a driver, and we will do something similar, I think. So, how does the "Everything is a file" philosophy make a difference here?


title: Move boot disk on SAN storage on Solaris 10

text: I'm looking for some infos/official docs/howto for migrating boot disks in a production enviroment server from internal disks to SAN on Solaris 10. It's possible for every kind of hw? It's also possible in a Sun Cluster enviroment?


title: Can't boot Debian with windows installed first

text: I have Windows XP already installed on my HD and I had some space left to install Debian. After I've installed Debian, I answered yes to the Grub bootloader but when booting the computer nothing appears; no menu, only Windows automatically starts.. Why and what to do? This the second install and the problem still occurs. (Windows is new too but always installed first) Debian is still installed now. Edit1: -Grub was installed on the MBR of the first hard disk. -I can access Debian only when bootable usb is plugged in. Edit2: problem is solved now, by reinstalling -and for the third time Debian- but with a hd image installation method(the previous installations were done by netiso method)- But still I want to know Why this problem occurs with the netiso method? Why grub is not working when installed with netiso?


title: LAMP Hardening, Transparent Proxy with iptables

text: I'm running a LAMP server with FTP(S) and several users. The users have only access to uploading PHP files and other web content. Some are running Drupal and Wordpress, but also a few home made stuff. I already disabled all shell access attempts from php. But in order to fully protect myself, my server and my users from downtime, script kiddies and other nasty things I want to disallow RFI. Actually I don't want to allow any traffic (TCP & UDP) going out from my server that I don't allow to. For this task I want to make a transparent proxy that retrieves all packages before they are sent, making decisions if the packages should be allowed or not. I want to use Python for the task of making the decisions as it is easy to fetch allowed URL's from the local database. Like I want to allow certain API's / OAuth sources. How do I configure iptables to send all data (including destination ip and port), to my python application? Or is there any better way of doing this? My thought was just that if I can disable shell access and unauthorized network traffic I can sleep at night. Then no one can use my server as a bot in a botnet. And they can't email spam. What do you think? I don't want to rely upon Suhosin, since I'm using PHP 5.4 and later.


title: What's the best way to have uwsgi create a '/run/uwsgi' folder on reboot?

text: I have set up a Django project to run with uwsgi and nginx and it's all running as expected, except that when I reboot uwsgi will not launch correctly until the /run/ folder is recreated on the fs. /run is mapped to 'tmpfs' so it needs to be recreated at each boot. I have a systemd service file that I created for uwsgi:               [Unit]     Description=uWSGI Module     After=syslog.target          [Service]     ExecStart=/usr/bin/uwsgi --ini /etc/uwsgi.ini     Restart=always     KillSignal=SIGQUIT     Type=notify     StandardError=syslog     NotifyAccess=main          [Install]     WantedBy=multi-user.target      And the `/etc/uwsgi.ini` file looks like this:               [uwsgi]     uid = uwsgi     gid = uwsgi     pidfile = /run/uwsgi/uwsgi.pid     stats = /run/uwsgi/stats.sock     socket = /run/uwsgi/uwsgi.sock     master = true     processes = 1     chdir = /path/to/our/django/app     module = icscada     max-requests = 100     daemonize = /var/log/uwsgi.log      **What is the recommended way for the`/run/uwsgi` folder to be recreated at each boot?** I would've also added the tag `uwsgi` but don't have enough rep yet.


title: How to make sure OpenVPN is connected?

text: I need some sort of "safeguard" for my VPN connection. If the connection drops, the machine shouldn't even reach the internet. (I can reach the machine by other means.) Is it possible somehow?   If I remember correctly, there are some "safeguards" for Windows, but I never heard about such a solution for Linux. Not to mention for cli.


title: zcat a file line by line?

text: I have written a C++ application that reads files line by line. It reads one line, does processing, then reads the next line. I would like to add support for gzipped files, and am looking to an alternative to using C++ decompression libraries. One solution is to decompress the entire file, then read it as usual. However, I'm dealing with very large files and I prefer the quick start-up time `zcat` provides by immediately decompressing the first lines of the file. The problem is that, left unchecked, `zcat` would decompress too much of the file too quickly for my application to keep up and the output buffer from the system command would quickly fill with a decompressed 10GB file while my application is still processing the first few lines. Is it possible to pause `zcat`, or tell it to only read one line at a time, only advancing when the user indicates?


title: Where is the bash feature to open a command in $EDITOR documented?

text: I have recently discovered that if we press `Ctrl`+`X` `Ctrl`+`E`, bash opens the current command in an editor (set in `$VISUAL` or `$EDITOR`) and executes it when the editor is closed. But it doesen't seem to be documented in the `man` pages.


title: How do I perform a reverse history search in ZSH's vi-mode?

text: I use `vim` for essentially all my editing needs, so I decided to once again try vi-mode for my shell (currently ZSH w/ oh-my-zsh on OS X), but I find myself trying (and failing) to use `Ctrl-R` constantly. What's the equivalent key-binding? And for future reference, how would I figure this out myself? I'm pretty sure I could use `bind -P` in bash.


title: How can I shrink a LUKS partition, what does `cryptsetup resize` do?

text: I am in progress of resizing a LUKS encrypted partition that contains a single ext4 filesystem (no LVM or something). The cryptsetup FAQ recommends to remove the old partition and recreate it, but that sounds like wasting a lot time. Therefore I want to proceeed by manually, carefully resizing the partition. So far, I think that I need to do:   1. **Create an (encrypted) backup of the filesystem. Important! You won't be the first to lose your data while performing the following tasks.**   2. Unmount the existing ext4 filesystem (e.g. by booting into a Live CD). If booting from a Live CD, mount the encrypted partition using `cryptsetup luksOpen /dev/sdXY ExistingExt4`   3. Resize the existing ext4 filesystem.   4. `cryptsetup resize /dev/mapper/ExistingExt4 -b $SECTORS`   5. Close/ "unmount" the LUKS partition using `cryptsetup luksClose ExistingExt4`   6. Shrink the partition size. **Are the above steps correct?** In step 4, **what should I choose for`$SECTORS`? Is this step even necessary?** The `cryptsetup` manual page is not really descriptive on the `resize` option:               resize <name>         resizes an active mapping <name>.         If --size (in sectors) is not specified, the size of the underlying         block device is used.      Finally, if I shrink the ext4 partition by 15 GiB, can I safely assume that 15 GiB can be removed from the existing partition using `parted`? If yes, how to do so? My disk is GPT partitioned, if that matters.


title: Open a specific application in a *new* workspace with i3wm

text: My question is something like this - but I don't want to open a given application on a specific workspace, I want each instance to open on a new workspace each time. The OP in the linked-to question wants to open Firefox on workspace 2, Chromium on workspace 1, etc... I want to open new instances of a text-editor (Sublime Text) in a new workspace for every new instance. Is this possible? _solution_ : I used the accepted answer in a modified form:               # .bashrc     ...     function sublime {       i3-msg workspace $(($(i3-msg -t get_workspaces | tr , '\n' | grep '"num":' | cut -d : -f 2 | sort -rn | head -1) + 1))       /usr/bin/sublime_text_3/sublime_text $1     }      so that I can use it like this:               $ sublime /path/to/file      and also because I'm using my dotfiles across several computers, so it's nicer to include everything in one place!


title: Takeover delay in Heartbeat HA cluster

text: I have set up a heartbeat HA two node cluster. And both of server have same configuration of ha.cf               #cat /etc/ha.cf     logfile /var/log/ha-log     autojoin none     bcast eth1     warntime 20ms     deadtime 40ms     initdead 30     keepalive 5ms     node server1.com     node server2.com      I set keepalive and deadtime in milliseconds hoping failover will take place in less than second or deadtime value. But expected behaviour is not met. With this configuration if I stop heartbeat in one server another server will take only after about 20 seconds(rough estimate by a stopwatch). I was wondering is what heartbeat can only do or am I missing something?