Udev taking 15 seconds to detect mouse

Whenever my mouse, a SteelSeries Xai, is plugged in, there is a 15 second delay until the mouse is properly recognized and starts working. This is specially troublesome at boot, where udev waits for 15 seconds doing nothing. The following is the relevant information that I found on `dmesg` at boot:               [    1.238572] hidraw: raw HID events driver (C) Jiri Kosina     [   16.249791] usbcore: registered new interface driver usbhid     [   16.249794] usbhid: USB HID core driver     [   16.250382] input: Ruling Technologies Sdn. Bhd. SteelSeries Gaming Device as /devices/pci0000:00/0000:00:1d.0/usb6/6-1/6-1:1.0/input/input1     [   16.250463] hid-generic 0003:1038:1360.0001: input,hidraw0: USB HID v1.00 Mouse [Ruling Technologies Sdn. Bhd. SteelSeries Gaming Device] on usb-0000:00:1d.0-1/input0     [   16.250608] input: Ruling Technologies Sdn. Bhd. SteelSeries Gaming Device as /devices/pci0000:00/0000:00:1d.0/usb6/6-1/6-1:1.1/input/input2     [   16.250642] hid-generic 0003:1038:1360.0002: input,hidraw1: USB HID v1.00 Keyboard [Ruling Technologies Sdn. Bhd. SteelSeries Gaming Device] on usb-0000:00:1d.0-1/input1     [   16.254873] hid-generic 0003:1038:1360.0003: hiddev0,hidraw2: USB HID v1.00 Device [Ruling Technologies Sdn. Bhd. SteelSeries Gaming Device] on usb-0000:00:1d.0-1/input2      As you can see, for 15 seconds, `udev` is doing nothing. However, when I unplug it and then re-plug it, the process is a bit different:               [22660.547752] usb 6-1: new full-speed USB device number 3 using uhci_hcd     [22665.718517] input: Ruling Technologies Sdn. Bhd. SteelSeries Gaming Device as /devices/pci0000:00/0000:00:1d.0/usb6/6-1/6-1:1.0/input/input19     [22665.718676] hid-generic 0003:1038:1360.0004: input,hidraw0: USB HID v1.00 Mouse [Ruling Technologies Sdn. Bhd. SteelSeries Gaming Device] on usb-0000:00:1d.0-1/input0     [22670.724539] input: Ruling Technologies Sdn. Bhd. SteelSeries Gaming Device as /devices/pci0000:00/0000:00:1d.0/usb6/6-1/6-1:1.1/input/input20     [22670.724665] hid-generic 0003:1038:1360.0005: input,hidraw1: USB HID v1.00 Keyboard [Ruling Technologies Sdn. Bhd. SteelSeries Gaming Device] on usb-0000:00:1d.0-1/input1     [22675.735427] hid-generic 0003:1038:1360.0006: hiddev0,hidraw2: USB HID v1.00 Device [Ruling Technologies Sdn. Bhd. SteelSeries Gaming Device] on usb-0000:00:1d.0-1/input2      Now it seems like it's recognizing parts of the mouse at 5 second intervals. The problem might be with the mouse. I had problems with it in the past on Linux, so I won't discard it. However, I'm interested in _at least_ a workaround so my boot process doesn't take so long (it's about 45s to the DE, so 15s of nothing is _a lot_ ). If whenever I plug it in I still have to wait 15 seconds, that's fine. The mouse works OK and doesn't reconnect by itself. So: Is there a way to speed up the detection of a device, even if it's manually? Or: Is there anything I can do to `udev` so it doesn't wait at boot for this particular device to respond?


How do I pass a comand-line program a list of files from a directory?

I am trying to upload documents to my `Microsoft OneDrive` account using `python-onedrive`. The command I am using is this:               onedrive-cli put Long\ Filename\ 1.jpg     onedrive-cli put Long\ Filename\ 2.jpg      The problem is that there are a lot of these files, and I want to upload all of them (There is no option to upload an entire directory). I have using the asterisk but that doesn't work either:               user@office-debian:~/Desktop/docs$ onedrive-cli put *     usage: onedrive-cli [-h] [-c path] [-p] [-i] [-e enc] [--debug]                              {auth,quota,recent,info,info_set,link,ls,mkdir,get,put,cp,mv,rm,comments,comment_add,comment_delete,tree}                         ...     onedrive-cli: error: unrecognized arguments: Long Filename 1.jpg Long Filename 2.jpg      I presume this is because the program expects the spaces to be escaped, but the asterisk doesn't expand them that way. I have tried "piping" the arguments to no avail:               user@office-debian:~/Desktop/docs$ ls | onedrive-cli put     usage: onedrive-cli put [-h] [-n] file [folder]     onedrive-cli put: error: too few arguments      Evidently `onedrive-cli` doesn't recognise `STDIN`. Are there any other simple options left? I realise I could probably write a script but I was really hoping to avoid that! The following seems to work, but it's not really what I had in mind:               for files in * ; do       onedrive-cli put "$files"     done


How to write bash script to configure my displays when HDMI is plugged in or unplugged

I have a notebook running Kubuntu Precise (12.04) which I occasionally use for watching videos. When I do, I plug in an HDMI cable connected to an A/V receiver with an HDMI monitor attached to it. When I watch videos this way, I still need to use the notebook display when I'm interacting with the system to control playback, etc. The text on the HDMI monitor is hard to read from where I sit. When I plug in the HDMI cable, Kubuntu detects it, but I have to go through a weird dance sequence (that works, but is convoluted) to get it setup correctly every time for both video and audio. To fix this, I'm trying to write a bash script with `xrandr` to do it right the first time. I got the basic idea from Peoro's answer to this U&L Q&A titled: A tool for automatically applying RandR configuration when external display is plugged in. ### About my script My script (included below) works, but needs improvement. It sets the video mode correctly for the HDMI monitor, but the LVDS1 monitor (on the notebook) changes to display only the upper left portion of the desktop - which is a problem because it cuts off window scroll bars on the right and the taskbar on the bottom. I tried fixing this with `--scale`, but my first attempt messed things up sufficiently that I had to reboot to get a working display back. Is there a way to make both displays show the same content, but with each one using it's own separate preferred resolution? Or, at least, a way to set the notebook display so that the whole desktop is still accessible when the HDMI display is in use? Since I'm debugging the script, it isn't cleaned up yet. I may want to make it do more later. ### My script               #!/bin/bash     ## hdmi_set     ## Copyleft 11/13/2013 JPmicrosystems     ## Adapted from     ## http://unix.stackexchange.com/questions/4489/a-tool-for-automatically-applying-randr-configuration-when-external-display-is-p     ## Answer by peoro          # setting up new mode for my VGA     ##xrandr --newmode "1920x1080" 148.5 1920 2008 2052 2200 1080 1089 1095 1125 +hsync +vsync     ##xrandr --addmode VGA1 1920x1080          ##source $HOME/bin/bash_trace     # default monitor is LVDS1     MONITOR=LVDS1          # functions to switch from LVDS1 to HDMI and vice versa     function ActivateHDMI {         echo "Switching to HDMI"         ##xrandr --output HDMI1 --mode 1920x1080 --dpi 160 --output LVDS1 --off         ##xrandr --output HDMI1 --same-as LVDS1         xrandr --output HDMI1 --mode 1920x1080         xrandr --output LVDS1 --mode 1366x768         MONITOR=HDMI1     }     function DeactivateHDMI {         echo "Switching to LVDS1"         xrandr --output HDMI1 --off --output LVDS1 --auto         MONITOR=LVDS1     }          # functions to check if VGA is connected and in use     function HDMIActive {         [ $MONITOR = "HDMI1" ]     }     function HDMIConnected {         ! xrandr | grep "^HDMI1" | grep disconnected     }          ## MONITOR doesn't do anything because it's not preserved between script executions     # actual script     ##while true     ##do         if HDMIConnected         then             ActivateHDMI         fi              if ! HDMIConnected         then             DeactivateHDMI         fi              ##sleep 1s     ##done      ### Output from xrandr Here's what xrandr sees:               bigbird@ramdass:~$ xrandr     Screen 0: minimum 320 x 200, current 1366 x 768, maximum 8192 x 8192     LVDS1 connected 1366x768+0+0 (normal left inverted right x axis y axis) 344mm x 194mm        1366x768       60.0*+        1360x768       59.8     60.0          1024x768       60.0          800x600        60.3     56.2          640x480        59.9       VGA1 disconnected (normal left inverted right x axis y axis)     HDMI1 connected (normal left inverted right x axis y axis)        1920x1080      60.0 +        1680x1050      60.0          1280x1024      60.0          1440x900       59.9          1280x720       60.0          1024x768       60.0          800x600        60.3          720x480        59.9          640x480        60.0          720x400        70.1       DP1 disconnected (normal left inverted right x axis y axis)


Test -n gives unexpected result

I understand `test -n <expression>` to return false if the expression evaluates to a string length of greater than 0. Why then does the following happen?               Macbook:~ echo ${#undeclared_variable}     0     Macbook:~ test -n $undeclared_variable && echo Foo     Foo      Bash 4.x My expectation is that since `test -n $undeclared_variable` should evaluate false, that Foo should not be echoed. If I use `[[ ]]` instead of test, it works as expected.


How can I keep user acccounts consistent accross multiple machines?

I now have a Raspberry Pi which runs Debian Wheezy. I have a couple machines (4 physical, 2 virtual) sitting here and I would like to unify the user accounts on those machines. The machines I run have the following Debian derivatives installed on them:   * Debian Wheezy (armhf)   * Debian Stable (amd64)   * Debian Unstable (amd64)   * Ubuntu 14.04 (amd64) How could I get the user accounts set up on all machines equally? I want that the name, the long name, password and the UID are consistent. In the future, I would like to unify other parts of the configuration, maybe   * HTCondor   * Mountpoints (Samba)   * `/etc/apt/sources.list`   * Unattended Updates Since I use different Ubuntu and Debian variants, the `sources.list` will differ a bit, but it will be the same on each distribution. What would be a good approach to this?


Is the maximinm value of network.http.pipelining.maxrequests still 8?

I've detected some slowness in Firefox 17 under Fedora 18, so I decided to modify some configuration options. So, the question is: Does someone know if the maximum value of **network.http.pipelining.maxrequests** is still 8? I find people saying that if I put more than 8, it will be ignored. It seems weird to me that the default value of Fedora and also Centos is 32.


Use output from head to copy files with spaces

I have 11 files with spaces in its name in a folder and I want to copy the newest 10. I used `ls -t | head -n 10` to get only the newest 10 files. When I want to use the expression in a cp statement I get an error that the files could not be found because of the space in the name. E.g.: `cp: cannot stat ‘10’: No such file or directory` for a file named `10 abc.pdf` The cp statement: `cp $(ls -t | head -n 10) ~/...` How do I get this working?


Grep search returning a different line

This is my grep search                grep 'Invoker_Slark*' true_pairscore.txt      But it returns the line `Invoker_Slardar`. Even though the file contains `Invoker_Slark`. Why is that?


How do I set up NFS to respect user and group permissions?

After creating an NFS share between two servers, **lb1** (nfs-client) and **data-server1** (nfs-kernel-server), users with permission on the NFS server do not have access on the NFS client. ## data-server1 configuration:               $ cat /etc/exports     /data  10.132.246.167(rw,no_subtree_check)     $ ls -la / | grep data     drwx--x--x  3 u1   users    4.0K Sep  6 03:55 data/     $ ls -la /data     drwxr-xr-x 3 u1       users    4.0K Sep  6 02:31 prod/     drwxrwsr-x 2 www-data www-data 4.0K Sep  6 02:31 keys/     $ awk -F: '$0=$1 " uid="$3 " gid="$4' /etc/passwd | grep 'root\|u1\|ftp\|www-data'     root uid=0 gid=0     www-data uid=33 gid=33     u1 uid=115 gid=100     ftp uid=999 gid=100      ## lb1 configuration:               $ mount 10.132.245.223:/data /data     $ mount     10.132.245.223:/data on /data type nfs4 (rw,relatime,vers=4,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=10.132.246.167,minorversion=0,local_lock=none,addr=10.132.245.223)     $ sudo -u u1 ls -la / | grep data     drwx--x--x  3 u1   users    4.0K Sep  6 03:55 data/     $ sudo -u u1 ls -la /data     drwxr-xr-x 3 u1       users    4.0K Sep  6 02:31 prod/     drwxrwsr-x 2 www-data www-data 4.0K Sep  6 02:31 keys/         $ awk -F: '$0=$1 " uid="$3 " gid="$4' /etc/passwd | grep 'root\|u1\|ftp\|www-data'     root uid=0 gid=0     www-data uid=33 gid=33     u1 uid=115 gid=100     ftp uid=999 gid=100          On the NFS server (ie, data-server1), root, u1, and ftp users have proper rwx permissions for the subdirectories of /data and can access the filesystem without any problems. However, on the NFS client (ie, lb1), root and ftp get `permission denied` errors when trying to simply list directory contents of `/data` within the NFS share. User u1 on the other hand, works perfect. This is one of my first usages of NFS


iptables to allow teamviewer

I'm having some trouble to allow TeamViewer in a restrictive iptables configuration. I'm running Fedora 20. After some research I found out TeamViewer uses ports 80, 443 and I have created this script to set up rules to allow those ports to be open but it still doesn't work:               #!/bin/bash     #clear iptables     iptables -F     iptables -X          #accept everything no matter port on localhost     iptables -A INPUT -i lo -j ACCEPT          #allow established connections     iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT     iptables -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT          #allow traffic going to specific outbound ports     iptables -A OUTPUT -p tcp --dport 80 -j ACCEPT     iptables -A INPUT -p tcp --sport 80 -j ACCEPT          iptables -A OUTPUT -p tcp --dport 443 -j ACCEPT     iptables -A INPUT -p tcp --sport 443 -j ACCEPT          iptables -A OUTPUT -p tcp --dport 5938 -j ACCEPT     iptables -A INPUT -p tcp --sport 5938 -j ACCEPT          iptables -A OUTPUT -p tcp --dport 53 -j ACCEPT     iptables -A INPUT -p tcp --sport 53 -j ACCEPT          iptables -A OUTPUT -p udp --dport 53 -j ACCEPT     iptables -A INPUT -p udp --sport 53 -j ACCEPT          #drop anything that doesnt match the rules above     iptables -A INPUT -j DROP     iptables -A OUTPUT -j DROP     iptables -A FORWARD -j DROP      With these rules I can access other machines with TeamViewer but I cannot have others access my machine. Also, when the default (boot) iptables are in place, I can receive and initiate TeamViewer connection. What am I missing? **EDIT 1** I just ran a packet trace and I can see loads of traffic going on on port 5938 but the PC connecting just says Connecting... and is not prompted for the password. **EDIT 2** I enabled the default set of rules which works and ran another packet trace and now I see that after a connection and some traffic going on on port 5938, I see a HTTP connection (port 80) being established to a TeamViewer server and before that I see a couple of DNS (port 53) requests for TeamViewer host names. All these ports are open in my restrictive setup yet I don't see the DNS requests and the HTTP connection... :-/ Connection to other hosts and sites works just fine. Actually I'm posting this EDIT using the restrictive set of rules. **EDIT 3** Just for peace of mind I removed the last three DROP rules and like this it works.


is it possible to lock a user into a give directory tree in bash?

I want to lock a user into a given directory tree. That is he/she can cd deeper into the tree but no higher out of the tree. Everything else in the environment should be the exact same. Edit: How can I do this without chroot. I am launching a bash via objective-c can creating a terminal-like application. I need to user to be able to access /usr/include and all the other places on they system, I just need them to be locked into a directory structure. chroot seems to require root privileges to run. Running bash in restrictive mode is to restrictive.


Copying files based on a condition

Here's the problem I'm attempting to solve:   * Let's say I have a directory "A", containing some files as well as some other directories.    * I want to copy all the files directly under directory A to directory B.   * I want to recursively copy all the folders inside folder A to folder C.  What is the shortest and less platform-specific way to accomplish this in UNIX/Linux?


"Home Directory / Not Ours" on boot

I get the line `Home Directory / Not Ours` repeated about 30 times when i boot Debian. This has recently started happening since i did an update where everything was stuffed up. eg. Gnome and gdm3 uninstalled and a whole lot of other things. is the best thing to do to reinstall Debian? Help Needed. PS. Would like not to reinstall.


iptables adding rules in OUTPUT chain

We can insert `iptables` rules based on IP/Network/Hostname:               iptables -t filter -A OUTPUT -p tcp -d www.google.com -j ACCEPT -m comment --comment "www.google.com"       It is not accepting:               iptables v1.4.7: host/network www.google.com not found     Try iptables -h' or 'iptables --help' for more information.


Limit Outgoing Bandwidth on an interface

I would like to know the easiest way to limit outgoing bandwidth for an interface. I want to cap the outgoing port speed so that file transfers between my servers don't fail during busy hours. What's the easiest solution? I know I could us `iptables` but I'm looking for a simple installation/configuration. Any suggestion would be great.


"mount -t TYPE /" - how to know that what could the "TYPE" be?

OS: ex.: Ubuntu 10.04 - how to know that what does the "mount -t TYPE" knows? I mean is there a command to list the supported filesystem types using with mount?? UPDATE: is the following cmd always good?:               cat /proc/filesystems | awk '{print $NF}' | sed '/^$/d'     sysfs     rootfs     bdev     proc     cgroup     cpuset     tmpfs     devtmpfs     debugfs     securityfs     sockfs     pipefs     anon_inodefs     inotifyfs     devpts     ext3     ext2     ext4     ramfs     hugetlbfs     ecryptfs     fuse     fuseblk     fusectl     mqueue     binfmt_misc     iso9660     vfat     udf     reiserfs     xfs     jfs     msdos     ntfs     minix     hfs     hfsplus     qnx4     ufs     btrfs


500:Internal Server Error from CGI program

I am trying to write a CGI Program which is invoked from a HTML page . The CGI code snippet is as follows:                #!/bin/bash      echo "Content-type: text/html"      echo  ""      echo ""      echo "Hi"      echo ""      echo ""      But after executing the script I can see the `500:Internal Server Error` in browser page. . Following can be seen in error log file               [Wed Apr 09 18:36:59 2014] [error] [client 127.0.0.1] malformed header        from script. Bad header=: image.sh     [Wed Apr 09 18:37:14 2014] [error] [client 127.0.0.1] malformed header      from script. Bad header=: image.sh


Pipe doesn't read my forked script

I have a problem. I modified a script called 'packer' a AUR-helper for Arch Linux. The problem coming when I apply my pipe, with a progress bar, doesn't show all info as I need. This is my forked script from packer, the next line install a program from AUR               echo > /tmp/packer-url-tmp          packer-postinstallerf -S --noconfirm --noedit alchemy         tee /tmp/packer-url-tmp |        stdbuf -oL sed '/\.\.\.$/ s/^/#/p' |        zenity --progress --title="packer progress" --pulsate --width=450 --auto-close      The output without a pipe and progress bar: http://pastebin.com/m0srNWkJ The above line, work fine without AUR packages; but when I install a AUR program disappears the previous information (build process) to installation. I do not understand the pipe with the progress bar should show this information. Only show the pipe with               :: ¿Continuar con la instalación? [S/n]     (1/1) verificando llaves en el llavero             [######################] 100%     (1/1) verificando la integridad de los paquetes    [######################] 100%     (1/1) cargando los archivos del paquete...         [######################] 100%     (1/1) verificando conflictos entre archivos        [######################] 100%     (1/1) verificando el espacio disponible en disco   [######################] 100%     (1/1) instalando alchemy                           [######################] 100%     Dependencias opcionales para alchemy         jpen: for tablet support      Please if my question isn't clear, I updated my question. I do not know how to clarify my question more :/.


How do I select files in a bash script that do not have an extension?

Let's say I have files xinitrc, alphabetsoup, ieat.pie in the current directory. Need a bash script to select only xinitrc and alphabetsoup.


How to remove unmet dependecies Debian 7 Wheezy

I'm trying to install different packages but it's showing unmet dependencies in most of them even after `sudo apt-get -f install`. Below is my `/etc/apt/sources.list` file:               #           # deb-src cdrom:[Debian GNU/Linux 7.1.0 _Wheezy_ - Official Multi-architecture i386/amd64/source DVD #1 20130615-23:45]/ wheezy main     # deb cdrom:[Debian GNU/Linux 7.1.0 _Wheezy_ - Official Multi-architecture i386/amd64/source DVD #1 20130615-23:45]/ wheezy main     #           #deb-src cdrom:[Debian GNU/Linux 7.1.0 _Wheezy_ - Official Multi-architecture i386/amd64/source DVD #1 20130615-23:45]/ wheezy main          #deb cdrom:[Debian GNU/Linux 7.1.0 _Wheezy_ - Official Multi-architecture i386/amd64/source DVD #1 20130615-23:45]/ wheezy main     #deb http://ftp.debian.org/debian/ squeeze main contrib non-free     #deb-src http://ftp.debian.org/debian/ squeeze main contrib non-free     ##################     ## Debian Stable  ##     ##################     # Stable     deb http://http.us.debian.org/debian/ squeeze main contrib non-free     # Stable Sources     deb-src http://http.us.debian.org/debian/ squeeze main contrib non-free          # Security Updates  http://www.debian.org/security/     deb http://security.debian.org/ squeeze/updates main contrib non-free          deb http://security.debian.org/ wheezy/updates main     deb-src http://security.debian.org/ wheezy/updates main          # wheezy-updates, previously known as 'volatile'     # A network mirror was not selected during install.  The following entries     # are provided as examples, but you should amend them as appropriate     # for your mirror of choice.     #     deb http://ftp.debian.org/debian/ wheezy-updates main     deb-src http://ftp.debian.org/debian/ wheezy-updates main


Interrupting very long output in tmux

In a (gnome) terminal, if I `cat` a file which turns out to be much too long, I can always press `Ctrl`-`c` to interrupt. However, in `tmux`, when the same happens, it takes long for the signal produced by the `Ctrl`-`c` keypress to reach the server, and until that happens, the server is busy with this output, and I'm unable to do anything but watching the flood (or using a different terminal). This is somewhat similar to the problem described here. I do not wish to restart the terminal, the server, or even the specific `tmux` window/pane; using `less` is a smart habit, but I'm asking here about how to solve problems that already occured, not how to be smart and avoiding them by thinking before acting... there will always be surprises! So, is there a way to let the terminal stop the floods, discard the sent data, etc.? Anything I can do to release myself from these annoying _minutes_ of watching characters on my screen?


How do I resolve samba share to IP address or host name

I have a list of hosts in the network providing shares via SAMBA. How can I determine either IP address or the host name of one particular host, e.g. the one with the name “SASAK02”. The output of `smbtree` is as follows               WORKGROUP         \\SASAK02                        \\SAURA-PC1                      \\PC-VAN-DAMME


Can I lock the root account during an install of Debian GNU/Linux 6 "squeeze"?

By default, Ubuntu locks account root; can I do the same, in Debian GNU/Linux 6 "squeeze", during install?


Arch Linux and optional dependencies

I installed XChat on an Arch Linux system. Every time I run it, I get the following error message:               Python interface loaded     Perl interface loaded     AutoLoad failed for: /usr/lib/xchat/plugins/tcl.so     libtcl8.5.so: cannot open shared object file: No such file or directory      So while the plugins for Python and Perl are loaded correctly, the Tcl plugin is not. In fact, `python2` and `perl` packages are installed on my system, while `tcl` package is not. Installing `tcl` fixes the problem. Before installing `tcl`, I get:               ldd /usr/lib/xchat/plugins/tcl.so | grep tcl         libtcl8.5.so => not found      After installing `tcl`, I get:               ldd /usr/lib/xchat/plugins/tcl.so | grep tcl         libtcl8.5.so => /usr/lib/libtcl8.5.so (0x00007fceba533000)      It seems that `tcl` is not a required dependency of `xchat`, but an optional one:               pacman -Qi xchat     ...     Optional Deps  : enchant: for spell checking support                      tcl: for tcl plugin                      python2: for python plugin     ...      Why is this the case? That is, why the `tcl` package is not installed along with `xchat` by default? Isn't `xchat` broken without `tcl`? I filed a bug more than two years ago, but I never really understood why things are this way in Arch Linux land. Please notice that while this bug is old, I'm only running this distribution on a daily basis since a couple of months, so I'm an Arch Linux newbie. I could have asked on Arch Linux forums or mailing lists, but I'm quite interested in knowing the point of view of other Linux distributions users. Arch Linux users are also welcome, of course. * * * EDIT.   1. The error message I get when running XChat without `tcl` installed is clearly visible in the GUI, in the same place where messages are displayed.   2. My question can also be reworded in the following way: why XChat, despite having clearly been built with `--enable-tcl` or equivalent passed to the `configure` script, can be installed without a mandatory dependency on the `tcl` package? If one don't want `tcl`, he should use `--disable-tcl`. * * * EDIT. I opened a thread on the Arch Linux forum, but I didn't get a satisfying answer. So I checked Debian and Gentoo, and it seems they don't have this problem.


What does "sudo chown -R hadoop:hadoop hadoop" do?

I saw the following script, posted online, that was used during the hadoop installation process.                 sudo tar xzf hadoop-0.20.2.tar.gz       sudo mv hadoop-0.20.2 hadoop       sudo chown -R hadoop:hadoop hadoop      I do not quite understand. What does the                   sudo chown -R hadoop:hadoop hadoop      do here? Thanks for the explanation.


Are there any alternatives to mutt?

I really like the idea of Mutt, reading mail in the terminal. I'm not really pleased with some inconsistencies and the imap handling. I set about trying to find some alternatives to mutt, but I can't seem to find any. What alternatives to the mutt e-mailclient for terminal exist for linux?


How to copy directory structure without removing symlinks?

I need to "install" a bunch of files to another directory keeping the directory structure of the source files intact. For example, if I have ./foo/bar/baz.txt going to /var/www/localhost/webroot/ I want the result to be /var/www/localhost/webroot/foo/bar/baz.txt. `rsync` has this capability in `--relative`, but when I did this I discovered it wasn't friendly to symlinks:               $ ls -ald /var/www/localhost/webroot/ | grep ^l     lrwxrwxrwx  1 www-data www-data     15 2014-01-03 13:45 media -> ../static/media     lrwxrwxrwx  1 root     root         13 2014-02-24 13:47 var -> ../static/var     $ rsync -qrR . /var/www/localhost/webroot/     $ ls -ald /var/www/localhost/webroot/ | grep var     drwxr-xr-x 3 root root 4096 2014-02-24 13:52 /var/www/localhost/webroot/var      So you see the symlink is no longer a symlink – the files were copied to the wrong place! `rsync` also has the `--no-implied-dirs` option, that superficially seems to do what I want, but it only works as I intend when _not_ doing a recursive rsync, so I have to:               find . -type f -print0 | xargs -0I{} rsync -R --no-implied-dirs {} /var/www/localhost/webroot/      Is there any more direct way to accomplish this mirroring of files without wiping out intermediate symlink directories (with or without rsync)?


How to measure the time when a packet arrives?

When the packet arrives the NIC generates an interrupt and the kernel then takes over. I want to measure the time at which a packet of a particular TCP flow arrives. How do I do this in Linux? This what tools like tcpdump do.


What stream does perf use?

What stream does the `perf` command use!? I've been trying to capture it with               (perf stat -x, -ecache-misses ./a.out>/dev/null) 2> results      following http://stackoverflow.com/q/13232889/50305, but to no avail. Why can I not capture the input... it's like letting some fish get away!!


Mounting /dev/dvd /media on VirtualBox

I have installed Scientific Linux on VirtualBox and I am trying to follow some exercises on a book I picked up. The first thing I need to do is:               mount /dev/dvd /media      But when I do that, I get               mount: you must specify the filesystem type      What I would like to do is mount the virtual DVD where I see that the DVD in the Options of VirtualBox has all the necessary files I need, but it won't let me mount. Can anyone tell me if something has been mis-configured or where I can check to see if it has been?


Linux hosts.deny settings are not applied

I want to make a bunch of websites unaccessible on my computer. My `hosts.allow` file:               sendmail: all     # /etc/hosts.allow: list of hosts that are allowed to access the system.     #                   See the manual pages hosts_access(5) and hosts_options(5).     #     # Example:    ALL: LOCAL @some_netgroup     #             ALL: .foobar.edu EXCEPT terminalserver.foobar.edu     #     # If you're going to protect the portmapper use the name "rpcbind" for the     # daemon name. See rpcbind(8) and rpc.mountd(8) for further information.      My `hosts.deny` file:               # /etc/hosts.deny: list of hosts that are allowed to access the system.     #                  See the manual pages hosts_access(5) and hosts_options(5).     #     # Example:    ALL: some.host.name, .some.domain     #             ALL EXCEPT in.fingerd: other.host.name, .other.domain     #     # If you're going to protect the portmapper use the name "rpcbind" for the     # daemon name. See rpcbind(8) and rpc.mountd(8) for further information.     #     # The PARANOID wildcard matches any host whose name does not match its     # address.     #     # You may wish to enable this to ensure any programs that don't     # validate looked up hostnames still leave understandable logs. In past     # versions of Debian this has been the default.     # ALL: PARANOID          ALL: .vk.com     ALL: .ria.ru     ALL: facebook.com      My `hosts` file:               127.0.0.1   localhost     127.0.0.1:82 testsecond     127.0.1.1   shc     127.0.2.2:81  someth.com     127.0.2.2:83 test          # The following lines are desirable for IPv6 capable hosts     ::1     ip6-localhost ip6-loopback     fe00::0 ip6-localnet     fe00::0 ip6-mcastprefix     fe02::1 ip6-allnodes     fe02::2 ip6-allrouters      I do follow all recommendations about settings hosts* files and I still CAN access them. I must do something really stupid or wrong. For me it looks like they are just ignored.


Convert string into date time stamp in gawk or awk

I want to convert following string ( **20140805234656** ) into date time stamp ( **2014-08-05 23:46:56** ).I am new to gawk and I don't know the exact syntax,how can I put **-** at every 5,8 and **:** at every 14,17 and put " " at 11 index. Is there any efficient way to achieve this in awk? **EDIT** Please note that I have string as variable in awk.I generated it during some processing of records.


LFS System not booting or GRUB cannot access /bood/grub on boot

The closest question I could find is this one, however it is still quite a bit different from what I am needing: GRUB fails to install **My specific setup and the steps I followed to produce this** I am attempting to build the Linux From Scratch project, using book version 7.2. I have followed every step up along the way, and performed every test that I could do to make sure that everything was operating correctly after building. The largest change I had to make was the partitioning, I have /dev/sda1 (as /), /dev/sda2 (as /home), /dev/sda3 (as swap), and /dev/sdb1 (as /source for compiling). I am performing the installation on a blank hard drive inside of VirtualBox using a LiveCD as the host OS. So, I have ran into very few problems up until the very end. For compiling the kernel, it is not very specific for what options I need to select, so I selected the default options with one change, I made sure the option in "Device Drivers ---> Generic Driver Options ---> Maintain a devtmpfs filesystem to mount at /dev" was checked. After following the rest of the instructions on setting up GRUB, after the reboot the boot process freezes with the following output visible:               ata3: SATA link up 3.0 Gbps (SStatus 123 SControl 300)     ata3.00: ATA-6: VBOX HARDDISK, 1.0, max UDMA/133     ata3.00: 33554432 sectors, multi 128: LBA48 NCQ (depth 31/32)     ata3.00: configured for UDMA/133     scsi 2:0:0:0: Direct-Access ATA VBOX HARDDISK 1.0 PQ: 0 ANSI: 5     scsi 4:0:0:0: CD-ROM VBOX CD-ROM 1.0 PQ: 0 ANSI: 5     List of all partitions:     No filesystem could mount root, tried:     Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)     Pid: 1, comm: swapper/0 Not tainted 3.5.2 #1     Call Trace:      ? panic      ? mount_block_root      ? xen_write_msr_safe      ? mount_root      ? prepare_namespace      ? kernel_init      ? start_kernel      ? kernel_thread_helper     atkbd serio0: Spurious ACK on isa0060/serio0. Some program might be trying to access hardware directly.      So, when I first received that, I thought that maybe it was something to do with the kernel, maybe I didn't select what I had to select, and after a bit of googling, I found out that I should make sure that "SATA_SIL" is enabled. I also found a website detailing the kernel options that need to be enabled for a kernel running in VirtualBox (http://en.gentoo- wiki.com/wiki/Virtualbox_Guest). I then restored my machine to the saved state right before I compiled the kernel and recompiled it with the options specified on that website, along with SATA_SIL. However, after the long compilation of the kernel, I went along with the book and issued the command `grub-install /dev/sda`. However, this time, rather than installing, GRUB returned the following error:               Path to `/boot/grub' is not readable by GRUB on boot. Installation is impossible. Aborting.      My first thought was that it had something to do with file permissions (because "is not readable" really sounds like file permissions). So, just to see, I set the /boot folder (recursively) to 777. Still no success. After that, I did some googling, but really returned no meaningful results. So, following along with that, I restored the machine to the version where GRUB was working but wouldn't boot up, used the same configuration and recompiled the kernel there (which, I had to add a new hard drive, /dev/sdc, because there wasn't enough space in /dev/sdb1 to compile the kernel with the new options). After going through the long compilation again, I installed the kernel, rebooted, and ... same error dump as before. **The main question** So, now I am to the point where I think I may need some help, if anyone has any ideas how I may get past this boot error and/or the GRUB installation path error, that would be great! **Extra information** All of my software is the exact version from the LFS version 7.2, a full list may be found here: http://pastebin.com/TiJBhbce Here is a complete list of the structure and setup of all of the drives in the computer: root:~# fdisk -l               Disk /dev/sda: 4294 MB, 4294967296 bytes     255 heads, 63 sectors/track, 522 cylinders, total 8388608 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: 0xeeeb9d91             Device Boot      Start         End      Blocks   Id  System     /dev/sda1            2048     6293503     3145728   83  Linux     /dev/sda2         6293504     6817791      262144   83  Linux     /dev/sda3         6817792     8388607      785408   83  Linux          Disk /dev/sdc: 17.2 GB, 17179869184 bytes     171 heads, 2 sectors/track, 98112 cylinders, total 33554432 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: 0x4c41c1df             Device Boot      Start         End      Blocks   Id  System     /dev/sdc1            2048    33554431    16776192   83  Linux          Disk /dev/sdb: 4294 MB, 4294967296 bytes     43 heads, 32 sectors/track, 6096 cylinders, total 8388608 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: 0xd3de256f             Device Boot      Start         End      Blocks   Id  System     /dev/sdb1            2048     8388607     4193280   83  Linux      And the drive that should start as / upon reboot, here's the contents of /dev/sda1:               drwxr-xr-x 24 root root  4096 Feb 17 20:46 .     drwxr-xr-x  3 root root    60 Feb 17 22:46 ..     drwxr-xr-x  2 root root  4096 Feb 17 13:11 bin     drwxr-xr-x  3 root root  4096 Feb 17 16:00 boot     drwxr-xr-x  2 root root  4096 Feb 17 20:46 build     drwxr-xr-x  2 root root  4096 Feb 16 20:06 dev     drwxr-xr-x 12 root root  4096 Feb 17 15:52 etc     drwxr-xr-x  2 root root  4096 Feb 16 13:11 home     drwxr-xr-x  7 root root  4096 Feb 17 22:11 lib     drwx------  2 root root 16384 Feb 16 13:09 lost+found     drwxr-xr-x  4 root root  4096 Feb 16 20:24 media     drwxr-xr-x  2 root root  4096 Feb 16 20:24 mnt     drwxr-xr-x  2 root root  4096 Feb 16 20:24 opt     drwxr-xr-x  2 root root  4096 Feb 16 20:06 proc     drwxr-x---  3 root root  4096 Feb 17 22:14 root     drwxr-xr-x  3 root root  4096 Feb 17 09:38 run     drwxr-xr-x  2 root root  4096 Feb 17 14:36 sbin     drwxr-xr-x  2 root root  4096 Feb 16 13:11 sources     drwxr-xr-x  2 root root  4096 Feb 16 20:24 srv     drwxr-xr-x  2 root root  4096 Feb 16 20:06 sys     drwxrwxrwt  3 root root 20480 Feb 17 22:12 tmp     drwxr-xr-x 13 root root  4096 Feb 16 18:51 tools     drwxr-xr-x  9 root root  4096 Feb 16 20:24 usr     drwxr-xr-x 11 root root  4096 Feb 16 23:26 var


Httpd can't access file even after setting httpd_sys_content_t

I'm currently learning SELinux. I was following the instructions in SELinux doc of RedHat. I indeed succeded after typing the following commands:               mkdir /mywebsite       //add something to /mywebsite/index.html       semanage fcontext -a -t httpd_sys_content_t "/mywebsite(/.*)?"       restorecon -R -v /mywebsite //everythins worked well by then      But I did something more afterwards:               chcon -R -t httpd_sys_content_t /mywebsite  //I can't access index.html now, as expected          restorecon -R -v /mywebsite //Still can't access index.html!!            semanage fcontext -a -t httpd_sys_content_t "/mywebsite(/.*)?"       restorecon -R -v /mywebsite  //didn't work, either          ls -dZ /mywebsite // unconfined_u:object_r:httpd_sys_content_t:s0      The error message in firefox is:               Forbidden          You don't have permission to access /index.html on this server.       Am I missing something? Or it is a bug? My OS is Fedora 20 with Apache 2.4.7.


Why is "wget -r -e robots=off http://ccachicago.org" not acting recursively?

I am trying to recursively download `http://ccachicago.org`, and am getting exactly one file, the root `index.html`, downloaded. I've looked at Download recursively with wget and started using the recommended `-e robots=off`, but it still behaves the same. How, with `wget` or some other tool, can I download a copy of the site?


(debian) installing mod_qos on apache results in error on start

I installed the mod_qos module using the steps found here, every step went perfectly fine without any problems, however, when attempting to restart the apache service it returned the following error:               apache2: Syntax error on line 203 of /etc/apache2/apache2.conf: Syntax error on line 1 of /etc/apache2/mods-enabled/qos.load: Cannot load /usr/lib/apache2/modules/mod_qos.so into server: /usr/lib/apache2/modules/mod_qos.so: undefined symbol: EVP_DecryptFinal      The contents of the qos.load file is just this line:               LoadModule qos_module /usr/lib/apache2/modules/mod_qos.so      How do I solve this error?


cat >/path/to/file <<EOF drops some paste content, also patch <<EOF too. Why?

From time to time I like to use `cat >/etc/configfile <<EOF` thing, and paste content, then send `EOF` that will flush it into file. Its good with one or two lines, but when there's more of them, some of content is missing, some extra newlines are added and so one. Same goes if I use `patch <<EOF`, even with a simple patch with less than 2000 characters in total. I suspect my terminal (urxvt) to do something wrong, It paste the content extreme fast but miss something, when I use mintty from cygwin, its slow as hell but not a single line is skipped. Also, if I enter Vim and paste it there, nothing is missed. The shell does not matter, happens on zsh, bash and ash.


Can less retain colored output?

Can I get less not to monochrome its output? E.g., the output from `git diff` is colored, but `git diff | less` is not.


plesk update fails

I have a dedicated server running CentOS 5.3. I'm trying to update Plesk 9.5.2 to version 10.0.0 but update fails. I do it with yum:               yum update psa* --skip-broken -t      but it fails and I get the errors at the end:               Skip-broken could not solve problems     Error: plesk-mail-pc-driver conflicts with psa-qmail     Error: plesk-mail-pc-driver conflicts with psa-qmail-rblsmtpd     Error: plesk-mail-qc-driver conflicts with plesk-mail-pc-driver     Error: plesk-core conflicts with plesk-billing     Error: Missing Dependency: sw-engine = 2.0 is needed by package plesk-billing-6.0.4-20090625.11.noarch (installed)     Error: Missing Dependency: pp-sitebuilder >= 10.3.0 is needed by package psa-10.3.0-cos5.build1012110629.18.x86_64 (plesk)     Error: plesk-mail-pc-driver conflicts with plesk-mail-qc-driver      Is there a way that I could solve this?


hpux leaves files that start with a # behind after I uninstall a program. Is this normal and how do I delete them?

I have tried using `rm -f` on these files, and I am running as root, so I should be able to delete them. So why does this program leave behind these files and how can I remove them. Here is what the files look like: ` -rwxr-xr-x 1 root sys 6180112 Apr 2 23:28 ##libprog.so.4.5.1   -rwxr-xr-x 1 root sys 427384 Apr 2 23:28 ##libprogn.so.1.0.0   -rwxr-xr-x 1 root sys 578912 Apr 2 23:28 ##libprogcacheipc.so.1.0.0   -rwxr-xr-x 1 root sys 225976 Apr 2 23:28 ##libvtsmartcache.so.1.0.0   -rwxr-xr-x 1 root sys 1338920 Apr 2 23:28 ##libprogil.so.1.0.0   -rwxr-xr-x 1 root sys 6180112 Apr 2 23:28 #libprog4.so.4.5.1`   Here is the error I get when trying to remove a file:   `rm -f /opt/prog/lib/hpux64/##libprog.so.4.5.1 rm: /opt/prog/lib/hpux64/##libprog.so.4.5.1 not removed. Text file busy`


Two HDD partitions with the same name result in uncertain directories

I'm running Ubuntu 14.04 on a machine that has a lot of hard drives plugged into it. These hard drives have partitions with old OS's which have a lot of key data that I use often. The problem is, I have 2 partitions with the same name, "Main Drive" and "Main Drive". Ubuntu, to differentiate between them, renames one drive to "Main Drive1", while keeping the other just "Main Drive". The problem is, every time I restart Ubuntu, it chooses **randomly** which partition to rename. As a result, any bookmarks or directories that I have in those partitions, do not work, and have to be reconfigured every time I reboot. Are there any solutions to this problem?


imagemagick creating one big image by piling up thousand of images of the same width?

I've got a few tens of thousands of images all of 2000 pixel width, and I would like to pile them up in one big image of summed up height and 2000 pixel width. I guess there must be a way to do that with imagemagick but I couldn't find a way to script it out for tens of thousands of images. Any suggestions?


Key mappings in Linux

What do people mean when they point out that the "keys are not properly mapped" in a Linux installation when working on the command line? Isn't the default installation OK? What extra/specific mappings are needed? I also was told that for my Mac where my `Home` and `End` and `Ctrl` keys do not do what I expected.


How do you dual boot Debian and FreeBSD using GRUB2?

I've been trying to install FreeBSD alongside my Debian installation in a single partition. All examples readily present on the Internet had shortcomings:   1. Some required chainloading the FreeBSD chainloader in ways GRUB2 refused to accept with "invalid signature".   2. Some assume you've installed FreeBSD inside a BSD disklabel.   3. None of the solutions (including loading /boot/loader) boot after changing the order of the devices or moving them from server to server.   4. None of the solutions work on Debian: The naming of the GRUB2 options on Debian seems to be different from e.g. Ubuntu. So how do I dual boot Debian and FreeBSD in the most reliable way?


How to dual boot Xubuntu with Windows 7 & 8 from separate drives

I had Windows 7 and 8 on a hard drive, then I decided to try Xubuntu, and installed it on a _separate hard drive._ Then I tried using EasyBCD, but Windows doesn't recognize Linux partitions. Additionally I removed the drive with Windows while installing Xubuntu, just in case... So, how can I add it to the boot list?


Where do I find the OID descriptions for SNMPv2 in Linux?

I was looking at this link here: http://www.debianadmin.com/linux-snmp-oids- for-cpumemory-and-disk-statistics.html and noticed that the OIDs are the same ones I see for the same stats for our appliance. Is this some kind of standard with SNMP maybe an RFC or something? Does anyone know where I can find the list that tells me what each OID describes?


cannot start network service in Fedora15?

I am pretty new to Linux operating system.I googled the error but did not find any solution to my problem. I am using Fedora15. Any pointers would be appreciated.Thanks               service network start          > Starting network (via systemctl): Job failed. See system logs and     > 'systemctl status' for details. [FAILED]          The log says     [root@Fedora15 sysconfig]# tail -f /var/log/messages     Oct 31 09:50:24 Fedora15 kernel: [ 7550.107576] userif-3: sent link up event.     Oct 31 09:50:24 Fedora15 kernel: [ 7550.988110] device p2p1 entered promiscuous mode     Oct 31 09:50:24 Fedora15 kernel: [ 7550.988148] bridge-p2p1: enabled promiscuous mode     Oct 31 09:50:24 Fedora15 vmnetBridge: Started bridge p2p1 to virtual network 0.     Oct 31 09:50:24 Fedora15 NetworkManager[6940]: <info> Policy set 'p2p1' (p2p1) as default for IPv4 routing and DNS.     Oct 31 09:50:24 Fedora15 NetworkManager[6940]: <info> Activation (p2p1) successful, device activated.     Oct 31 09:50:24 Fedora15 NetworkManager[6940]: <info> Activation (p2p1) Stage 5 of 5 (IP Configure Commit) complete.     Oct 31 09:50:24 Fedora15 systemd[1]: network.service: control process exited, code=exited status=1     Oct 31 09:50:24 Fedora15 systemd[1]: Unit network.service entered failed state.     Oct 31 09:50:24 Fedora15 kernel: [ 7551.188136] userif-3: sent link down event.


What is the GNU/Linux equivalent of BSD's "route get ..."?

The BSD `route` command has a feature that will show what route will be selected for a given host. For example:               /Users/mhaase $ route get google.com        route to: iad23s07-in-f8.1e100.net     destination: iad23s07-in-f8.1e100.net         gateway: 10.36.13.1       interface: en0           flags: <UP,GATEWAY,HOST,DONE,WASCLONED,IFSCOPE,IFREF>      recvpipe  sendpipe  ssthresh  rtt,msec    rttvar  hopcount      mtu     expire            0         0         0         0         0         0      1500         0       I occasionally find this useful if I am manually messing with routing tables to make sure that the routing rules are working as expected. The GNU version of route does not have this same "get" subcommand. Is there some equivalent or alternative for GNU/Linux?


Saving tab completion possibilities to a file

Instead of displaying all possibilities on terminal screen, as in:               $ ls /etc/<TAB>     Display all 230 possibilities? (y or n)      I want to save all possibilities to a file. `ls /etc/ > file.txt` will not always work. apt-get is an example:               $ apt-get <TAB>     autoclean        check            install          update     autoremove       clean            purge            upgrade     build-dep        dist-upgrade     remove                changelog        dselect-upgrade  source                 I'm looking for a command like `tabcompletions 'ls /etc/'` which outputs all possibilities, so that I can run a command like the one below, which compares the tab completion possibilities for two commands:               diff <(tabcompletions 'ls ') <(tabcompletions 'cd ')      Is that possible?


Pidgin won't connect to MSN, claims "Invalid response"

I'm using Pidgin on Debian Wheezy, Debian's package version 2.10.6-3. A few days ago I started getting sign-in errors on MSN; specifically, Pidgin complains about _Windows Live ID authentication:Invalid response_. Looking at the Pidgin web site, there is a newer version 2.10.7 specifically to fix signin errors with MSN. Unfortunately Debian hasn't packaged such a version for Wheezy yet (it's in Jessie and Sid, though), and I really only need the certificates (the security fixes listed on the front page don't apply in my situation). I tried going into Tools -> Certificates and delete all SSL certificates that had `live`, `passport` or `msn` in their host names, and when I reconnect after that it installs certificates for `local-bay.contacts.msn.com` and `login.live.com`, but I am still getting the exact same error. While waiting and hoping for Debian to package an upgrade, _is it possible to use the certificates packaged with Pidgin 2.10.7 (either the official source code or the Debian package from Jessie or Sid) with the 2.10.6-3 build as distributed in Wheezy? If so, how?_ It is OK if this might break on a reinstall of the Wheezy build of Pidgin, because by the time that comes up hopefully the version that would be installed is fixed anyway. **Edit** I downloaded and installed Pidgin 2.10.7-2 (specifically the pidgin, pidgin-data, libpurple0 and libpurple-bin packages) from Jessie, confirmed that I am running those (through dpkg and Pidgin's About dialog), deleted the Live and MSN certificates and reconnected, but I am still getting the same error.


