title: Resume transfer of a single file by rsync

text: In Ubuntu, I want to copy a big file from my hard drive to a removable drive by `rsync`. For some other reason, the operation cannot complete in a single run. So I am trying to figure out how to use `rsync` to resume copying the file from where it left off last time. I have tried to use the option `\--partial` or `\--inplace`, but together with `\--progress`, I found `rsync` with `\--partial` or `\--inplace` actually starts from the beginning instead of from what was left last time. Mannually stopping `rsync` early and checking the size of the received file also confirmed what I found. But with `\--append`, rsync starts from what was left last time. I am confused as I saw on the man page `\--partial`, `\--inplace`, and `\--append` seem to relate to resuming copying from what was left last time. Is someone able to explain the difference? Why don't `\--partial` or `\--inplace` work for resuming copying? Is it true that for resuming copying, `rsync` has to work with the `\--append` option? Also, if a partial file was left by `mv` or `cp`, not by rsync, will `rsync --append` correctly resume copying the file?


title: Linux crashes when i attach usb dongle

text: I have a D-Link Usb dongle the description about it is:               $ lsusb | grep D-Link     Bus 002 Device 003: ID 07d1:3303 D-Link System DWA-131 802.11n Wireless N Nano Adapter(rev.A1) [Realtek RTL8192SU]      My OS is Linux Centos 6.5 and kernel version is:               $ uname -r     2.6.32-431.23.3.el6.x86_64      i found the proper linux driver for it here and the i installed it:               $ gunzip RTL8188SU_usb_linux_v2.6.6.0.20110401.zip     $ cd rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20110401/     $ cd driver     $ ./clean     ERROR: Module r8192s_usb does not exist in /proc/modules     ERROR: Module ieee80211_rsl does not exist in /proc/modules     ERROR: Module ieee80211_crypt_ccmp does not exist in /proc/modules     ERROR: Module ieee80211_crypt_tkip does not exist in /proc/modules     ERROR: Module ieee80211_crypt_wep does not exist in /proc/modules     ERROR: Module ieee80211_crypt does not exist in /proc/modules     $ sudo make     make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/2.6.32-431.23.3.el6.x86_64/build M=/home/amir/Downloads/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20110401/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20110401  modules     make[1]: Entering directory `/usr/src/kernels/2.6.32-431.23.3.el6.x86_64'       Building modules, stage 2.       MODPOST 1 modules     make[1]: Leaving directory `/usr/src/kernels/2.6.32-431.23.3.el6.x86_64'     $ sudo make install     install -p -m 644 8712u.ko  /lib/modules/2.6.32-431.23.3.el6.x86_64/kernel/drivers/net/wireless/     /sbin/depmod -a 2.6.32-431.23.3.el6.x86_64      Now the problem is when I attach the dongle it the OS will crash and restart. my guess is then it load the dongle driver it conflicts with my laprop wireless device driver because when is disable all wireless and networking this wouldn't happen. Laptop wireless device is:               $ lspci |grep Network     03:00.0 Network controller: Qualcomm Atheros AR9285 Wireless Network Adapter (PCI-Express) (rev 01)      when I attach the dongle the OS crashes and restarts.


title: How to exit out of the shell script successfully so that python subprocess think it is successfull exit?

text: Below is my shell script which simply execute a url like this `http://example.com:8080/beat` and parse the response and verify certain conditions on it. If that condition is met, then exit successfully out of the shell script using `exit 0`.               #!/bin/bash     set -e          COUNT=60      SUM_SYNCS=0     SUM_SYNCS_BEHIND=0     HOSTNAME=$hostname            echo $HOSTNAME          while [[ $COUNT -ge "0" ]]; do          #send the request, put response in variable     DATA=$(wget -O - -q -t 1 http://$HOSTNAME:8080/beat)          #grep $DATA for syncs and syncs_behind     SYNCS=$(echo $DATA | grep -oE 'num_syncs: [0-9]+' | awk '{print $2}')     SYNCS_BEHIND=$(echo $DATA | grep -oE 'num_syncs_behind: [0-9]+' | awk '{print $2}')          echo $SYNCS     echo $SYNCS_BEHIND          #verify conditionals     if [[ $SYNCS -gt "8" && $SYNCS_BEHIND -eq "0" ]]; then exit 0; fi          #decrement the counter     let COUNT-=1          #wait another 10 seconds     sleep 10          done      I am able to execute the above shell script from Python subprocess module successfully as shown below -               proc = subprocess.Popen(shell_script, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, executable='/bin/bash')      (stdout, stderr) = proc.communicate()     if proc.returncode != 0:         # log an error here     else:         # success log here      But what is happening here is - If you see my shell script I am exiting out of the shell script using `exit 0` which is a successful exit I guess and somehow in my Python code, it is logging an error after executing that shell script? Meaning it is going inside if statement somehow. So is there any way, I can replace `exit 0` with some other successful exit call in shell script so that Python script can identify that, it's a successfull exit? I don't want to modify Python script code..


title: Valid screen session names

text: With GNU screen (version 4), why is it that the following runs perfectly fine:               $ screen -S some-name      But if I try having a slash (`/`) in the session name, it gives me an error about multiuser support.               $ screen -S some/name     Must run suid root for multiuser support.      If I try setting the session name from within the screen:               $ screen     C-a :sessionname some/name      I get the following error:               : bad session name 'some/name'      So apparently a `/` is invalid character for a session name. Looking at the man page for screen, I see nothing about invalid or reserved characters for `sessionname`: > ‘-S sessionname’ > > Set the name of the new session to sessionname. This option can be used to > specify a meaningful name for the session in place of the default tty.host > suffix. This name identifies the session for the screen -list and screen -r > commands. This option is equivalent to the sessionname command (see Session > Name). > 8.5 Session Name — Command: sessionname [name] > > (none) Rename the current session. Note that for screen -list the name shows > up with the process-id prepended. If the argument name is omitted, the name > of this session is displayed. Caution: The $STY environment variable still > reflects the old name. This may result in confusion. The default is > constructed from the tty and host names. Also, unmatched `'` and `"` in the session name complain about unmatched quotes which seems to be about syntax. E.g., `:sessionname 'test"'` gives `test"` as the name. And `^A`, `^B`, etc. yield control characters. What is the valid syntax or characters for a session name?


title: Make a new sniffer

text: How can use the Linux-kernel to supervise what is going on, about the new connections, new ports, connected hosts? Like I will do a new sniffer. Which files should I monitor to know what is going around. For example, if a server have no ssh connections, then a new host is connected using port 22 , i want to have alert for this new connection. If the host is disconnected, another alert will be run.


title: .bashrc and .bash_profile not executed

text: I'm running RHEL5. I added simple alias command into `~/.bashrc`. When I start a new terminal, nothing happens but `source ~/.bashrc` works so I know the syntax is correct. I also modified/source-tested `~/.bash_profile` but it's not executed on terminal startup either. `~/.bash_login` and `~/.profile` don't exist on my system. here is my `~/.bashrc`               # .bashrc          # Source global definitions if [ -f /etc/bashrc ]; then             . /etc/bashrc fi          # User specific aliases and functions     alias hi=hello      And my `~/.bash_profile`               # .bash_profile          # Get the aliases and functions     if [ -f ~/.bashrc ]; then             . ~/.bashrc     fi          # User specific environment and startup programs          PATH=$PATH:$HOME/bin          export PATH


title: How to control authentication attempts in PAM?

text: I would like to configure the no. of times user will be prompted for password(authentication attempts) for login, before dropping the session. Does PAM support this case, if so can you help me out with the configuration required for this ?


title: Get a list of users with access to the host

text: I tried to go into `/home` and list all the subdirectories but it seems that all dirs that are not mine are hidden. I also tried `cat /etc/passwd` but that didn't list my very own ID I was logged in under. I should also note that my home dir is not physically located on the host but on another network server that hosts everybody's home directories, which are then mounted to all the machines that they have access to. So while dirs like /opt, /var, /etc and so on are physically located on that particular machine, the home dir is on another server. As a non-root user, is there a way for me to see who all has access to a certain host? OS is Solaris 5.10.


How to programatically detect when a device raises an interrupt? This can be when a device is connected or disconnected. And also this case: for example: when a finger is held over a fingerprint scanner, an interrupt is raised. How to detect and possibly trap this interrupt? I want to write an application using Gtkmm such that when an event occurs like a CD being inserted or a pendrive being plugged in, I catch the interrupt these devices raises and use it to do something in my application, involving these devices. If it cannot be done in Gtkmm, can I trap the Interrupt at a lower level and inform the Gtkmm application? I was checking out how GParted behaves. It was initially showing `/dev/sda` and when I connected my pendrive, it automatically opened `files` application. When I checked GParted, pendrive was not present in the drop down menu of devices. It appeared only when I selected “Refresh Devices” in the GParted menu or `Ctrl`+`R`.


title: True P2P chat client?

text: Does a true P2P chat client exist for Linux? If it does exist, can someone please provide a link? I have tried searching for such a client, but haven't had any luck yet. Ideally the client will work on debian and/or debian based systems.


title: Execute command when mouse is pluged/unpluged on GNU/Linux

text: Is it possible to have something like event handler for plugging unpluggig a mouse in Unix System? I want to have a script that will enable/disable touchpad but not only on startup (you can find solution for that using google) but whenever I plug/unplug the mouse (when the system is running). Is it possible?


title: How do I only undo pasted text in vim?

text: TL;DR; version - How do I undo text that was pasted in from my OS copy buffer without undoing other text that was typed in since I went into insert mode? Longer description:   1. Put something in your OS copy buffer (e.g. highlight some text and do `Command-c` on Mac)   2. Go into insert mode in vim ( `i` )   3. Type something ( e.g. `asdf`)   4. Without exiting insert mode, paste from your copy buffer into vim ( `Command-v` on Mac)   5. Hit `escape`   6. Try to undo the paste ( `u` ) It undoes everything from the last time you went into insert mode. In otherwords, it clears out `asdf` plus all the text I pasted in. How do I _just_ undo the text that pasted in? Do I have to always go out of insert mode and back in before I paste text just to have the option to undo the pasted text?


title: How to make a Fedora respin that has a custom program icon on its desktop?

