title: Apache configuration wont update

text: I have just installed this server with Ubuntu server 12.10 and then installed Apache2, however now when I run service apache2 reload or service apache2 restart it claims to have suceeded in updating but actually, it does not update, here is the problem:               root@sbh1:/etc/apache2# a2dissite 000-default     Site default already disabled     root@sbh1:/etc/apache2# a2dissite default-ssl     Site default-ssl disabled.     To activate the new configuration, you need to run:       service apache2 reload     root@sbh1:/etc/apache2# service apache2 reload      * Reloading web server config                                                                                [Fri Nov 09 17:00:19 2012] [warn] NameVirtualHost *:80 has no VirtualHosts                                                                                [ OK ]     root@sbh1:/etc/apache2# service apache2 restart      * Restarting web server apache2                                                                                [Fri Nov 09 17:00:23 2012] [warn] NameVirtualHost *:80 has no VirtualHosts      ... waiting .[Fri Nov 09 17:00:26 2012] [warn] NameVirtualHost *:80 has no VirtualHosts                                                                                [ OK ]     root@sbh1:/etc/apache2#     root@sbh1:/etc/apache2# ll sites-enabled     total 8     drwxr-xr-x 2 root root 4096 Nov  9 17:00 ./     drwxr-xr-x 7 root root 4096 Nov  9 16:59 ../     root@sbh1:/etc/apache2# wget localhost     --2012-11-09 17:00:36--  http://localhost/     Resolving localhost (localhost)... ::1, 127.0.0.1     Connecting to localhost (localhost)|::1|:80... failed: Connection refused.     Connecting to localhost (localhost)|127.0.0.1|:80... connected.     HTTP request sent, awaiting response... 200 OK     Length: 177 [text/html]     Saving to: `index.html.1'          100%[===================================================================================================================================================================================================>] 177         --.-K/s   in 0s          2012-11-09 17:00:36 (46.2 MB/s) - `index.html.1' saved [177/177]          root@sbh1:/etc/apache2#      Why is the default site still broadcasting? If I enable other sites they do not start broadcasting either.


title: Start installation of a package, when the working one is finished

text: Suppose I install a package on a debian based system via `sudo aptitude install mypackage`. Suppose the package is big and it takes long to download and install it. When I notice that I want to install another package after invoking that command I have to wait until the first package is completely installed. Is it possible to make aptitude to start automatically installing the second package, after the first one is finished?


title: How to attach to remote machine's local display session over ssh?

text: Scenario: Linux mint is running on a machine at my home. I have some gui applications open on it. I'm away from home but want to get at the open applications. I have cygwin/x and I know how to `ssh -X homecomputer`, and I could run gui applications from there, but I want to get at the windows that are already open on the local display. Is there a way to attach to the existing x session on linux without using extra software like VNC? Thanks!


title: How to remove Cinnamon's Alt-F1 keybinding using Linux Mint 15

text: I've just started using Linux Mint 15 with Cinnamon 1.8.8 at work and when I press `Alt`+`F1` the display zoom out and displays the workspace switcher. How can I disable this shortcut? I removed the keyboard shortcuts in System settings -> Keyboard -> Keyboard Shortcuts that seemed relevant but with no effect. Then I removed all of them, but of course still no effect. **Update** The accepted answer worked for Mint 15. After upgrading to Mint 16 I also had to use dconf-editor as described by maosmurf below.


title: Are limits.conf values applied on a per-process basis?

text: I'm tuning the `nofile` value in `/etc/security/limits.conf` for my oracle user and I have a question about its behavior: does `nofile` limit the total number of files the user can have open for _all_ of its processes or does it limit the total number of files the user can have open for _each_ of its processes? Specifically, for the following usage:               oracle                  hard    nofile                  65536


title: Watchdog script to keep an application running

text: I currently use an application called MxEasy on my linux servers to display video from a couple of IP cameras. The software is rather buggy and crashes occasionally. I've wrote a script that checks to see if the application is running and if its not... it launches the application. I've tried adding this line to my crontab to have it run the script. It's running the script but not launching MxEasy. Any thing I'm over looking?               0,15,30,45,50 * * * * root  export DISPLAY=:0 && /etc/cron.hourly/MxEasyCheck.sh       BTW Ubuntu Server 12.04 is the OS Here is MxEasyCheck.sh               MXEASY=$(ps -A | grep -w MxEasy)          if ! [ -n "$MXEASY" ] ; then         /home/emuser/bin/MxEasy/startMxEasy.sh &         exit     fi      Here is my crontab               # /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 )     0  *    * * *   root    /etc/cron.hourly/rsynccheck.sh     0,15,30,45,50 * * * * root  export DISPLAY=:0 && /etc/cron.hourly/MxEasyCheck.sh      #


title: Bash Vi-mode: Move back to last slash

text: I'm using Bash in vi mode with `set -o vi`. Often I re-run a command but need to change the name of a file in the same directory. Example:               mv /tmp/myfileA.txt /home/daniel/myfileA.txt      Then, I decide to also move another file:               mv /tmp/w00t.txt /home/daniel/w00t.txt      Typically I press the up-arrow key to get the last command, and press `b` until I get to the last slash character, and then insert the new file name. Since I do this very often, I'm wondering if there is an easy way to get the cursor just right after or on the last slash character. Please note the above is only an example; I know I could do something like `mv /tmp/{myfileA,w00t}.txt ...` but often I simply type faster than I think :-)


title: How do I compare a file with a floppy image and the actual floppy's content?

text: Is there a command that compares a floppy disk image (e.g. a .iso file) to the actual contents of the floppy the image was written on (e.g. /dev/fd0)?


title: Determining the Source of a Given File System Mount on Unix

text: **Background** Recently I have run into a bit of a snag on my home FreeBSD server. I recently upgraded it to the latest stable release, and I have noticed some strange behavior with the /var partition. Originally, I had the system configured such that /var had its own partition with /var/run and /var/log in memory disks (/tmp, too). After the upgrade, I notice there is a new, fourth memory disk mounting directly to /var that I had **not** set up manually and is not in my fstab. It is only 28 megs or so in size and is causing problems when trying to update my ports collection. The ramdisk mounts atuomagically at boot and cannot be unmounted while in multi-user mode. If I drop to single user mode, I am able to unmount it without issue, however rebooting causes it to pop right back up. System specifications have been included at the end of the post. **Question** Is there any way to determine exactly what is mounting a given memory disk (or any filesystem, for that matter) after it has been mounted? Alternately, does anybody have any ideas what might have caused the new /var ramdisk to pop up? **System Specification**               # uname -a          FreeBSD sarge 9.1-PRERELEASE FreeBSD 9.1-PRERELEASE #0: Thu Nov 22 14:02:13 PST 2012     donut@sarge:/usr/obj/usr/src/sys/GENERIC  i386          # df          Filesystem   1K-blocks      Used     Avail Capacity  Mounted on     /dev/da0s1a     515612    410728     63636    87%    /     devfs                1         1         0   100%    /dev     /dev/da0s1d     515612    287616    186748    61%    /var     /dev/da0s1e    6667808   2292824   3841560    37%    /usr     /dev/md0         63004        32     57932     0%    /tmp     /dev/md1          3484         8      3200     0%    /var/run     /dev/md2         31260         8     28752     0%    /var/log     /dev/md3         31260       512     28248     2%    /var       <-- This          # cat /etc/fstab          # Device    Mountpoint  FStype  Options         Dump    Pass#     /dev/da0s1a /       ufs rw,noatime      1   1     /dev/da0s1d /var        ufs rw,noatime      2   2     /dev/da0s1e /usr        ufs rw,noatime      2   2     md      /tmp        mfs rw,-s64M,noatime    0   0     md      /var/run    mfs rw,-s4M,noatime     0   0     md      /var/log    mfs rw,-s32M,noatime    0   0         Thank you in advance for any assistance.


title: using awk to split a line on single spaces not multiples

text: I'm trying to split a line that I have no control over the format of. If parameter 7 and 8 are missing which is possible they will be replaced by a space so I would end up with,               field1 field2 field3 field4 field5 field6   field9      At the moment in this situation field 9 is being read as field 7. Much searching has led me to believe that the following should work but it isn't doing. It's probably some minor syntax error on my part but I can't seem to spot it.               word1=`echo $LINE | awk 'BEGIN { FS="[ ]" } ; { print $9 }'`


title: Loading a color scheme has no effect in Vim