What should someone know about using Python scripts in the shell?

I'm wondering what should someone generally know about Python(the interpreter) when using it in the shell in Linux? This is what I have on _Gentoo_ :               # ls -al /usr/bin/python*; file /usr/bin/python; /usr/bin/python-wrapper --version     lrwxrwxrwx 1 root root    14 Dec 26 04:49 /usr/bin/python -> python-wrapper     lrwxrwxrwx 1 root root     9 Dec 26 04:51 /usr/bin/python2 -> python2.7     -rwxr-xr-x 1 root root  6144 Jan  8 21:22 /usr/bin/python2.7     -rwxr-xr-x 1 root root  1450 Jan  8 21:22 /usr/bin/python2.7-config     lrwxrwxrwx 1 root root     9 Dec 26 04:49 /usr/bin/python3 -> python3.3     -rwxr-xr-x 1 root root 10304 Jan 19 20:37 /usr/bin/python3.3     -rwxr-xr-x 1 root root  1753 Jan 19 20:37 /usr/bin/python3.3-config     -rwxr-xr-x 1 root root   217 Dec 26 04:49 /usr/bin/python-config     lrwxrwxrwx 1 root root    16 Jan  8 21:22 /usr/bin/python-config-2.7 -> python2.7-config     lrwxrwxrwx 1 root root    16 Jan 19 20:37 /usr/bin/python-config-3.3 -> python3.3-config     -rwxr-xr-x 1 root root 10384 Dec 26 05:24 /usr/bin/python-wrapper     /usr/bin/python: symbolic link to `python-wrapper'     Python 3.3.3      So in my case calling `python` launches version 3.3. On most of the distributions I used, there was more than one version installed. And the latest version isn't backward compatible, and some of its features were backported to the "old" one. I thought the two versions situation was something temporary? Now each time I need to run a Python script I try it with both Python versions just to make sure. Should I know anything else about using Python in the shell i.e. to run scripts; if so, what? Someone who makes a python script and uses `env python` in the first line, does he/she mean it should be compatible with both versions? What is the use for the python-wrapper in all that?