text: I want to create a Fedora custom Live DVD that ships with an icon to a custom program (not in any repository, it's something I made) appearing on the desktop, ready to be executed by the user as soon as he boots the DVD and the desktop appears. I'm using this page as a guide: http://fedoraproject.org/wiki/How_to_create_and_use_a_Live_CD But it's unclear how I would include a custom file like that in the generated ISO. Is it some directive in the .ks file? Where should I place the file, and how do I specify that I want a link to this file on the live user's desktop? Would it help if I made an RPM out of it?


Where is filename stored on a filesystem? It's not in inode or with the actual file content since we have hard link that two filenames can point to the same inode.


title: curl does not return any thing for protected file

text: I have a file on the server that is HTTP Head password protected, but when I tried to get the page the command returned with nothing at all:               curl --user username:password http://mysite.com


title: Extracting some files from a folder and creating a list of these files

text: I am just a beginner with Unix and so my skills in Unix commands is limited. I am currently dealing with a folder containing about 1000 files and I have to extract some filenames from this folder and create another file (configuration file) containing these filenames. Basically, the folder has filenames in the following format :               1_Apple_A_someword.txt      1_Apple_B_someword.txt      2_Apple_A_someword.txt      2_Apple_B_someword.txt      3_Apple_A_someword.txt      3_Apple_B_someword.txt      and so on up until               1000_Apple_A_someword.txt     1000_Apple_B_someword.txt      I just want to extract out all files which have "Apple_A" in them. Also, I want to create another file which has 'labels' (Unix variables) for each of these "Apple_A" files whose values are the names of the files. Also, the 'labels' are part of the filenames (everything up until the word "Apple") For example,               1_Apple=1_Apple_A_someword.txt     2_Apple=2_Apple_A_someword.txt     3_Apple=3_Apple_A_someword.txt      and so on...till               1000_Apple=1000_Apple_A_someword.txt      Could you tell me a one-line Unix command that does this ? Maybe using "awk" and "sed" Thanks.


title: How to unrar and unzip files recursively?

text: I have a huge file that contains zips and rars with zip and rar files located within on a linux box. I basically need a script or one-liner that will recursively hunt through the directories and unzip and unrar any rar or zip it finds.


title: Shell script to find what package provides a file on OpenBSD

text: # for i in `pkg_info -q`; do pkg_info -L "$i" | grep ^/ | sed "s/^/$i/g" | perl -pe 's/\//\t\//'; done | grep tasklist.desktop     xfce4-panel-4.10.0p2    /usr/local/share/xfce4/panel/plugins/tasklist.desktop     # pkg_file() { for i in `pkg_info -q`; do pkg_info -L "$i" | grep ^/ | sed "s/^/$i/g" | perl -pe 's/\//\t\//'; done | grep $1; }      ksh: syntax error: `{' unexpected     #       **Q:** what am I missing? I just want to put in the .profile file, but when I put the line in a function I got the shown error


title: How to lock my session in Xfce?

text: I am looking a simple way to lock my session in Xfce (Debian Unstable). I don't want to have to write my password at every wake-up _but_ I want to be able to press to a shortcut (which launches a commandline) which asks for identification. The usage is to lock my laptop when I leave office for lunch. I want to press this shortcut before closing the screen (and so putting the laptop to suspend). If someone tries to wake it up, he will have to enter the password.


title: XBMCbuntu freezes at random intervals

text: I have a Gateway GM5474 which is running XBMCbuntu on a 500GB Hard drive (the originial I believe or maybe slightly newer hard drive). Little background: The system is still stock, and I was having issues getting any linux kernel to install and I considered it a miracle that it installed at all. I tried all three hard drives I have until it installed on the 500GB. (the others are 500GB and 1TB) It was working fine but now it randomly freezes up, on reboot there is nothing logged to syslog, nor is there anything in dmesg indicating that there is an issue. I thought it may have been due to the screensaver as I could not ping it after the screensaver had been initiated for longer than 20 minutes. I also can't turn off the screensaver for whatever reason, I tried the command line method and the gconf method and neither affect the screensaver. [EDIT:] It was not always the screensaver causing the issue, it seems to stall after a solid hour has elapsed. I would like some advice but if the general consensus is to reinstall using something suited to older hardware then so be it.


title: back-up: which patitions to back-up before upgrading/reinstalling

text: I have Ubuntu13.04 on my laptop. I have to upgrade it to the next release or else I would install a fresh release after deleting my current system. I have already installed and configured my current system a lot and I can't take the burden of doing it all over again if I install the next release. Now I would like to know that what all back-ups are required to be taken beforehand so that I would recover all my files/installations/configurations etc. In other words I should have everything on my new system (simply by restoring from back-ups) that I possess currently. My current system has /, /boot, /home & swap partitions which were created by me when I had freshly installed the O.S.


title: Rewriting lines from the ending

text: I want to read a file and write its lines from the ending (which means that I want to replace the first line with the last line, the second line with the penultimate line and so on) just by using VIM features.


title: Symbol on the border of pages when printing

text: I am using Debian (unstable) and I try to use a hp printer (hp Color Laserjet CP3525dn). I installed the last version of hplip. I have a problem when I try to print a US layout document in A4 paper. The print add a symbol useful when you want to cut the paper : ![enter image description here](http://i.stack.imgur.com/5MWKF.png) I have this symbol at every corners. How can I get rid of it?


title: Upstart: How to respond to startup of a service, thats not part of Upstart?

text: I'm running Ubuntu server and playing around with Upstart. I have installed PostgreSQL database server which **doesn't use** Upstart system, however im also writting an Upstart script that starts another process which depends on the PostgreSQL server to be up and running. How do i setup my Upstart conf file to run when the PostgreSQL will already be running since its not part of the Upstart? Heres my simple script so far:               start on runlevel [2345]     stop on runlevel [!2345]          exec /spatial/server_init.sh


title: How to properly install Python packages?

text: I run a Slackware system and I'm trying to run some Python code, but getting a lot of errors such as this one below:               >>> import urllib2     Traceback (most recent call last):       File "<stdin>", line 1, in <module>       File "/usr/lib/python2.6/urllib2.py", line 91, in <module>         import hashlib       File "/usr/lib/python2.6/hashlib.py", line 136, in <module>         md5 = __get_builtin_constructor('md5')       File "/usr/lib/python2.6/hashlib.py", line 63, in __get_builtin_constructor         import _md5     ImportError: No module named _md5      urllib2 should be a rather basic lib with Python, how can I get Python working correctly? Reason being is that `urllib2` seems to be a dependancy of `praw`: https://github.com/praw-dev/praw/issues/135 Trying to install pip to get this installed gives me:               Traceback (most recent call last):       File "setup.py", line 5, in <module>         from setuptools import setup     ImportError: No module named setuptools      So I tried installing setuptools:               running install     Traceback (most recent call last):       File "setup.py", line 94, in <module>         scripts = scripts,       File "/usr/lib/python2.6/distutils/core.py", line 152, in setup         dist.run_commands()       File "/usr/lib/python2.6/distutils/dist.py", line 975, in run_commands         self.run_command(cmd)       File "/usr/lib/python2.6/distutils/dist.py", line 995, in run_command         cmd_obj.run()       File "/root/setuptools-0.6c11/setuptools/command/install.py", line 76, in run         self.do_egg_install()       File "/root/setuptools-0.6c11/setuptools/command/install.py", line 85, in do_egg_install         easy_install = self.distribution.get_command_class('easy_install')       File "/root/setuptools-0.6c11/setuptools/dist.py", line 395, in get_command_class         self.cmdclass[command] = cmdclass = ep.load()       File "/root/setuptools-0.6c11/pkg_resources.py", line 1954, in load         entry = __import__(self.module_name, globals(),globals(), ['__name__'])       File "/root/setuptools-0.6c11/setuptools/command/easy_install.py", line 21, in <module>         from setuptools.package_index import PackageIndex, parse_bdist_wininst       File "/root/setuptools-0.6c11/setuptools/package_index.py", line 2, in <module>         import sys, os.path, re, urlparse, urllib2, shutil, random, socket, cStringIO       File "/usr/lib/python2.6/urllib2.py", line 91, in <module>         import hashlib       File "/usr/lib/python2.6/hashlib.py", line 136, in <module>         md5 = __get_builtin_constructor('md5')       File "/usr/lib/python2.6/hashlib.py", line 63, in __get_builtin_constructor         import _md5     ImportError: No module named _md5


title: Why is bzip2 needed in the kernel patch instructions?

text: This is from here. **Extract the patch**               tar -xvzf /usr/src/web100-2.5.22-200810130047.tar.gz          bzip2 web100/ web100-2.6.27-2.5.22-200810130047.patch      **Test the patch**               bzip2 -dc /usr/src/linux/web100/ web100-2.6.27-2.5.22-200810130047.patch.bz2 | patch -p1 --dry-run      I looked at the `.patch`, the diff output of many files and the file `.patch.bz2` after the bzip2 command which is too also the diff output of many files, they seem to be the same. My question is why is `bzip2` even needed to turn the `.patch` into a `.patch.bz2`? Is it for the redirection to std output from the `-dc` option for the patch command? Even if it is, why not just not just use the patch command in the form something like this:`patch -p1 < patchfile`? I don't see why the `bzip2` is done here. Thanks! Also, I think the `bzip2` might have an extra space in the command after `web100/`, right?


title: How to buld with MAKE and only --silent output on screen, but get full output to log file

text: How can I redirect output from MAKE i such a way that I get only --silent output to screen, but full MAKE-output to a log file? Or can this be achieved through some sdout/stderr redirection magic?


title: Best *nix or *nux OS for Compaq Presario 2100 laptop

text: I have an old Compaq Presario 2100 laptop with the following configuration:   1. **RAM** : 192 MB DDR PC2100   2. **Processor** : Intel Pentium 4 2.19 GHz   3. **Current OS** : Windows XP Professional Version 2002 Service Pack 3   4. **Hard Disk** : 2 drives 14 GB each I want to migrate to some Unix based OS. Please let me know the best one. Do ask for additional info if needed. If you feel that this question does not suit here, then please let me know the place to post it before downvoting. Thanks a lot!


title: Ctrl-C with two simultaneous commands in bash

text: I want to run two commands simultaneously in bash on a Linux machine. Therefore in my `./execute.sh` bash script I put:               command 1 & command 2     echo "done"      However when I want to stop the bash script and hit `Ctrl`+`C`, only the second command is stopped. The first command keeps running. How do I make sure that the complete bash script is stopped? Or in any case, how do I stop both commands? Because in this case no matter how often I press `Ctrl`+`C` the command keeps running and I am forced to close the terminal.


title: CPU is free, yet bash script not utilizing all CPU resources

text: I ran a simple script to generate a large (10000000 lines) csv file with 6 fields in which some fields changed in each line/row, using a _while_ loop. The machine had all (32) CPUs free, lot of RAM (~31 Gb) was free too. I timed the script with the command > /usr/bin/time -v bash script.01.sh After running for around 2 hours, I got the following stats: > Command being timed: "bash script.01.sh"   >  User time (seconds): 1195.14   >  System time (seconds): 819.71   >  **Percent of CPU this job got: 27%**   >  Elapsed (wall clock) time (h:mm:ss or m:ss): 2:01:10   >  Average shared text size (kbytes): 0   >  Average unshared data size (kbytes): 0   >  Average stack size (kbytes): 0   >  Average total size (kbytes): 0   >  Maximum resident set size (kbytes): 4976   >  Average resident set size (kbytes): 0   >  Major (requiring I/O) page faults: 0   >  Minor (reclaiming a frame) page faults: 3131983488   >  Voluntary context switches: 22593141   >  Involuntary context switches: 10923348   >  Swaps: 0   >  File system inputs: 0   >  File system outputs: 2182920   >  Socket messages sent: 0   >  Socket messages received: 0   >  Signals delivered: 0   >  Page size (bytes): 4096   >  Exit status: 0 I want to know why did my script used only 27% of the CPU? The Disk IO was nothing much at all (saw in vmstat output). So what caused the restriction? The code in the script? Here is the script:               #!/usr/bin/env bash     number=1          while [[ $number -lt 10000001 ]] ; do           fname="FirstName LastName $"         lname=""           email="fname.lname.$number@domain.com"           password="1234567890"           altemail="lname.fname.$number@domain.com"           mobile="9876543210"                    echo "$fname,$lname,$email,$password,$altemail,$mobile" >> /opt/list.csv         number=$(expr $number + 1)       done


title: When do changes to gsettings take place?

text: After making a change to something in gsettings, is anything to be done to make the changes take effect? For example, if I have thumbnails in `~/.thumbnails` dating back a few days, will running:               gsettings set org.gnome.desktop.thumbnail-cache maximum-age 1      cause thumbnails older than one day to be immediately deleted? Another case would be turning off a notification by accident and then wanting to restore the default as in:               gsettings reset org.gnome.nm-applet disable-vpn-notifications      Depending on the nature of the key modified, will a log out and log in or a reboot be required? Is there a way to find out other than by trial and error? My OS is Lubuntu 13.10.


title: fedora like ubuntu

text: I remember ubuntu like a system which had every repository that I could enable and download apps. But now in fedora I can use only her repository and it's all. Do you know if I can change my fedora to be more like ubuntu?


title: how to assign another modifier to Alt key for X11?

text: ### Aim: I would like to assign Alt to CapsLock-key, and Meta to Alt-key. But in such way, Alt-key would no longer be recognized as Alt, and CapsLock-key would no longer be recognized as CapsLock. openSUSE 11.4 ### Previously: openSUSE 11.1 -- since I am the only user of my computer I "simply" edited the /usr/share/X11/xkb/keycodes/xfree86 file and it worked without problem. Keys were wired to their symbols at the lowest level. ### Problems:   1. xkb  I created a variant of Polish layout (pl_ext) which (for test) consists of such entries:              key <CAPS> { [ Alt_L ] };     modifier_map Mod1 { Alt_L, Alt_R };      However this does simply nothing, CapsLock-key in xev is recognized (symbol) as Alt_L, but when I press CapsLock-key it behaves like CapsLock (e.g. assuming you have File in menu, Alt+F should open this menu, it does not). **Question:** How to define a layout file to set CapsLock-key as Alt, and Alt- key as Meta? **Edit:** Half of success here! Now I have such entries:              key <CAPS> { [ Alt_L ] };     modifier_map Mod1 { <CAPS> }; // this is a difference      and this works as desired. This does not:              key <LALT> { [ Meta_L ] } ;     key <RALT> { [ Meta_R ] } ;     modifier_map Mod5 { <LALT>,<RALT> };      Alt-keys are recognized as Meta by xev, but I still can open the menus with Alt+F, switch windows, and I shouldn't. And on the other hand I cannot enter any national character, and I should.   2. xfree86 But now this does not work, I guess other file table is read instead of xfree86. **Question:** How to find out which keycode table file is used by system (X/Gnome)? **Edit:** The best option for me -- editing keycode tables -- was solved by macias's answer!   3. xmodmap Half of success here. This part works as desired: remove Lock = Caps_Lock keysym Caps_Lock = Alt_L Now, I have trully CapsLock-key which is mapped to Alt. But this: keysym Alt_L = Meta_L ...does strange thing. xev shows that Alt-key is mapped to Meta, but when I press Alt+F (this should be mapped to Meta+F --> doing nothing) the File menu is opened. What's more, when I press Alt+Tab, I get window-switcher (I should not -- Alt is Meta now). **Question:** How to "delete" old behavior for Alt-key? **Edit:** This part is solved by Gilles's answer. ### Summary: Answering any question would (hopefully) solve my problem, however I prefer using xkb entirely because I could then pack all the files for xkb and change layout in one place. Thank you in advance for any help!


title: Creating bootable USB from .iso in Fedora 19

text: I created a somewhat similiar question previously, but seeing as my understanding of the topic improved drastically with the answers, I realized that I had asked the wrong question. I am trying to create a Windows 7 USB on my 8 GB stick. I am using Fedora 19 and so far:   * UNetbootin. While this seemingly works (only if the stick is formatted to a somewhat old laptop (Dell Latitude D630). I have tried the following methods FAT32), trying to boot the stick only gives me the alternative "default" with a countdown. Its the same error described other places, such as here. I have not succeeded in finding a good alternative to try, as someone claims that formatting to NTFS would do the trick, but UNetbootin won't recognize the stick in NTFS.   * "dd". While it claims to copy 4.1 GB, and the name of the stick is automatically changed to "WINDOWS7", the "Discs"-GUI provided in Fedora claims that only 0.5GB is used, and attempting to boot leaves me with "Unable to find operating system" or "Missing operating system", something along those lines. It also looks like it changes the format to UDF.   * WinUSB. Returns error 32512. Are there any alternative methods? Or improvements/changes upon methods I have already tried? EDIT: I found a method that many have claimed to work:   1. make one partition, format as NTFS & mark bootable   2. write boot sector (ms-sys -7)   3. mount and copy all the files from the iso How do I do steps 2 and 3?


title: How limited is the Linux-based distribution on the Nokia n900?

text: I am interested what N900 can do with Linux-based Maemo 5 system installed. Can it for example:   1. Compile c++ or java files?   2. Hack into wifi (I meant advanced wlan card features)   3. Create own wifi access point?   4. Be WWW server?   5. Use normal usb keyboard? (after changing plug into smaller)   6. Play flash games?


title: Is there a graphical shell or scripting environment for Linux?

text: I would like to draw my scripts and connect commands like blocks of functions (something similar to Yahoo Pipes). Does such an environment exist or do I have to develop it myself?


title: Disable colours on terminal and SSH

text: My local Linux machine has coloured terminal output like this; ![enter image description here](http://i.stack.imgur.com/JMaYD.png) When I SSH to a pfSense/BSD box it changes the colours like this; ![enter image description here](http://i.stack.imgur.com/c6t25.png) Even when I SSH from to a machine that doesn't have a coloured local terminal output, and SSH from there to this pfSense/FreeBSD box it enables coloured output, and starts producing unwanted coloured output/ Is there something I can change locally so that when I SSH to the pfSense box from either my local machine or via an intermediary machine, my client will ignore the remote colour settings. Ideally I want to stay in black and white, two tone standard background and text colour only?


title: Is it possible to tell Xorg not to listen on the abstract socket

text: On Linux (in recent versions), Xorg listens on both a Unix domain socket on the filesystem (`/tmp/.X11-unix/X _< n>_`) and in the _abstract_ domain (shown as `@/tmp/.X11-unix/X _< n>_` in netstat output). It also listens on TCP (port `6000 + _< n>_`). One can stop it from listening on TCP by adding a `-nolisten tcp`, but how can we tell it not to listen on the abstract namespace?


title: how to escape "\"in ssh-copy-id?

text: I'm connected to Ubuntu server that is a member of a corporate Active Directory domain via likewise-open. The users are in the form `mydomain\myuser`. I can connect to it via ssh, escaping the `\` with another `\`:               ssh mydomain\\myuser@myserver      I've generated a pair of keys via `ssh-keygen`, then tried to copy it to the remote machine. The user I'm using in the local machine is not the same I want to copy the key into, so I issued the command:               ssh-copy-id mydomain\\myuser@myserver      and the output:               password:     password:     password:     mydomainyuser@myserver's password:     Received disconnect from myserver: 2: Too many authentication failures for myuserydomain      prompting me for the local user's password three times, and then the `\\\` actually worked as a single `\` escaping the first `m` in `mydomain`. Am I getting this straight? And how can I escape that `\` and correctly copy key to the remote machine? EDIT: also `ssh-copy-id myuser@mydomain.com@myserver` turned out to be a valid syntax.. However, the question was about escaping the `\`.


title: Using SUDO to execute a general command inside a non-accessible directory

text: I want to grep something inside a directory. But the user dont have permissions in the direcotry. Because of some reasons, i am not allowed to change permissions, group or owner. Just want to know i can access that directory by some entry in the sudoers file.               grep -r "some phrase" /path/to/restricted-dir      Is there any way to execute the above command using SUDO. ?


title: Restricting access to yahoo.com in elinks using squid

text: I need to restrict access to yahoo.com and all its subdomains in `elinks`. I must use squid but I don't know how to configure it. Can anybody help me because I am new to Linux.


title: About to replace windows with Ubuntu 11.10. Will this cause any problems?

text: I have Ubuntu installed on a (originally just Windows) machine using wubi. What are the chances of going something horribly wrong if I were to:   1. create a new partition   2. Install Ubuntu 11.10 on it using a CD   3. format the partitions with Windows and wubi on them. Will this successfully make Ubuntu 11.10 as my main OS? In case anyone is wondering why I want to do so: simply because I never use windows and it's just sitting there idle, taking up space.


title: Does using noatime on modern Linux make sense?

text: Starting from version 2.6.30 (which was released 5 years ago), Linux has the option `relatime` enabled by default. It means updates of file access time are very infrequent and prudent. But I still see recomendations to use `noatime` for databases or SSD discs. Are there any reason to change default configuration and use it? Does it make any measurable difference compared to `relatime`?


title: Downgrade Gnome 3 to Gnome 2

text: I have installed fedora16 recently. I don't like the Gnome3 that my fedora got shipped with. I want to downgrade it to Gnome2 as i haven't used any other desktop environment before. Any knowledge about how to do it ?


title: What happens for the last line when using N command with sed

text: Here is my sed command:               echo -e "AB\nCD\nEF\nGH" | sed 'N; D;'      It prints:               GH      while `sed` processing input line by line, what happens with the last line? (When after that `sed` saw End-Of-File)? I mean the pattern buffer only contains 1 line.


title: Test effective permissions of file for user

text: Is it possible to test effective permissions of a file for a specific user? I normally do this by `su user` and then accessing the file, but I now want to test this on an user with no shell (i.e. a System user)


title: Ubuntu sound not working after sleep/suspend

text: Whenever I sleep my laptop I mean if I down the flap sound doesn't work, every time i have to restart my laptop for sound to make working. Fo instance right now sound is not working(since I closed the flap few minutes back.) so I check sound app and in output tab its showing               Speakers      Built-in Audio      but still I can't hear the output sound. I've even tried `sudo alsa force-reload` but still same problem.


title: How can I send single file to multiple remote sites at the same time?

text: Can `scp` be used to send a single file to multiple remote servers at the same time? If so, how? If not, what's the alternative?


title: how to close all panes but the current pane in tmux

text: I have a key bound to setup panes to my liking, but sometimes things get messed up or out of hand and I want to close all the panes and rerun the script. Is there a simple `tmux` command to close all panes except the one I am currently in?


title: How to regenerate /var/cache/debconf on Debian?

text: Suppose one deleted (or damaged) the following files/folder.               /var/cache/debconf     /var/cache/debconf/config.dat     /var/cache/debconf/config.dat-old     /var/cache/debconf/passwords.dat     /var/cache/debconf/templates.dat     /var/cache/debconf/templates.dat-old      How to regenerate them?


title: How to install Uglify on Debian Sid

text: I have a question about how to install Uglify or Uglify2 on Debian. I'm also wondering whether I have to install Node.js as well. My main goal of asking this question is to minify all my CSS and .js files and gzip/compress them so that the page load on my website gets faster for visitors. I was looking over the net for a step by step tutorial on how to do that, but got nothing handy so far. Does any one know how to do that?


title: Matching two files, line by line?

text: I have two files consisting of numbers. Now, I want to match the line of first file to all the line of second file and increasing the counter if the match is found. How to write the bash script for this ?               file1:     1     2     3     4     5     6     file2:     2     3     6     10     12     13     23     counter = 3


title: syslog-ng won't write to log file - "No such file or directory"

text: I have set up a fresh instance of syslog-ng using the conf file included below. I can see that messages are trying to route to the right place (var/log/bash) when I look in val/log/messages. But I can't figure out why it refuses to see/write to the designated log file. The file didn't originally exist, but I have tried creating one from scratch, as well as trying to copying over another working log file and renaming it. Also tried opening up the file permissions on the log file to 777 to no avail. (the other log files are set to 600) How can I get it to write to the designated log file? Here is the relevant lines from `/var/log/messages`:               Feb  6 17:44:35 centos32v2 syslog-ng[31027]: Log statistics; processed='src.internal(s_sys#2)=16', stamp='src.internal(s_sys#2)=1391726082', processed='destination(d_mesg)=16', processed='destination(d_bash)=12', (and so on)          Feb  6 17:50:50 centos32v2 syslog-ng[31027]: Error opening file for writing; filename='“/var/log/bash”', error='No such file or directory (2)'      The `syslog-ng.conf` file is a brand new vanilla install, with the following added lines:               destination d_bash { file(“/var/log/bash”); };     filter f_bash { facility(local1) and level(debug); };     log { source(s_sys); filter(f_bash); destination(d_bash); };      Each of these lines looks to be formatted exactly as the other existing entries.


title: Linux Mint Not Updating

text: I literally installed it last night. This morning I saw an update icon but when I click Update Manager it says > ERROR###ERROR###ERROR###ERROR###ERROR###ERROR###ERROR E:Encountered a > section with no Package: header, E:Problem with MergeList > /var/lib/apt/lists/packages.linuxmint.com_dists_petra_import_i18n_Translation- > en, E:The package lists or status file could not be parsed or opened. Does anyone know a fix?


title: explanation on chown(1) POSIX spec

text: The POSIX spec for the `chown` utility mentions in its _rationale_ section about the `chown user:group` syntax (formerly `chown user.group`) (emphasis mine): > The 4.3 BSD method of specifying both owner and group was included in this > volume of POSIX.1-2008 because: > >   * There are cases where the desired end condition could not be achieved > using the chgrp and chown (that only changed the user ID) utilities. **(If > the current owner is not a member of the desired group and the desired owner > is not a member of the current group, the chown() function could fail unless > both owner and group are changed at the same time.)** > I thought the `user:group` syntax was a convenience thing. Now the above implies there are things you can do with `chown user:group` that you can't with `chgrp group; chown user` Now that text doesn't make sense to me. In 4.3BSD, only root could change the owner a file so in any case there's no restriction in what he can do. SysV and a few other systems allow (or used to allow) the owner of a file to change the user and group of a file to anything, but even in those system, that text above doesn't make sense to me. OK, if one does do a `chown someone- else the-file`, one cannot do `chgrp something-else the-file` afterwards because one is no longer the owner of the file, but there's nothing preventing him/her from doing the `chgrp` first (staying the owner of the file) and `chown` after, and that's not what the text above is exactly saying. I don't understand what the _and the desired owner is not a member of the current group_ has to do with the problem. So what are the conditions for which _the chown() function could fail unless both owner and group are changed at the same time_ , and on what system?


title: Boot Crunchbang LiveCD from HDD

text: Is it possible to copy Crunchbang's LiveCD (or any other LiveCD) contents to a hard drive and run it from grub? Or is there any other option to start #! installer without a CD or USB stick? I have Puppy Linux installed currently.


title: CentOS 6.5 + KVM (Virtual Machine Manager) create shortcut - Laucher for Guest Machine

text: How can I create a Launcher on my desktop for guests machines inside of KVM on desktop of CentOS 6.5?


title: How do I change user to uid/gid 760?

text: I requested creation of new user (so that all processes by particular program could be owned by this user). Our admin told me that this new user has uid/gid 760. Please, how do I switch to this user?


title: Tmux output is slower when vertical splits exist: why?

text: When I use Tmux and split the window into panes, I notice that programs are quite a bit slower to print out lines of text when there is vertical split (two panes side by side) than when there is a horizontal split (panes stacked). Does anyone know why?


title: Recover damaged grub loader on Scientific Linux 6.3

text: ![Screenshot of a Grub command line](http://i.stack.imgur.com/1N9Sh.png) So... there is a notebook far away from me, and I can only sit in front of it in about a month. So I'm searching for a solution - "remotely". Scientific Linux 6.3 is installed on it, and it worked perfectly. One day the people that use it sent me this picture. **Q** : How can I fix the GRUB menu? So that they can use the notebook again? P.S.: There was an auto-update configured on that machine besides the base install, here is how I implemented it:               yum remove -y PackageKit* yum-autoupdate yum-updateonboot; read; vi /etc/yum-update      * * *               cat yum-update     #!/bin/bash     # run an update in at least every 172800 seconds [in at least every 48h]          # wait for random time:  0-2700 sec [0-45min]     /bin/sleep $[ ($RANDOM % 2701 ) ]          if [ `stat --format=%Y $0` -le $(( `date +%s` - 172800 )) ]; then          # sync time - http://www.pool.ntp.org/zone/hu             /usr/sbin/ntpdate time.kfki.hu 0.hu.pool.ntp.org; /sbin/hwclock --systohc              # do updates             /usr/bin/yum -q -y update             /usr/bin/yum clean all              # update last modification time + create log entry             /bin/touch $0             /bin/echo "/etc/yum-update OK" | /usr/bin/logger     fi      * * *               chmod +x /etc/yum-update; crontab -e     52 * * * * bash /etc/yum-update      P.P.S.: They tried to press up/down when the machine booted (hoping to select another kernel) but it didn't help.


title: AutoMysqlBackup --lock-tables=false

text: I'm trying to use `AutoMysqlBackup` script to perform daily backups of my application. Unfortunately on the first try it didn't served me how I thought it would. I believe that the script has used the `\--lock-tables=true` parameter and it made my application stop working. If this is the case, how can I make the script not lock the tables? (so my application can continue running)? Thank you.


title: Format disk through rootfs terminal

text: I've got into a strange situation (because of my own stupidity of course:-)). I kept failing to install Chakra Linux from Live USB, so I was thinking that the reason could be that I created the Live USB the wrong way. So I tried to create Live USB directly using `dd` in the live version of Chakra, but I probably mispelled the path to my device and created the iso on one of my partitions. And now, when I try to boot from Live USB I get this error message:               :: Waiting for boot device…     :: /dev/disk/by-label/CHAKRA_201208 found, but the filesystem is unknown.       Waiting 30 seconds for /dev/disk/by-label/ ...     Falling back to interactive prompt     You can try to fix the problem manually, log out when you are finished     sh: can't access tty: job control turned off     [rootfs /]#       How do I fix this situation? Is there a way to format my partitions from the rootfs prompt?


title: Paste text from clipboard directly to browser and make Google search for it

text: When we need to paste something to Google Search from our clipboard, we need at least two or more clicks, before we can get to _URL_ bar and hit `CTRL+V` and then `Enter` to start searching. I was thinking to make it in one click?


title: Manually run a cron job / simulate running cron job?

text: I am new to cron and I want to test if cron's mailing stuff after an executed task and things like that work. Is there a more elegant way to test this, then setting a cron job to run every few seconds? So, is there any way to simulate the execution of a cron job / start a cron job manually, but with the same behaviour it would have when being run automatically by cron?


title: Gigapixel Panorama not loading after converted with imagemagick

text: I made a 3GB tif panorama, but as 3GB is a too big size to open in a computer with a 3Gb RAM, i converted it to JPG > convert input.tif output.jpg The result was a 15Mb(?!?) JPG, which i am unable to open with any image viewer (memory allocation fails). How can i render such a big image, and why is this conversion so small and unable to open anywhere? PS: Is there any image viewer ideal for such images?


title: How to use Crontab for a java file in linux

text: How can I use Crontab in Linux specifically for a Java program? I want to run a MIS Script. How can I crontab it and what should the path be?


title: In bash, is it possible to use an integer variable in the loop control of a for loop?

text: I have the following bash script:               #!/bin/bash          upperlim=10          for i in {0..10}     do     echo $i     done          for i in {0..$upperlim}     do     echo $i     done      The first `for` loop ( _without_ the variable `upperlim` in the loop control) works fine, but the second `for` loop ( _with_ the variable `upperlim` in the loop control) does not. Is there any way that I can modify the second `for` loop so that it works? Thanks for your time.


title: bash variables in for loop range

text: I want to print list of numbers from 1 to 100 and I use a for loop like the following:               number=100     for num in {1..$number}     do       echo $num     done      When I execute the command it only prints {1..100} and not the list of number from 1 to 100.


title: How to install a custom boost version in CentOS?

text: I'm trying to compile and install boost 1.54 from source in CentOS. The documentation is pretty straight forward and there are plenty of tutorials in the internet available (1) (2) (3). This is what I did:               wget http://sourceforge.net/projects/boost/files/boost/1.54.0/boost_1_54_0.tar.gz     tar -xzvf boost_1_54_0.tar.gz     cd boost_1_54_0     ./bootstrap.sh --prefix=/usr/local     ./b2 install --with=all      This is compiling and installing boost correctly to `/usr/local/lib` and everything looks fine. Now I compile other software that requires boost using `gcc` and everything works fine. From my understanding everything should be OK as long as `gcc` finds the required libs. But now the problem: If I run my compiled binaries I get the following error:               ./myProgram       ./myProgramm: error while loading shared libraries: libboost_system.so.1.54.0: cannot open shared object file: No such file or directory      Why can the libraries not be found? In addition I tried:               ldconfig     locate boost       [...]      But boost libraries can not be found. I've looked for the path manually, it is:               /usr/local/lib/libboost_system.so.1.54.0      I also tried to create symlinks to `/usr/lib` but this doesnt fix this either. Any ideas? What can I do?


title: Finding groups of IP addresses in a file

text: I have a file with groups of IP addresses. The file looks like this:               London:     1.1.1.0-1.1.1.200     172.25.2.0-172.25.2.100     Germany:     2.2.2.0-2.2.2.100     192.168.1.0-192.168.1.200     172.25.2.0-172.25.2.200      So when I search for an IP address (`./program.sh 172.25.2.32` ) the output should be London and Germany.


title: Are any files loaded when a terminal session terminates?

text: I know that .profile / .bash_profile are loaded when a terminal session is started, either through local machine or SSH. Are there any files that are loaded/called when the session terminates? Reason: I have the .profile set to log the date and IP address that connects to a terminal session for a specific user.


title: How to display the permissions of a new file in the status line of the Vim editor?

text: With the following piece of code I get the permissions for an existing file:               augroup Get_file_perm       autocmd!       autocmd BufWinEnter,FileChangedShell * let w:file_perm=getfperm(expand('%:p'))     augroup END     " Output, e.g.: rw-rw-r--     set statusline=%{w:file_perm}      Unfortunately the `getfperm` function returns the empty string (`""`) for the current file path (`'%:p'`) if it doesn't exist. I had expected the file permissions calculated from the `umask`.


title: What happen when we plug a device in to computer

text: I'm currently learning about device developement for linux, I have glaced at some books such as LLD3, .. but I still can't understand what happen when we plug a device into computer, That's my imagination: When we plugs a device into a port, in a magic way, Linux kernel will know what device type and call to appropriate module's probe function to determine if it is exactly device which module need, and the next is magic .... Can anyone correction this?


title: Small build-in ssd in notebook can install linux?

text: I bought a samsung laptop series 5. There are a 24gb ssd and normal hard disk. I need to install linux ubuntu on this notebook. Can I just install the ubuntu on the build-in 24gb ssd? If not, how can I use the 24gb ssd for anything?


title: Are .so files in Fedora considered ELF files?

text: ELF 'Executable and Linkable Format' So if I generate Shared Object files `.so` are those considered ELF files?


title: Can I dual boot Linux Mint 32/64?

text: I have Linux Mint Maya 13 XFCE 4, 64bit installed on my pc.   I can't download Swedish bankid on a 64bit version. Is it possible to make a dual boot by installing a 32bit version and keeping my 64 bit as it is today?


title: moving from user mode to kernel mode

text: I read the following: > "All processes begin execution in user mode, and they switch to kernel mode > only when obtaining a service provided by the kernel." When it says "obtaining a service provided by the kernel", does "service" refer to a system call like `fork()` or I/O operation like accessing information from a peripheral like a keyboard? Does this mean that during these kind of operations like spawning a new subprocess or I/O operations puts the currently running process in kernel mode and gives it access to kernel low level functions? Here's the source: http://stackoverflow.com/questions/16707098/node-js-kernel- mode-threading


title: Accessing /home/user data from an Ubuntu system mounted as external drive on Debian wheezy

text: I just switched my Hard Drives and I would like to copy my data from the old HDD to the new HDD. I have mounted the old HDD at `/mnt`, it is a LVM Ubuntu partition. What I would like to do is copy my old user directory which should be located under under `/mnt/home/user1`. The `dir` however seems to be protected or unaccessible, I can't remember if I have encrypted the data or not. In my file manager I get a lock symbol and when I open the dir it is empty! **Update:** I have opened it with root rights, the lock disapears but the directory stays empty. Further the username and pwd were the same on the old and the new system if that helps. Is there a way to access the data on the mounted external LVM drive without switching the HDDs back and copy all data to a third drive first?               sudo fdisk -l     Disk /dev/sdb: 500.1 GB, 500107859968 bytes     255 heads, 63 sectors/track, 60801 cylinders, total 976773164 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x000b2653             Device Boot      Start         End      Blocks   Id  System     /dev/sdb1   *        2048      499711      248832   83  Linux     /dev/sdb2          501758   976771071   488134657    5  Extended     /dev/sdb5          501760   976771071   488134656   8e  Linux LVM          Disk /dev/mapper/ubuntu-root: 491.6 GB, 491635343360 bytes     255 heads, 63 sectors/track, 59771 cylinders, total 960225280 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x00000000          Disk /dev/mapper/ubuntu-root doesn't contain a valid partition table          Disk /dev/mapper/ubuntu-swap_1: 8162 MB, 8162115584 bytes     255 heads, 63 sectors/track, 992 cylinders, total 15941632 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x00000000          Disk /dev/mapper/ubuntu-swap_1 doesn't contain a valid partition table      And mount of the partition as requested:               mount     /dev/mapper/ubuntu-root on /mnt type ext4 (rw,relatime,user_xattr,barrier=1,data=ordered)


title: How to record Skype calls (audio) on Debian 6?

text: I conduct business over Skype. Sometimes when I talk to clients they give a lot of instructions real quick. It would be nice to have a way to record conversations so that I could listen to them at a later point of time when I need them. I have noticed people suggesting 'recordmydesktop', 'xvidcap', and 'ffmpeg' for recording. However, I DO NOT want to record video. I just want to record voice calls **while having my headphones on**. This means that I should be able to record the sound **inline** , not record it externally by pulling out my headphones and putting my clients on speaker (I know they can hear that, and they don't like it). If there are ways you know that can solve my problem on a Debian 6 system, please let me know.


title: Where to I copy mouse cursor themes in xfce 4.8

text: I'm running Debian wheezy, xfce 4.8.   Where do I copy mouse cursor themes I downloaded from xfce-look? If you can give me the location to copy themes, icons, and cursors I would really appreciate it.


title: Has the GNU coreutils stat tool changed?

text: Has the GNU coreutils (8.6) version of `stat` changed? After a recent update, some scripts I wrote that call stat are not working as expected; in particular, I had been making use of `stat -c %Y "${filename}"`. This is supposed to return the time of last modification in the form of seconds since "Epoch". However, I could have sworn this used to take the form of a whole integer. However, I'm now getting output from this of the form `1287630625.956667227` rather than `1287630625`. Since Bash can't handle floating point arithmetic, this is a litttle annoying. Is this a deliberate change? Or a bug? Or has my memory gone fuzzy? I tried searching for information on this, but couldn't find anything.


title: How to install after windows 8.1 with MBR partition

text: I have a laptop, which has a 500GB hard disk and with MBR partition, and I install my windows8.1 on it, but I left ~75G unused which I would like to use it for OpenSuse13.1. Now I have 2 USB, one is Gnome Live 13.1, another is standard DVD install ISO. I tried to insert Gnome live 13.1 and no problems, it recognized my unused 75G partition, and recommend my Linux partition as below:               /dev/sda6 --> swap          /dev/sda7 --> /          /dev/sda8 --> /home      I cancelled this installation and try with DVD iso, and now I get an error when I try to use my 75G unused partition as below: Your system states that it requires an EFI boot setup, since the selected disk does not contain a GPT disk label YaST will create a GPT label on this disk. You need to mark all partitions on this disk for removal. I would like to keep my windows and create a dual boot system, but I am stuck here. anyone please give me some suggestions? ![Error](http://i.stack.imgur.com/PSSId.jpg)


title: How come I installed Ubuntu 64 bit on a Pentium 4 machine?

text: I have just tried booting the Ubuntu 10.10 64 bit live USB on this machine and to my amazement everything works fine. I even installed the system, after which I checked with `uname -a` and the result is > Linux T205-04 2.6.35-22-generic #33-Ubuntu SMP Sun Sep 19 20:32:27 UTC 2010 > x86_64 GNU/Linux This is quite confusing to me. To my knowledge Pentium 4 is 32 bit only. How was that possible? Below is the result of `cat /proc/cpuinfo` (there are 2 CPUs, but the information is the same)               processor       : 1     vendor_id       : GenuineIntel     cpu family      : 15     model           : 4     model name      : Intel(R) Pentium(R) 4 CPU 3.00GHz     stepping        : 3     cpu MHz         : 2800.000     cache size      : 2048 KB     physical id     : 0     siblings        : 2     core id         : 0     cpu cores       : 1     apicid          : 1     initial apicid  : 1     fpu             : yes     fpu_exception   : yes     cpuid level     : 5     wp              : yes     flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov      pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm      constant_tsc pebs bts pni dtes64 monitor ds_cpl est cid cx16 xtpr     bogomips        : 6000.41     clflush size    : 64     cache_alignment : 128     address sizes   : 36 bits physical, 48 bits virtual     power management:


title: How can I see what processes are running?

text: I use Ubuntu Server 10.10 and I would like to see what processes are running. I know that PostgreSQL is running on my machine but I can not see it with the `top` or `ps` commands, so I assume that they aren't showing all of the running processes. Is there another command which will show all running processes or is there any other parameters I can use with `top` or `ps` for this?


title: Self cache-proxying all outcoming http/https request

text: Is there a way to setup squid (or another caching proxies) to cache any http/https request from my own computer? i will use it to record all request and get the downloaded files from software that does not show the url's or redownload packages that already been downloaded (such as Yaourt --> this package always redownload packages that already been downloaded, it's really takes too much bandwidth for big packages)


title: How to upgrade PHP to 5.3 on Debian 5.0 (Lenny)?

text: I currently have PHP 5.0 installed on my Debian VPS and was wondering how I would be able to upgrade it to PHP 5.3 and keep all of my installed modules running.


title: How do I disable udevd in systemd?

text: I'm trying to boot a Fedora Rawhide LXC container from a Fedora 16 host, and it's not working - `systemd` just keeps dropping into emergency mode. Because `udevd` doesn't work in LXC containers, I thought I'd try disabling `udevd` inside the guest, but I can't manage to do this. You'd think that               systemctl disable udev.service      would do the trick, but it doesn't. I can see that `udevd` is still being spawned by running `pstree` in the host.


title: Accidental modified SELinux context on root account to staff_u

text: I logged in as a normal account(test) on my CentOS 6.5 VM and `sudo su - root` and run `usermod -Z staff_u test` but looks like it changed my root account to staff_u as well, now I am stuck, could not change it back.               bash-4.1# id     uid=0(root) gid=0(root) groups=0(root) context=staff_u:staff_r:staff_t:s0-s0:c0.c1023     bash-4.1# id -Z     staff_u:staff_r:staff_t:s0-s0:c0.c1023     bash-4.1# bash     bash: /root/.bashrc: Permission denied     bash-4.1# setenforce 0     setenforce:  setenforce() failed     bash-4.1# sudo setenforce 0     setenforce:  setenforce() failed     bash-4.1# cd .ssh     bash: cd: .ssh: Permission denied     bash-4.1# cd      bash: cd: /root: Permission denied     bash-4.1# usermod -Z unconfined_u root     usermod: cannot lock /etc/passwd; try again later.     bash-4.1# cat /etc/shadow     cat: /etc/shadow: Permission denied     bash-4.1#       Direct root login disabled, but don't think it will help anyway, any idea ? It is just a VM, does not really matter but would like to know how to fix this.


title: Can a Linux install be moved from one computer to another?

text: **split to here** I have a 16gb flash drive which I want to contain a portable Linux install. If I could just install Knoppix onto the flash drive, and have that work on any computer, I could do that. Would that work, or are hardware specific things set when you install?


title: What are some of these directories in the Linux kernel src?

text: When I uncompress the Linux kernel source code from Kernel.org, there are many folders. I know what most of them contain and their purpose. However, I cannot figure out or find on the Internet the purpose for the tools and samples directories. What are these two directories and what is their purpose?


title: No space left on device / No Inodes free OR used / Double mounting

text: For about a day now I can only create/`cp`/`mv` (through terminal or various GUI programs) files on my FAT16 formatted USB stick, of about a few bytes. Doing so with larger files reports `cannot create regular file 'XXX': No space left on device` I have a NTFS drive, and a USB stick with 2 FAT16 formatted partitions on it, attached to the computer.   * /dev/sda1 is the NTFS   * /dev/sdb1 is one of the FAT 16 formatted partitions   * /dev/sdc1 is the other the FAT 16 formatted partitions (Prior and after unplugging the USB stick while PC was `pm-suspend`'d, to clear space on the full drive - Seems this may have caused part/all of this issue in hindsight)   * /dev/sdb1 is the other the FAT 16 formatted partitions (After unplugging the USB stick while PC was `pm-suspend`'d `df` reported:                   Filesystem  1K-blocks   Used   Available  Use%  Mounted on         /dev/sdc1    1999360  1999360      0      100%  /media/sdc1         /dev/sdd1    1999360   822400   1176960   42%   /media/sdd1      `df -i` reported:                   Filesystem  Inodes  IUsed  IFree  IUse%  Mounted on         /dev/sdc1      0      0      0      -    /media/sdc1         /dev/sdd1      0      0      0      -    /media/sdd1      _Sub question: Any idea why there are no inodes reported??_ `df -i /dev/sda1` reported:                   Filesystem  Inodes   IUsed   IFree    IUse%  Mounted on         /dev/sda1   5539908  171718  5368190    4%   /media/sda1      `umount`'ng /dev/sdc1 didn't change the counts. I have verified through Windows that space available more-or-less marries with the 42% listed for the latest mounted device (/dev/sdd1). Any ideas on what is going on? **Edit 1:** The output of `du -k --max-depth=1 /media/sdc1` is:                  1856 /media/sdc1/dir1          32 /media/sdc1/dir2        1440 /media/sdc1/dir3       18144 /media/sdc1/dir4        8512 /media/sdc1/dir5       54304 /media/sdc1/dir6        3200 /media/sdc1/dir7       27200 /media/sdc1/dir8       41088 /media/sdc1/dir9       11520 /media/sdc1/dir10         128 /media/sdc1/dir11         128 /media/sdc1/dir12        1216 /media/sdc1/dir13        2464 /media/sdc1/dir14       12032 /media/sdc1/dir15        5824 /media/sdc1/dir16       29600 /media/sdc1/dir17       20928 /media/sdc1/dir18        5856 /media/sdc1/dir19        4352 /media/sdc1/dir20      659200 /media/sdc1/dir21      121600 /media/sdc1/dir22       22688 /media/sdc1/dir23         128 /media/sdc1/dir24        2144 /media/sdc1/dir25        6912 /media/sdc1/dir26       19968 /media/sdc1/dir27        9632 /media/sdc1/dir28         960 /media/sdc1/dir29        1088 /media/sdc1/dir30        2624 /media/sdc1/dir31         480 /media/sdc1/dir32     1142944 /media/sdc1


title: Is there a Homebrew-equivalent for limited access user accounts in Linux?

text: I have a few Linux servers that lack necessary `sudo` or `root` permissions, and I'm feeling kind of stuck with my options:   * hand-compile packages to a `~/local/` folder or some equivalent   * work with sysadmins to get some old version of whatever tool I'm wanting installed, likely never to be upgraded again   * try to roll my own homebrew, not having a clue how to do it Is there something for a user in my limited state to be able to locally compile and install various localized applications in the same way I use homebrew on my personal Mac at home?


title: Can close() block?

text: For example, if you close a pipe or socket that still has data in its write buffer that hasn't been read by the process on the other end, does close() block until the data is read or the other process dies?


title: Using software OpenGL rendering with X

text: I want to try the most basic OpenGL driver, in order to find out what's the problem of my X server with OpenGL. I want then to have X use software rendering for OpenGL, like windows do with `opengl.dll` with no driver installed. How can I do that? Didn't find anything when searching for `X OpenGL software rendering`. I'll be glad for a reference, and for the keywords I had to use in order to find out how to do that. I'm using `Xorg` in RHEL 5.3.


title: Why is there a separate package repository for Debian security updates?

text: Why don't they upload packages to the normal package repository? Is this a general convention (IE, do other distros separate the repositories also)?


title: Can using SFTP with HMAC-RIPEMD160 replace computing file hashes before and after transferring?

text: As part of my job I often find myself transferring lots of files between my computer and a remote storage space accessible over SFTP. To ensure the files' correct transfer I compute their SHA256 hashes prior to transferring them, transfer them, then verify these hashes on my computer. However, this can be very lengthy since I often download several gigabytes on my computer from the remote storage. Now, I have been curious about forcing SCP to use HMAC-RIPEMD160 to ensure message integrity (`-o MACs=hmac-ripemd160`). It's the strongest HMAC supported by my servers, and admittedly it is weaker than SHA256, but if I rely on SSH's own mechanisms to ensure message integrity, in principle it should be enough to not have to spend a long time calculating and then verifying file hashes when transferring stuff. So, to wrap it up: can I replace computing and verifying file hashes with using SCP with HMAC-RIPEMD160?


title: Flash Player not working for certain websites in Debian 7.5

text: I'm trying to use a website that uses Flash Player for instant video podcasts. Flash Player usually works, but when I'm trying to visit the page I get the following message: > express install is not supported on this operating system to upgrade please > visit flash player download center I have flash player nonfree from the Debian 7 repo, _and_ I've tried downloading from the website, but still no luck...


title: Find newest file. Multiple Filetype restrictions

text: I want to write a command that gives me the **newest file** in a directory **recursively**. But that's not my only limitation. The files has to be an **mp3** **or a jpg** file. ( **case insensitive** prefered) I only need the creating date of that newest file. If possible I want it formatted like this: 30-12-2014 (so: **day-month-year** ) This is currently wath I've got:               find .  -name '*.mp3' -or -name '*.JPG'   -printf "%TD \n" | sort -rn | head -n 1      But it doesn't work well. I only get JPG's and the date isn't formatted.


title: iptables rule no actions on scapy packets

text: I wrote this rule to change all `udp` destination IP addresses to `8.8.8.8` when `dport` is 53:               iptables -t nat -A OUTPUT -p udp -m udp --dport 53 -j DNAT --to-destination 8.8.8.8      The rule worked when I used:               dig +short iranled.com @4.2.2.4      `tcpdump` output is:               04:42:38.023348 IP 192.168.1.2.48984 > 8.8.8.8.53: UDP, length 29     04:42:38.242241 IP 8.8.8.8.53 > 192.168.1.2.48984: UDP, length 45      it is OK. But when I create this packet from `scapy`, the `iptables` rule has no result!               sr1(IP(dst="4.2.2.4")/UDP()/DNS(rd=1,qd=DNSQR(qname="iranled.com")))      `tcpdump` output is:               04:43:00.442453 IP 192.168.1.2.53 > 4.2.2.4.53: UDP, length 29     04:43:00.855930 IP 4.2.2.4.53 > 192.168.1.2.53: UDP, length 45      why aren't `scapy` packets changed by `iptables`? **UPDATE** :               #iptables -L -n --line-numbers          Chain INPUT (policy DROP)     num  target     prot opt source               destination              1    ACCEPT     tcp  --  127.0.0.1            0.0.0.0/0            tcpflags:! 0x17/0x02     2    ACCEPT     udp  --  127.0.0.1            0.0.0.0/0                3    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0                4    ACCEPT     icmp --  0.0.0.0/0            0.0.0.0/0            limit: avg 10/sec burst 5     5    DROP       all  --  0.0.0.0/0            255.255.255.255          6    DROP       all  --  0.0.0.0/0            192.168.1.255            7    DROP       all  --  224.0.0.0/8          0.0.0.0/0                8    DROP       all  --  0.0.0.0/0            224.0.0.0/8              9    DROP       all  --  255.255.255.255      0.0.0.0/0                10   DROP       all  --  0.0.0.0/0            0.0.0.0                  11   DROP       all  --  0.0.0.0/0            0.0.0.0/0            state INVALID     12   LSI        all  -f  0.0.0.0/0            0.0.0.0/0            limit: avg 10/min burst 5     13   INBOUND    all  --  0.0.0.0/0            0.0.0.0/0                14   LOG_FILTER  all  --  0.0.0.0/0            0.0.0.0/0                15   LOG        all  --  0.0.0.0/0            0.0.0.0/0            LOG flags 0 level 6 prefix "Unknown Input"          Chain FORWARD (policy DROP)     num  target     prot opt source               destination              1    ACCEPT     icmp --  0.0.0.0/0            0.0.0.0/0            limit: avg 10/sec burst 5     2    LOG_FILTER  all  --  0.0.0.0/0            0.0.0.0/0                3    LOG        all  --  0.0.0.0/0            0.0.0.0/0            LOG flags 0 level 6 prefix "Unknown Forward"          Chain OUTPUT (policy DROP)     num  target     prot opt source               destination              1    ACCEPT     tcp  --  192.168.1.2          127.0.0.1            tcp dpt:53     2    ACCEPT     udp  --  192.168.1.2          127.0.0.1            udp dpt:53     3    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0                4    DROP       all  --  224.0.0.0/8          0.0.0.0/0                5    DROP       all  --  0.0.0.0/0            224.0.0.0/8              6    DROP       all  --  255.255.255.255      0.0.0.0/0                7    DROP       all  --  0.0.0.0/0            0.0.0.0                  8    DROP       all  --  0.0.0.0/0            0.0.0.0/0            state INVALID     9    OUTBOUND   all  --  0.0.0.0/0            0.0.0.0/0                10   LOG_FILTER  all  --  0.0.0.0/0            0.0.0.0/0                11   LOG        all  --  0.0.0.0/0            0.0.0.0/0            LOG flags 0 level 6 prefix "Unknown Output"          Chain INBOUND (1 references)     num  target     prot opt source               destination              1    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED     2    ACCEPT     udp  --  0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED     3    LSI        all  --  0.0.0.0/0            0.0.0.0/0                     Chain LOG_FILTER (5 references)     num  target     prot opt source               destination                   Chain LSI (2 references)     num  target     prot opt source               destination              1    LOG_FILTER  all  --  0.0.0.0/0            0.0.0.0/0                2    LOG        tcp  --  0.0.0.0/0            0.0.0.0/0            tcpflags: 0x17/0x02 limit: avg 1/sec burst 5 LOG flags 0 level 6 prefix "Inbound "     3    DROP       tcp  --  0.0.0.0/0            0.0.0.0/0            tcpflags: 0x17/0x02     4    LOG        tcp  --  0.0.0.0/0            0.0.0.0/0            tcpflags: 0x17/0x04 limit: avg 1/sec burst 5 LOG flags 0 level 6 prefix "Inbound "     5    DROP       tcp  --  0.0.0.0/0            0.0.0.0/0            tcpflags: 0x17/0x04     6    LOG        icmp --  0.0.0.0/0            0.0.0.0/0            icmptype 8 limit: avg 1/sec burst 5 LOG flags 0 level 6 prefix "Inbound "     7    DROP       icmp --  0.0.0.0/0            0.0.0.0/0            icmptype 8     8    LOG        all  --  0.0.0.0/0            0.0.0.0/0            limit: avg 5/sec burst 5 LOG flags 0 level 6 prefix "Inbound "     9    DROP       all  --  0.0.0.0/0            0.0.0.0/0                     Chain LSO (0 references)     num  target     prot opt source               destination              1    LOG_FILTER  all  --  0.0.0.0/0            0.0.0.0/0                2    LOG        all  --  0.0.0.0/0            0.0.0.0/0            limit: avg 5/sec burst 5 LOG flags 0 level 6 prefix "Outbound "     3    REJECT     all  --  0.0.0.0/0            0.0.0.0/0            reject-with icmp-port-unreachable          Chain OUTBOUND (1 references)     num  target     prot opt source               destination              1    ACCEPT     icmp --  0.0.0.0/0            0.0.0.0/0                2    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED     3    ACCEPT     udp  --  0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED     4    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0


title: When do I use cp --attributes-only

text: Doing some study on basic Unix commands and trying to get an example when I want to use the following command line option `\--attributes-only` for command `cp` here is from `cp` man page               --attributes-only                   don't copy the file data, just the attributes


title: How to search for video files on Ubuntu?

text: I had downloaded a video a few months back. I'm not very well remembering the name by which it is saved. Is there any command or any method that will output only video files so that I can search for my video there? From man pages, I couldn't find any option of find doing that work. The video file I downloaded may have any extension (like webm etc) and also it may be possible that I had that time changed the name to anything like 'abcde' which I don't remember now. So the search can't be based on file name! (Just mentioning one similarity: In perl there are commands to check whether a file is text file or binary , etc. Similarly there may be a way to check if its video file or multimedia file)


title: RAID6 scrubbing mismatch repair?

text: You can initiate a scrub of a mdadm array with `echo 'check' > /sys/block/mdX/md/sync_action`, and if a bad sector is found, it'll rewrite it automatically (from a mirror or from parity information for RAID5/6). However if all blocks read successfully but are found to not be consistent, then this is regarded as a mismatch. In this case repair is complicated because mdadm cannot tell which mirror contains the correct data (RAID1/10) or whether it is data or parity that is corrupted (RAID5). In theory this is not the case with RAID6 if I understand RAID6 correctly. Because double-parity exists, it should be possible to pinpoint where a single corruption is, whether it is data or parity.   1. Is my understanding correct, should this be possible in theory?   2. If correct, is mdadm able to repair this inconsistent data without guessing which block is corrupted?


title: GTK applications don't get the icon theme selected in KDE

text: I changed my KDE icon theme to KFaenza (but it doesn't matter: happens with any other icon theme I choose) and would like to have consistent icons across both KDE applications and GTK applications. However, no matter which theme I choose, the GTK applications still use another theme (looks like it's Oxygen). For an example of what I mean, look at this picture and compare the first icon in each toolbar (the icon for the _new file_ feature of both programs) - the Qt program (top) shows the correct icon, but the GTK (bottom) doesn't: ![enter image description here](http://i.stack.imgur.com/MxofM.png) This happens even if I use another program (like lxappearance) to set the icon theme manually. I have Fedora 20 with KDE 4.11.4. What to do?


title: Hardware requirements for building a Debian server that will run as ltsp, vpn, and fileserver

text: I will be building a server based on Debian that will have several functions in a small office (5-10 users). The primary function will be as a file server, but I would like to set the office up to use only thin clients connected to this single computer. Additionally I have the requirement that users be able to log into their clients remotely over a VPN. I know that a VPN requires two network cards, 1 to the internet and 1 to the LAN. LTSP also uses two network cards, 1 to the internet and 1 to the LAN. For a server to do both do I need to have more than two cards? (i.e. one to the internet and two to the LAN)


title: visudo/sudoedit and gvim --remote-silent

text: Is it possible to use `gvim --remote-silent` and similar as an editor for visudo and sudoedit? Actually, I don't think this is related to the `\--remote` option. Even if I set `Defaults editor = "/usr/bin/gvim"`, the tmpfile gvim loads is blank and editing it has no effect.


title: How to restore my system after reinstalling Ubuntu?

text: I'm presently having Ubuntu 13.04. I am wishing to change it to the next version by installing the next version i.e. Ubuntu 13.10 using bootable DVD. For that I will 1st download .iso image from Internet and burn it. Now, what I want to know is how to restore my system to the current state after the fresh install. I explain what I mean: I have taken back up of my /, /boot & /home partition (in the current Ubuntu 13.04). Now for the fresh install the current O.S. will be replaced or removed. Then after my system has Ubuntu 13.10, what do I need to do so that my backed up partitions are restored? Is it simply running commands for restoring (like I run tar or cpio or dd command)? This is the 1st time I'm restoring my system after fresh install. If I simply run commands for restoring (say for ex. my '/' file system ) then won't it replace the files on the Ubuntu 13.10 (that are specific to the new O.S.) with those of the old version? If so , then it may make my system not work like Ubuntu 13.10. I'm unclear on this. In other words, are the files residing on / & /boot file system makes the O.S. behave as that particular O.S. If so, then they can't be replaced!!


title: Exclude directory in find

text: How can I find every file and directory matching a pattern, excluding one directory using `find`? Say I have the following file structure;               .       foo-exclude-me/         foo.txt       foo-exclude-me-not/         foo.txt       bar/         foo.txt         foobar/           bar.txt           foofoo.txt      how would I get the following output using `find`:               ./bar/foo.txt     ./bar/foobar     ./bar/foobar/foofoo.txt     ./foo-exclude-me-not     ./foo-exclude-me-not/foo.txt      I have tried using both of the following command:               find . -name 'foo-exclude-me' -prune -o -name 'foo*'     find . -name 'foo*' \! -path './foo-exclude-me/*'      but both of them return this:               ./bar/foo.txt     ./bar/foobar     ./bar/foobar/foofoo.txt     ./foo-exclude-me # << this should be excluded     ./foo-exclude-me-not     ./foo-exclude-me-not/foo.txt      How can I properly exclude the `foo-exclude-me` directory?


title: Setup of DNS zone with secure zone updates

text: How do I run a `dns` server with a zone for a local domain and be able to add dynamic entries to the `dns` zone securely from selected hosts? I have tried to setup a domain 'rag.local' with bind9. I have tried to add a new record to that zone using `TSIG`. It works now. The steps are below. Used dnssec to generate secret key for the zone               $ dnssec-keygen -r /dev/urandom -a HMAC-MD5 -b 512 -n HOST rag.local     $ ls -l      -rw------- 1 rag rag 118 Mar  7 23:22 Krag.local.+157+26937.key     -rw------- 1 rag rag 229 Mar  7 23:22 Krag.local.+157+26937.private      Copied .key to /etc/bind               /etc/bind$ ls -lt     -rw-r--r-- 1 root bind  265 Mar  7 23:43 rag.local     -rw-r--r-- 1 root bind  435 Mar  7 23:35 named.conf.local     -rw------- 1 root bind  118 Mar  7 23:33 Krag.local.+157+26937.key      named.conf.local               /etc/bind$ cat named.conf.local           key "rag.local." {       algorithm hmac-md5;       secret "secret-key";     };          zone "rag.local" {             type master;             file "/etc/bind/rag.local";             allow-update { key "rag.local."; };     };      rag.local zone definition. EDIT: this file earlier did not have a valid name server and admin email for the zone. also the zone file missed an A record for the name server.               /etc/bind$ cat rag.local     ;     ; BIND data file for local loopback interface     ;     $TTL    604800     @   IN  SOA ns.rag.local. admin.rag.local. (                       2     ; Serial                  604800     ; Refresh                   86400     ; Retry                 2419200     ; Expire                  604800 )   ; Negative Cache TTL     ;     @   IN  NS  ns.rag.local.     @   IN  A   127.0.0.1     ns  IN  A   127.0.0.1     @   IN  AAAA    ::1      You may get some error like below if zone file is not valid               Mar  8 00:00:44 rag-tos-laptop named[20349]: zone rag.local/IN: journal rollforward failed: no more     Mar  8 00:00:44 rag-tos-laptop named[20349]: zone rag.local/IN: not loaded due to errors.      EDIT: after the zone file is corrected               Mar  8 00:23:43 rag-tos-laptop named[21469]: zone rag.local/IN: loaded serial 2     Mar  8 00:23:43 rag-tos-laptop named[21469]: zone localhost/IN: loaded serial 2      A sample nsupdate file               $ cat nsupdate.txt      server localhost     debug yes     zone rag.local.     update add host1.rag.local. 3600 A 10.20.30.40     show     send      Ran update                nsupdate -k Krag.local.+157+26937.private -v nsupdate.txt       Requires write permissions to `bind` group on `/etc/bind` to solve a few permissions issues. Thanks


title: Replacing tmux with exec

text: I'm using tmux from a while and I'm very happy with it. Since I need it most of the time, I made it my default shell (in guake, to be precise). This is nice and I'm perfectly fine with this. But from time to time, I need to exit tmux and having a clean shell, but since I'm defaulted with tmux, terminating the session will result in another tmux later. So, my question is: is it possible to replace the _tmux process_ with a given shell? Something like `exec` which, of course, doesn't work, because it replacess the shell inside tmux and not tmux itself.


title: Duplicating Opera icon in Gnome Shell Dash

text: When I launch Opera manually I have a single icon in the Dash (red icon on top). But when restarting Gnome Shell (with Opera running) or having Opera restored from saved session on login, another Opera icon appears (see the bottom icon) which looks slightly different from the first one. I don't have any idea why it happens or what I need to do to help you locate the problem, so any advice is appreciated. I'm running RFRemix, a Fedora-based Linux distribution, and have Opera installed from a RFRemix repo.


title: getting list of children processes by a background shell function

text: I have a bash script, in which I call function in a background:               process_manager $1 $2 $3 &      The function runs / executes commands that are passed as an argument in the background. How can I get a list of child processes in the function process_manager ? I tried doing that:               process_manager () {       count=$1       interval=$2       cmd=$3       bash_pid=$$       last_pid=$!            echo "bash_pid: $bash_pid, ppid: $PPID, last_pid: $last_pid"       $cmd &       $cmd &       sleep 30 &     }          process_manager $1 $2 $3 &     process_manager $1 $2 $3 &     process_manager $1 $2 $3 &      But here function process_manager won't display $! or $last_pid when its called for the first time. How should I get $last_pid in that situation and to be able to access children process list?


title: conditional coloring in grep

text: I have a simple `bash` script. One line of my script matches a "pattern" with grep and colors the match               grep -i --color=always -- "$1"      I need to modify it, so that it only colors the match, if the line is not a comment (i.e. if it does not start with a `#`). In other words: I still want grep to match the commented line, but without coloring it. Let's say I have following text file (with added line numbers)               1 aaa PATTERN     2 bbb ccc PATTERN ddd     3 # eee PATTERN     4 fff ggg      I need my grep expression to match lines 1,2,3 but only color the lines which are not commented (1 and 2)


title: What is the effect of rsync --block-size on large files?

text: I want to backup a few terabytes of large files (500mb to 1500mb each) to a backup server (BULK storage) via rsync. For this I use the following command (updated with suggestions from @Gilles): ~~`rsync --stats --progress --ignore-existing --recursive --exclude ".*" /from/ /to`~~               rsync --stats --progress  --archive --update --exclude ".*" /from/ /to       My transfer speeds are ~40MB/s. I think this speed is limited by the BULK storage system on the other site of the line. (SSD --> 1000mbits/s --> BULK storage) As I know I will rsync mainly big files, is it useful to specify the block- size for speeding up my transfer? If it does speed up my transfer, will it be reasonably more?


title: Router Firmware for wm8505 netbook

text: Is there any router firmware that is Linux based that will work on an ARM- WM8505 CPU with a 2 GB hard drive (I think nand flash) and 128MB of RAM. My netbook is useless so I want it to be a router to share 3g data with USB datacard. or tell me to support 3g datacard on android. It has android 1.6 installed by myself (Windows CE 6.0 before). But it does not support my 3g dongle, it's an bluei 3g datacard. Is there any driver for it to use my datacard?


title: Tape device file does not exist

text: I am trying to Read / Write data into my HP LTO3 1X8 Autoloader Tape drive. I have the required drivers installed. When I ran `rpm -qa | grep mt-st` I got:               mt-st-1.1-5.el6.x86_64      Further when I ran `cat /proc/scsi/scsi` I got:               Host: scsi1 Channel: 00 Id: 00 Lun: 00       Vendor: NECVMWar Model: VMware IDE CDR10 Rev: 1.00       Type:   CD-ROM                           ANSI  SCSI revision: 05     Host: scsi2 Channel: 00 Id: 00 Lun: 00       Vendor: VMware   Model: Virtual disk     Rev: 1.0       Type:   Direct-Access                    ANSI  SCSI revision: 02     Host: scsi2 Channel: 00 Id: 01 Lun: 00       Vendor: HP       Model: 1x8 autoloader   Rev: 1.50       Type:   Medium Changer                   ANSI  SCSI revision: 03      Further `tapeinfo -f /dev/sg2`:               Product Type: Medium Changer     Vendor ID: 'HP      '     Product ID: '1x8 autoloader  '     Revision: '1.50'     Attached Changer API: No     SerialNumber: 'MXA0633052'     SCSI ID: 1     SCSI LUN: 0     Ready: yes      There is no device file st0 in my /dev location. So I tried to make it by some references from internet. I ran `mknod /dev/st0 c 9 0`, but when I use `mt` command               mt -f /dev/st0 status          /dev/st0: No such device or address      Please point me in right direction


title: What does a computer actually do with its spare CPU cycles?

text: When a computer is not running at full load, in the context of Linux, what does it _actually do_? Between scheduled threads, if there is nothing to do, does it spin wait? Does it enter some sleep state? When a computer reports it is at 20% load, does that actually mean (give or take) that it does nothing 80% of the time?


title: What to do when result from pipe is not last argument in next command

text: The example below shows what I want to do, namely take the result from my last pipe and put it into the middle of the next command (where I wrote `$RESULT_FROM_FIND_COMMAND`).               $ find . -name "*0.01*txt" | cp $RESULT_FROM_FIND_COMMAND $(awk '{{split($1,a,"/")} {print a[3]"_"a[4]"_"a[5]}}')      What variable or command must I use to achieve this? I'm using bash if that matters. Ps. note that awk should also take the result from find as an input.


title: Centos 6.2: Unable to open terminal after vbox save state

text: I'm experiencing this issue frequently. Usually, I work on my Centos 6.2 in VBox for a while and then close it by saving state (going to other machines or doing host work). Then, I resume my session in VBox and I have the following issues   1. Internet is down. The connection is lost.   2. Trying to restart the connection hangs the menu/machine   3. Can't open the terminal (it says loading and never open) Any body has an explanation/idea for what's going on.


title: Using Unison with colordiff

text: I want Unison to show the diffs with `colordiff`. I’ve got `diff = colordiff -u CURRENT2 CURRENT1 | less -R` in my config file but it seems like `Unison` pipes the output to plain `less` nonetheless, so I get raw escape sequences instead.


title: Failed dependencies trying to install package 'libxml2'

text: I am trying to install `libxml2`, but my system complains about dependencies. The dependent packages exist on system. The ultimate goal is to install `xml_grep2`, I have been trying various methods (`cpan`, etc).               [root@testserver xml]# rpm -ivh libxml2-2.9.0-1.x86_64.rpm       warning: libxml2-2.9.0-1.x86_64.rpm: Header V4 DSA signature: NOKEY, key ID de95bc1f       error: Failed dependencies:       libc.so.6(GLIBC_2.14)(64bit) is needed by libxml2-2.9.0-1.x86_64          [root@testserver xml]# yum install glibc       Package glibc-2.5-107.x86_64 already installed and latest version       Package glibc-2.5-107.i686 already installed and latest version          [root@testserver xml]# find / -name libc.so.6       /lib64/libc.so.6       /lib/libc.so.6       /lib/i686/nosegneg/libc.so.6


title: Problem with small bash script

text: I often run `find` in my code projects when I make a change somewhere and I have to find where it impacts other pieces of code, so I thought about writing a very small script to make this easier, call it `blah.sh`:               #!/bin/bash -eu          if [ $# -ne 3 ]; then         echo "Three inputs required"     else         find $1 -name $2 -exec grep -iHn $3 {} \;     fi      The problem is, I get an error when the third argument (the text I'm looking for) contains a space. For example, `blah . '*.php' 'foo bar'` returns `grep: bar: No such file or directory` for each file `grep` tried to explore. I'm sure it's a silly mistake, I'm not really hands on with bash..


title: OpenVPN autostart with systemd

text: I enabled an openvpn globally by               systemctl enable openvpn@con.service      Which works well and I'm connected to my VPN after reboot. But once I suspend my laptop instead of rebooting, or simply lose the connection, I cant access to internet any more and have to do either a reboot or a `systemctl restart openvpn@con.service` How can I reconnect automatically to my VPN? An idea I have is to edit the openvpn@con.service manually and set a `Restart=always` and a `RestartSec=15`. But is that safe any longer? Wont my connection be interrupted? Is there a better solution? This is what my con.conf looks like:               client     dev tun0     proto udp     remote pw.openvpn.ipredator.se 1194     resolv-retry infinite     nobind          auth-user-pass /etc/openvpn/IPredator.auth     auth-retry nointeract          ca [inline]          tls-client     tls-auth [inline]     ns-cert-type server          keepalive 10 30     cipher AES-256-CBC     tls-cipher TLSv1:!ADH:!SSLv2:!NULL:!EXPORT:!DES:!LOW:!MEDIUM:@STRENGTH     persist-key     persist-tun     comp-lzo     tun-mtu 1500     mssfix     passtos     verb 3          <ca>     -----BEGIN CERTIFICATE-----     dummy     -----END CERTIFICATE-----     </ca>          <tls-auth>     -----BEGIN OpenVPN Static key V1-----     dummy     -----END OpenVPN Static key V1-----     </tls-auth>


title: How to produce a file encoded in Mac OS Roman

text: Inside a bash script I have a line that creates and then inside a loop, append strings to a text file, something like               echo $myTextString >> file.txt       I need this final file to be formatted using **Western (Mac OS Roman)**. The file does not exist when the script starts, so the first appending line will create the file. Is there a way to make the file be that format or convert it at the end to this Mac OS Roman format? How do I do that inside the bash script?


title: Is there a way to run process parallelly in the loop of a bash script

text: > **Possible Duplicate:**   >  Parallelizing a for loop The original code might look like this:                for i in *; do something.py $i; done      I was wondering whether I can run these jobs parallelly in the backgroud, such as:                for i in *; do something.py $i &; done      I tried and found the `&` here won't work.. Moreover, a better way might be that bash allow 8 jobs(or any number) run together **in the queue in background** , but I don't know how to do that... Does anyone have ideas about this? Thanks!


title: Moving Fedora to another computer

text: I have Fedora 16 - based server (file, MySQL, Web, SVN) that I am going to replace with a bigger machine. I plan to reinstall Fedora from scratch (with the help of `rpm -qa`). I am concerned that I am going to leave something important. Obviously, I am going to copy /home and /etc directories. But, for example, SVN database is in /var/svn, while MySQL is in /var/lib/mysql. I am concerned that I am going to miss some important runtime files. Can anybody point to some migration checklist for common packages? Over time I also put additional help to `usr/share/docs` but I don't know how whether it's easier to backup and restore, or simply install from scratch. I read this post and several others, but it deals mainly with how to move linux without reinstalling. I'd rather reinstall (and I plan to make a few changes anyway), but I won't have both machines for more than a few hours - so backing up everything important is my main question.


title: Interactive tree command

text: Is there any version of `tree` command that displays file structure as a tree structure, but in a way that I can interactively walk trough? Why do I need it exactly - I am trying to simulate TextMate project drawer using `vim` and splitscreen with `screen` and "interactive" `tree` on the left. But if there is any better way than that, I would also like to hear it.