text: I had selected some really smart looking color schemes for Vim here Following the instruction inside those files I've copied them in my `$VIMRUNTIME/colors` directory. When Vim is launched in normal mode, I type `:colorscheme dw_blue`, and nothing happens. Same if I put this line in my .vimrc file. In deed sometimes (with a nother custom file) not really nothing happens, if I visualize a cpp file, only the color of the #include will became gray instead of pink. But it's really all. All the color scheme remains intact (and I'm really not found of yellow and red and cyan and blue and rainbows all over my code :-)) I have tried with the files `dw_cyan.vim`, `dw_blue.vim`, `dw_red.vim`, `dw_purple.vim`, `maroloccio3.vim` and `matrix.vim`, and the problem is the same for all these files. At first, there was a problem of end of line. So I corrected all the Dos cr-lf into Unix lineFeed with the text editor Scite. But this was blocking with a clear error in vim `unknown ^M error`. But there's no more error in my case: it just doesn't load the theme. * * * However, if I load the original theme `darkblue` from original Vim themes, then the theme **is loaded**. Same with `slate`, `desert`, 'ron' and so on... As a solution I could try playing with the content of those files so as to achieve a theme I like, but I'd really like to know why I couldn't load the files. I use vim73. I thought I could be because of the ATerm transparent terminal I was using, so I tried with XTerm and I got no different results.


title: Change default application of USB

text: I am using GNOME 3.8.4. When I plug in a USB device it asks to open with Rhythmbox but I want to be asked to open with Nautilus. How can I handle this?


title: Frequent connection aborts with arch-linux

text: I have an arch-linux system which I use as a server. I try to connect with _ssh_ and _samba_ from different Windows 7 machines.   However, I get frequent connection aborts. _ssh_ (e.g. putty or kitty) says for instance: > Server unexpectedly closed network connection And often, when I try to connect for the first time > Network error: Software caused connection abort When I manage it to connect to the machine, it is very random how long it takes to get disconnected again. Sometimes only seconds, sometimes an hour or more.   When I use _samba_ , I often copy some GBs of data before I get an abort. I can not browse the samba shares for a while, before it works again. _ssh_ and _samba_ always disconnect at the same time (given both are active). I am not sure what kind of problem this is - when my _ssh_ or _samba_ disconnects I can ~~still~~ _not_ `ping` the machine _anymore_. I already tried to use a different switch between the machines, but it didn't help either. I tried to change _MTU/MRU_ values - no success. A _tcpdump_ shows, that the _tcp_ handshake is successful, but afterwards the Windows 7 clients are not responding anymore. Do you have any idea what's going on here or how I can debug the behavior?


title: How to recover a missing file

text: I am running ubuntu and last week the system didn't let me alter files as if I had no write permissions. Then on reboot the system did a check of the system which took some time. Then everything went normally. Yesterday I was using matlab. I created 2 function ".m" files, and matlab crashed from an out of memory exception. This morning after checking my computer, I see that 1 of the files is missing, non-existant. What can I do about this? I heard of a folder called yesterday but I can't find it. If there are any other ways this would be great.


title: Is there any danger in changing the labels of my hard drives?

text: I've have both Ubuntu and Arch installed on my computer, and want to change the labels of the `/` and `/home` partitions (four in total), to make it clear which is which. Can this potentially break anything? The only thing that I can think of is `/etc/fstab`; this shouldn't be an issue in my case, since it defines partitions by UUID, not label.


title: Is Ramdisk and initrd the same?

text: While reading through the kernel documentation on ramdisk in ramfs-rootfs- initramfs.txt i was having a doubt like the ramdisk explained there is same as the initrd features described in the post at the-difference-between-initrd- and-initramfs. Could someone clarify me on this?? And if it is the same, i read that there are many disadvantages for it, but still in my fedora PC, i see > initrd-2.6.29.4-167.fc11.i686.PAE.img in my boot folder. Is it different from the initrd mentioned above?? UPDATE_EDIT :   In of the articles I even saw a command like   `# update-initramfs -u all   update-initramfs: Generating /boot/initrd.img-2.6.18-5-amd64` So how is this initramfs linked to initrd.img ?


title: My own Arch Linux based distribution

text: Well, i'm looking for some book, or wiki, that help me to create my own based distribution, I really don't know where to start, only thing that I know is: I want to make a Arch Linux distribution, not just a Live CD, or something, but my OWN distribution, I know that I'll have to study so much to get there, but I really want it. Someone could help me about it? :)


title: How to change hostname on centos 6.5?

text: Hi can't seem to change the hostname on my centos 6.5 host. I am following the instructions I found here: http://www.rackspace.com/knowledge_center/article/centos-hostname-change I set my `/etc/hosts` like so ...                   [root@mig-dev-006 ~]# cat /etc/hosts         127.0.0.1   localhost localhost.localdomain          192.168.32.128  ost-dev-00.domain.com ost-dev-00         192.168.32.129  ost-dev-01.domain.com ost-dev-01      ... then I make my `/etc/sysconfig/network` file like so ...                   [root@mig-dev-006 ~]# cat /etc/sysconfig/network         NETWORKING=yes         HOSTNAME=ost-dev-00.domain.com         NTPSERVERARGS=iburst      ... then I run `hostname` like so ...                   [root@mig-dev-006 ~]# hostname ost-dev-00.domain.com      ... and then I run bash and all seems well ...                   [root@mig-dev-006 ~]# bash      ... but when I restart my network the old hostname comes back:                   [root@ost-dev-00 ~]# /etc/init.d/network restart         Shutting down interface eth0:  Device state: 3 (disconnected)                                                                    [  OK  ]         Shutting down loopback interface:                          [  OK  ]         Bringing up loopback interface:                            [  OK  ]         Bringing up interface eth0:  Active connection state: activating         Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/6         state: activated         Connection activated                                                                    [  OK  ]         [root@ost-dev-00 ~]# bash         [root@mig-dev-006 ~]#       ... I can't figure it out. What am I doing wrong here.


title: Use xargs to move files from within a directory

text: I am searching for some folders in my current directory. What I want to do is, move all the files within those directories to another directory. I am using the following command:               find -maxdepth 1 -regex 'myRegexExpHere' | xargs -I file mv file/* Desktop/New\ folder/      But as expected, the '*' is not expanded by xargs, instead searching for a file named * in each folder. What should I do to achieve my aim? Please suggest ways involving the use of xargs only (and not the -exec switch of find), primarily because I have read that using xargs is much more efficient.


title: Swap bash script pins htop's memory usage

text: I deployed a hack to add swap space to a VPS that otherwise didn't allow me to use `swapon` to create a file. Prior to adding and executing the script, I followed the steps outlined here. and summarized below:   1. First I create the swap file: `sudo dd if=/dev/zero of=/swapfile bs=1024 count=512k`   2. Then `sudo mkswap /swapfile`.    3. The next step would usually have been to do a `sudo swapon /swapfile`. However, the VPS I'm using doesn't jive with that, so I found this post. That claimed I could use the following script as a workaround. See below:               #!/bin/bash     SWAP="${1:-512}"     NEW="$[SWAP*1024]"; TEMP="${NEW//?/ }"; OLD="${TEMP:1}0"     umount /proc/meminfo 2> /dev/null     sed "/^Swap\(Total\|Free\):/s,$OLD,$NEW," /proc/meminfo > /etc/fake_meminfo     mount --bind /etc/fake_meminfo /proc/meminfo      For more context, the process is described in detail in this answer. (It's mostly just spoon-feeding on running a bash script.) All seems to be fine, however when I look in htop (or in `free -m` for that matter); the memory usage remains at whatever value it was at when I executed the script and the used swap space remains at zero. This is regardless of whatever process I run on the server. My knowledge of what's going on in memory allocation is very limited (this is really my first time screwing around with it). Could anyone tell me if this makes sense, given the script I'm running, and why?


title: What is the significance of Linux's Disk caching Mechanisms?

text: I would like to know the exact meaning and significance of Linux's Disk caching Mechanisms. In one of the articles I have read, page cache and dentry cache are two forms of them. Could somebody explain to me these concepts?


title: What is the fastest way to install GCC on Wind River 3.02?

text: I am fairly new to installing things on a bare-bones Linux system and really do not want to just blindly install rpm after rpm of dependencies I think I might need... I know that this version of Linux is based off of Fedora 11 if that helps at all. I am currently trying to install yum to pull down all of the required files / installers. However, when trying to install yum via a RPM I am missing several dependencies. I have begun the hunt for these dependencies but they are becoming more and more obscure. Before I start installing all of these crazy RPMs is there a better way to approach this?


title: Which terminal type am I using?

text: I have tested this with both Ubuntu 12.04 and Debian 7. When I do               echo $TERM      I get               xterm      But if I use the dropdown menu "help" > "about" then it says `gnome terminal 3.4.1.1`. Does this mean I am using just gnome-terminal? Or just xterm? Or is gnome- terminal an extension of xterm? I'm confused.


title: Postfix, postges courier-imap / relay reject error on gentoo

text: I followed a guide to put together a server https://wiki.gentoo.org/wiki/Complete_Virtual_Mail_Server it went smooth with no real headaches. First domain works like a champ but adding a second domain, I can't receive mail mail due to a relay reject               2013-10-03T02:53:02+00:00 emailer1 postfix/trivial-rewrite[18031]: warning: table "pgsql:/etc/postfix/pgsql/virtual_mailbox_domains.cf": empty lookup result for: "effin.me" -- ignored     2013-10-03T02:53:02+00:00 emailer1 postfix/smtpd[18144]: NOQUEUE: reject: RCPT from mail-vc0-f181.google.com[209.85.220.181]: 554 5.7.1 <test@effin.me>: Relay access denied; from=<telecom@gmail.com> to=<test@effin.me> proto=ESMTP helo=<mail-vc0-f181.google.com>      The postfix side must be working fine since it has nothing to do with mailboxes. The records in the postgres db are identical (first and second domain)               emailer1 vmail # ls -l effin.me/test/     total 28     drwx------ 2 vmail vmail 4096 Oct 2 18:19 courierimapkeywords     -rw-r--r-- 1 vmail vmail 23 Oct 2 18:23 courierimapsubscribed     -rw-r--r-- 1 vmail vmail 15 Oct 2 18:23 courierimapuiddb     -rw-r--r-- 1 vmail vmail 469 Oct 2 18:16 courierpop3dsizelist     drwx--S--- 2 vmail vmail 4096 Oct 2 18:23 cur     drwx--S--- 2 vmail vmail 4096 Oct 2 18:19 new     drwx--S--- 2 vmail vmail 4096 Oct 3 02:50 tmp      * * *               postfix=# SELECT maildir FROM mailbox WHERE local_part='test' AND domain='effin.me' AND active='1';     maildir     ----------------     effin.me/test/     (1 row)          postfix=# SELECT goto FROM alias WHERE address='test@effin.me' AND active='1';     goto     ---------------     test@effin.me     (1 row)      * * *               emailer1 ~ # telnet localhost 25     Trying 127.0.0.1...     Connected to localhost.     Escape character is '^]'.     220 emailer1.nyctelecomm.com ESMTP Postfix     EHLO emailer1.telecomm.com     250-emailer1.telecomm.com     250-PIPELINING     250-SIZE 10240000     250-ETRN     250-STARTTLS     250-AUTH LOGIN PLAIN     250-ENHANCEDSTATUSCODES     250-8BITMIME     250 DSN     mail from:test@effin.me     250 2.1.0 Ok     rcpt to:bcd-dd214@yahoo.com     250 2.1.5 Ok     data     354 End data with <CR><LF>.<CR><LF>     test email out from cli.     .     250 2.0.0 Ok: queued as 445887490E     quit     221 2.0.0 Bye     Connection closed by foreign host.


title: Kernel panic after building kernel in Red Hat Linux?

text: I've been trying to build a new kernel for Red Hat Enterprise Linux virtual installs under VM Ware. I've followed these steps so far:   1. Download the kernel from kernel.org.   2. Extract the downloaded file.   3. `make menuconfig`   4. `make -j8`   5. `make modules`   6. `make -j8 modules_install install` And everything seems to work ok, however, when I reboot and access to the kernel version built, I get a kernel panic screen, and pressing `F1` I get messages like: > `Could not load /lib/modules/3.10.14/modules.dep No such file ...`


title: mount: special device /tmp/cdrom does not exist - CentOS kickstart %post section

text: I am upgrading an installation from CentOS 5.5 to 6.4. I am having troubles with my kickstart file in the %post section while mounting /tmp/cdrom during the install: The following configuration in ks.cfg worked fine in CentOS 5.5..But, now takes a dump in 6.4... ks.cfg:               #     # Post install tasks to ready the system for the installation of PressureMap     #     %post --nochroot  --log=/mnt/sysimage/root/ks_post.log     #     # Copy additional files to the installed system     #     echo "Copying files to installed system..."     # mount the install disk     mkdir -p /mnt/source     mount -t iso9660 /tmp/cdrom /mnt/source      What has change from CentOS 5.5 to 6.4?? Not sure what I need to do here?? I see the error in my ks_post.log file:               Copying files to installed system...     mount: special device /tmp/cdrom does not exist


title: unable to open X server

text: I am trying to generate a screenshot of a firefox window in my terminal, but I keep getting an error:               root@host [~]# DISPLAY=:1 firefox http://www.cnn.com & sleep 5 && DISPLAY=:1 import -window root -crop 1264x948+0+25 -quality 90 /usr/local/apache/htdocs/screenshot1.jpg && pkill firefox     [1] 30200     import: unable to open X server `:1' @ import.c/ImportImageCommand/364.      Why is this happening? How can I fix it?


title: How to check that a user/password is expired in AIX?

text: I can check that the user is expired or not with:               lsuser -f USERNAME | fgrep expires      But how can I check that the user's password is expired or not? Are there any other "expiring" things that can cause trouble? [so that user can't login, because he can only reach a server through FTP and his password expired, and he can't change it, because he hasn't got SSH access to give out the "passwd" command to update his password.]


title: Cron Job Clean Directory

text: How is it possible to delete files older than 14 days in a folder using a cron job? Everything I have tried so far hasn't worked.


title: Editing the *bookmark list* buffer on Emacs

text: On Emacs (using Bookmarks+), if I type `C-x r l` I can open the buffer `*Bookmark List*` and navigate through my bookmarks. On this buffer, if I type `Enter` on a given bookmark, Emacs opens the bookmark, and if I type `r` Emacs allows me to edit it (rename). However, this mode of editing requires me to type my edits from scratch on the minibuffer (i.e. I need to provide the new name of the bookmark and the full new path of the bookmark). I was wondering if there is a way to edit the `*Bookmark List*` buffer directly, as if I was editing any regular buffer, so that I don't have to re- type the new name or path of the bookmark (in case I want to keep parts of them) from scratch.


title: How to set up Active Directory authentication on CentOS 6.5?

text: I have: 1. A CentOS machine to which I have SSH and STFP access. 2. The machine is on network where there is a MS SQL Server database and Windows shared drives. 3. All authentication seems to be with Active Directory. I want: 1. Connect to eh SQL Server Database from the CentOS machine 2. Connect to the shared drives from the CentOS machine So far I have: 1. Installed unixODBC 2.3.0 (as per the instructions on the Microsoft website) 2. Installed MS SQL Server 2011 driver for Linux 3. Created ~/odbc.ini and populated the following fields: Driver, Server and Trusted_Connection 4. sudo yum install -y samba-winbind samba-winbind-clients oddjob-mkhomedir pam_krb5 krb5-workstation How do I set up the machine to 1. connect to the SQL Server and 2. connect to the network shares? Is there a "walk through"?


title: Zsh autocomplete ls command with directories only

text: Suppose I have following files and directories:               % ls                                                                        bui00293    buiawer      builds/     buiowpe/      I want to list the content of `builds`               % ls bui[TAB]      Zsh however shows the options with all the files and dirs above. What I want is the autocompletion of zsh's `cd` command ie. only autocomplete with directory names.


title: Linux executable sandboxing?

text: I'm running a service that allows users to submit code which is compiled and executed on the server. At the moment I'm using Moe and while it works fine for C and C++ code, I've been having some weird issues with other languages such as Perl and PHP on 64 bit. Is there any secure way to run possibly unsafe code that works properly on 64 bit? I've had success running all sorts of languages like Perl, Lua and PHP on 32 bit systems in the past with both Moe and my own ptrace based sandbox, but neither work perfectly on 64 bit.


title: How to ignore -ls errors in find

text: I'm writing a `find` command to look for files or folders with broken permissions (files should be `rw`, directories `rwx`) and trying to `ls -l` (give or take) the results. The following `find` command looks like it works, but the `ls` part is giving me trouble.               find . '(' -not -readable ')' -or \            '(' -not -writable ')' -or \            '(' '(' -not -executable ')' -and -type d ')'      Adding `-ls` or `-exec ls -l {} \;` to the end works until it gets to a directory it can't read. That gives a `permission denied` error and bails out completely without finishing. Running `ls -ld $(<that command>)` works, as far as I can tell, but it feels like I'm missing something simple in `find`. As an aside, I'm not worried about POSIX compliance, so I'd rather use `-or` instead of `-o` and such for readability.


title: Context of the matching regular expression

text: I'm using `egrep` with the `-o` option in order to just get the matching part of the line, e.g.               cat /usr/share/dict/words | egrep -o '(aa|ii)'      Now I'd like to see some context of the match, i.e. a few characters on the left and on the right. One way to achieve this is by               cat /usr/share/dict/words | egrep -o '.{3}(aa|ii).{2}'      Is there a better (more efficient and elegant) way? (I've gone through the `egrep` commandline options but didn't find one for this purpose.)


title: Is automake and autoconf the standard way to compile code?

text: I sometimes compile apps from source and I've either been using:               ./configure     make     sudo make install      But recently, I came across `./autogen.sh` which generates the configure and make scripts for me and executes them. What other methods to streamline C/C++/C#(mono) compilation exist? Make seems a bit old. Are there new tools out there? Given the choice, which one should I use?


title: Installing gcc on rhel 6.1

text: GCC doesnt seem to be installed on my Rhel 6.1 machine. Also, when i did:               sudo yum install gcc       It barfed:               Updating Red Hat repositories.     Setting up Install Process     No package gcc available.     Error: Nothing to do      The same command works fine on rhel 5.5. What could be the problem?               sudo yum search gcc      Returns:               libgcc.x86_64 : GCC version 4.4 shared support library     libgomp.x86_64 : GCC OpenMP v3.0 shared support library          sudo yum grouplist      Returns:               Loaded plugins: product-id, subscription-manager     Updating Red Hat repositories.     Setting up Group Process     Error: No group data available for configured repositories               sudo yum repolist      Returns:               Loaded plugins: product-id, subscription-manager     Updating Red Hat repositories.     repolist: 0      Update:               ls -l /etc/yum.repos.d/      Returns:               -rw-r--r--. 1 root root  67 Nov 28 06:28 redhat.repo     -rw-r--r--. 1 root root 529 Apr 27  2011 rhel-source.repo


title: Suggestion for an ISO image indexer and manager?

text: I have recently moved from Windows to Linux and my most missed application is WhereIsIt. I am looking for a software that can index the contents of all my ISO files (750GB in total) sitting in an external hard drive. The goal is to search for old files that were backed up in the ISO files over the years. Is there any good application for this purpose?


title: Meaning of backslash

text: Why the following command prints `Smith` but not `\Smith`?               echo \Smith


title: fedora can't find mysql service

text: I have a VPS running Fedora 16 (upgraded from 15). Mysql was installed and working until recently. Now I can't get the mysql service started. when I try               /etc/init.d/mysqld start      I get the error               /etc/init.d/mysqld: No such file or directory      I have uninstalled and installed mysql several times               yum install mysql mysql-server      but the service still isn't available


title: Compling KUTE traffic generator 1.4 on Fedora Core 5

text: I am trying to install KUTE traffic generator on Fedora Core 5 kernel version 2.6.15. When I try to complile I get this error message:               [root@dhcppc128 kute-1.4]# make     make modules     make[1]: Entering directory `/kute-1.4'     make -C /lib/modules/2.6.15-1.2054_FC5smp/build SUBDIRS=/kute-1.4 modules     make: *** /lib/modules/2.6.15-1.2054_FC5smp/build: No such file or directory. Stop.     make: Entering an unknown directorymake: Leaving an unknown directorymake[1]: *** [modules] Error 2     make[1]: Leaving directory `/kute-1.4'     make: *** [all] Error 2      Also I get errors when trying to patch. I have been told I need to install the kernel headers, and I have tried installing the kernel headers and kernel devel from the DVD: I have checked the kernel version and it is: `2.6.15-1.2054_FCSsmp i686` I have tried the `kernel-smp-devel.2.6.15-1.2054_FC5.i686` RPM but it gives an error message.               rpm -i kernel-smp-devel-2.6.15-1.2054_FC5.i686.rpm     warning: kernel-smp-devel-2.6.15-1.2054_FC5.i686.rpm: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2     error: Failed dependencies:     /usr/sbin/hardlink is needed by kernel-smp-devel-2.6.15-1.2054_FC5.i686      Installing the `kernel-devel.2.6.15-1.2054_FC5.i686` RPM does work but I still get the same problem with compiling, even after a reboot. I am guessing I need to install the SMP version? P.S. I am running it on a P4 3.0 Ghz with 1 Gig RAM.


title: What is the purpose of `/etc/group-`

text: On a standard Linux distribution (e.g. Ubuntu) there is usually `/etc/group` and `/etc/group-`, where the second one is only readable by root. `man group` only describes `/etc/group`. Thus my question: What is the purpose of `/etc/group-`?


title: Retrieve URL content and follow redirects

text: I want to visit an URL in CentOS and then automatically follow the redirects. So, for example:               Visit http://domain.com     This will redirect my by a `header()` to another webpage, so automatically follow this redirect.     And this page will also redirect me.     Save the contents on the `landing` page.      How do I accomplish this?


title: How to fix "cannot retrieve repository metadata" when installing CentOS 6.5 from Kickstart over FTP?

text: I am pulling my hair out trying to fix this. I am attempting to install CentOS 6.5 over an FTP server on KVM from the physical host. I have vsftpd installed, selinux set to permissive, and iptables temporarily flushed. My installation is copied to `/var/ftp/pub/inst/CentOS_6.5_Final/`. My kickstart config is `/var/ftp/pub/inst/ks.cfg`. I `chmod -R 777` for both the file and directory (without the `-R` for `ks.cfg`). The first command I append to the installation menu is `ks=x.x.x.x/pub/inst/ks.cfg` The VM is able to retrieve my ks.cfg easily once I flushed my iptables. It starts reformatting my virtual drives with no problems. As soon as it gets to retrieving the repository it spits out `cannot retrieve repository metadata (repomd.xml) for repository.` When I Ctl+Alt+F3 inside the VM, the following output is displayed: `Failed to get <the path to my IP>/CentOS_6.5_Final/repodata/repomd.xml: [Errorno 14] PYCURL ERROR 7 - "couldn't connect to host"` Here is my kick start config:               # Kickstart file automatically generated by anaconda.     #version=DEVEL     install     url --url ftp://x.x.x.x/pub/inst/CentOS_6.5_Final/     lang en_US.UTF-8     keyboard us     network --onboot no --device eth0 --bootproto static --ip x.x.x.x --netmask x.x.x.x --gateway x.x.x.x --nameserver 8.8.8.8 --hostname <myhostname> --noipv6          rootpw  --iscrypted <very long string of hash>     firewall --service=ssh     authconfig --enableshadow --passalgo=sha512     selinux --enforcing     timezone --utc America/Denver     bootloader --location=mbr --driveorder=vda     # The following is the partition information you requested     # Note that any partitions you deleted are not expressed     # here so unless you clear all partitions first, this is     # not guaranteed to work     zerombr     clearpart --drives=vda --all     ignoredisk --only-use=vda          #part None --fstype=efi --onpart=sda1 --noformat     #part None --fstype=ext4 --onpart=sda2 --noformat     #part swap --onpart=sda3 --noformat          part / --fstype=ext4 --size=8000     part /boot --fstype=ext4 --size=500     part /home --fstype=ext4 --size=1000     part swap --size=1000               #repo --name="CentOS" --baseurl=http://x.x.x.x/inst/ --cost=100          %packages     @base     @core     @debugging     @basic-desktop     @desktop-debugging     @desktop-platform     @directory-client     @fonts     @general-desktop     @graphical-admin-tools     @input-methods     @internet-applications     @internet-browser     @java-platform     @legacy-x     @network-file-system-client     @office-suite     @print-client     @remote-desktop-clients     @server-platform     @server-policy     @workstation-policy     @x11     mtools     pax     oddjob     wodim     sgpio     enisoimage     device-mapper-persistent-data     abrt-gui     samba-winbind     certmonger     pam_krb5     krb5-workstation     libXmu     %end     shutdown     firstboot --disabled`      _edit_ Okay... I just figured out it was a networking issue when setting up the static properties. I changed `\--bootproto static` to `\--bootproto dhcp` and removed everything afterwards except `\--noipv6`. Apparently I need to learn more about our new router-modem combo from comcast. I really hate that modem.


title: how to filteri by asterisk or similar expression by rsync in zsh

text: I have a lot of files named like:               /var/log/foo/2014-07-06-01.log     ...     /var/log/foo/2014-07-20-04.log      Everyday I have several log files and I want to download specified day's log files:               $ rsync server:/var/log/foo/2014-07-06-*.log .      BUt I got `zsh: no matches found` error. I found in the manual that I can filter by extension, but I couldn't find how to filter file name in case like this. Is there easy way to use filtering with `rsync`?


title: How to force email into queue?

text: I'm writing an application for Linux, and it needs to interact with the mail queue. Is there any way to force a message to be deferred?


title: Optimize hostapd for highest range

text: I have an Alfa Wifi dongle. This dongle should have a sensitivity of -100 dbi at 1 MBit speed.   * Is it enough to set `hw_mode` to "a" to get highest range?   * Are there other settings which have to get changed? My config:               ###############################     # Basic Config     ###############################     interface=wlan0     driver=nl80211          ###############################     # DRAFT-N     ###############################     #ieee80211n=1     #ht_capab=[HT40-][SHORT-GI-20][SHORT-GI-40]     #wmm_enabled=1     channel=8          ##########################     # Local configuration...     ##########################     ssid=bar     hw_mode=b     #hw_mode=g     macaddr_acl=0     auth_algs=1     ignore_broadcast_ssid=0     wpa=2     wpa_passphrase=foo     wpa_key_mgmt=WPA-PSK     wpa_pairwise=TKIP     rsn_pairwise=CCMP


title: Eclipse has lots of broken bits

text: Something really dodgy has happened to my installation of Eclipse (version 3.7.2). I don't know if this is an Eclipse issue or some kind of disk corruption issue or what, so I may have used the wrong tags or even the wrong site. I've used Eclipse before and it's worked fine. But now lots of things are broken. For example: When I open Eclipse it says: "'Indexing help...' has encountered a problem. Errors while indexing". Nearly all the syntax highlighting has gone, but it still underlines unused imports. I had installed icons at the top for Android stuff, but they've now vanished. When I search for something using the panel on the right it says "'Local help' has encountered a problem. An internal error occurred during: \"Local Help\". invalid format:". Basically it's broken in various ways. I tried reinstalling it, but it didn't help. But there are several Eclipse- related packages, and it's possible that I missed the broken one. One potentially interesting observation is that even if I uninstall the eclipse package (`sudo apt-get purge eclipse`), the icon for opening Eclipse is still in the left-hand menu and it still opens in its usual (broken) way. Does this mean that even when it is installed it's somehow not connected to whichever package is supposed to open it? Any ideas?


title: vmtoolsd doesn't end after logout

text: There is a process 'vmtoolsd' `/usr/bin/vmtoolsd -n vmusr` left when a user logs out. I have to type root password to shutdown or restart because of this. How to prevent this from happening? And what package provide this command? I will remove the package to get rid of the problem as a last resort. I don't need to run virtual machines on my Fedora 19 machine.


title: Is it safe to take the drive image of the current working drive?

text: I have to backup my hard disk. I want to use `dd` and put the image on an external hdd.   * Can I do this using `dd` from the OS that resides on the hdd itself or do I have to boot from another device, for example a LiveCD?   * Is it safe, in general, to take the image of a device, if the device is mounted and working?   * What if the device is mounted, but I'm sure there's no other I/O operation, while `dd` is running? I'm sure that `rsync` is the best tool to use for backups, specially the incremental ones. But I'm interested in `dd`, because I want to backup up also other storage devices, and it copies also data stored on unpartitioned space. For example, my e-book reader use an unpartitioned space to store uboot, kernel and other data.


title: List all directories that do NOT have a file with a given file name inside

text: How would I go into listing all directories that do **not** have a file with a given file name inside? e.g. given this tree               /       /a          README          file001          file002       /b          README          file001       /c          file003      I want to list the directories that do **not** have a file named `README`, in this case it would be directory `/c`. How would I do that? I can't think of any syntax using e.g. `find`.


title: How to encrypt my system such that suspend to RAM works and is also encrypted

text: How can I encrypt my system (at best using lvm + dm-crypt/luks) such that suspend to RAM works and that everything is in an encrypted state when suspended to RAM?


title: FFmpeg doesn't recognize my audio sources

text: I want to record my screen with audio for practice. I saw recommendations to use this command line:               ffmpeg -f alsa -ac 2 -i pulse -f x11grab -r 25 -s 800x600 -i :0.0+200,100 -c:a pcm_s16le -c:v libx264 -preset ultrafast -crf 0 -threads 4 output.mkv      But `ffmpeg` doesn't recognize the "alsa" format or the "pulse" file. If I remove both of those, it can capture the specified region of the screen just fine, but silently. I'm using Linux Mint 17 Mate edition; I know I'm using ALSA. My testing audio source is VLC (which I thought used PulseAudio) playing an Ogg Vorbis file from the system tray. This is my `ffmpeg` configuration:               ffmpeg version 2.2.4 Copyright (c) 2000-2014 the FFmpeg developers       built on Jul  6 2014 09:48:53 with Ubuntu clang version 3.4-1ubuntu3 (tags/RELEASE_34/final) (based on LLVM 3.4)       configuration: --cc=clang --extra-libs=-ldl --disable-shared --disable-ffserver --enable-ffplay --disable-doc --enable-bzlib --enable-zlib --enable-libx264 --enable-libtheora --enable-libvorbis --enable-libmp3lame --enable-libass --enable-libfaac --enable-libvpx --enable-libopus --enable-x11grab --enable-nonfree --enable-gpl       libavutil      52. 66.100 / 52. 66.100       libavcodec     55. 52.102 / 55. 52.102       libavformat    55. 33.100 / 55. 33.100       libavdevice    55. 10.100 / 55. 10.100       libavfilter     4.  2.100 /  4.  2.100       libswscale      2.  5.102 /  2.  5.102       libswresample   0. 18.100 /  0. 18.100       libpostproc    52.  3.100 / 52.  3.100


title: Document save instead of autorecovery save

text: In a LibreOffice Writer document, I want to disable autorecovery save but I want automatic save be enabled. Is there any way to do this? Saving takes time for large documents. Saving both the document and autorecovery is more time-consuming. I want just save the document.


title: Awk regular expression syntax with number of repetition - different handling between gawk 3 and gawk 4

text: I am having trouble understanding or explaining why the following expression fails in `gawk 3.1.x` and yet works in gawk `4.1.x`: (Minimum working example) `echo ";#ADCDE#" | awk '/#.{5}#$/'` -> produces a match in `gawk 4.1.x`, does not produce a match in `gawk 3.1.x` `echo ";#ADCDE#" | awk '/#.*#$/'` -> produces a match in both Did something change between gawk 3 and 4 in how regular expressions are handled? I didn't think the repetition construct {n} was new for regular expressions. The same behaviour happens if I change the dot (.) with a character class or [A-Z]


title: What is chmod 6050 good for

text: Recently I came across to command:               chmod -R 6050 /usr/lib/hadoop-yarn/bin/container-executor      I don't know what that mean? I know file permissions like 777 etc. in a mode rwx for owner group others. But this results in               ---Sr-s---. 1 root hadoop 36024 Oct 17 20:40 container-executor      Can someone please explain a bit?


title: Can't create a+r file

text: Using Debian I am unable to create files that by default has read permission for all users. For example:               # umask     0002     # touch test     # ls -l test     -rw-rw----+ 1 user user 0 Jun 25 18:18 test      Is there any specific restriction on creating readable files?


title: Does Kate support HTML5?

text: I am editing a long HTML document in Kate, and I'd love to be able to "close" the parts I'm not currently working on. But this is a new document, and the highest level of modularization uses `section`, not `div`. This is a HTML tag, and my Kate (version 3.8.4) doesn't recognize it. It works fine with `div` and other older elements. I started looking around if there is a way to get this support in Kate. I can imagine that my version is old (it is what came with Debian stable), but I don't want to upgrade it unless the newer one really has the support for HTML5. Strangely, I can't find much documentation on what I need: neither a list of "newest features" of Kate, nor even information which number is the most current version. Does the newest version of Kate have HTML5 support? If yes, is it advisable to install it from source? After all, many of my programs which came from the repositories rely on Kate, for example Kile? And if it doesn't have HTML5 support, is there another way to get it, maybe with some kind of plugin?


How do I set up a OpenVPN server on pfsense? I want to be able to VPN in from a labptop when I am on the road. I set up a openvpn server in the openvpn menu. I duplicated that NAT rules for the VPN server. I tried opening the fire wall ports. I also set up the certificates, made a user account (put a certificate on that) as well as turned on the interface. I am thinking my next step has something to do with fixing it so the vpn server process can run but I am not sure why it will not start. I also think my firewall rules should be done better so I don't leave a port wide open but I'm not sure how. I cleared all the logs and then tried to start up the VPN server. I got this:               Jun 26 00:30:57     openvpn[26660]: MANAGEMENT: Client connected from /var/etc/openvpn/client1.sock     Jun 26 00:30:57     openvpn[26660]: MANAGEMENT: CMD 'state 1'     Jun 26 00:30:57     openvpn[26660]: MANAGEMENT: Client disconnected     Jun 26 00:30:57     openvpn[34295]: MANAGEMENT: Client connected from /var/etc/openvpn/client3.sock     Jun 26 00:30:57     openvpn[34295]: MANAGEMENT: CMD 'state 1'     Jun 26 00:30:57     openvpn[34295]: MANAGEMENT: CMD 'status 2'     Jun 26 00:30:57     openvpn[34295]: MANAGEMENT: Client disconnected     Jun 26 00:30:57     openvpn[45727]: MANAGEMENT: Client connected from /var/etc/openvpn/client4.sock     Jun 26 00:30:57     openvpn[45727]: MANAGEMENT: CMD 'state 1'     Jun 26 00:30:57     openvpn[45727]: MANAGEMENT: CMD 'status 2'     Jun 26 00:30:57     openvpn[45727]: MANAGEMENT: Client disconnected     Jun 26 00:30:59     openvpn[87234]: Options error: --server directive network/netmask combination is invalid     Jun 26 00:30:59     openvpn[87234]: Use --help for more information.     Jun 26 00:31:10     openvpn[26660]: MANAGEMENT: Client connected from /var/etc/openvpn/client1.sock     Jun 26 00:31:10     openvpn[26660]: MANAGEMENT: CMD 'state 1'     Jun 26 00:31:10     openvpn[34295]: MANAGEMENT: Client connected from /var/etc/openvpn/client3.sock     Jun 26 00:31:10     openvpn[26660]: MANAGEMENT: Client disconnected     Jun 26 00:31:10     openvpn[34295]: MANAGEMENT: CMD 'state 1'     Jun 26 00:31:10     openvpn[34295]: MANAGEMENT: CMD 'status 2'     Jun 26 00:31:10     openvpn[34295]: MANAGEMENT: Client disconnected     Jun 26 00:31:10     openvpn[45727]: MANAGEMENT: Client connected from /var/etc/openvpn/client4.sock     Jun 26 00:31:10     openvpn[45727]: MANAGEMENT: CMD 'state 1'     Jun 26 00:31:10     openvpn[45727]: MANAGEMENT: CMD 'status 2'     Jun 26 00:31:10     openvpn[45727]: MANAGEMENT: Client disconnected      I have a guess that this has something to do with my "IPv4 Tunnel Network" and "IPv4 Local Network/s" My IPv4 Tunnel Network is: `WAN_ip/24` MY IPv4 Local Network/s is: `LAN_ip/24` I am not sure this is what is suppose to be here. edit: I found two issues. My WAN_ip should not have been my WAN_ip but a made up ip. Also, I was not specifying to for it to get log in account information correctly. I can now connect to the VPN but it gives no internet.


title: Clone repos with a similar name

text: I would like to do something like: `git clone https://github.com/meteor{A,B,C,D}test` but bash does not convert the `{}` into an each. What am I doing wrong?


title: What modern terminal programs are still configurable per-invocation?

text: What terminal programs have the following characteristics?   * Unicode support   * geometry, fg/bg colours, other options settable from command line on a per-invocation basis   * actively supported Background: I don't want or need a _lot_ from my terminal emulator, but the ones I've used recently don't quite stand up. I've been using Xfce generally for a few years, and hence xfce4-terminal is my default: it's good, lightweight, and modern, but is limited in its command-line configuration; in particular, I cannot set the background colour on a per-window basis (afaict). I've also used xterm since basically ever, which is highly configurable, but... aging... and my current xterm install lacks good Unicode support (among other modern conveniences, but that's the big annoyance at the moment). I've also used rxvt, but it looks like that hasn't been updated in years.


title: Control precision of CPU or MEM percentage in top?

text: Looks like the default precision has changed in Arch, but I checked `top (1)`, I didn't find anything related to `precision`, maybe I've used the wrong jargon. ![enter image description here](http://i.stack.imgur.com/FpKz0.png) Right now it's 3 bit precision, I want only one. How can I change that?


title: NTFS ESATA disk needs to be "partprobe"d on every reboot

text: I have an ESATA disk with NTFS that works fine on Windows. It is recognized as the `/dev/sde` device, but no partition is recognized (no `/dev/sde1`) unless `partprobe` is run. After this, device `/dev/sde1` appears and can be mounted with `mount`. `fdisk` does show `/dev/sde1` even before `partprobe` is run. What could be the reason for this? Are there any workarounds, other than creating a script that runs at startup that `partprobe`'s and mounts it? Thanks **EDIT (extra info)** `/dev/sde1` doesn't exist until I partprobe, so I can't even try to mount it. If I try I get "device does not exist". If I try to mount "sde", I get the error "unknown filesystem type 'isw_raid_member' This is what I get from `parted`               Model: ATA WDC WD5000AAKS-0 (scsi)     Disk /dev/sde: 500GB     Sector size (logical/physical): 512B/512B     Partition Table: msdos     Disk Flags:           Number  Start   End    Size   Type     File system  Flags      1      32.3kB  500GB  500GB  primary  ntfs         boot      If there's any additional relevant information to give, please let me know


title: Convert table in LaTeX

text: I copy the table from Calc (or Tracker) In my research I know three ways: **1:** Record a macro: `@a0f cw & <ESC>;.;.I\hline <ESC>A \\\` (the spaces count ;) )   And then `VG:normal @a<ENTER>` **2:** `VG:s/ / \& /gv:<UP><ENTER>gv:<UP><ENTER>`   and then other macro for the `\hline` and `\\\` **3:** `f <C-v>kkk23jc & <ESC>;.;.`   And again `I\hlineA \\\<ESC>` * * * Is there another way? Sample input:               0.79    0.80    5.40    6.48     0.86    0.87    4.57    5.81     0.93    0.94    4.04    5.32      Output:               \hline 0.79 & 0.80 & 5.40 & 6.48 \\     \hline 0.86 & 0.87 & 4.57 & 5.81 \\     \hline 0.93 & 0.94 & 4.04 & 5.32 \\


title: Where is my Ubuntu One control panel in Linux Mint 14?

text: Using Linux Mint 14. Everything was just great since yesterday. Yesterday I have installed some update through Update Manager. I saw there was an update for Ubuntu One. Whatever today after starting my PC, I'm not getting my Ubuntu One panel along with Ubuntu One indicator. They are just gone. I can't even find Ubuntu One in the menu. I need that panel get back ASAP.


title: scp and compress at the same time, no intermediate save

text: What is the canonical way to:   * `scp` a file to a remote location   * compress the file in transit (`tar` or not, single file or whole folder, `7za` or something else even more efficient)   * do the above without saving intermediate files I am familiar with shell pipes like this:               tar cf - MyBackups | 7za a -si -mx=9 -ms=on MyBackups.tar.7z      essentially:   * rolling a whole folder into a single `tar`   * pass data through `stdout` to `stdin` of the compressing program   * apply _aggressive_ compression What's the best way to do this over an `ssh` link, with the file landing on the remote filesystem? * * * I prefer not to `sshfs` mount. * * * This, does not work:               scp <(tar cvf - MyBackups | 7za a -si -mx=9 -so) localhost:/tmp/tmp.tar.7z      because:               /dev/fd/63: not a regular file


title: Why is the 'sudo' password different than the 'su root' password

text: On my personal machine, I often type `sudo` in front of certain commands in order to accomplish administrative tasks. I had hoped to avoid doing this throughout the day, by typing `su root` and providing the same password I usually do for `sudo`. However, the two passwords are not the same(I don't know how to log in to `su root`). Is running a command with `sudo` different than logging in with `su root` and running the same command? I think `sudo` and `su root` are the same, because when I type `sudo whoami`, I get `root`, as opposed to just `whoami` where I get my user-name.


title: Permission denied for user accessing mount

text: Using root I can mount another Linux share no problem.               root@crunchbang:/mnt# mkdir javalib     root@crunchbang:/mnt# mount -t cifs //10.1.3.7/javalib ./javalib -o username=guest      Root can read/write to the share dirs no problem.               root@crunchbang:/mnt# ll     drwxrwx---  9 500 users 0 Apr 13 17:59 javalib          root@crunchbang:/mnt# cd javalib     root@crunchbang:/mnt/javalib#      When trying to access the dir under another user, even when the user is part of the 'users' group it gets permission denied.               shawn@crunchbang:/mnt# cd javalib     bash: cd: javalib: Permission denied      Thank you, Shawn


title: Is the free space of unmounted partitions and hard disks used in the background when the OS needs some more space?

text: I have two hard disks on a computer and I intend to recover the data in one of the them (Had Disk 1). An Ubuntu OS is installed in the other(Hard Disk 2). Both Hard Disks are connected to the computer and I boot into the Ubuntu OS in Hard Disk 2. Does Ubuntu use the space in Hard Disk 1 if its partition are not mounted?


title: Setting `$EDITOR` to open file in local emacs session

text: Sometimes I need to issue a remote command which uses `$EDITOR` to pick the, well, editor (think `git commit` for example). Is it possible to use the local emacs session to open it via, for example, port forwarding (I have tramp installed)?


title: File permissions when mixing command line and server

text: I have a PHP server which creates folders and files for certain things. I also run supporting code from the command line operating on the same folders and files. The problem is that when running from the server, the file permissions for new files become `rwxr-xr-x _www _www`, whereas files created from the command line become `rwxr-xr-x user _www`. So if I am on the command line as "user" and run PHP code which tries to delete files created from the server, I have to `sudo`, because "user" does not have write access to the files. What is the correct way to fix it so that both the server and command line have equal permissions to the files?


title: Capture information of system-call

text: I have a QEMU-KVM hypervisor (ubuntu) with several VMs. What I want to do is capture all information of VMs system call to hypervisor (without any intervention to VM whatsoever) in real time within a log file. I also want the information captured can be associated to which VM the system-call came from. Is it possible? If I want to write a program (in C or python) to do so, can anybody show resources on internet?


title: Kali Linux shows strange line of code using Bash command "set"

text: I have Kali8 installed - it is a Debian/GNU Linux ("wheezy") based distro - and when I use the Bash built-in command "set" to check my vars from X, like in LXterminal, everything works fine, but when I do it from either the console VT or SSH/Putty log-in, I get some vars and then a bunch of lines of code - thousands of lines that look like from some kind of completion script. The other thing is that, it seems to me, that the list was shorter few weeks ago when the system was freshly installed and the lines are getting cumulatively more numerous, so the list get longer as time passes. The list always has the actual variables that should be there at the beginning and the same lines of code at the end, so I assume the added lines are in the middle. To verify this last one, i am going to pipe the list to a file and then do it again in few days and see if the size get larger. Anyway, does anybody know why or how to fix the fact that is printing thousands of line of unknown script code? Here is an example:               root@kali:~# set     BASH=/bin/bash     BASHOPTS=checkwinsize:cmdhist:expand_aliases:extglob:extquote:force_fignore:interactive_comments:$     BASH_ALIASES=()     BASH_ARGC=()     BASH_ARGV=()     BASH_CMDS=()     BASH_COMPLETION_COMPAT_DIR=/etc/bash_completion.d     BASH_LINENO=()     BASH_SOURCE=()     BASH_VERSINFO=([0]="4" [1]="2" [2]="37" [3]="1" [4]="release" [5]="x86_64-pc-linux-gnu")     BASH_VERSION='4.2.37(1)-release'     COLUMNS=80     COMP_WORDBREAKS=$' \t\n"\'>=;|&(:'     DIRSTACK=()     EUID=0     GROUPS=()     HISTFILE=/root/.bash_history     HISTFILESIZE=500     HISTSIZE=500     HOSTNAME=kali     HOSTTYPE=x86_64     IFS=$' \t\n'     LANG=en_US.UTF-8     LIBGL_DRIVERS_PATH=/usr/lib32/dri:/usr/lib64/dri     LINES=24     LOGNAME=root     LS_COLORS='rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;$     LS_OPTIONS='--color=auto -F'     MACHTYPE=x86_64-pc-linux-gnu     MAIL=/var/mail/root     MAILCHECK=60     OPTERR=1     OPTIND=1     OSTYPE=linux-gnu     PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin     PIPESTATUS=([0]="1" [1]="0")     PPID=10987     PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '     PS4='+ '     PWD=/root     SHELL=/bin/bash     SHELLOPTS=braceexpand:emacs:hashall:histexpand:history:interactive-comments:monitor     SHLVL=1     SSH_CLIENT='192.168.10.143 10827 22'     SSH_CONNECTION='192.168.10.143 10827 192.168.10.104 22'     SSH_TTY=/dev/pts/1     TERM=xterm     UID=0     USER=root     XDG_SESSION_COOKIE=fb89d5d02d263ebdcf49f3a551dccb8b-1374307938.708154-385548377     _=     __colormgr_commandlist=$'\n    create-device\n    create-profile\n    delete-device\n    delete-p$     __git_all_commands=     __git_diff_common_options=$'--stat --numstat --shortstat --summary\n\t\t\t--patch-with-stat --nam$     __git_fetch_options=$'\n\t--quiet --verbose --append --upload-pack --force --keep --depth=\n\t--t$     __git_log_common_options=$'\n\t--not --all\n\t--branches --tags --remotes\n\t--first-parent --mer$     __git_log_date_formats='relative iso8601 rfc2822 short local default raw'     __git_log_pretty_formats='oneline short medium full fuller email raw format:'     __git_log_shortlog_options=$'\n\t--author= --committer= --grep=\n\t--all-match\n'     __git_merge_options=$'\n\t--no-commit --no-stat --log --no-log --squash --strategy\n\t--commit --$     __git_merge_strategies=     __git_mergetools_common=$'diffuse ecmerge emerge kdiff3 meld opendiff\n\t\t\ttkdiff vimdiff gvimd$     __git_porcelain_commands=     __git_send_email_confirm_options='always never auto cc compose'     __git_send_email_suppresscc_options='author self cc bodycc sob cccmd body all'     __git_whitespacelist='nowarn warn error error-all fix'     __grub_script_check_program=grub-script-check     _backup_glob='@(#*#|*@(~|.@(bak|orig|rej|swp|dpkg*|rpm@(orig|new|save))))'     _xspecs=([freeamp]="!*.@(mp3|ogg|pls|m3u)" [cdiff]="!*.@(dif?(f)|?(d)patch)?(.@([gx]z|bz2|lzma))"$     __colormgrcomp ()     {         local all c s='     ' IFS=' ''      ''     ';         local cur="${COMP_WORDS[COMP_CWORD]}";         if [ $# -gt 2 ]; then         fi;         for c in $1;         do             case "$c$4" in                 *.)                     all="$all$c$4$s"                 ;;                 *)                     all="$all$c$4 $s"                 ;;             esac;         done;         IFS=$s;         COMPREPLY=($(compgen -P "$2" -W "$all" -- "$cur"));         return     }     __dconf ()     {         local choices;     ...          ********... thousands of lins after... **********     ...     {         local userland=$( uname -s );         [[ $userland == @(Linux|GNU/*) ]] && userland=GNU;         [[ $userland == $1 ]]     }     _variables ()     {         if [[ $cur =~ ^(\$\{?)([A-Za-z0-9_]*)$ ]]; then             [[ $cur == *{* ]] && local suffix=} || local suffix=;             COMPREPLY+=($( compgen -P ${BASH_REMATCH[1]} -S "$suffix" -v --             "${BASH_REMAT$             return 0;         fi;         return 1     }     _xfunc ()     {         set -- "$@";         local srcfile=$1;         shift;         declare -F $1 &>/dev/null || {             local compdir=./completions;             [[ $BASH_SOURCE == */* ]] && compdir="${BASH_SOURCE%/*}/completions";             . "$compdir/$srcfile"         };         "$@"     }     _xinetd_services ()     {         local xinetddir=/etc/xinetd.d;         if [[ -d $xinetddir ]]; then             local restore_nullglob=$(shopt -p nullglob);             shopt -s nullglob;             local -a svcs=($( printf '%s\n' $xinetddir/!($_backup_glob) ));             $restore_nullglob;             COMPREPLY+=($( compgen -W '${svcs[@]#$xinetddir/}' -- "$cur" ));         fi     }     quote ()     {         local quoted=${1//\'/\'\\\'\'};         printf "'%s'" "$quoted"     }     quote_readline ()     {         local quoted;         _quote_readline_by_ref "$1" ret;         printf %s "$ret"     }               root@kali:~#      P.S.: on a side note and probably unreleted subject the line above it should have been `COMP_WORDBREAKS=$' \t\n"\'><=;|&(:'`, but I had to remove the `<` from it, because it seems to mess-up with StackExchange MarkDown and HTML... if I enter this complete line to the line above, it actually shows up as /dev/null after the `>` and it will impede most of the remaining lines after it from showing on my post... mhmm... strange.


title: How to find all disks & their size before using them?

text: I need to know the following information, before using the harddisk to create logical volumes or database.. Any perl modules or snippet would be of great help.   1. how many hard disks are presented to my system?   2. Find out their sizes ( total, used, available )


title: What is meant by “a process has open handles to system objects”?

text: The following are qualities of a process:               virtual address space     executable code     open handles to system objects     a security context     a unique process identifier     environment variables     a priority class     minimum and maximum working set sizes     at least one thread of execution      What is meant by "a process has open handles to system objects"?


title: How to install php5-memcached on Debian 7 with PHP 5.5?

text: My attempts to install the PHP 5 Memcached module on my Debian 7 VirtualBox VM failed:               root@testvm:~# apt-get install php5-memcached     Reading package lists... Done     Building dependency tree            Reading state information... Done     Some packages could not be installed. This may mean that you have     requested an impossible situation or if you are using the unstable     distribution that some required packages have not yet been created     or been moved out of Incoming.     The following information may help to resolve the situation:          The following packages have unmet dependencies:      php5-memcached : Depends: libmemcached11 but it is not installable     E: Unable to correct problems, you have held broken packages.      I also could not install it over Synaptic Package Manager. I guess, the problem can lie in the missing source information in `/etc/apt/sources.list`. * * * UPDATE: **/etc/apt/sources.list**               # deb cdrom:[Debian GNU/Linux 7.1.0 _Wheezy_ - Official amd64 NETINST Binary-1 20130615-23:04]/ wheezy main          # deb cdrom:[Debian GNU/Linux 7.1.0 _Wheezy_ - Official amd64 NETINST Binary-1 20130615-23:04]/ wheezy main          deb http://ftp.de.debian.org/debian/ wheezy main contrib non-free     deb-src http://ftp.de.debian.org/debian/ wheezy main contrib non-free          deb http://security.debian.org/ wheezy/updates main contrib non-free     deb-src http://security.debian.org/ wheezy/updates main contrib non-free          # wheezy-updates, previously known as 'volatile'     deb http://ftp.de.debian.org/debian/ wheezy-updates main contrib non-free     deb-src http://ftp.de.debian.org/debian/ wheezy-updates main contrib non-free          # nginx     deb http://packages.dotdeb.org wheezy all     deb-src http://packages.dotdeb.org wheezy all          # PHP 5.5     deb http://packages.dotdeb.org wheezy-php55 all     deb-src http://packages.dotdeb.org wheezy-php55 all      UPDATE: I tried to install the missing dependency manually, but it also doesn't work:               root@devvm:~# apt-get install libmemcached11     Reading package lists... Done     Building dependency tree            Reading state information... Done     Package libmemcached11 is not available, but is referred to by another package.     This may mean that the package is missing, has been obsoleted, or     is only available from another source          E: Package 'libmemcached11' has no installation candidate      UPDATE:               root@devvm:~# apt-cache depends php5-memcached libmemcached10     php5-memcached       Depends: libc6       Depends: <libmemcached11>       Depends: zlib1g       Depends: <phpapi-20121212>         libapache2-mod-php5filter         libapache2-mod-php5         libphp5-embed         php5-cgi         php5-cli         php5-fpm       Depends: php5-common      |PreDepends: dpkg       PreDepends: <dpkg-maintscript-helper>     libmemcached10       Depends: libc6       Depends: libgcc1       Depends: libstdc++6       PreDepends: multiarch-support       Conflicts: <libmemcached2>       Conflicts: <libmemcached3>       Conflicts: <libmemcached6>       Conflicts: <libmemcached9>


title: How to replace a string with a string containing slash with sed?

text: i am looking for a way to replace a string in a file with a string that contains a slash by using sed.               connect="192.168.100.61/foo"     srcText="foo.bar=XPLACEHOLDERX"     echo $srcText | sed "s/XPLACEHOLDERX/$connect"      the result is               sed: -e Expression #1, Character 32: Unknown option for `s'


title: find -print always prints the starting directory

text: I am trying to count how many files and folders I have recursively under a directory with 500K files with `find` (note: **recursively** and **under** ). I am using the following command:               find my_folder -name '*' -print | wc -l      But I noticed something strange when running the first part:               find my_folder -name '*' -print      It always prints the folder name (`my_folder` in this example) first on the first line. This increases the file count by one in my first command Why is that? and how can I avoid this and make sure find only prints the contents under `my_folder`?


title: Install Debian over Ubuntu using same home partition

text: I'm interested in changing from Ubuntu to Debian. I currently have 12.04LTS installed on its own boot partition which is separate from the `/home` partition. I would simply wipe the Ubuntu partition and install Debian and modify the `fstab` file to mount my home and swap partitions. What types of problems would I come across? Which would be a better choice the testing or unstable branch?


title: Batch encrypt all mail on IMAP server

text: I would like to keep my emails on my provider's IMAP server for convenience and as backup archive; however, I do not want my provider (or anybody else) to be able to read those 'archived' emails. Despite the fact that unencrypted emails could have been read earlier and in particular during delivery, is there a way to replace unencrypted emails on the IMAP server by a version encrypted with my public key?


title: Rename files with spaces in a BusyBox shell

text: I'm trying to rename some files on my Synology Diskstation via SSH. The available shell is the BusyBox built-in shell:               BusyBox v1.16.1 (2013-04-16 20:13:10 CST) built-in shell (ash)      The move command always yields two errors when I try using a space character either in the source or destination filename. Escaping space characters or quoting the filename seems to have no effect. Example for renaming a file with a space character in the destination:               /volumeUSB1/usbshare/directory $ touch test     /volumeUSB1/usbshare/directory $ ls     test     /volumeUSB1/usbshare/directory $ mv test 'te st'     mv: can't rename 'test': No such file or directory     mv: can't rename 'te': No such file or directory     /volumeUSB1/usbshare/directory $ mv test te\ st     mv: can't rename 'test': No such file or directory     mv: can't rename 'te': No such file or directory      Renaming a file with a space character in the source yields similar results:               /volumeUSB1/usbshare/directory $ touch 'te st'     /volumeUSB1/usbshare/directory $ ls     te st     /volumeUSB1/usbshare/directory $ mv 'te st' test     mv: can't rename 'te': No such file or directory     mv: can't rename 'st': No such file or directory     /volumeUSB1/usbshare/directory $ mv te\ st test     mv: can't rename 'te': No such file or directory     mv: can't rename 'st': No such file or directory      `type mv` returns `mv is /bin/mv`. The `file` command is not available on my machine. `cat /bin/mv` revealed that it's a small script that ends with calling `/bin/busybox mv $@`. Where is my mistake?


title: find in /sys/class does not show everything, why?

text: Like every other person I am from time to time compelled to list the directory structure from a certain point int the filesystem. I do so with `find /path/in/fs/` and this yields something like:               /path/in/fs/subfolder1     /path/in/fs/subfolder1/file1     /path/in/fs/subfolder1/subfolder2/yetanothefile     /path/in/fs/subfolder1/subfolder2/yetanothefile2     /path/in/fs/subfolder1/subfolder2/yetanothefile3     /path/in/fs/subfolder1/file2      in a way this saves me from endless iterations of `cd` and `ls`. Now I wanted to list the directory structure in the `/sys/class` path and I think it falls short. The next two commands show the odd behavior:   * (1) using the `cd` and `ls`                   root@freak:/sys/class/hwmon# ls         hwmon0  hwmon1  hwmon2         root@freak:/sys/class/hwmon# cd hwmon0         root@freak:/sys/class/hwmon/hwmon0# ls         name  power  subsystem  temp1_crit  temp1_input  uevent        * (2) using the said `find` command at the same place                   root@freak:/sys/class/hwmon# find .         .         ./hwmon0         ./hwmon1         ./hwmon2      As you can see it seems to me that `find` does not show me everything, which I find an odd and suprising behavior. Now I know that stuff below /sys/ is somehow special. Still it all works the `cd` `ls` way. Somebody has an answer why this happens and better even how I can make find not overlook the content in ./hwmon0 ./hwmon1 ... etc for instance?


title: Show application window on workspace on which application was called (dmenu, terminal)

text: Is there a way to configure xmonad in a such way that it **dynamically remembers** workspace on which application was called and then shows its windows on this workspace? Using default configuration applications that take longer to load (eg. Eclipse, IntelliJ IDEA) show up on workspace that is currently active, not on one they were called. How to reproduce: >   1. Switch to workspace X >   2. In dmenu/terminal call application, eg.: ./eclipse >   3. Switch to workspace Y > If 3 was done fast enough, application will show up on workspace Y (I would like it to show up on X). Please note that this question is not about applications not showing at workspace that has been defined in config, but about starting applications on workspace that was **active when application was called**.


title: What does "FILENAME=$(echo $INFILE | grep -oE "[^/]+$") " mean?

text: FILENAME=$(echo /root/Source/code/script.sh | grep -oE "[^/]+$")      I know that it would give me the file name from the file path here as `script.sh`. But can some one please explain me this?


title: How can I count all the files on my system from root?

text: I want to know the total number of files on my server. Can this be done?


title: List only temporary aliases in bash

text: I know that to list all aliases in a given bash session with `alias -p`. Is there a way to get a list of all the temporary aliases in a given bash session, i.e. all aliases that aren't in my bash profile? Thanks!


title: How can I look up a username by id in linux?

text: The command `id` can be used to look up a user's `uid`, for example:               $ id -u ubuntu     1000      Is there a command to lookup up a username from a `uid`? I realize this can be done by looking at the `/etc/passwd` file but I'm asking if there is an existing command to to this, especially if the user executing it is not root. I'm not looking for the _current_ user's username, i.e. I am not looking for `whoami` or `logname`. This also made me wonder if on shared web hosting this is a security feature, or am I just not understanding something correctly? For examination, the `/etc/passwd` file from a shared web host:               root:x:0:0:root:/root:/bin/bash     bin:x:1:1:bin:/bin:/sbin/nologin     daemon:x:2:2:daemon:/sbin:/sbin/nologin     adm:x:3:4:adm:/var/adm:/sbin/nologin     lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin     sync:x:5:0:sync:/sbin:/bin/sync     shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown     halt:x:7:0:halt:/sbin:/sbin/halt     mail:x:8:12:mail:/var/spool/mail:/sbin/nologin     news:x:9:13:news:/etc/news:     uucp:x:10:14:uucp:/var/spool/uucp:/sbin/nologin     operator:x:11:0:operator:/root:/sbin/nologin     games:x:12:100:games:/usr/games:/sbin/nologin     gopher:x:13:30:gopher:/var/gopher:/sbin/nologin     ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin     nobody:x:99:99:Nobody:/:/sbin/nologin     nscd:x:28:28:NSCD Daemon:/:/sbin/nologin     vcsa:x:69:69:virtual console memory owner:/dev:/sbin/nologin     pcap:x:77:77::/var/arpwatch:/sbin/nologin     rpc:x:32:32:Portmapper RPC user:/:/sbin/nologin     mailnull:x:47:47::/var/spool/mqueue:/sbin/nologin     smmsp:x:51:51::/var/spool/mqueue:/sbin/nologin     oprofile:x:16:16:Special user account to be used by OProfile:/home/oprofile:/sbin/nologin     sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin     dbus:x:81:81:System message bus:/:/sbin/nologin     avahi:x:70:70:Avahi daemon:/:/sbin/nologin     rpcuser:x:29:29:RPC Service User:/var/lib/nfs:/sbin/nologin     haldaemon:x:68:68:HAL daemon:/:/sbin/nologin     xfs:x:43:43:X Font Server:/etc/X11/fs:/sbin/nologin     avahi-autoipd:x:100:104:avahi-autoipd:/var/lib/avahi-autoipd:/sbin/nologin     named:x:25:25:Named:/var/named:/sbin/nologin     mailman:x:32006:32006::/usr/local/cpanel/3rdparty/mailman/mailman:/usr/local/cpanel/bin/noshell     dovecot:x:97:97:dovecot:/usr/libexec/dovecot:/sbin/nologin     mysql:x:101:105:MySQL server:/var/lib/mysql:/bin/bash     cpaneleximfilter:x:32007:32009::/var/cpanel/userhomes/cpaneleximfilter:/usr/local/cpanel/bin/noshell     nagios:x:102:106:nagios:/var/log/nagios:/bin/sh     ntp:x:38:38::/etc/ntp:/sbin/nologin     myuser:x:1747:1744::/home/myuser:/usr/local/cpanel/bin/jailshell      And here is a sample directory listing of `/tmp/`               drwx------  3 root     root        1024 Apr 16 02:09 spamd-22217-init/     drwxr-xr-x  2      665      664    1024 Apr  4 00:05 update-cache-44068ab4/     drwxr-xr-x  4      665      664    1024 Apr 17 15:17 update-extraction-44068ab4/     -rw-rw-r--  1      665      664   43801 Apr 17 15:17 variable.zip     -rw-r--r--  1      684      683    4396 Apr 17 07:01 wsdl-13fb96428c0685474db6b425a1d9baec      We can see `root` is the owner of some files, and `root` is also showing up in `/etc/passwd` , however the other users/groups all show up as numbers.


title: Burned binary files don't match original files

text: Kernel = 2.6.23.1-42   genisoimage 1.1.6 (Linux)   Wodim 1.1.10               Create iso image:     genisoimage -V "Data_Layer_1" -v -J -r -o cdl_data_1.iso cdl_1/          Test integrity of iso image:     mount -t iso9660 -o loop cdl_data_1.iso /mnt/iso_test/     cksum each of 6 files in iso image against original file, byte counts and CRCs match     umount /mnt/iso_test/          Burn iso to CD-R:     Close X11 desktop, go to single user console mode as root user     insert blank disk     mount -l, check that blank disk isn't mounted      wodim -v -dao speed=2 dev=/dev/cdrw cdl_data_1.iso     eject disk          Look for burn errors:     no errors or warnings in wodim output     dmesg | tail     cdrom: This disk doesn't have any tracks I recognize!      tail /var/log/messages     localhost kernel: cdrom: This disk doesn't have any tracks I recognize! (The timestamp matches the time the blank disk was inserted)          Test individual burned files:     startx     insert burned CD     execute cksum on individual files on mounted CD, byte counts do not match, CRC values match      example of post-burn cksum comparison        [kfw@localhost ~]$ cksum /media/Data_Layer_1/CDL_2012_004.zip         1556659744 97975264 /media/Data_Layer_1/CDL_2012_004.zip        [kfw@localhost ~]$ cksum CDL_2012_004.zip         752249099 97975264 CDL_2012_004.zip          example of cmp execution on individual files         [kfw@localhost ~]$ cmp /media/Data_Layer_1/CDL_2012_004.zip CDL_2012_004.zip          /media/Data_Layer_1/CDL_2012_004.zip CDL_2012_004.zip differ: byte 705623, line 1199          copy individual files from burned CD to HDD, test integrity     unzip CDL_2012_004.zip     ...             error:  invalid compressed data to inflate        bad CRC 27b7a348  (should be eb348979)      All data CD burns of different types of binary files suffer this problem; I have burned many dozens of audio disks with no problems at all. Any ideas?


title: Is it possible to have a cron job run more frequently than once every minute?

text: CentOS 6 I have a shell script that performs a task every minute. The task itself only takes a couple seconds to complete and ideally I'd like to have this shell script execute 2-3 times per minute. Is that possible to do with cron? Or is the fastest interval once every 60 seconds?


title: KDE4 does not finish loading

text: I've installed and configured xorg on arch (using these instructions) and kdebase. I've added dbus and kdm to daemons. After the login with kdm, but before finishing loading the deskop all stops and i can only move cursor by mouse and nothing happens. This solution on the wiki doesn't work for me (because I don't have Nvidia card?). My graphic card is Intel Mobile 4 Series Chipset Integrated Graphics Controller (rev 07). Any suggestions?


title: Per-directory history in zsh

text: I am happily using `zsh` since a while now, and I am quite satisfied with my history settings, which are:               # Write to history immediately     setopt inc_append_history     # History shared among terminals     setopt share_history     # Save extended info in history     setopt extended_history     # Ignore duplicates     setopt hist_ignoredups      But it happens often that I need to use specific commands inside some specific directories. For example, when I am in `~/my_project` I usually invoke `make target1 && ./run1`, but when I am in `~/second_project` I usually need `make target2 && cat foobar | ./run2`. That is: different directories, but similar commands. So, I usually `cd ~/my_project` and type `make` and then search backward in the history until I find what I need. But if it happen that I worked in `second_project`, when searching the history I will find some commands that I do not need. So, my question: does a plugin/setting/something exist for zsh such that, when searching in history, commands invoked in the current directory are displayed first? Ideally, every other matching history command will appear after those, optionally specifying a max number of priority elements. I would try to write something like this by myself, but I still do not know how to write custom zsh plugins, how to handle history and so on.


title: Why do I only get 100mbit on my Asus GigaX1005?

text: My GbNIC (Intel 82579LM, kernel 3.0 module e1000e) only connects with 100mbit although it's connected to a 1000mbit port (Asus GigaX1005) via an short (<3m) CAT6 cable.               flo-nbook ~ # ethtool eth0     Settings for eth0:         Supported ports: [ TP ]         Supported link modes:   10baseT/Half 10baseT/Full                                  100baseT/Half 100baseT/Full                                  1000baseT/Full          Supports auto-negotiation: Yes         Advertised link modes:  10baseT/Half 10baseT/Full                                  100baseT/Half 100baseT/Full                                  1000baseT/Full          Advertised pause frame use: No         Advertised auto-negotiation: Yes         Speed: 100Mb/s         Duplex: Full         Port: Twisted Pair         PHYAD: 2         Transceiver: internal         Auto-negotiation: on         MDI-X: on         Supports Wake-on: pumbg         Wake-on: g         Current message level: 0x00000001 (1)                        drv         Link detected: yes      Also forcing has no effect:               ethtool -s eth0 speed 1000       Is this a known bug in the kernel module? Am I missing something? Or an interoperability problem with the Asus switch?


title: rpm content compress

text: My default kernel rpm has 12mb size, for some reasons I compile a custom kernel and make rpm from that(make rpm command). However, my custom kernel rpm size is 96mb. I look inside default rpm, in that modules is zipped by bz format, but in my rpm isn't. How can I compress modules in rpm compress? Is any option or command to do that?


title: Writing content from a file to another file on set time intervals using delimiters

text: I'm trying to write a script in bash that reads a file `file1` and writes to another file `file2` every 2 seconds, which is easy enough. However, I want to write to `file2` on either a line by line basis or using delimiters. For example:               File1 = Some text goes in here      I want to write to `file2` every 2 seconds the first word `Some`, but only once, after 2 seconds the second word and so on until the end of `file1`.


title: Upgrade a single package from a target release

text: In Debian Squeeze I have installed a packageX from debian-backports. **Q1:** When I `apt-get dist-upgrade` or `aptitude full-upgrade`, what release is checked for updates for packageX? debian-backports or debian-stable? **Q2:** Can I use a command to update a single package from a specific release? For example is `aptitude -t full-upgrade packageX` a valid command? I tried `aptitude -st full-upgrade packageX` but the output was not helpful. **Q3:** For completeness purposes, what are the equivalent answers for RPM based distros?


title: An equivalent to OS X's "open" in Cygwin?

text: I know this may be a slightly strange question, plus the fact that I'm asking it here. The reason is that whenever I ask Windows-people about this, or even regular Cygwin-users, they don't seem to understand why I need this functionality. For those of you who haven't used "open" in the shell in Mac OS X, it works like this: $ open somepic.jpg $ open SomeFile.m So it looks at the default program associated with the file, and opens it. I'd like to do the same from within Cygwin. Any ideas would be highly appreciated!


title: Installing ksh as the standard shell in Redhat: Foolhardy?

text: I'm not a system administrator, but my organization is considering replacing /bin/sh in Red Hat Enterprise Linux 6+ with a hard link to /bin/ksh. How foolhardy would this be? The background to this question is that we're migrating a third-party application from AIX 5.3 to RHEL 6+. This application executes shell commands by invoking sh. The shell commands themselves are user-defined, and in practice have been written for the Korn shell (ksh). This works in AIX because IBM delivers sh as a hard link to ksh. Over the years, thousands of user- defined commands have been created and stored by our team. We've found that some of these commands fail in Red Hat, because sh in Redhat is a symbolic link to bash. When invoked as sh, bash runs in sh emulation mode. The problem is that our ksh-specific commands (e.g., print) that used to work in "fake sh" in AIX do not work in "fake sh" in Red Hat. We don't yet know the full scope of the incompatibilities. In chapter 10 of Learning the Korn Shell (ISBN 0-596-00195-9), Bill Rosenblatt and Arnold Robbins say: "[W]e want to emphasize something about the Korn shell that doesn't apply to most other shells: you can install it as if it were the standard Bourne shell, i.e., as /bin/sh." ... "Many installations have done this with absolutely no ill effects." How foolhardy would it be to do this in Red Hat? My concern is that system or 3rd party scripts in the Red Hat installation might depend on idiosyncracies of how sh is emulated by bash. If so, solving our immediate problem with a hard link to ksh could cause unknown breakage throughout the system.


title: How to make a bootable HDD with GRUB2

text: I have a (non-UEFI) Gentoo Linux system, and I am preparing a hard drive for another system. I have prepared partitions for the new system, and now I want to make it bootable. I remembed that in legacy GRUB, I used these commands:               # grub     grub> root (hd0,0)     grub> setup (hd1)      This made a bootsector on current (hd1), which pointed to (hd0). Then, when I booted the system, the new disk became the first device (i.e. hd0) and everything worked. The only thing I was able to find for GRUB2 is `grub2-install /dev/sdb`, which installs the MBR pointing to UUID of some current volume, which of course fails when I move the disk to a new machine. So, how do I make a bootable HDD with GRUB2?


title: Is learning a text editor like vi necessary and still worth the time today?

text: I started a new internship where all the servers run on `AIX`. Logging in for the first time I was suprised to see that my favorite text editor `nano` was not installed. Everyone here uses `vi` not `vim`......just `vi`. I've tried learning it before and I can do basic text manipulation but I just can't help but wonder....... Is it worth the time and effort to become proficient in this environment when there are other more modern options that exist? Why should i write and edit scripts in the terminal rather than booting up a newer and "fancier" IDE with more modern features like auto-completion and syntax highlighting? **UPDATE** I want to thank all of you for your input and help. I don't think the labor will be in vain.


title: Is split-screen `cat`ing possible?

text: I asked the question How to use `cat` or `less` depending on the line count? with the intention of browsing many files without having to scroll up too far to view my history after displaying a long file, while keeping short files' contents directly visible. However, it would be even more convenient to simply use half the screen for "usual" bash output and the other half (right or top, probably a matter of taste) for `cat` output. Is there a nice way (maybe some `screen`-magic) to achieve this? I.e. have a splitscreen terminal, where a simple pipe relocates output to the other half, and maybe some second pair of hotkeys to separately scroll through that half's buffer? My first impulse would be using `mkfifo` for the pipe, but maybe there's an easier way or someone actually already wrote a tool for this...


title: How to AND terms in zypper search?

text: Suppose I want to search for the packet `luasocket` in OpenSUSE, but I don't know if it's called `lua-socket`, `lua_socket`, `liblua-socket`, `lua5.1-socket`, `socket-lua` or who knows what. Therefore I make a search:               zypper se lua socket      The problem with this is it shows both packages containing `lua` keyword and also packets containing `socket` keyword, thus filling my screen with results I don't want. `zypper search --help` tells the following:                  Command options:          --match-all            Search for a match with all search strings (default).          --match-any            Search for a match with any of the search strings.      But `\--match-all` does not seem to work the way I expect. How can I AND terms when searching packets in OpenSUSE? **Note** : If possible in a cleaner way than:               zypper se lua | grep socket


title: Changing file associations in GNOME?

text: This blog post talks about how to change the default application to handle a file type in Nautilus for individual file types (right-click on the file, "open with", and select the new default application), but is there a way to list _all_ current associations and configure them in one go, similar to the Windows "folder options | file types" tab? There seem to be a bunch of default associations that I want to change (all various image files are being opened in IceWeasel instead of the image viewer), and I don't want to have to change them one-by-one in the file manager. If there's no GUI for doing this, then where does Nautilus store its file associations? Can I edit them with a text editor?


title: Different Kernel in DomU than in Dom0 on xen

text: If my Dom0 on Xen is kernel 2.6.18 with xen 3.3.1 can i boot a, say, 2.6.34 kernel in a DomU ? Background: 2.6.18 runs like a charm on Dom0. Don't want to update here, because there is special Hardware on the Host (ISDN-Card, etc.). Building a new kernel with this Modules for Dom0 is pain ! But i want to upgrade some DomU's to a newer Kernel...


title: wpa_supplicant ignore some networks

text: I am using wpa_supplicant and would like to add a rule so that my machine connects to any open network. I can do this with:               network={         key_mgmt=NONE     }      Now I would like to blacklist some wireless networks. Is that possible? I need to do this as my computer is also a router which sends out an open network. How can I ignore this ssid:               network={         ssid="router"         key_mgmt=NONE     }


title: Autologin enabled, keychain blocking VNC connection

text: I have a CentOS server set to autolog in so we can remotely connect to the machine. When the machine reboots and we try connect to the machine, the CentOS server needs a keychain password... due to this we cannot remotely connect. The server is not meant to have a screen or keyboard. RDP should be automatic. Any fixes for this?


title: Resume an aria2 downloaded file by its *.aria2 file

text: I have a partially downloaded file with aria2. Next to it, is a file with the same name end with `.aria2`.   I don't know the download link. I only have these two files. I want to know how could I resume download in this situation. Note: `*.aria2` is created along side the download file and remains until the download finishes.


title: Does the Fn Lock (FnLk) on Thinkpad T440s work well with Linux?

text: I'm considering to buy a Lenovo Thinkpad T440s and to install Linux on it. According to the user guide and photos of T440s, to use `F1`-`F12` you have to hold down the `Fn` key, or use `Fn`+`Esc` to enable "Fn Lock"(`FnLk`).   ![ss of keyboard](http://i.stack.imgur.com/LpFlC.jpg) _source:Lenovo website_ Also mentioned in the user guide, there are only three settings in the "Keyboard/Mouse" section in BIOS/UEFI configuration (aka. ThinkPad Setup):   * TrackPoint (Enabled or Disabled)   * Trackpad (Enabled or Disabled)   * Fn and Ctrl Key swap (Disaabled or Enabled) No settings about `F1`-`F12`. In this review from a Chinese forum, someone wrote: > 如果还想用原来的操作方式，安装好驱动后，按FN+ESC键进行FnLK操作就行了，重启后该设置继续保留，无需重新设置。 which translates into: > If you want the old way back, just press `Fn`+`Esc` to get a `FnLk` with the > driver installed. This configuration keeps even if you reboot the machine. I asked this question on another Chinese bbs and got a negative feedback: (translated) > FnLk does not work on Windows if no driver installed. Can anybody who has a T440s tell me whether FnLk works with Linux? Perhaps with some kernel module?


title: setup ad-hoc wifi

text: I'm trying to create a ad-hoc wifi, after some readings here is what I did: I changed `/etc/network/interfaces` on computer A like this:               auto lo     iface lo inet loopback          ## WIFI AD-HOC     auto wlan0     iface wlan0 inet static             address 192.168.0.1             netmask 255.255.255.0             wireless-mode ad-hoc             wireless-essid test      on computer B:               auto lo     iface lo inet loopback          ## WIFI AD-HOC     auto wlan0     iface wlan0 inet static              address 192.168.0.2             netmask 255.255.255.0              wireless-mode ad-hoc             wireless-essid test      Then check `wlan0` configuration with `ifconfig` everything seems OK, but I cannot ping each others (host unreachable stuff). Any idea, what am I missing here?


title: Deleting Word text-objects in VIM

text: In the expression `(word (first-Word second-Word))` on typing `diW` with the cursor on `f`, I get `(word second-Word))` when I would like just the Word `first-Word` deleted. On typing `diW` with the cursor on `s` in the original expression, I get `(word (first-Word` when again I would only like the Word removed. I expected the modifier `i` to result in only the Word text-object being deleted and not surrounding spaces or parentheses. How can I get the behavior I want?


title: Xen crashes when loading X

text: I installed debian-7.1.0-i386-kde then apt-get install various Xen stuff. After updating Grub I found it boots up using Xen however at the point where it tries to draw my desktop (KDE) I get a bunch of random static colors on screen and it freezes/locks up/crashes. How do I fix this so I can boot up Xen with Debian as my host OS?


title: How to send an alert if the DHCP range exceeds using shell script?

text: I've install and configure DHCP server on CentOS 6.5. I've also added a subnet to the `dhcpd.conf` file as follows:               subnet 192.168.1.0 netmask 255.255.255.0 {       option domain-name-servers 192.168.1.2, 8.8.8.8;       default-lease-time 600;       max-lease-time 7200;       range dynamic-bootp 192.168.1.10 192.168.1.30;       option broadcast-address 192.168.1.255;       option routers 192.168.1.1;       option ip-forwarding off;     }      As you can see the DHCP server can assign only 20 IP Addresses. Is it possible to make the DHCP server send an alert to the system administrator after it has assigned all the 20 addresses using a shell script?


title: Cron spamming because of renice

text: I have a bash script that I execute using cron. The script begins like this:               #! /bin/bash          DIR=/home/pi/bin/run          renice 19 -p $$     ionice -c 3 -p $$     :      Now, every time cron runs this script it sends me a mail:               /home/pi/bin/run/test-script:     6461 (process ID) old priority 0, new priority 19      When I comment out the `renice` command the script executes without a problem. I don't want cron to send me a mail that the script reniced itself because that's by design. What's going on and/or how can I fix this?


title: Fedora 16 strange /tmp permissions: mysqld will not start

text: I installed mysql on a brand-new Fedora 16 server and it would not start. This is the line from the log file (`^G` and all):               ^G/usr/libexec/mysqld: Can't create/write to file '/tmp/ibNPyIlu' (Errcode: 13)      I looked at `/tmp/` and it has rather strange-looking permissions:               drwxrwxrwt.      Why the dot? `chmod 1777` does not change anything. Is this responsible for the error? What's next?