How to decide what to mention in .spec file 'Requires: ' filed

I am new in building rpm package.For Creating RPM for my binary I have following dependancies:               [tejas@target]$ ldd exe         linux-vdso.so.1 =>  (0x00007fff85bff000)         libQtWebKit.so.4 => /opt/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtWebKit.so.4 (0x00007f868c4e8000)         libphonon.so.4 => /opt/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libphonon.so.4 (0x00007f868c288000)         libQtScript.so.4 => /opt/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtScript.so.4 (0x00007f868bdd3000)         libQt3Support.so.4 => /opt/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQt3Support.so.4 (0x00007f868b8b5000)         libQtSql.so.4 => /opt/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtSql.so.4 (0x00007f868b66f000)         libQtXml.so.4 => /opt/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtXml.so.4 (0x00007f868b426000)         libQtGui.so.4 => /opt/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtGui.so.4 (0x00007f868a6c7000)         libQtNetwork.so.4 => /opt/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtNetwork.so.4 (0x00007f868a369000)         libQtCore.so.4 => /opt/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtCore.so.4 (0x00007f8689e72000)         libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003cd2200000)         libqwt.so.6 => /usr/lib64/libqwt.so.6 (0x00007f8689b4e000)         libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x0000003cd8200000)         libm.so.6 => /lib64/libm.so.6 (0x0000003cd1a00000)         libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000003cd7e00000)         libc.so.6 => /lib64/libc.so.6 (0x0000003cd1600000)         libdl.so.2 => /lib64/libdl.so.2 (0x0000003cd1e00000)         libXrender.so.1 => /usr/lib64/libXrender.so.1 (0x000000373ba00000)         libgio-2.0.so.0 => /lib64/libgio-2.0.so.0 (0x00000030aa000000)         libgstapp-0.10.so.0 => /usr/lib64/libgstapp-0.10.so.0 (0x00000034f2e00000)         libgstinterfaces-0.10.so.0 => /usr/lib64/libgstinterfaces-0.10.so.0 (0x00000034f0e00000)         libgstpbutils-0.10.so.0 => /usr/lib64/libgstpbutils-0.10.so.0 (0x00000034f1a00000)         libgstvideo-0.10.so.0 => /usr/lib64/libgstvideo-0.10.so.0 (0x00000034f2200000)         libgstbase-0.10.so.0 => /usr/lib64/libgstbase-0.10.so.0 (0x00000034f1e00000)         libgstreamer-0.10.so.0 => /usr/lib64/libgstreamer-0.10.so.0 (0x00000034f1600000)         libgobject-2.0.so.0 => /lib64/libgobject-2.0.so.0 (0x00000030b1200000)         libgmodule-2.0.so.0 => /lib64/libgmodule-2.0.so.0 (0x00000030a9800000)         libxml2.so.2 => /usr/lib64/libxml2.so.2 (0x0000003cdba00000)         libgthread-2.0.so.0 => /lib64/libgthread-2.0.so.0 (0x00000030b4400000)         librt.so.1 => /lib64/librt.so.1 (0x0000003cd2a00000)         libglib-2.0.so.0 => /lib64/libglib-2.0.so.0 (0x00000030b0e00000)         libfontconfig.so.1 => /usr/lib64/libfontconfig.so.1 (0x0000003cd5e00000)         libfreetype.so.6 => /usr/lib64/libfreetype.so.6 (0x0000003cd5a00000)         libXext.so.6 => /usr/lib64/libXext.so.6 (0x000000373b600000)         libX11.so.6 => /usr/lib64/libX11.so.6 (0x0000003e83600000)         libQtDBus.so.4 => /opt/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtDBus.so.4 (0x00007f86898c1000)         libpng12.so.0 => /usr/lib64/libpng12.so.0 (0x0000003cd5600000)         libz.so.1 => /lib64/libz.so.1 (0x0000003cd2600000)         libSM.so.6 => /usr/lib64/libSM.so.6 (0x000000373d200000)         libICE.so.6 => /usr/lib64/libICE.so.6 (0x0000003cdb200000)         /lib64/ld-linux-x86-64.so.2 (0x0000003cd1200000)         libQtSvg.so.4 => /opt/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtSvg.so.4 (0x00007f8689662000)         libresolv.so.2 => /lib64/libresolv.so.2 (0x0000003cd3600000)         libselinux.so.1 => /lib64/libselinux.so.1 (0x0000003cd2e00000)         libexpat.so.1 => /lib64/libexpat.so.1 (0x0000003cd5200000)         libxcb.so.1 => /usr/lib64/libxcb.so.1 (0x0000003e82600000)         libuuid.so.1 => /lib64/libuuid.so.1 (0x0000003e83200000)         libXau.so.6 => /usr/lib64/libXau.so.6 (0x0000003e81e00000)      So I have checked from which rpm I can get those libraries by `rpm -qf <library path>` command.   eg:               [tejas@target]$ rpm -qf /lib64/libpthread.so.0     glibc-2.12-1.80.el6_3.5.x86_64      I have also checked which minimum version should be available for that library. So, accordingly I made spec file including all those packges. My .spec file is:               [tejas@target]$ cat /home/tejas/rpmbuild/SPECS/ModCMS-gdm.spec     Name:   ModCMS-gdm       Version:1.0      Release:1     Summary:gdm               Group:  ModCMS       License:WESEE        URL:    http://wesee.org         Source0:ModCMS-gdm-1.0.tar.gz             Requires:dbus-libs >= 1.2.24     Requires:expat >= 2.0.1     Requires:fontconfig >= 2.8.0     Requires:freetype >= 2.3.11     Requires:glib2 >= 2.22.5     Requires:glibc >= 2.12     Requires:keyutils-libs >= 1.4     Requires:krb5-libs >= 1.8.2     Requires:libasyncns >= 0.8     Requires:libcom_err >= 1.41.12     Requires:libgcc >= 4.4.4     Requires:libICE >= 1.0.6     Requires:libpng >= 1.2.44     Requires:libqwt6 = 6.0.1     Requires:libselinux >= 2.0.94     Requires:libSM >= 1.1.0     Requires:libsndfile >= 1.0.20     Requires:libstdc++ >= 4.4.4     Requires:libuuid >= 2.17.2     Requires:libXau >= 1.0.5     Requires:libxcb >= 1.5     Requires:libXcursor >= 1.1.10     Requires:libXext >= 1.1     Requires:libXfixes >= 4.0.4     Requires:libXi >= 1.3     Requires:libXinerama >= 1.1     Requires:libXrandr >= 1.3.0     Requires:libXrender >= 0.9.5     Requires:libXtst >= 1.0.99.2     Requires:openssl >= 1.0.1e     Requires:pulseaudio-libs >= 0.9.21     Requires:qt48 >= 4.8.5     Requires:qt48-x11 >= 4.8.5     Requires:qtwebkit >= 2.0     Requires:sqlite >= 3.6.20     Requires:tcp_wrappers-libs >= 7.6     Requires:zlib >= 1.2.3               %description     This is Just to test various files allocation through rpm build          %prep     %setup -q          %install     mkdir -p "$RPM_BUILD_ROOT/root/ModCMS"     cp -r GDM.tar.gz "$RPM_BUILD_ROOT/root/ModCMS/"          %files     /root/ModCMS/GDM.tar.gz          %clean     rm -rf $RPM_BUILD_ROOT          %post     cd /root/ModCMS/     tar xzf GDM.tar.gz      Now my questions are :   * How do I mansion dependency libraries directly instead of rpm?   * Is it necessary to include all those dependencies in Required field?   * How do I minimize them? I have searched, but couldn't find specific solution.


Elegantly get list of children processes

I would like to get a list of all the processes whose parent is $pid. This is the simplest way I've come up with: `pstree -p $pid | tr "\n" " " |sed "s/[^0-9]/ /g" |sed "s/\s\s*/ /g"` Is there any command, or any simpler way to get the list of children processes? Thanks!


Life with empty about:plugins (so without flash)

I use Firefox as it is stated in the $subject. Nevertheless there are still too many contents (I'm talking about mostly videos) on the web that needs flash. This is what I use for it:   * https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/   * https://userscripts.org/scripts/show/87011 So in this way I can download/view with VLC ex.: youtube videos. But aren't there a better way to do this? To get the life without flash easier? And no, enabling html5 on youtube... doesn't help, because it looks like very- very-very low percentage of the youtube videos are viewable in html5.. UPDATE: so I don't want to run videos inside my browser. They will be always slower compared to a video natively played in ex.: VLC. Also AFAIK it's much safer to have empty about:plugins and play the needed videos in VLC.


Calculate difference between two non-linear data sets

I would like to calculate the difference between two data sets at any given moment in time. The problem is that the "timestamps" at which both data sets were taken differ. For example consider these data sets               time-1   state-1    time-2    state-2     6.164012 1          6.164015  1     6.290051 2          6.290055  2     6.454675 3          6.454678  3     7.006175 4          7.006178  4     7.080418 5          7.016555  5     7.193570 6          7.016595  4     7.351850 7          7.016595  3     7.465638 8          7.016595  2     7.492480 9          7.080421  3     7.524426 10         7.193572  4     8.006629 11         7.203975  5      It would be even sufficient to have the difference between state-1 and state-2 calculated at each 0.000001 seconds (brute force). Does anybody know how to solve this issue? EDIT: To clearify my question: the first data set contains a time stamp (time-1) and a corresponding value (state-1); the second data set contains also a time stamp (time-2) and a corresponding value (state-2). I would like to compare the "state" variables at every moment in time to find the maximum difference between both. However, since the time stamps are not synchronized between both data sets I cannot simply compare line 1 with line 1 etc. The data sets can be read as follows: data set 1 has 1 state at time 6.164012 seconds and after 2 states after 6.290051 seconds. Data set 2 has 1 state after 6.164015 seconds and 2 states after 6.290055 seconds. EDIT2: You can think of both data sets as step functions (x-axis is the time, y-axis the state variable). Then you end up with something like this:               ^     |    +---------+     |    |         | +---+     | +--+   +---+ | |   |     | |      |   | +-+   + ... f1     |--------+   +-------- ... f2     +------------------------------->      And I want to know at which time (x value) the difference between f1 and f2 (y_1 - y_2) is at its peak. In this case I don't have "functions" but two data sets belonging to the same experiment being run with different parameters.


What's the best way to configure shared filesystem directories? (beyond standard unix perms)

I have multiple users on my system. I'd like to have shared directories like music, video. pictures etc. The problems is that I want users to be able to write any new files to any directory, but not be able to delete or modify any files they don't own. With standard unix perms if you can add a file to a directory you can also delete others. I'd also like to make sure all the files in these directories are always readable by the user group. Can I do this with POSIX ACL's? or do I need something more advanced like SELinux (or other security framework). example of what I don't want to work.               su - root     mkdir /home/music     chmod 775 /home/music     chgrp users /home/music     su - user1 /home/music     touch /home/music/testfile     ll /home/music/testfile     su - user2     rm /home/music/testfile     ll /home/music


How does searching a file (locate) or autocompletion work?

I am a Windows user and coming from Windows with all the indexing and eternal wait times when searching for files, I find it surprising how fast does _locate_ work or the autocompletion (that I know) work in linux. Is there any indexing being done in the background or how is this achieved? I still have a pretty clean installation, so maybe this goes bad with time, but in Windows the moment you want to search on a folder which is not indexed you have to wait for some seconds. Thanks


NVIDIA Proprietary Driver on Debian Jessie Problems

I have dabbled in running a Debian server before, but this is my first time using its graphical interface for my main pc. I have been trying to install the nvidia proprietary drivers. I have SLI gtx 460s 1GB. I am running Debian "Jessie" (if it turns out my issues are due to me running the testing build, please let me know). So far, I have tried following the exact directions on the Debian wiki. Upon reboot, my primary monitor remains completely blank once the desktop environment launches (I never even see the login screen), though it is still receiving some sort of video signal because the monitor doesn't complain about no signal. This contrasts my secondary monitor which is given no signal whatsoever. Oddly, when I hook up my monitor via HDMI to my motherboard's integrated graphics, I see a black screen with a cursor blinking at the top left corner. I am able to alt+ctrl+F1 to login to the terminal, purge my system of nvidia packages, delete the xorg config file, and reboot; this returns my system to a usable state using nouveau, dual monitors and everything. I have tried slightly different methods such as installing the 'nvidia-driver' metapackage. Still, I get the same result. Digging through the Xorg log, I found this segment:               [     7.605] (II) LoadModule: "glx"     [     7.605] (II) Loading /usr/lib/xorg/modules/linux/libglx.so     [     7.642] (II) Module glx: vendor="NVIDIA Corporation"     [     7.642]    compiled for 4.0.2, module version = 1.0.0     [     7.642]    Module class: X.Org Server Extension     [     7.642] (II) NVIDIA GLX Module  331.67  Fri Apr  4 11:43:47 PDT 2014     [     7.642] Loading extension GLX     [     7.642] (II) LoadModule: "nvidia"     [     7.642] (II) Loading /usr/lib/xorg/modules/drivers/nvidia_drv.so     [     7.649] (II) Module nvidia: vendor="NVIDIA Corporation"     [     7.649]    compiled for 4.0.2, module version = 1.0.0     [     7.649]    Module class: X.Org Video Driver     [     7.650] (II) NVIDIA dlloader X Driver  331.67  Fri Apr  4 11:24:40 PDT 2014     [     7.650] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs     [     7.650] (++) using VT number 7      Any help would be greatly appreciated. I'll gladly provide any more information that's required. Thanks.


Changing one character in keyboard layout

I edited the file `/usr/share/X11/xkb/symbols/us` and added a definition with my new layout as follows               partial alphanumeric_keys modifier_keys     xkb_symbols "us_pl" {         include "us(basic)"         name[Group1]= "English (with Polish characters)";         key <AD06> { [ z, Z, zabovedot, Zabovedot ] };     };      I commented the line 27 (for xkb_symbols "basic")               // key <AD06> { [   y,  Y   ] };      Then I compiled the changed layouts               $ xkbcomp -xkm -m basic us     $ xkbcomp -xkm -m us_pl us      I set the new layout               $ setxkbmap 'us(us_pl)'          $ setxkbmap -query     rules:      evdev     model:      pc105     layout:     us(us_pl)      Now, I'd like to test my newly defined character but nothing changed. Where am I doing a fault? Note, that I'd like to change more characters later, so I'd like this example to work. OS: Ubuntu 12.04


How to place big file on two disks without splitting?

I have a file 100gb in size and a server with two 72gb disk's. The server runs Ubuntu Linux, with ext4 on the disks, and without LVM. How I can put the 100gb file on the server with 72+72gb disk's? I can't change the filesystem and I can't split the file; the file must be readable.


qtcreator debugger shows <unavailable synchronous data> when trying to view the contents of std::map

I'm running QtCreator 4.8.0 on a Ubuntu 12.04 (64bit) machine. `apt-cache policy qtcreator` shows:               qtcreator:       Installed: 2.4.1-0ubuntu2       Candidate: 2.4.1-0ubuntu2       Version table:      *** 2.4.1-0ubuntu2 0             500 http://ca.archive.ubuntu.com/ubuntu/ precise/universe amd64 Packages             100 /var/lib/dpkg/status      My `gdb` version info is:               GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04      Whenever I try to view the contents of a `std::map` using Qt debug mode I get > >     <unavailable synchronous data> >   However, I can view the contents of other STL data structures such as vectors or lists. Why is it that I can't view the contents of `std::map`? To reproduce the problem:   1. write a program that initializes and inserts some elements into a std::map   2. set a break point right after the elements are inserted into the map   3. run qtcreator in debug mode (F5)   4. attempt to view the contents of your map variable in the "Locals and Expressions view" Here is a screenshot that also shows the debugger log at the top:     ![qtcreator in debug mode](http://i.stack.imgur.com/22asj.png)


Clear / erase a mistyped invisible password on a shell / terminal in Linux

One thing that annoys me using Linux's terminal is when I have to type a invisble password, like when you run **ssh**. Sometimes I mistype one or more letters and then I have to press backspace key a few times to make sure that I erased everything to start again. I know this is not a big deal but since on the other day I found out that pressing CTRL+L "clears" the terminal I was wondering if there's a way to clear/erase the invisible password without relying on backspace or pressing enter key to try again.


Using Awk To Parse Individual Lines

Here is the output from qacct -o               Total : OWNER WALLCLOCK UTIME STIME CPU MEMORY IO IOW         =========================================================================================================================      Total : adeluca 1947 45.550 8.325 53.875 3.079 17.268 0.000      Total : athardin 1 0.039 0.056 0.095 0.000 0.000 0.000      Total : axelsone 35398815 34902115.362 37631.812 34939747.173 33441742.534 11432.294 0.000      Total : bfinley 1875 6654.039 108.112 6762.151 2867.369 33.136 0.000      Total : bihe 12018070 6479035.116 1168497.282 7647532.398 4463769.624 478955.800 0.000      Total : brogers 108710282 108181275.073 46824.068 108228099.141 1741423.539 2.129 0.000      Total : ckbui 10 0.006 0.006 0.012 0.000 0.000 0.000      Total : ctokheim 114192 15177.837 460.056 15898.657 11150.583 208.076 0.000      Total : dliang 6483476 8023175.362 80187.624 13133457.012 12167904.607 472.620 0.000      Total : gaolong 3395364 3382687.178 5792.021 3388479.200 6904718.986 11.328 0.000      Total : htrn 1 0.016 0.006 0.022 0.000 0.000 0.000       Right now I have               qacct - o | awk 'NR>2 print {$1}'      The purpose of this is to pull the individual user names like so:               adeluca     athardin     axelsone     bfinley     bihe     brogers     ckbui     ctokheim     dliang     gaolong     htrn      What I want is to be able to parse through the list and for each user be able to pull out each individual user to put into another file that requires their username. For Example. ~/qacct.monthly adeluca So What I want ultimately is to be able to parse through qacct -o, get the individual users and be able to call something like ~/qacct.monthly $users So that I don't have to manually put the individual users in every time.


Filesystem type on Solaris 5.10

How can I get the file system type for each device on Solaris 5.10? I tried `mount` with no args but that only listed each mount point, similar to `df`. Also, how can I find where a specific directory is mounted to, directly, without which of the mounting points is its superdirectory or grep? Thanks


Is SMTP over SSL possible in the Balsa email client?

In Balsa 2.5.1 is it possible to connect to SMTP with port 465 with SSL? The IMAP setup has an SSL option which disables the TLS choices, but I do not see anything similar when setting up SMTP. I know that SMTP port 587 with STARTTLS is the standard-compliant way to connect (and the same with IMAP port 143 STARTTLS vs IMAP port 993 SSL), but my mail service doesn't seem to support this yet. I have tried every combination I can come up with in the SMTP settings in Balsa, but nothing seems to work. I have been able to connect in every other email client I have used, so I don't think there is any problem with the server (other than supporting the latest standards, ha). Also, when using the compose window in Balsa and typing in the To field, after hitting tab it takes you to another To field and you have to hit tab once or twice more to get to the Subject field. Is there any way to have the tab press after typing the first To address take you directly to the Subject field (I didn't notice anything in the options, but perhaps I overlooked it)? Thank you.


Tool to watch latest software releases from upstream?

Does anyone know of a program/framework to watch latest software releases from upstream? For example for wordpress, apache/nginx, and so on. The program should just retrieve respective software project's webpage (or FTP listing, whatever) and parse it to grab the version numbers and tarball URLs. Imagined invocation and output of such program:               % swwatch wordpress     branch: 3.4     status: release     version: 3.4.2     date: ...     tarball url: http://...          branch: 3.5     status: beta     version: 3.5.0-beta2     date: ...     tarball url: http://...      There is a related question: Keeping track of the latest releases , and I'm checking out debian/watch right now, but this requires downloading the package source. And it also means I have to wait until a Debian maintainer uploads a new version, which can be a while. I'd prefer something more lightweight that checks the upstream information directly.


FreeBSD and Linux shared partitions

Which directories, and how, can I share between FreeBSD and Linux? In particular, how can I deduplicate respectively /usr/home and /home? I guess directly sharing a partition between both systems could lead to conflicting dotfiles, so that may not be the right solution. Is union-mounting the shared partition reasonable? This way, I could move the dotfiles into the "/" partition of each OS, and share the rest of the files into the shared partition. Which filesystem should I use for the shared home partition itself? I have under 2GB RAM so I don't think ZFS will behave, from what I've read. Maybe ext2 will do? Any better options? EDIT: is write-to-UFS kernel support in Linux stable already?   * Linux distro is LMDE.   * Actually using PC-BSD but as far as I've read it should behave just as FreeBSD for this. Correct me if I'm wrong.   * Partitions would be:               OS      Mountpoint FS    Size (GiB; Total:~160GB)     Linux   /          ext4  16     FreeBSD /          ufs   16     Shared  /mnt/home/ ext2? ~124    # EDITED: See below     Shared         -   swap  4      Any other partitions I should make? It's a workstation without "persistent" servers, but I may fool around with jails in FreeBSD. Maybe I should have a partition for those? Disclaimer: I haven't actually used union filesystems before, and am new to BSD in general; feel free to propose better solutions :) EDIT: How about adding a "dotfiles" tree in each root partition and union- mount it?               Mount points in FreeBSD:     /     /mnt/home/     /usr/home/: /usr/dotfiles/ U /mnt/home/            # /usr/dotfiles/ has priority          Example contents:     /usr/dotfiles/fchurca/: .cache .kderc     /mnt/home/fchurca/: .vimrc development/ Documents/ # .vimrc isn't platform-specific     /usr/home/fchurca: .cache .kderc .vimrc development/ Documents/      This way, it could work for all the (two at most) users of the box.


Portable Firefox Linux

I've installed latest **firefox linux-x86_64** from ftp.mozilla.com on a usb device and created a new profile file with the `-P` command. Unfortunately, the application does not recognize the flash plugin that is already installed on the operating system. How can I **enable the flash plugin** on the portable version? ![enter image description here](http://i.stack.imgur.com/GiD4p.png)


Does mutt support saving to an mbox?

Is it possible to save messages in mbox format? I have `set mbox_type = Maildir`, because I use offlineimap to retrieve my mail. Unfortunately it seems to affect the global settings, and it will save in Maildir format as well, which breaks git patches.


How can I check to see if the /tmp directory on my CentOS 5.x system is mounted on tmpfs?

CentOS 5.x My understanding is that the contents of `/tmp/` in CentOS 5.x can/are automatically purged by the OS via one of two methods:   * A daily cron task running `tmpwatch`   * If `/tmp/`is mounted on a `tmpfs` (RAM), a system reboot/power cycle will clear everything. Is that correct? If so, how can I confirm if /tmp is mounted on tmpfs? I checked `/etc/fstab` and saw this:               LABEL=/                 /                       ext3    defaults        1 1     LABEL=/boot             /boot                   ext3    defaults        1 2     tmpfs                   /dev/shm                tmpfs   defaults        0 0     devpts                  /dev/pts                devpts  gid=5,mode=620  0 0     sysfs                   /sys                    sysfs   defaults        0 0     proc                    /proc                   proc    defaults        0 0     LABEL=SWAP-sda2         swap                    swap    defaults        0 0


Is it necessary to reboot after a kernel upgrade (via APT)?

I have been wondering this for quite a while. Let's say that you have a Debian server that you keep updated via APT. Usually (every 1-2 months) there are some kernel updates, which will update the GRUB entries to boot from it next time. This is okay, but if you care about uptime and SLA, it would be difficult to reboot just to use the updated kernel. I guess this is the usual way to go, but is it actually how it works?


Software for navigating a network diagram

I would like to visualize a large amount of data as a network diagram, such as the one seen in this graph drawing (but much more complex). Is there any software available that can import a huge database and allow one to navigate to different parts of the graph?


Using sed (?) to extract one instance of a string that is repeated in the original string

INPUT:               FOO      OUTPUT:               FOO      **Q:** how can I replace the INPUT with the OUTPUT? The FII and "./>" is CONSTANT. The FOO could vary to any english letter and "-" and "." UPDATE: (to clarify "FOO")               FOO=ASD     then:      ASD          FOO=XYZ     XYZ      UPDATE2: (this one doesn't works :O )               [user@notebook ~] echo 'FOO'     FOO     [user@notebook ~] echo 'FOO' | sed 's/>[ \t]*\([^ \t]\+\)[ \t]*</\1/'          [user@notebook ~]


How to recover a multiboot configuration after having installed Windows 7?

I've installed Windows 7 and XP on my laptop. After that, I installed RedHat 5. Now the problem is that I'm not able to load my RedHat. What should be done to fix this problem?


Why Inotify is unable to add watch

I have been trying to install teamviewer on RHEL 6 machine. The installation went fine. When I try to run teamviewer, it terminates immediately after showing the GUI. I went to /var/log/teamviewer/TeamViewer9_Logfile.log and the last two lines of the log file says:               S0! INotify: unable to add watch for /tmp/.X11-unix     S0!! XSocketSessionObserver: caught exception 'add-watch' 2 Errorcode=2      I am not sure why INotify is unable to add watch for /tmp/.X11-unix. This file/directory does not exist, could that be the reason? In that case, how this gets created?


How to save temp data

**updated:** I'd like to save a large amount data ( ~ 100MB ) from _the standard input_ in **temporary** location for the duration of my bash session. Piping it to a _file_ won't work as I have only 30MB of free space. I also don't want to save it in a _variable_. I'd obviously have to utilize some space other than that of my _Disk Storage_. Which leaves my _RAM_. Is there some _mechanism_ that will allow me to write to it, and then to retreive the written data again. ( like when you pipe to and from `/dev/null` )


Wget or curl a self-signed certificate from server

From my browser, I can browse to a machine in my companies local intranet and (after marking the certificate as trusted) export that certificate to a file. I'm trying to automate this process into a shellscript so I can make my life a little easier when using various commandline tools without throwing security out the window. Trying to google this topic has been difficult and has mainly yielded results about how to trust a certificate you have already downloaded while using wget or curl, but that's not what I need in this case. How can I download the server's public self-signed certificate to a local file via wget or curl?


1:1 NAT with several identical LANs

I want to connect several LANs located on remote buildings.   The "central" site have a Linux computer running OpenVPN. Each remote site also run OpenVPN.   1. the central site has a LAN numbered 192.168.0.0/24   2. several remote sites are also numbered 192.168.0.0/24   3. I can't/won't/don't want to/whatever modify LAN numbering   4. I don't have control on most remote OpenVPNs I then need to :   1\. define virtual LANs   2\. configure a 1:1 NAT for each site   3\. the 1:1 NAT has to be configured on the central router ![LAN map](http://i.stack.imgur.com/EJjId.png) .   So each site is seen to have a 10.10.x.0/24 LAN.   When a computer want to reach, say, 192.168.0.44 on site 12, it just have to send a paquet to 10.10.12.44 Operating a VPN is not a problem for me. I currently connect 60+ sites. But I don't find a simple way to do this 1:1 NAT. Here is an example of a packet sent from the central site to a remote site, and its response packet : ![enter image description here](http://i.stack.imgur.com/YC3HD.png) I did some tests with iptables NETMAP but I can't manage to make it work because I don't find a way to modify source+destination after routing decision.   I prefer to avoid the new `--client-nat` OpenVPN's feature.   Maybe I have to force routing with `ip route` ? Or to loop twice into the network stack with `veth` ? Note : I don't want to use masquerade. Only 1/1 NAT. EDIT :   It's not possible with a regular openVPN setup. Because a packet from a remote site is indistinguishable from a packet from another site : both have similar source and destination addresses, and both come from the same tun (or tap) interface. So it's not possible to source-NAT it. Solution 1 : do the NAT on the remote sites. Not possible in my case. I have to do it only on the central site. Solution 2 : setup one VPN for each remote site. So I'll have one tun for each. I think this can be ok. Not very memory efficient but ok. Solution 3 : setup a (unencrypted) tunnel inside the VPN for each site. This will give one interface for each. Simple tunnels are are not cross-platform (to my knoledge). For example GRE or ipip or sit are ok for Linux, but some distant sites are running only one Windows computer, so openVPN is installed on it. So impossible to setup a simple tunnel. Other option is to use a more complicated tunnel (wich ?) but the overhead on the system and on the sysadmin may be bigger than having multiple VPNs Solution 4 : compile the latest openVPN, because its include a 1:1 NAT feature. I test this this week.


tab-expansion and “./” bash shell

Maybe someone here would be able to help me out. Have installed Ubuntu 12.04 LTS (kubuntu) on two machines. The `.bashrc` and `.bash_profile` files are identical as the file structures on each machine is the same. **On machine 1** : I run bash scripts within a terminal window with the simple: `./scriptname.sh` **On machine 2** : I cannot do this and must use: `sh scriptname.sh` Nor can I use `./` and tab-complete the script filename. All executable bits are set correctly, all files and folders have the correct permissions. In the header of the scripts the shebang is set correctly. Any ideas why this would be occurring? When I try `ls -l`, I get:               -rwxrwxrwx 1 adelie adelie 351 Nov 4 20:32 file_motion_grab.sh      Output of `getfacl` is:               # file: file_motion_grab.sh     # owner: adelie     # group: adelie     user::rwx     group::rwx     other::rwx      More general - any new script on the second machine must be invoked with: sh scriptname.sh Something probably wrong in the .bash files. But not sure where to look. **EDIT** Yep parent directory is all set correctly.


Linux Mint does not shut down

Sometimes (very rarely actually) I have a problem that when I try to shut down my desktop, it will freeze with the following screen and I can only shut it down by pressing the power button for 8 seconds: ![Shutdown failure](http://i.stack.imgur.com/HLvzM.jpg) Does anyone know why this error occurs (I am guessing it is because of the proprietary fglrx-driver) - or how I could get more diagnosing information if it reoccurs? I guess there would be a lot more information than I can capture with a simply photo, but as soon as the screen appears it is impossible to do anything. The problem is, it occurs very rarely (maybe once a month) so it is not really a big hassle and I can not willingly recreate it. I would just like to know what exactly is causing it. Edit: After stumbeling over this bug \- this seems to be the reason for it: the fglrx driver seems to the buggy.


Achieving full resolution with PowerVR SGX454 on Ubuntu 12.04

I have a Mini-PC with an ASRock AD2700B-ITX motherboard, which has an Intel PowerVR SGX545 on-board graphic chip. I installed Ubuntu 12.04 on it today. Everything is working properly and is quite quick and responsive, except that the video resolution is too low. I cannot set it higher than 1280x1024. I have a BenQ G2220HD display, which is capable of 1920x1080. Since both the graphics chip and the display are capable of higher resolutions, I assume this is a driver problem?


Remapping scancode for Caps Lock

In Windows I was able to set Caps Lock to act as a second Enter, which can be pressed by the left little finger. I added this parameter to the registry to do that: > [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout] > "Scancode > Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,1c,00,3a,00,00,00,00,00 How can I do the same in Linux?


How to share a tethered iPhone internet connection with VirtualBox guest?

I mostly connect to my Linux distros to the internet via a USB iPhone tethered connection (MyWi app). I have just installed an Windows XP guest OS via Virtualbox on Ubuntu 12.04. How do I connect the guest OS to the internet via my tethered iPhone connection?


Software installation with GUI package installer using sudo permission

I have the sudo permission, and I can install any software using the CLI. But I want to know that whether `sudo` works with package installers in GUI mode. For example I have a `.chm` file and I want to open it with a mouse click, but `chmviewer` is not installed. So some prompt appears to search on net and by clicking on that pop-up it has suggested some packages e.g `kchmviewer`. But when I clicked on `<install>` it pops-up asking for the root password, which I dont have. Is there a way to install software in GUI mode when you have sudo permission, but not the root password?   Just for curiosity I want to know how to use `sudo` with a GUI installation mode. BTW: I have already installed `kchmviewer` from command line :)


What changes may break a live persistent USB installation?

From my experience it looks like the persistence feature is just an enhancement that provides some space for remembering supplementary changes (installing supplementary software, like office suites, some multimedia players, internet browsers, and for the settings made inside applications). But I am under the impression that the persistence space is not meant for changes in the system files or in the important drivers. Attempting such changes seems useless (they are not remembered) or dangerous (the drive would not boot after a while). I was not able to keep a such drive operating properly and there must be some changes that have entailed this. What they may be and can they be avoided?


Exclude files that have very long lines of text from grep output

I often run grep commands to find things in my code, but the problem with web projects is that there will often be compressed JavaScript and CSS files which create one huge line of text, so that if a match is found, the whole terminal window is filled for more then a 1000 lines, making it extremely impractical to find what I'm looking for. So is there a way to avoid files that have say single lines of text over 200 characters?


How To Locate Dependencies Needed by RPM Packages

I am trying to deal with keeping our RHEL 5 server patched up, but also dealing with our security constraints. This particular server is not allowed to talk to the Internet. So yum isn't really an option. When we get RHN Alerts, I manually go to Red Hat's portal and view the available packages via Classic Management, and download the necessary RPM's to my workstation, then I FTP them onto the server. This all works well and fine, until a particular dependency is needed that's not included in the packages. For example... > root@myserver:~/rhn-packages $ rpm -Uvh *.rpm error: Failed dependencies: > libfontenc.so.1 is needed by libXfont-1.2.2-1.0.5.el5_10.i386 Searching in Red Hat's packages for libfontenc doesn't get me anywhere. How do I go about getting this dependency installed?


How to terminate a hung process in SSH?

I have a SSH session with a VM running on Amazon AWS. One of the programs I had run hung up and froze the SSH terminal. So I hit `Enter`+`~`+`.` Now when I am trying to connect to my machine it says connection timed out.   1. Does this mean that connection was only terminated from the client side and is still active on server? If so how do I create a new connection?   2. `Ctrl`+`C` does not work on a SSH shell. Does this mean it is not possible to terminate the hung up command without terminating the SSH session?


How can a group own a file?

Whe I do `ls -l`, two of the fields are username of the owner and name of the owning group. The username is clear - I created the file, it is mine. However the group entry confuses me. My user is a member of several groups. What is so special about the group with the name same as my username, that _it_ owns newly created files and not some other group e.g. sudoers.


How to get vimchat to work in linux

I added               Bundle 'throughnothing/vimchat'      to my `~/.vimrc` file and ran `:PluginInstall`. That all ran fine, then I added an account and password to the `~/.vim/Bundle/vimchat/config` file like this:               user@domain = password      When I run `vim` and type `:VimChat` (after restarting) I get this message:               E492: Not an editor command: VimChat      Clearly the installation somehow failed, but I'm a bit at a loss on how to diagnose this. The installation seemed to go fine! I'm using `vim 7.4`


Replacing text between two HTML Comments

I am new to the world of `sed`/`awk` and regex in general and have been studying their usage, but have been floundering trying to meet my need: I have an `htm` page that has a single line notice that needs to be updated with user inputted text (via shell script) between two comments acting as tags, for example:               <!--BeginNoticeMSG-->NOTICE: This is a notice<!--EndNoticeMSG-->      The user inputted text (stored in a variable, let's call it `$NEWNOTICE`) would then need to replace what's between the tags, so effectively:               <!--BeginNoticeMSG-->$NEWNOTICE<!--EndNoticeMSG-->      Which would get inserted into the `htm` file as (for example):               <!--BeginNoticeMSG-->This is a test notice<!--EndNoticeMSG-->      How can I identify and replace the text between the tags properly?


Why is bash used in boot scripts?

Why programs run at boot/shutdown are written in `bash` script? If a compiled language (or a faster interpreted language, like Python) was used, then its running time would be shorter.


smartctl: suspend read-scan the remainder of the disk

I have started read-scan the disk using:               smartctl -t select,10-11 -t afterselect,on -t pending,45 /dev/sda      It seems, however, it kills the disk performance. I had expected that the read-scan would (just like the tests) be suspended when there was disk activity. I had also expected the read scan (like the tests) would run without load on the server, but according to `iostat -x -d 1` it seems read-test goes through the controller. Is this normal? Can I suspend the read scan when the disk is active (e.g. only run read scan if idle for 500 ms)?


How do I get the MD5 sum of a directory's contents as one sum?

The md5sum program does not provide checksums for directories. I want to get a single MD5 checksum for the entire contents of a directory, including files in sub-directories. That is, one combined checksum made out of all the files. Is there a way to do this?


How to summarize error messages of an emerge run?

An update on a gentoo system with               # emerge --update --newuse --deep --keep-going @world      creates lots of text on the console. Error messages and warnings appear between less important informative lines of the compiler. **Which tools help to summarize the problems of the last update runs?**


How to meet required dependencies in order to install expect pecl extension on Mac OS X?

I am attempting to install the expect pecl extension. > OS version = 10.7.3   >  PHP version 5.3.10 installed via macports   >  expect version 5.45 installed via macports The command I am executing:               sudo pecl -d preferred_state=beta install expect      fails with `ld: library not found for -lexpect` The `libexpect5.45.dylib` file is located in `/opt/local/lib`. Full output of the install command is here. From what I can tell pecl just can not find the libexpect library, I even tried prepending:               LD_LIBRARY_PATH=/opt/local/lib/expect5.45     LD_LIBRARY_PATH=/System/Library/Tcl/8.5/expect5.45     LD_LIBRARY_PATH=/opt/local/lib      Each location has an `expect5.45.dylib` file. It did not help. Can anyone help me figure out how to get this extension installed?


Is it necessary to run a SSH daemon if I use Chef locally?

I want to write a `chef` cookbook to setup Linux desktop environments. I created a `kitchen` by `knife solo init chef-repo`, and created a cookbook `hello` and a node file `localhost.json`. Then I run:               $ knife solo cook localhost      and got this error:               Running Chef on localhost...     Checking Chef version...     ERROR: Network Error: Connection refused - connect(2) for "localhost" port 22     Check your knife configuration and network settings      Should I run a ssh daemon even if I use chef host and client in localhost? I'm using `Linux Mint 16` in a VirtualBox environments. And this is my `~/.chef/knife.rb` config file:               log_level                :info     log_location             STDOUT     node_name                'ironsand'     client_key               '/home/ironsand/.chef/ironsand.pem'     validation_client_name   'chef-validator'     validation_key           '/etc/chef-server/chef-validator.pem'     chef_server_url          'https://vm-mint:443'     syntax_check_cache_path  '/home/ironsand/.chef/syntax_check_cache'


How to secure Apache/MySql/PHPMyAdmin against brute force/dictionary attacks? (Fail2ban?)

I'm wanting to run a publicly accessible server for web hosting. I'm interested in preventing brute force attacks made against PHPMyAdmin or any other form of authentication process I may include in the site. What types of options exist for this without having to monitor every possible login method that may exist that I actually want public facing? I use Fail2ban to block things like too many ssh attempts. I also just started using it for stopping too many PHPMyAdmin login attempts. My concern are other arbitrary login pages that my web developer may create for things specific to the website. Initial thoughts were things like stopping too many requests per X seconds. That, however, would have to be a rather high number to accommodate pages with lots of images and sounds like it would have a lot of room for false positives. I would think this would be similar to how a shared hosting provider would help keep your website secure when they have no idea what content you may have (a bank would obviously not host that kind of information with a shared provider, but many less sensitive sites would still want to keep logins from being brute forced). Perhaps this is the reason for captchas?


How to securely allow scp, but not ssh

I work from a Mac Book Pro (called foo). I have a server where my customers scp large files to. (called bar). I frequently ssh into bar, and scp a file (called buzz) to my Mac.               bob@foo$ ssh bar       Last login: Fri Aug 23 14:49:32 2013 from foo       bob@bar$ scp /guest/buzz bob@foo:~     Password:       I don't want to enter my password every time I scp a file back to my Mac because I'll eventually automate this.   I know I _could_ setup ssh keys, but I am concerned that if someone hacks `bar` that they could easily access `foo`. (Correct me if I'm wrong) **Is there a way to copy a file from bar to foo, without a password, that wouldn't give someone full shell access to my Mac if the server was compromised?** Note: I'm thinking setting up a new user on my Mac and disabling shell access for that user _might_ work, but I feel like there is a better way. I'd rather not add users if possible.