Creating launchable tmux configurations?

I find myself often doing the same thing with `tmux`:   1. `cd` to a given directory.   2. `tmux`   3. Rename window to what I'm doing.    4. Split the window vertically 50%.   5. Start one process in the left window.   6. Start another process in the right window.   7. Profit. Is there a way for me to automate launching all of this so that I can run a single command and get the window I'm looking for?


Screen flickers and will not advance to login on Fedora 18

When I try to load Fedora on my desktop, the screen flickers as the "f" fills up. After the "f" fills up, the screen continues to flicker but does not advance to the login screen. Additionally, the screen is offset a random amount (that changes each time) so that when I move my mouse all the way to the left it wraps around to the right for a few hundred pixels. I used to deal with this problem by tapping the power button to enter sleep mode - when I tapped it again to resume the problem would be fixed. However, after recent updates, the power button no longer seems to start sleep mode and I can't figure out another way to do it. I can't open the terminal from this view to debug in any meaningful way. I've tried the last three kernels (I don't have more previous ones saved) and they all have the same problem. Searching around, I can't find much on Fedora flickering + not properly booting. Does anyone have any suggestions? What kind of hardware specs should I provide to make this an easier problem to solve? I'm not sure if this is a Fedora specific problem or a general linux one because I have only Fedora and Windows installed on this computer.


Is it better to upgrade Fedora 17 or install new Fedora 18?

I have a good and configured Fedora 17, I am very happy with it. I am going to upgrade it to Fedora 18 using `FedUp`, I was wondering can i do it easily without any break or problem or it is better to install a fresh Fedora 18. I have several concerns after upgrading:   * My Fedora performance.   * Break My fedora and does not boot.   * Some of my software does not run. I must mention that i have installed RPM fusion packages on my Fedora 17. Please advise me if you have any knowledge or experience about this issue.


Are there a way to block a program from starting during certain times?

As the title says. I want to prevent a certain program from being started during specific times. Are there a good way of accomplishing this at *nix distros?


Build minimal centos

I'm building a miniminal Centos5 for use in xen but i having problems when go to use yum this are the steps:               $ mkdir -p images/x86_64/5     $ cd images/x86_64/5     $ mkdir -p proc etc dev var/{cache,log,lock/rpm} sys     # yum -c yum.conf --installroot=images/x86_64/5 -y groupinstall Base      the last command throw the following error:               error: could not open Packages index using db3 - No such file or directory (2)     error: can not open Packages database in images/x86_64/5/var/lib/rpm     Traceback (most recent call last):       File "/usr/bin/yum", line 29, in ?         yummain.user_main(sys.argv[1:], exit_code=True)       File "/usr/share/yum-cli/yummain.py", line 309, in user_main         errcode = main(args)       File "/usr/share/yum-cli/yummain.py", line 157, in main         base.getOptionsConfig(args)       File "/usr/share/yum-cli/cli.py", line 187, in getOptionsConfig         self.conf       File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 665, in <lambda>         conf = property(fget=lambda self: self._getConfig(),       File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 240, in _getConfig         self._conf = config.readMainConfig(startupconf)       File "/usr/lib/python2.4/site-packages/yum/config.py", line 805, in readMainConfig         yumvars['releasever'] = _getsysver(startupconf.installroot, startupconf.distroverpkg)       File "/usr/lib/python2.4/site-packages/yum/config.py", line 878, in _getsysver         idx = ts.dbMatch('provides', distroverpkg)     TypeError: rpmdb open failed      ## How i can solve this?


Make cd follow symbolic links

I have my code mounted as an sshfs in my home directory, but the hierarchy is difficult to remember, so I created a symlink in my home directory leading to that directory. Is there a way so that when I cd to that symbolic link, instead of cding to the symbolic link, it will actually cd to that directory? If the question was unclear, here is an example of what I am looking for:               foo@foo:~$ ls -l     lrwxrwxrwx  1 foo      foo              5 2012-11-14 08:20 foo -> bar/bar          foo@foo:~$ cd foo     foo@foo:~/bar/bar/$


Attempting to insert characters via shell script bound to hotkey

I added the following to `/root/.config/openbox/rc.xml`:               <keybind key="C-A-t">             <action name="Execute">                 <command>/root/my-applications/test1.sh</command>             </action>     </keybind>        The `test1.sh file` consists of an executable shell script which outputs `ñ`. The idea being to tie the key combination to the output, so when I press `C`-`A`-`t` it will output an `ñ`. However, it doesn't work; pressing it in (for example) Geany does nothing. I have reconfigured openbox. What am I doing wrong?


How can I access a directory outside a chroot from within it?

I have a user which is chrooted to her home directory, but I want her to also be able to manage files within `/var/www`. As such, I did the following:               root@server:/home/username# ln -s /var/www www     root@server:/home/username# cd www     root@server:/home/username/www# chown username:username *      However, when I try to open `/www` with FileZilla it returns "no such file or directory". I can see the linked directory, but I can't access it. What am I doing wrong?


What happens if I set default system runlevel to 0 or 6?

What I understand from runlevels is that in each level some programs have permission to be executed and some don't. runlevel 3 boots system into CLI and runlevel 5 starts the default GUI. But I don't understand what do 0(shutdown) and 6(reboot) mean?(Start in shutdown/reboot mode?!). What happens If set initdefault to these values?


What are some ways to compare file type and encodings to resolve buggy grep...?

In this case I have a folder of .txt files I created using _drag and copy and paste_ from Adobe Acrobat PDFs and Text Editor in OSX. I've been editing these files in vim. Now I'm using grep to find notes in these files. For example,               grep -c "\[t\]" Herbert*      `[t]` is the note and the directory has 22 files with the name-prefix `Herbert*` (as in `Herbert-02-Transformation.txt`, `Herbert-14-Classification.txt`). The trouble is `grep` only finds the search string in one file (`Herbert-03-Square.txt`), but each file has the same note many times. The trouble files display `converted` in the status bar when I open them,               "Herbert-02-Transformation.txt" [converted] 276L, 57171C      A post at unix.stack suggests special characters from the original have survived the trip from PDF to vim to cause this trouble with `grep`. I've been deleting the borked characters and manually inserting the proper `:digraphs`. Some of the edited files are searchable by grep and other edited files are not. I attempted to use,               :e Herbert-02-Transformation.txt     :set encoding=utf-8`      :w      but the file still opens as shown above. Now I'm thinking I need to figure out how to compare the encodings of those files where `grep` is working and those where it is not. There are enough help pages detailing _how to set up file detection_ in .vimrc to avoid this problem that I've spent over 1.5 hours researching this, and I now think its a good question...


How to decide that mv moves into a directory rather than replacing directory?

Say I have a directory `/hello`. Then I do `mv /hello /hello2`. Am I moving `/hello` into `/hello2/hello`? Or am I moving `/hello` to `/hello2`? It seems that when I do something like this, I get inconsistent results.


equivalent of update-grub for rhel/fedora/centos systems

In Ubuntu (and I guess in Debian too) there is a system script named `update- grub` which automatically executes `grub-mkconfig -o` with the correct path for the grub configuration file. Is there any similar command for redhat based system? If not, how do the system knows where is the grub configuration file to update when a new kernel version is installed?


Ctrl + Right and Right send same Sequence in Putty > Screen > Vim

I'm using putty > screen > vim, and screen is sending the same sequence for `Ctrl`+`Right` and `Right` in application mode for vim. There is an option to make putty send the cursor mode sequences (disable application cursor keys mode) when in application mode and that works, but when screen is introduced, something isn't right. How would I go about fixing this?


Linux md RAID: /dev/md0 vs. /dev/md/0

On newer systems `/usr/share/mdadm/mkconf` (the script that is used to generate `/etc/mdadm/mdadm.conf`) tends to use the device name `/dev/md/0` instead of `/dev/md0`:               new-system ~ # /usr/share/mdadm/mkconf | grep ARRAY     ARRAY /dev/md/0 metadata=1.2 UUID=a0021927:0e4f10bf:2c47dc72:ca0b352e name=unassigned:0      This may cause some irritation for users who expect `/dev/md0` there, but apparently it works fine because the server boots without problems. In `/proc/mdstat` the device is still called `/dev/md0`:               new-system ~ # cat /proc/mdstat     Personalities : [raid1]     md0 : active raid1 sdb2[2] sda2[0]           1953381184 blocks super 1.2 [2/2] [UU]          unused devices: <none>      `ls` shows that `/dev/md/0` is a symlink to `/dev/md0`:               new-system ~ # ls -l /dev/md/0      lrwxrwxrwx 1 root root 6 Nov 20 14:06 /dev/md/0 -> ../md0      On another older system `mkconf` still uses `/dev/md0` instead, and `/dev/md` is empty:               old-system ~ # /usr/share/mdadm/mkconf | grep ARRAY     ARRAY /dev/md0 UUID=76472cf5:83fd8e5a:ad617046:69b2ebf1     old-system ~ # ls -l /dev/md     total 0      I'd like to know the difference between these device names, and I can't find any explanation on Google. Is `/dev/mdN` the old name, and `md` is planning to move to `/dev/md/N` device names? Is this change related to the 1.2 metadata (I've noticed that the new server is using md 1.2, while the old one is still using 0.90)?


How do I multiply and sum column data using awk and or sed?

I have several columns of data. I always have the same number of rows (say 5). In the 2nd column, I want to multipy the first value by 5, then the second value by 4, the third value by 3, etc. I then want to sum these values, and divide by the sum of the values in the second column. How would I do this in sed and/or awk? Example:               4 5 7 1 2 3     5 1 2 3 1 2     4 2 3 6 1 2     3 4 1 6 3 3     2 3 1 2 1 6 Answer: `(5*5 + 4*1 + 3*2 + 2*4 + 1*3)/(5 + 1 + 2 + 4 + 3) = 3.067`


Export an env variable to be available at all sub shells, and possible to be modified?

Suppose I have               export MY_VAR=0      in `~/.bashrc`. I have an opened gnome terminal, and in this terminal, I change `$MY_VAR` value to `200`. So, if I do               echo $MY_VAR      in this terminal, `200` is shown. Now, I opened another tab in my gnome terminal, and do               echo $MY_VAR      ...and instead of `200`, I have `0`. What should I do to persist the 200 value when a terminal modifies an environment variable, making this modification (setting to 200) available to all subsequent sub shells and such? Is this possible?


Periodically unable to connect to WPA2-EAP access point

I have setup a WPA2-EAP TLS WiFi access point at home and everything works fine usually. Unfortunately, though, many times I'll drop my connection to the access point and won't be able to reconnect. Here's output from `/var/log/syslog`:               Feb 19 13:45:55 mightymoose NetworkManager[1520]: <warn> Activation (eth2/wireless): association took too long.     Feb 19 13:45:55 mightymoose NetworkManager[1520]: <info> (eth2): device state change: config -> need-auth (reason 'none') [50 60 0]     Feb 19 13:45:55 mightymoose NetworkManager[1520]: <warn> Activation (eth2/wireless): asking for new secrets     Feb 19 13:45:55 mightymoose wpa_supplicant[1823]: CTRL-EVENT-DISCONNECTED bssid=00:00:00:00:00:00 reason=0     Feb 19 13:45:55 mightymoose kernel: [ 7683.962658] cfg80211: Calling CRDA to update world regulatory domain     Feb 19 13:45:55 mightymoose kernel: [ 7683.968693] cfg80211: World regulatory domain updated:     Feb 19 13:45:55 mightymoose kernel: [ 7683.968698] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)     Feb 19 13:45:55 mightymoose kernel: [ 7683.968701] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)     Feb 19 13:45:55 mightymoose kernel: [ 7683.968703] cfg80211:   (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)     Feb 19 13:45:55 mightymoose kernel: [ 7683.968706] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)     Feb 19 13:45:55 mightymoose kernel: [ 7683.968708] cfg80211:   (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)     Feb 19 13:45:55 mightymoose kernel: [ 7683.968710] cfg80211:   (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)     Feb 19 13:45:55 mightymoose NetworkManager[1520]: <info> (eth2): supplicant interface state: associated -> disconnected     Feb 19 13:45:55 mightymoose NetworkManager[1520]: <warn> Couldn't disconnect supplicant interface: This interface is not connected.     Feb 19 13:45:58 mightymoose NetworkManager[1520]: get_secret_flags: assertion `is_secret_prop (setting, secret_name, error)' failed     Feb 19 13:45:58 mightymoose NetworkManager[1520]: <info> Activation (eth2) Stage 1 of 5 (Device Prepare) scheduled...     Feb 19 13:45:58 mightymoose NetworkManager[1520]: <info> Activation (eth2) Stage 1 of 5 (Device Prepare) started...     Feb 19 13:45:58 mightymoose NetworkManager[1520]: <info> (eth2): device state change: need-auth -> prepare (reason 'none') [60 40 0]     Feb 19 13:45:58 mightymoose NetworkManager[1520]: <info> Activation (eth2) Stage 2 of 5 (Device Configure) scheduled...     Feb 19 13:45:58 mightymoose NetworkManager[1520]: <info> Activation (eth2) Stage 1 of 5 (Device Prepare) complete.     Feb 19 13:45:58 mightymoose NetworkManager[1520]: <info> Activation (eth2) Stage 2 of 5 (Device Configure) starting...     Feb 19 13:45:58 mightymoose NetworkManager[1520]: <info> (eth2): device state change: prepare -> config (reason 'none') [40 50 0]     Feb 19 13:45:58 mightymoose NetworkManager[1520]: <info> Activation (eth2/wireless): connection 'Teekopolis' has security, and secrets exist.  No new secrets needed.     Feb 19 13:45:58 mightymoose NetworkManager[1520]: <info> Config: added 'ssid' value 'Teekopolis'     Feb 19 13:45:58 mightymoose NetworkManager[1520]: <info> Config: added 'scan_ssid' value '1'     Feb 19 13:45:58 mightymoose NetworkManager[1520]: <info> Config: added 'key_mgmt' value 'WPA-EAP'     Feb 19 13:45:58 mightymoose NetworkManager[1520]: <info> Config: added 'eap' value 'TLS'     Feb 19 13:45:58 mightymoose NetworkManager[1520]: <info> Config: added 'fragment_size' value '1300'     Feb 19 13:45:58 mightymoose NetworkManager[1520]: <info> Config: added 'ca_cert' value '/home/naftuli/.certs/teekopolis-wifi-client-ca.crt'     Feb 19 13:45:58 mightymoose NetworkManager[1520]: <info> Config: added 'private_key' value '/home/naftuli/.certs/teekopolis-wifi-naftuli-mightymoose.p12'     Feb 19 13:45:58 mightymoose NetworkManager[1520]: <info> Config: added 'private_key_passwd' value '<omitted>'     Feb 19 13:45:58 mightymoose NetworkManager[1520]: <info> Config: added 'identity' value 'naftuli@mightymoose'     Feb 19 13:45:58 mightymoose NetworkManager[1520]: <info> Config: added 'bgscan' value 'simple:30:-45:300'     Feb 19 13:45:58 mightymoose NetworkManager[1520]: <info> Activation (eth2) Stage 2 of 5 (Device Configure) complete.     Feb 19 13:45:58 mightymoose NetworkManager[1520]: <info> Config: set interface ap_scan to 1     Feb 19 13:45:58 mightymoose NetworkManager[1520]: <info> (eth2): supplicant interface state: disconnected -> scanning     Feb 19 13:46:01 mightymoose wpa_supplicant[1823]: Trying to associate with FF:FF:FF:FF:FF:FF (SSID='Teekopolis' freq=2412 MHz)     Feb 19 13:46:01 mightymoose NetworkManager[1520]: <info> (eth2): supplicant interface state: scanning -> associating     Feb 19 13:46:01 mightymoose wpa_supplicant[1823]: Associated with FF:FF:FF:FF:FF:FF     Feb 19 13:46:01 mightymoose wpa_supplicant[1823]: bgscan simple: Failed to enable signal strength monitoring     Feb 19 13:46:01 mightymoose kernel: [ 7689.938155] cfg80211: Calling CRDA for country: US     Feb 19 13:46:01 mightymoose wpa_supplicant[1823]: CTRL-EVENT-EAP-STARTED EAP authentication started     Feb 19 13:46:01 mightymoose NetworkManager[1520]: <info> (eth2): supplicant interface state: associating -> associated     Feb 19 13:46:01 mightymoose kernel: [ 7689.942709] cfg80211: Regulatory domain changed to country: US     Feb 19 13:46:01 mightymoose kernel: [ 7689.942713] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)     Feb 19 13:46:01 mightymoose kernel: [ 7689.942716] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2700 mBm)     Feb 19 13:46:01 mightymoose kernel: [ 7689.942718] cfg80211:   (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 1700 mBm)     Feb 19 13:46:01 mightymoose kernel: [ 7689.942721] cfg80211:   (5250000 KHz - 5330000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)     Feb 19 13:46:01 mightymoose kernel: [ 7689.942723] cfg80211:   (5490000 KHz - 5600000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)     Feb 19 13:46:01 mightymoose kernel: [ 7689.942725] cfg80211:   (5650000 KHz - 5710000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)     Feb 19 13:46:01 mightymoose kernel: [ 7689.942727] cfg80211:   (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 3000 mBm)     Feb 19 13:46:01 mightymoose wpa_supplicant[1823]: CTRL-EVENT-EAP-PROPOSED-METHOD vendor=0 method=13     Feb 19 13:46:01 mightymoose wpa_supplicant[1823]: OpenSSL: pending error: error:0606F076:digital envelope routines:EVP_PKCS82PKEY:unsupported private key algorithm     Feb 19 13:46:01 mightymoose wpa_supplicant[1823]: OpenSSL: pending error: error:140CB00D:SSL routines:SSL_use_PrivateKey_file:ASN1 lib     Feb 19 13:46:01 mightymoose wpa_supplicant[1823]: OpenSSL: pending error: error:140CB009:SSL routines:SSL_use_PrivateKey_file:PEM lib     Feb 19 13:46:01 mightymoose wpa_supplicant[1823]: CTRL-EVENT-EAP-METHOD EAP vendor 0 method 13 (TLS) selected     Feb 19 13:46:01 mightymoose kernel: [ 7690.190340] net_ratelimit: 14 callbacks suppressed     Feb 19 13:46:01 mightymoose kernel: [ 7690.190345] ERROR @wl_cfg80211_get_station : Could not get rate (-1)     Feb 19 13:46:01 mightymoose kernel: [ 7690.190350] ERROR @wl_cfg80211_get_station : Could not get rssi (-1)     Feb 19 13:46:01 mightymoose kernel: [ 7690.190386] ERROR @wl_cfg80211_get_station : Could not get rate (-1)     Feb 19 13:46:01 mightymoose kernel: [ 7690.190389] ERROR @wl_cfg80211_get_station : Could not get rssi (-1)     Feb 19 13:46:02 mightymoose kernel: [ 7690.689071] ERROR @wl_cfg80211_get_station : Could not get rate (-1)     Feb 19 13:46:02 mightymoose kernel: [ 7690.689073] ERROR @wl_cfg80211_get_station : Could not get rssi (-1)     Feb 19 13:46:02 mightymoose kernel: [ 7690.689087] ERROR @wl_cfg80211_get_station : Could not get rate (-1)     Feb 19 13:46:02 mightymoose kernel: [ 7690.689088] ERROR @wl_cfg80211_get_station : Could not get rssi (-1)     Feb 19 13:46:02 mightymoose kernel: [ 7691.188556] ERROR @wl_cfg80211_get_station : Could not get rate (-1)     Feb 19 13:46:02 mightymoose kernel: [ 7691.188564] ERROR @wl_cfg80211_get_station : Could not get rssi (-1)     Feb 19 13:46:05 mightymoose wpa_supplicant[1823]: CTRL-EVENT-EAP-PEER-CERT depth=1 subject='/C=US/ST=California/L=Teekopolis/O=City of Teekopolis/OU=Internet Security Division/CN=Teekopolis Certificate Authority/emailAddress=me@mail.com'     Feb 19 13:46:05 mightymoose wpa_supplicant[1823]: CTRL-EVENT-EAP-PEER-CERT depth=0 subject='/C=US/ST=California/L=Teekopolis/O=City of Teekopolis/OU=Internet Security Division/CN=Teekopolis WiFi/emailAddress=me@mail.com'     Feb 19 13:46:07 mightymoose kernel: [ 7695.679441] net_ratelimit: 34 callbacks suppressed     Feb 19 13:46:07 mightymoose kernel: [ 7695.679446] ERROR @wl_cfg80211_get_station : Could not get rate (-1)     Feb 19 13:46:07 mightymoose kernel: [ 7695.679450] ERROR @wl_cfg80211_get_station : Could not get rssi (-1)     Feb 19 13:46:07 mightymoose kernel: [ 7695.679481] ERROR @wl_cfg80211_get_station : Could not get rate (-1)     Feb 19 13:46:07 mightymoose kernel: [ 7695.679484] ERROR @wl_cfg80211_get_station : Could not get rssi (-1)     Feb 19 13:46:07 mightymoose kernel: [ 7696.178268] ERROR @wl_cfg80211_get_station : Could not get rate (-1)     Feb 19 13:46:07 mightymoose kernel: [ 7696.178274] ERROR @wl_cfg80211_get_station : Could not get rssi (-1)     Feb 19 13:46:07 mightymoose kernel: [ 7696.178318] ERROR @wl_cfg80211_get_station : Could not get rate (-1)     Feb 19 13:46:07 mightymoose kernel: [ 7696.178321] ERROR @wl_cfg80211_get_station : Could not get rssi (-1)     Feb 19 13:46:08 mightymoose kernel: [ 7696.677439] ERROR @wl_cfg80211_get_station : Could not get rate (-1)     Feb 19 13:46:08 mightymoose kernel: [ 7696.677446] ERROR @wl_cfg80211_get_station : Could not get rssi (-1)     Feb 19 13:46:12 mightymoose kernel: [ 7701.168812] net_ratelimit: 34 callbacks suppressed     Feb 19 13:46:12 mightymoose kernel: [ 7701.168817] ERROR @wl_cfg80211_get_station : Could not get rate (-1)     Feb 19 13:46:12 mightymoose kernel: [ 7701.168821] ERROR @wl_cfg80211_get_station : Could not get rssi (-1)     Feb 19 13:46:12 mightymoose kernel: [ 7701.168867] ERROR @wl_cfg80211_get_station : Could not get rate (-1)     Feb 19 13:46:12 mightymoose kernel: [ 7701.168870] ERROR @wl_cfg80211_get_station : Could not get rssi (-1)     Feb 19 13:46:13 mightymoose kernel: [ 7701.667772] ERROR @wl_cfg80211_get_station : Could not get rate (-1)     Feb 19 13:46:13 mightymoose kernel: [ 7701.667778] ERROR @wl_cfg80211_get_station : Could not get rssi (-1)     Feb 19 13:46:13 mightymoose kernel: [ 7701.667808] ERROR @wl_cfg80211_get_station : Could not get rate (-1)     Feb 19 13:46:13 mightymoose kernel: [ 7701.667811] ERROR @wl_cfg80211_get_station : Could not get rssi (-1)     Feb 19 13:46:13 mightymoose kernel: [ 7702.166645] ERROR @wl_cfg80211_get_station : Could not get rate (-1)     Feb 19 13:46:13 mightymoose kernel: [ 7702.166652] ERROR @wl_cfg80211_get_station : Could not get rssi (-1)     Feb 19 13:46:18 mightymoose kernel: [ 7706.657907] net_ratelimit: 34 callbacks suppressed     Feb 19 13:46:18 mightymoose kernel: [ 7706.657912] ERROR @wl_cfg80211_get_station : Could not get rate (-1)     Feb 19 13:46:18 mightymoose kernel: [ 7706.657916] ERROR @wl_cfg80211_get_station : Could not get rssi (-1)     Feb 19 13:46:18 mightymoose kernel: [ 7706.657947] ERROR @wl_cfg80211_get_station : Could not get rate (-1)     Feb 19 13:46:18 mightymoose kernel: [ 7706.657950] ERROR @wl_cfg80211_get_station : Could not get rssi (-1)     Feb 19 13:46:18 mightymoose kernel: [ 7707.156579] ERROR @wl_cfg80211_get_station : Could not get rate (-1)     Feb 19 13:46:18 mightymoose kernel: [ 7707.156585] ERROR @wl_cfg80211_get_station : Could not get rssi (-1)     Feb 19 13:46:18 mightymoose kernel: [ 7707.156700] ERROR @wl_cfg80211_get_station : Could not get rate (-1)     Feb 19 13:46:18 mightymoose kernel: [ 7707.156705] ERROR @wl_cfg80211_get_station : Could not get rssi (-1)     Feb 19 13:46:19 mightymoose kernel: [ 7707.655948] ERROR @wl_cfg80211_get_station : Could not get rate (-1)     Feb 19 13:46:19 mightymoose kernel: [ 7707.655954] ERROR @wl_cfg80211_get_station : Could not get rssi (-1)     Feb 19 13:46:23 mightymoose kernel: [ 7712.147167] net_ratelimit: 34 callbacks suppressed     Feb 19 13:46:23 mightymoose kernel: [ 7712.147173] ERROR @wl_cfg80211_get_station : Could not get rate (-1)     Feb 19 13:46:23 mightymoose kernel: [ 7712.147179] ERROR @wl_cfg80211_get_station : Could not get rssi (-1)     Feb 19 13:46:23 mightymoose kernel: [ 7712.147234] ERROR @wl_cfg80211_get_station : Could not get rate (-1)     Feb 19 13:46:23 mightymoose kernel: [ 7712.147239] ERROR @wl_cfg80211_get_station : Could not get rssi (-1)     Feb 19 13:46:24 mightymoose kernel: [ 7712.646038] ERROR @wl_cfg80211_get_station : Could not get rate (-1)     Feb 19 13:46:24 mightymoose kernel: [ 7712.646044] ERROR @wl_cfg80211_get_station : Could not get rssi (-1)     Feb 19 13:46:24 mightymoose kernel: [ 7712.646076] ERROR @wl_cfg80211_get_station : Could not get rate (-1)     Feb 19 13:46:24 mightymoose kernel: [ 7712.646079] ERROR @wl_cfg80211_get_station : Could not get rssi (-1)     Feb 19 13:46:24 mightymoose kernel: [ 7713.145072] ERROR @wl_cfg80211_get_station : Could not get rate (-1)     Feb 19 13:46:24 mightymoose kernel: [ 7713.145079] ERROR @wl_cfg80211_get_station : Could not get rssi (-1)     Feb 19 13:46:29 mightymoose kernel: [ 7717.636378] net_ratelimit: 34 callbacks suppressed     Feb 19 13:46:29 mightymoose kernel: [ 7717.636383] ERROR @wl_cfg80211_get_station : Could not get rate (-1)     Feb 19 13:46:29 mightymoose kernel: [ 7717.636387] ERROR @wl_cfg80211_get_station : Could not get rssi (-1)     Feb 19 13:46:29 mightymoose kernel: [ 7717.636432] ERROR @wl_cfg80211_get_station : Could not get rate (-1)     Feb 19 13:46:29 mightymoose kernel: [ 7717.636435] ERROR @wl_cfg80211_get_station : Could not get rssi (-1)     Feb 19 13:46:29 mightymoose kernel: [ 7718.135475] ERROR @wl_cfg80211_get_station : Could not get rate (-1)     Feb 19 13:46:29 mightymoose kernel: [ 7718.135484] ERROR @wl_cfg80211_get_station : Could not get rssi (-1)     Feb 19 13:46:29 mightymoose kernel: [ 7718.135530] ERROR @wl_cfg80211_get_station : Could not get rate (-1)     Feb 19 13:46:29 mightymoose kernel: [ 7718.135533] ERROR @wl_cfg80211_get_station : Could not get rssi (-1)     Feb 19 13:46:30 mightymoose kernel: [ 7718.633836] ERROR @wl_cfg80211_get_station : Could not get rate (-1)     Feb 19 13:46:30 mightymoose kernel: [ 7718.633842] ERROR @wl_cfg80211_get_station : Could not get rssi (-1)     Feb 19 13:46:34 mightymoose kernel: [ 7723.125379] net_ratelimit: 34 callbacks suppressed     Feb 19 13:46:34 mightymoose kernel: [ 7723.125384] ERROR @wl_cfg80211_get_station : Could not get rate (-1)     Feb 19 13:46:34 mightymoose kernel: [ 7723.125389] ERROR @wl_cfg80211_get_station : Could not get rssi (-1)     Feb 19 13:46:34 mightymoose kernel: [ 7723.125481] ERROR @wl_cfg80211_get_station : Could not get rate (-1)     Feb 19 13:46:34 mightymoose kernel: [ 7723.125487] ERROR @wl_cfg80211_get_station : Could not get rssi (-1)     Feb 19 13:46:35 mightymoose kernel: [ 7723.624485] ERROR @wl_cfg80211_get_station : Could not get rate (-1)     Feb 19 13:46:35 mightymoose kernel: [ 7723.624491] ERROR @wl_cfg80211_get_station : Could not get rssi (-1)     Feb 19 13:46:35 mightymoose kernel: [ 7723.624527] ERROR @wl_cfg80211_get_station : Could not get rate (-1)     Feb 19 13:46:35 mightymoose kernel: [ 7723.624530] ERROR @wl_cfg80211_get_station : Could not get rssi (-1)     Feb 19 13:46:35 mightymoose kernel: [ 7724.123601] ERROR @wl_cfg80211_get_station : Could not get rate (-1)     Feb 19 13:46:35 mightymoose kernel: [ 7724.123607] ERROR @wl_cfg80211_get_station : Could not get rssi (-1)     Feb 19 13:46:40 mightymoose kernel: [ 7728.614731] net_ratelimit: 34 callbacks suppressed     Feb 19 13:46:40 mightymoose kernel: [ 7728.614736] ERROR @wl_cfg80211_get_station : Could not get rate (-1)     Feb 19 13:46:40 mightymoose kernel: [ 7728.614740] ERROR @wl_cfg80211_get_station : Could not get rssi (-1)     Feb 19 13:46:40 mightymoose kernel: [ 7728.614776] ERROR @wl_cfg80211_get_station : Could not get rate (-1)     Feb 19 13:46:40 mightymoose kernel: [ 7728.614779] ERROR @wl_cfg80211_get_station : Could not get rssi (-1)     Feb 19 13:46:40 mightymoose kernel: [ 7729.113430] ERROR @wl_cfg80211_get_station : Could not get rate (-1)     Feb 19 13:46:40 mightymoose kernel: [ 7729.113436] ERROR @wl_cfg80211_get_station : Could not get rssi (-1)     Feb 19 13:46:40 mightymoose kernel: [ 7729.113584] ERROR @wl_cfg80211_get_station : Could not get rate (-1)     Feb 19 13:46:40 mightymoose kernel: [ 7729.113590] ERROR @wl_cfg80211_get_station : Could not get rssi (-1)     Feb 19 13:46:41 mightymoose kernel: [ 7729.612654] ERROR @wl_cfg80211_get_station : Could not get rate (-1)     Feb 19 13:46:41 mightymoose kernel: [ 7729.612660] ERROR @wl_cfg80211_get_station : Could not get rssi (-1)     Feb 19 13:46:45 mightymoose kernel: [ 7734.103894] net_ratelimit: 34 callbacks suppressed     Feb 19 13:46:45 mightymoose kernel: [ 7734.103898] ERROR @wl_cfg80211_get_station : Could not get rate (-1)     Feb 19 13:46:45 mightymoose kernel: [ 7734.103904] ERROR @wl_cfg80211_get_station : Could not get rssi (-1)     Feb 19 13:46:45 mightymoose kernel: [ 7734.103938] ERROR @wl_cfg80211_get_station : Could not get rate (-1)     Feb 19 13:46:45 mightymoose kernel: [ 7734.103941] ERROR @wl_cfg80211_get_station : Could not get rssi (-1)     Feb 19 13:46:46 mightymoose kernel: [ 7734.602939] ERROR @wl_cfg80211_get_station : Could not get rate (-1)     Feb 19 13:46:46 mightymoose kernel: [ 7734.602945] ERROR @wl_cfg80211_get_station : Could not get rssi (-1)     Feb 19 13:46:46 mightymoose kernel: [ 7734.602985] ERROR @wl_cfg80211_get_station : Could not get rate (-1)     Feb 19 13:46:46 mightymoose kernel: [ 7734.602988] ERROR @wl_cfg80211_get_station : Could not get rssi (-1)     Feb 19 13:46:46 mightymoose kernel: [ 7735.101881] ERROR @wl_cfg80211_get_station : Could not get rate (-1)     Feb 19 13:46:46 mightymoose kernel: [ 7735.101887] ERROR @wl_cfg80211_get_station : Could not get rssi (-1)     Feb 19 13:46:51 mightymoose kernel: [ 7739.593081] net_ratelimit: 34 callbacks suppressed     Feb 19 13:46:51 mightymoose kernel: [ 7739.593086] ERROR @wl_cfg80211_get_station : Could not get rate (-1)     Feb 19 13:46:51 mightymoose kernel: [ 7739.593090] ERROR @wl_cfg80211_get_station : Could not get rssi (-1)     Feb 19 13:46:51 mightymoose kernel: [ 7739.593123] ERROR @wl_cfg80211_get_station : Could not get rate (-1)     Feb 19 13:46:51 mightymoose kernel: [ 7739.593125] ERROR @wl_cfg80211_get_station : Could not get rssi (-1)     Feb 19 13:46:51 mightymoose kernel: [ 7740.092017] ERROR @wl_cfg80211_get_station : Could not get rate (-1)     Feb 19 13:46:51 mightymoose kernel: [ 7740.092023] ERROR @wl_cfg80211_get_station : Could not get rssi (-1)     Feb 19 13:46:51 mightymoose kernel: [ 7740.092059] ERROR @wl_cfg80211_get_station : Could not get rate (-1)     Feb 19 13:46:51 mightymoose kernel: [ 7740.092062] ERROR @wl_cfg80211_get_station : Could not get rssi (-1)     Feb 19 13:46:52 mightymoose kernel: [ 7740.591164] ERROR @wl_cfg80211_get_station : Could not get rate (-1)     Feb 19 13:46:52 mightymoose kernel: [ 7740.591171] ERROR @wl_cfg80211_get_station : Could not get rssi (-1)      also on PasteBin This is, needless to say, extremely annoying and the only workaround I've found in the past is to restart my computer. I've sometimes had success with disabling wireless in the Network Manager and then re-enabling it, but this doesn't always work. I've also tried reloading `wl` with `modprobe`, but that also doesn't usually work. My router is running OpenWRT and I configured the EAP network myself. One thing to note is that my other machines don't have this problem at all with the network. My Android devices and my laptop (running the same distribution as this desktop machine) don't have this problem. Any ideas on where to start to debug this issue? ### EDIT: Adding Output from `lshw -c network`                 *-network            description: Wireless interface            product: BCM43228 802.11a/b/g/n            vendor: Broadcom Corporation            physical id: 0            bus info: pci@0000:0c:00.0            logical name: eth2            version: 00            serial: dc:85:de:7c:c6:02            width: 64 bits            clock: 33MHz            capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless            configuration: broadcast=yes driver=wl0 driverversion=6.20.155.1 (r326264) ip=192.168.100.110 latency=0 multicast=yes wireless=IEEE 802.11abg            resources: irq:18 memory:f6800000-f6803fff      Here is requested output from `wpa_supplicant` on PasteBin. Not sure, but there seems to be an OpenSSL issue.


How to check if my battery is healthy?

My `Lenovo ThinkPad T61` is rather old, and a couple of years ago I had to replace the battery as the old one was dead. Now the replacement battery seems like dying a slow death, but I get conflicting data from `xfce4-power- manager`. So I'm wondering if there is a way to check whether the battery is healthy. The symptoms are as follows:   * The power manager indicates that the `battery is fully charged`   * If I disconnect the AC charger, then the battery status jumps to `47%` or similar in less than 5min   * And in less than 15min the laptop runs out of juice and shuts down I tried to check `upower` data:               root@malou-laptop:/home/liv# upower --enumerate     /org/freedesktop/UPower/devices/line_power_AC     /org/freedesktop/UPower/devices/battery_BAT0     root@malou-laptop:/home/liv# upower -i /org/freedesktop/UPower/devices/battery_BAT0       native-path:          /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0       vendor:               SANYO       model:                92P1137       serial:               885       power supply:         yes       updated:              Wed 19 Feb 2014 09:35:37 PM CET (23 seconds ago)       has history:          yes       has statistics:       yes       battery         present:             yes         rechargeable:        yes         state:               fully-charged         energy:              70.38 Wh         energy-empty:        0 Wh         energy-full:         72.42 Wh         energy-full-design:  71.28 Wh         energy-rate:         26.561 W         voltage:             12.4 V         percentage:          97.1831%         capacity:            100%         technology:          lithium-ion      I also looked at `ACPI` data:               root@malou-laptop:/home/liv# cat /proc/acpi/battery/BAT0/info      present:                 yes     design capacity:         71280 mWh     last full capacity:      72420 mWh     battery technology:      rechargeable     design voltage:          10800 mV     design capacity warning: 3621 mWh     design capacity low:     200 mWh     cycle count:          0     capacity granularity 1:  1 mWh     capacity granularity 2:  1 mWh     model number:            92P1137     serial number:             885     battery type:            LION     OEM info:                SANYO     root@malou-laptop:/home/liv# cat /proc/acpi/battery/BAT0/state      present:                 yes     capacity state:          ok     charging state:          charged     present rate:            0 mW     remaining capacity:      70380 mWh     present voltage:         12400 mV      But I cannot pinpoint anything suspicious: the `design capacity` and `last full capacity` seem healthy to me. So is there some other utility that could indicate whether the battery is working as expected, or needs replaced?


Move line from output to the front of output or custom reordering

I have a command `find "$PWD" -name __openerp__.py|awk -F/ -vOFS=/ 'NF-=2'|sort -u` and I want to take a certain line containing `/web/addons` and push it to the front of output then do the same with `/openerp/addons` making so that line with `/openerp/addons` would be first and line with `/web/addons` would be second. I figured to use grep with that input and from the same output - grep with wildcard and exclude, but yet to figure out how to pass pipe output to multiple greps. Also there is probably multiple ways of doing this. So right now I get:               <my path>/addons     <my path>/development     <my path>/external     <my path>/server/openerp/addons     <my path>/web/addons      And I want it to become:               <my path>/server/openerp/addons     <my path>/web/addons     <my path>/addons     <my path>/development     <my path>/external      P.S. Reversal of sort will not solve this


redirecting to /dev/null

I'm reading an example bash shell script:               #!/bin/bash          # This script makes a backup of my home directory.          cd /home          # This creates the archive     tar cf /var/tmp/home_franky.tar franky > /dev/null 2>&1          # First remove the old bzip2 file.  Redirect errors because this generates some if the archive     # does not exist.  Then create a new compressed file.     rm /var/tmp/home_franky.tar.bz2 2> /dev/null     bzip2 /var/tmp/home_franky.tar          # Copy the file to another host - we have ssh keys for making this work without intervention.     scp /var/tmp/home_franky.tar.bz2 bordeaux:/opt/backup/franky > /dev/null 2>&1          # Create a timestamp in a logfile.     date >> /home/franky/log/home_backup.log     echo backup succeeded >> /home/franky/log/home_backup.log      I'm trying to understand the use of "/dev/null 2>&1" here. At first, I thought this script uses /dev/null in order to gracefully ignore errors, without causing the script to crash (kind of like try catch exception handling in programming languages). Because I don't see how using tar to compress a directory into a tar file could possibly cause any type of errors.


What does 0.0.0.0:* mean in netstat?

Could anyone explain the following output of `netstat -plunt`?               udp        0      0 0.0.0.0:58262           **0.0.0.0:***  1163/avahi-daemon:         udp        0      0 0.0.0.0:17500           **0.0.0.0:***  3779/dropbox:u         udp        0      0 0.0.0.0:5353            **0.0.0.0:***  1163/avahi-daemon:      What does 0.0.0.0:* mean? Are all the ports being listened or something else?


Backtrack R3 can't find wlan

I have installed Backtrack R3 in virtualbox, but i cant find any wireless connections. Cant find anything in wicd either. What i want to do is to run `airmon-ng start wlan0` in terminal, and after that `wash -i mon0` But i find nothing then i run `airmon-ng start wlan0` and the command `wash -i mon0` doesn't work at all. `airmon-ng start wlan0` giving this output: ![airmon-ng start wlan0](http://billedeupload.dk/images/axVXC.png)! `wash -i mon0` giving this output: ![wash -i mon0](http://billedeupload.dk/images/3XGZB.png)! Have no idead about what i need to do


How can I close a terminal without killing its children (without running `screen` first)?

sometimes I run an app in the gnome-terminal, but then I suddenly have to restart gnome or something. I guess the answer to the question is also useful then I want to disconnect from SSH where something is happenning. Gnome's terminal tree looks like this:               gnome-terminal         bash             some-boring-process      Can I 'detach' `bash` from `gnome-terminal` (or detach `some-boring-process` from bash and redirect its output somewhere)? If I just kill `gnome-terminal`, `bash` will be killed to will all its subprocesses


Set makeprg to gradlew

First a bit of context for those who don't know gradle. It's basically like `make` except that you don't have to have `gradle` installed on your computer. It ships with projects as a file called `gradlew`. So for instance a gradle project could look like:               .     ├── gradlew     └── src         └── main             └── java                 └── com                     └── foo                         └── bar                             ├── Bar.java                             ├── Baz.java                             ├── Foo.java                             └── Qux.java      And from the root directory I can run commands like `./gradlew build` or `./gradlew test` to build/test my code. Now vim. First I `:set autochdir` in my `.vimrc`. Second, my current buffer is `Foo.java`. I want to run `:make` which would trigger `../../../../../../gradlew`. How can I set `makeprg` such that no matter what's my `:pwd` it'll call `gradlew` (I guess that could be achieved using `dirname` in a loop but I'm not sure if that's the most efficient/cleanest way to do that). Thanks.


Did this tutorial block pings to my server?

I am a programmer teaching myself linux admin stuff. I followed this tutorial to setup a firewall on a VPS. As a part of that tutorial, I block all traffic except for web traffic and SSH traffic. I checked to see if my server was vulnerable to ping floods and it seems that I can't ping my server ("request timeout for icmp"). A few quick googles show that Ping uses ICMP which does not use ports. ICMP traffic is still regulated by the firewall, right? Just double checking to make sure I am correctly understanding what is happening. ICMP traffic is still traffic -- it just does not use ports. Hence it is governed by the rules in the iptables commands. Here is what my iptables look like:               $sudo iptables -L -nv     Chain INPUT (policy ACCEPT 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination                  0     0 ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0                    2   100 fail2ban-ssh  tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            multiport dports 22      145K 9706K ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            ctstate RELATED,ESTABLISHED        10   616 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:3457      3463  222K ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:80       192 14090 DROP       all  --  *      *       0.0.0.0/0            0.0.0.0/0                     Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination                   Chain OUTPUT (policy ACCEPT 81298 packets, 505M bytes)      pkts bytes target     prot opt in     out     source               destination                   Chain fail2ban-ssh (1 references)      pkts bytes target     prot opt in     out     source               destination                  2   100 RETURN     all  --  *      *       0.0.0.0/0            0.0.0.0/0                $


IPTables allow NTP Time Server

I am new to IPTables. I have an existing config that seems to work well. I am not sure I know how to add NTP to the rule `Chain RH-Firewall-1-INPUT` correctly. My goal is to add an additional rule to allow NTP to enter the server so it can act as a NTP server for my network. Would I simply need `iptables -I RH-Firewall-1-INPUT -p udp --dport 123 -j ACCEPT` and then of course if it works `iptables save` I'm not confident whether I should be using -I Insert or -A Append, or if it is much more difficult. Below is my existing config shown with `iptables -L`               Chain INPUT (policy ACCEPT)     target     prot opt source               destination     RH-Firewall-1-INPUT  all  --  anywhere             anywhere          Chain FORWARD (policy ACCEPT)     target     prot opt source               destination     RH-Firewall-1-INPUT  all  --  anywhere             anywhere          Chain OUTPUT (policy ACCEPT)     target     prot opt source               destination          Chain RH-Firewall-1-INPUT (2 references)     target     prot opt source               destination     ACCEPT     all  --  anywhere             anywhere     ACCEPT     icmp --  anywhere             anywhere            icmp any     ACCEPT     esp  --  anywhere             anywhere     ACCEPT     ah   --  anywhere             anywhere     ACCEPT     udp  --  anywhere             224.0.0.251         udp dpt:mdns     ACCEPT     udp  --  anywhere             anywhere            udp dpt:ipp     ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:ipp     ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED     ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:ssh     ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:https     ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:http     ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:squid     REJECT     all  --  anywhere             anywhere            reject-with icmp-host-prohibited


Deliver emails outside network, from a server behind router DNS and port forwarding

I've been trying to configure webserver to deliver emails outside the local network. Server is connected directly to the router and relay on its DNS service, and one of that online service for resolve the dynamic-ip of the router (like no-ip, or dyndns). That way it can be reachable from the outside pointing always to the same ip. I can't succeed to deliver emails using Postfix or Exim (tried both) outside of local network. I already have excluded that the problem could be related to firewall rules. And I'm starting to believe it is just related to the DNS+no- ip and the dynamic ip address of the server. I don't have any difficulty on configure mail to send outside on 'normal' Virtual Machines. I Did it for testing the configuration before doing it on production server. And i could easily make it work. But on that server really seems it won't work at all. Can anybody confirm that the problem is related to the network config of the server:                -Dynamic ip (dhcp)      -DNS service on router      -no-ip (for resolve the ip from the outside)


How can I boot with a compressed rootfs?

**My problem is:** I cannot use compressed rootfs (the kernel crashes during boot) but uncompressed ones work fine. **What I did:** I'm using Buildroot 2013.11 to generate Images for my embedded Linux (2.6.39) ARM 9 system, booting from SD card. I'm "dd"ing the Images (e.g. ext4) to the 2nd partition of the SD card with               sudo dd if=/path-to/rootfs.ext4 of=/dev/sdb2 bs=2048      and enable the driver in linux-menuconfig, that is               File systems     - <*> The Extended 4 (ext4) filesystem     - [*] Use ext4 for ext2/ext3 file systems     - [*] Ext4 extended attributes      Now when I like to use the compressed ext4 (e.g. with lzo), buildroot generates an `rootfs.ext4.lzo` when "dd"ing here with               sudo dd if=/path-to/rootfs.ext4.lzo of=/dev/sdb2 bs=2048      the command is executed without any error but from this point "sdb2" isn't accessible anymore until it is formated again. When using this SD to boot the system the kernel crashes telling me it was trying to interpret the partition with ext4 but he wasn't able to read it. Where am I going wrong?


Chromebook Crouton Debian xfce4 - Cannot change locale!

On the system described in the title, I am trying to change my locale to a UTF-8 one, in order to run the program Anki. However it won't let me, the commands `locale-reconfigure locale-gen` and any `locale-xxx/xxx-locale` command doesn't exist. There was no `locale.gen` so I created one, it looks like this:               en_GB.UTF-8 UTF-8     LC_ALL="en_GB.UTF-8"      When I type in locale it says everything is `POSIX` except `LANG`, `LANGUAGE` and `LC_ALL` which are all left blank. `locale -a` returns:               C     C.UTF-8     POSIX      I've followed the guide on debian wiki and many other guides, all of which involve the use of `locale-gen` or a similar command which I don't have. I've also tried restarting with the new `locale.gen`, but that also didn't work.


Linux dmesg errors, motherboard issue?

When doing heavy disk IO on my system (16GB RAM, 6 cores, RAID0 PCIe SSD), the system stalls and eventually crashes. Normal day-to-day disk IO is fine, just prolonged read/write such as a database re-index are problematic. Some investigation has revealed dmesg output such as:               [...] ata2: exception Emask 0x10 SAct 0x0 SErr 0x90202 action 0xe frozen     [...] ata1: SError: { RecovComm Persist PHYRdyChg 10B8B }     [...] ata1: hard resetting link     [...] ata4: irq_stat 0x00400000, PHY RDY changed      And tons of other logs for various sata devices attached to the system. When doing heavy disk IO, any other input stalls the system (moving the mouse etc) for a 5-30 seconds. Given the errors are on multiple devices and the system seems sketchy when giving inputs from other devices/causing non-disk interrupts ... im going to assume motherboard. Temps are fine, memcheck passes. The crash is a total soft lockup rather than a kernel crash or switch-off. Does this seem reasonable to you gurus? Anything else I can do to check? Edit: Fedora20, home server on 870A-UD3 board, Intel 910 pcie SSD + OCZ vertex + Intel X25 Edit2: Workstation is in a home office doing officy stuff like churning data in Postgresql. All very boring nothing to warrant another close vote.


Cannot connect to Solaris Server when Oracle GoldenGate process uses the port

I'm trying to test the Oracle goldengate to replicate data between two databases on **the same server**. So I installed **two** databases and **two** goldengate homes in the same machine. The goldengate processes are started from each home and they are responsible for the replication :   * Process from home 1 configured on port 7809 &   * process for home 2 configured on port 7810. For a successful replication, processes started from goldengate home 1 should communicate with processes started from goldengate home 2. But for some reasons, this is not happening. The goldengate log file has the following error : > OGG-01223 Oracle GoldenGate Capture for Oracle, exthrr.prm: TCP/IP error 131 > (Connection reset by peer). * * * "Googling" for this error, it said that _the connection occurred but the host terminated it._ Tried to telnet the machine with the used port and it gave the following error:               bash-3.00$ telnet 10.10.3.124 7810     Trying 10.10.3.124...     Connected to 10.10.3.124.     Escape character is '^]'.     Connection to 10.10.3.124 closed by foreign host.      Here the communication occurs but for only around 3 seconds then it is closed by the host, which is the same explanation of the above error in the goldengate log file.   * I tried to change the port but still the same error.   * The problem is happening only when the goldengate process is using the port. When other process is using the same port, I can telnet successfully.


How I can enable Linux full tickless mode using CONFIG_NO_HZ_FULL?

Where do I enable the CONFIG_NO_HZ_FULL kernel configuration? Is it something I can set in conf files or is it something that has to be enabled when I build the kernel? I am using CentOS with an upgraded kernel 3.10.


determine what service is running a script

I share a dev server with some colleagues, it's a Ubuntu server and we have several scripts there, so basically the usual way we run a process is using a `screen` session. My problem is that when I do `ps aux| grep python` I see a running process:               root     x  x  x x x x  Ss   Apr12  29:58 /usr/bin/python /home/script.py      this script is not being run on a screen session and it automatically starts when killed so I need to know what service is starting/restarting that process. Any help is appreciated.


Is there a shortcut for repeat the second proximate command in bash?

We all know that `!!` can repeat the last command you do in bash. But sometimes we need to do some operation like               $ python test.py     $ vim test.py          $ python test.py # here is where I need to repeat the second proximate bash command      I can use up-arrow key to do that, but that requires me to move my right hand away to an uncomfortable position. So I'm wondering if there is a command which like `!!` can help me to realize my purpose?


Replace a backslash with sed

I've been trying to create a script that would replace every occurence of `C:\` in two different types of file by `/root`. My arborescence looks like :               - Batch       - Place of the script     - Conf       - Appli1         - File1.xml         - File2.xml         - ...       - Appli2         - File1.xml         - File2.xml         - ...       - ...     - Info       - File1.conf       - File2.conf       - ...      My script is like so in `/Batch` :               #/bin/bash     find ../ -name "*.xml" -o name "*.conf" -print | xargs sed -i 's C:\ /root/ g'      But, I have an error on the `sed part`, which says that at `character 14: command 's' unfinished` Why is that so?


Need to install MySQL Client libaries but RPM not installing them

I'm trying install the MySQL Client libraries for the Perl Mod of the same name but when I run               sudo rpm --install -v --allfiles MySQL-client-5.5.16-1.linux2.6.i386.rpm      and querying the rpm database shows the package installed, but the lib files aren't there.                rpm -qa | grep -i mysql      MySQL-client-5.5.16-1.linux2.6      ll /usr/lib/mysql      total 4.0K      4.0K drwxr-xr-x 3 root root 4.0K Oct 11 09:49 plugin/      I'm not finding the files in /usr/lib               ls -ld /usr/lib/*mysql*     drwxr-xr-x 3 root root 4.0K Oct 11 09:49 /usr/lib/mysql     perlstation:~\ ->      Here's the results of rpm -qil MySQL-client                   rpm -qil MySQL-client     Name        : MySQL-client                 Relocations: (not relocatable)     Version     : 5.5.16                            Vendor: Oracle and/or its affiliates     Release     : 1.linux2.6                    Build Date: Fri 09 Sep 2011 11:27:55 AM CDT     Install Date: Tue 11 Oct 2011 02:38:14 PM CDT      Build Host: loki32     Group       : Applications/Databases        Source RPM: MySQL-5.5.16-1.linux2.6.src.rpm     Size        : 53026574                         License: Copyright (c) 2000, 2011,    Oracle and/or its affiliates. All rights reserved. Under GPL license as shown in the Description field.     Signature   : DSA/SHA1, Wed 14 Sep 2011 03:13:49 AM CDT, Key ID 8c718d3b5072e1f5     Packager    : MySQL Build Team <build@mysql.com>     URL         : http://www.mysql.com/     Summary     : MySQL - Client     Description :     This package contains the standard MySQL clients and administration tools.          For a description of MySQL see the base MySQL RPM or http://www.mysql.com/     /usr/bin/msql2mysql     /usr/bin/mysql     /usr/bin/mysql_find_rows     /usr/bin/mysql_waitpid     /usr/bin/mysqlaccess     /usr/bin/mysqlaccess.conf     /usr/bin/mysqladmin     /usr/bin/mysqlbinlog     /usr/bin/mysqlcheck     /usr/bin/mysqldump     /usr/bin/mysqlimport     /usr/bin/mysqlshow     /usr/bin/mysqlslap     /usr/share/man/man1/msql2mysql.1.gz     /usr/share/man/man1/mysql.1.gz     /usr/share/man/man1/mysql_find_rows.1.gz     /usr/share/man/man1/mysql_waitpid.1.gz     /usr/share/man/man1/mysqlaccess.1.gz     /usr/share/man/man1/mysqladmin.1.gz     /usr/share/man/man1/mysqlbinlog.1.gz     /usr/share/man/man1/mysqlcheck.1.gz     /usr/share/man/man1/mysqldump.1.gz     /usr/share/man/man1/mysqlimport.1.gz     /usr/share/man/man1/mysqlshow.1.gz     /usr/share/man/man1/mysqlslap.1.gz     perlstation:~\ ->      I'm at a loss here.


How to fix character encoding in bash (arch linux)

I have some issues with the encoding of german umlauts in bash. It mostly is working fine, but when i am typing a invalid command, the error message generated by bash contains strange escape sequences and not the actual characters. Here is a log, which shows the problem:               [root@myhost ~]# mkdir ä     [root@myhost ~]# ä     -bash: $'\303\244': Kommando nicht gefunden.     [root@myhost ~]# ü     -bash: $'\303\274': Kommando nicht gefunden.     [root@myhost ~]# ls     ä  äöü  Projects  tbb     [root@myhost ~]# cat äöü     äüö     [root@myhost ~]# rm ä     rm: Entfernen von „ä“ nicht möglich: Ist ein Verzeichnis     [root@myhost ~]# rmdir ä     [root@myhost ~]# rm äöü      the configuration of my `/etc/rc.conf`:               LOCALE="de_DE.UTF-8"     DAEMON_LOCALE="no"     HARDWARECLOCK="localtime"     TIMEZONE="Europe/Berlin"     KEYMAP="de-latin1"     CONSOLEFONT=     CONSOLEMAP=     USECOLOR="yes"      `/etc/locale.gen` only contains the de_DE locales:               de_DE.UTF-8 UTF-8     de_DE ISO-8859-1     de_DE@euro ISO-8859-15      `locale` output:               LANG=de_DE.UTF-8     LC_CTYPE="de_DE.UTF-8"     LC_NUMERIC="de_DE.UTF-8"     LC_TIME="de_DE.UTF-8"     LC_COLLATE="de_DE.UTF-8"     LC_MONETARY="de_DE.UTF-8"     LC_MESSAGES="de_DE.UTF-8"     LC_PAPER="de_DE.UTF-8"     LC_NAME="de_DE.UTF-8"     LC_ADDRESS="de_DE.UTF-8"     LC_TELEPHONE="de_DE.UTF-8"     LC_MEASUREMENT="de_DE.UTF-8"     LC_IDENTIFICATION="de_DE.UTF-8"     LC_ALL=


Check version of RPM package available in upstream repo if I have a custom one installed

I have a RHEL6.1 machine that's registered with Redhat. I needed to install a customized version of a package (in my case, qemu-kvm), which I installed via RPM. I can see the version info for my customized package by doing: "rpm -qi" or "yum info". How can I see the version information for the (non-customized) version of the RPM that exists in the Redhat repository?


"tree" command output with "pure" (7-bit) ASCII output

The "tree" command uses nice box-drawing characters to show the tree but I want to use the output in a "code-page-neutral" context (I know that really there's always a code page, but by restricting it to the lower characters I hope to be free of worries that someone in Ulan Bator sees smiley faces, etc). For example instead of:               ├── include     │   ├── foo     │   └── bar      I'd like something like:               +-- include     |   +-- foo     |   \-- bar      but none of the "tree" switch combinations I tried gave this (seems more as if they take the box-drawing chars as the baseline and make it yet prettier) I also looked for box-drawing filters to perform such conversions without finding anything beyond an infinite amount of ASCII art :-). A generic filter smells like something to be cooked-up in 15 mins - plus two more incremental days stumbling into all the amusing corner cases :-)


Permissions for non-htdocs directory

I have created a folder outside of my htdocs directory as a means of adding extra security for downloadable digital goods to be sold from within a Magento storefront; so my question is: what permissions should I set for this non- htdocs directory ("digitalgoods")? **Ownership:**               [parent]/htdocs apache:apache     [parent]/digitalgoods apache:apache      I currently have the "digitalgoods" folder set to 770. Does the PUBLIC need read or execute permissions to this folder if the web application will be pulling and serving these files via unique links??


Getting size with du of files only

How can I get the size of all files and all files in its subdirectories using the du command. I am trying the following command to get the size of all files (and files in subdirectories) `find . -type f | du -a` But this prints out the folder sizes as well. How can I get a listing of sizes of all files and files in subdirectories? I also tried the `exec flag` but I am not sure how to pipe the output into another command after it executes the results of `find` into `du`. Sorry should have mentioned this before, the operating system is AIX 6.1 with ksh shell. Thank you.


How can I display the time when a command was executed in my bash prompt?

Currently my bash prompt looks like this               $ echo $PS1     # \[\e[34m\][\t]\[\e[0m\] \[\e]0;\w\a\]\[\e[34m\]\u@\h: \[\e[34m\]\w\[\e[0m\]\n$     $      The problem is that `\t` will only display the time when the prompt was rendered (which would be very close to the time of completion of the last command). For me, it would be more useful to display the time at which the current command process was started. Is there a way to do this?


Physically break into box? (Memory & disk)

I have a VPS. I might be able to encrypt my partition but I havent tried. My VPS company I believe can reset my root password although the only SSH key I see is my own. With all my data I have it encrypted with `encfs`. Just in case a hacker gets some kind of access, `encfs` can only mount the drive if my password is correct (SSH keys won't mount it, resetting root password will not mount as the new password is an incorrect passphrase) My question is can my VPS host break into my box? Physically the data is encrypted. I believe root can be changed without resetting the box? If so then they can have access to my already mounted filesystem? If another user with no permission is logged in can the user do something to access the ram and dump sensitive data? can the VPS host easily read the contents of my RAM? Note: This is hypothetical. I'm thinking about if I have big clients I want to know how much security I can promise and this popped into mind. I'd rather not host a box at home nor have the pipes to support it.


How to use tshark to do this task

I don't have any base knowledge about tshark, and it is hard to find any tutorial to help me with this. So now I have a pcap file which consists a lot of network flows; a time range; an ip addr; a tcp port number; the number of packets sent by the ip addr OR the number of packets received by the ip addr. What I want to do is that first I let tshark to read from that pcap file, and then use the time range to filter out all the network flows that are in that time range, and then use the ip addr to filter out all the network flows from that ip addr on that already-filter-out-by-time flows, and then use the tcp port number and the number of packets sent/received by the ip addr to finally locate the flow I want. Then follow this flow/stream and save the whole conversation to a new pcap file. Anyone can help? I'll be very very appreciate it.


Local Account Creation Date

For compliance purposes there is the need to fetch information regarding local (user and non-user) accounts creation date on UNIX machines. Is there any way (even if it's not the most reliable or accurate method) for collecting that kind of information? For instance, as an alternative, I went searching for 'home' directory creation date (for user accounts), but I discovered that for POSIX-compliant systems timestamps for file creation are not available. Thanks in advance


Why my $PATH is not inherited by the invoked bash?

I work on an AIX system where I have no administrator privileges. It has several shells installed, default being `tcsh`. I am not allowed to change the login shell. Usually I start my session from `exec bash`. The problem is that I do not inherit the `$PATH` I had in `tsch`. The first strange thing is that some of the entries in my `$PATH` are duplicated, when I do `exec bash`. Another strange thing is that when I do `exec bash --norc` and then `source .bashrc` everything is fine -- I get the path from tcsh and some additions from my `.bashrc`. I have tried commenting out my `.bashrc` enirely, but it gave no result -- I still do not get the `$PATH` from `tcsh`. It seems that the system wide /etc/profile is manipulating my `$PATH`. I tried running `exec bash --noprofile`, but I still see the changes, that are introduced by `/etc/profile` script (which I have no control over). So in the end perhaps someone spotted a flaw in my investigation and can tell me how to invoke bash with inhereted `$PATH` or can suggest a way to do it without reading the global config scripts? (I have posted this question on superuser as well, I am not sure if it is ok, to duplicate questions, but I got no answer there, so what a heck...)


List of modified files of the past 24 hours

Is there a reliable way to have a system that mails me the list of files that were modified in the past 24 hours inside a set of directories? (like `/home/*/public_html/*` and `/home/*/*domains/*`)


Setting up X server on Centos6 minimal

I'm trying to install Centos6, but as it turned out, DVD I downloaded was just couple Mb too large (CentOS-6.0-i386-bin-DVD.iso) for DVD to carry. So, to save time and don't download DVD again, I downloaded minimal (CentOS-6.0-x86_64-minimal.iso) and set up successfully. At first, I did not get that anaconda stuff to show gui for install - only after 4th reinstall, it showed, so I thought install is OK, even thou, I did not get any possibility to customize installable packages. Ok, installed without delays. On first boot up, it did not show X server, just login prompt in a command line. Ok, I logged in, ran a `yum update` and `yum groupinstall "X Window System" "GNOME Desktop Environment"`, as _internets_ suggested. Tried startx and it just flicker and popped out some errors `(EE) SIS(0): Illegal video RAM size (262144K) detected, using BIOS-provided info`, so I understood from _internets_ , that SIS chipset is malfunctioning - something is wrong with integrated gpu - I put PCIe one inside. Reboot, `startx` and nothing - it flickered, popped some messages and then `Witing for X server to shutdown`, `ctrl+alt+F7` shows blinking caret, nothing more. Here is Xorg.0.log. Ok, I'm newbie with linux installation and configuration (usually use GUI desktop), that is why I want to get to environment, I'm familiar with. Can anyone suggest step-by-step tutorial, **what needs to be done, to set up GUI on minimal Centos6 system AND make it default on startup** , so after boot, X server login screen appears, not the one in commandline.


Cannot edit crontab as non root user

When I use the command `crontab -e` on my Debian server as a non root user (in this case as postgres), I can't edit it because of `"/tmp/crontab.SJlY0Y/crontab" [Permission Denied]` `crontab -l` on the other hand works fine. How can I fix this problem? Here are the current permissions:               $ ls -l /tmp/crontab.SJlY0Y/crontab     -rw------- 1 root postgres 1.2K Aug  3 11:44 /tmp/crontab.SJlY0Y/crontab     $ ls -l /var/spool/cron     total 12K     drwxrwx--T 2 daemon daemon  4.0K Sep 12  2012 atjobs     drwxrwx--T 2 daemon daemon  4.0K Jun  9  2012 atspool     drwx-wx--T 2 root   crontab 4.0K Aug  3 11:15 crontabs     $ ls -l /var/spool/cron/crontabs     total 12K     -rw------- 1 git      crontab 1.3K Mar  2 16:48 git     -rw------- 1 postgres crontab 1.4K Aug  3 11:15 postgres     -rw------- 1 root     root    2.3K Jul 20 20:32 root     $ ls -l /usr/bin/crontab     -rwsr-xr-x 1 root root 36K Jul  3  2012 /usr/bin/crontab     $ ls -ld /tmp/     drwxrwxrwt 6 root root 4.0K Aug  3 11:43 /tmp/


Is there a way to determine what packages or libraries should be loaded to support an executable?

There is an executable I want to install on a computer that I can't recompile that wasn't built as a package, and I want to download the libraries it requires to run them. Below is part of the output from running `ldd` on it               libpango-1.0.so.0 => /usr/lib/i386-linux-gnu/libpango-1.0.so.0 (0xb702f000)     libcairo.so.2 => /usr/lib/i386-linux-gnu/libcairo.so.2 (0xb6f64000)     libatk-1.0.so.0 => /usr/lib/i386-linux-gnu/libatk-1.0.so.0 (0xb6f43000)     libsqlite3.so.0 => /usr/lib/i386-linux-gnu/libsqlite3.so.0 (0xb6e9e000)     libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb6cf4000)     /lib/ld-linux.so.2 (0xb786e000)     libxcb.so.1 => /usr/lib/i386-linux-gnu/libxcb.so.1 (0xb6cd3000)     libgio-2.0.so.0 => /usr/lib/i386-linux-gnu/libgio-2.0.so.0 (0xb6b7c000)     libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xb6b4f000)      Is there a tool that can use this information to select which packages should be downloaded or better yet extract only the libraries listed and their dependencies, in order to minimize the disk usage? The system is running on a headless VM and the program will be displayed via VNC. Although I suspect that a full blown graphics desktop will supply most of the libraries needed I want to download only the required libraries, their dependencies and just enough of the X Windows package to support it.


How do you configure numpad keys using XKB?

I haven't figured out how you configure XKB to use the numpad yet. I found the following in the "us" file.               partial alphanumeric_keys modifier_keys      xkb_symbols "basic" {              name[Group1]= "USA";              // Alphanumeric section         key <TLDE> {    [     grave,    asciitilde  ]   };         key <AE01> {    [     1,    exclam      ]   };         key <AE02> {    [     2,    at      ]   };         key <AE03> {    [     3,    numbersign  ]   };         key <AE04> {    [     4,    dollar      ]   };         key <AE05> {    [     5,    percent     ]   };         key <AE06> {    [     6,    asciicircum ]   };         key <AE07> {    [     7,    ampersand   ]   };         key <AE08> {    [     8,    asterisk    ]   };         key <AE09> {    [     9,    parenleft   ]   };         key <AE10> {    [     0,    parenright  ]   };         key <AE11> {    [     minus,    underscore  ]   };         key <AE12> {    [     equal,    plus        ]   };              key <AD01> {    [     q,    Q       ]   };         key <AD02> {    [     w,    W       ]   };         key <AD03> {    [     e,    E       ]   };         key <AD04> {    [     r,    R       ]   };         key <AD05> {    [     t,    T       ]   };         key <AD06> {    [     y,    Y       ]   };         key <AD07> {    [     u,    U       ]   };         key <AD08> {    [     i,    I       ]   };         key <AD09> {    [     o,    O       ]   };         key <AD10> {    [     p,    P       ]   };         key <AD11> {    [ bracketleft,  braceleft   ]   };         key <AD12> {    [ bracketright, braceright  ]   };              key <AC01> {    [     a,    A       ]   };         key <AC02> {    [     s,    S       ]   };         key <AC03> {    [     d,    D       ]   };         key <AC04> {    [     f,    F       ]   };         key <AC05> {    [     g,    G       ]   };         key <AC06> {    [     h,    H       ]   };         key <AC07> {    [     j,    J       ]   };         key <AC08> {    [     k,    K       ]   };         key <AC09> {    [     l,    L       ]   };         key <AC10> {    [ semicolon,    colon       ]   };         key <AC11> {    [ apostrophe,   quotedbl    ]   };              key <AB01> {    [     z,    Z       ]   };         key <AB02> {    [     x,    X       ]   };         key <AB03> {    [     c,    C       ]   };         key <AB04> {    [     v,    V       ]   };         key <AB05> {    [     b,    B       ]   };         key <AB06> {    [     n,    N       ]   };         key <AB07> {    [     m,    M       ]   };         key <AB08> {    [     comma,    less        ]   };         key <AB09> {    [    period,    greater     ]   };         key <AB10> {    [     slash,    question    ]   };              key <BKSL> {    [ backslash,         bar    ]   };         // End alphanumeric section     };      And I was notified of http://cgit.freedesktop.org/xkeyboard- config/tree/symbols/keypad , but I was wondering if there was a resource/manual to make sense of it, and how to modify it.


Kernel does not detect Hardware / Software or Hardware fault

I've got more of a basic question for you: My linux kernel (I tried several here from stock 2.6, 3.2 and 3.5 as well as a custom 3.7.3 one) does not detect my synaptics touchpad - or I'am too dumb to find it. I looked into: dmesg, lsusb -v, lspci -v, lshw, /dev/input, /dev/bus/00x/ (...) It shows me several internal usb root hubs and integrated rate matching hubs, my pendrive and optical mouse but nothing else of interest. **Now, as for the question** : is it possible that the kernel does not detect certain hardware if there is no driver available? As far as I understand it, the kernel should at least report some unknown device at some hardware address. Thanks for your time. **dmesg | grep input**               [    3.529623] input: Sleep Button as /devices/LNXSYSTM:00/device:00/PNP0C0E:00/input/input0     [    3.529659] input: Power Button as /devices/LNXSYSTM:00/device:00/PNP0C0C:00/input/input1     [    3.529694] input: Lid Switch as /devices/LNXSYSTM:00/device:00/PNP0C0D:00/input/input2     [    3.529745] input: Power Button as /devices/LNXSYSTM:00/LNXPWRBN:00/input/input3     [    5.196578] input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input4     [    5.847405] input: Logitech USB-PS/2 Optical Mouse as /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.3/1-1.3:1.0/input/input5     [    5.847752] hid-generic 0003:046D:C050.0001: >input,hidraw0: USB HID v1.10 Mouse [Logitech USB-PS/2 Optical Mouse] on usb-0000:00:1a.0-1.3/input0     [    5.993994] input: Video Bus as /devices/LNXSYSTM:00/device:00/PNP0A08:00/LNXVIDEO:00/input/input6     [   15.474899] input: HDA Intel PCH HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:1b.0/sound/card0/input7     [   15.475781] input: HDA Intel PCH Mic as /devices/pci0000:00/0000:00:1b.0/sound/card0/input8     [   15.475950] input: HDA Intel PCH Headphone as /devices/pci0000:00/0000:00:1b.0/sound/card0/input9      **cat /proc/bus/input/devices**               I: Bus=0019 Vendor=0000 Product=0003 Version=0000     N: Name="Sleep Button"     P: Phys=PNP0C0E/button/input0     S: Sysfs=/devices/LNXSYSTM:00/device:00/PNP0C0E:00/input/input0     U: Uniq=     H: Handlers=kbd event0      B: PROP=0     B: EV=3     B: KEY=4000 0 0          I: Bus=0019 Vendor=0000 Product=0001 Version=0000     N: Name="Power Button"     P: Phys=PNP0C0C/button/input0     S: Sysfs=/devices/LNXSYSTM:00/device:00/PNP0C0C:00/input/input1     U: Uniq=     H: Handlers=kbd event1      B: PROP=0     B: EV=3     B: KEY=10000000000000 0          I: Bus=0019 Vendor=0000 Product=0005 Version=0000     N: Name="Lid Switch"     P: Phys=PNP0C0D/button/input0     S: Sysfs=/devices/LNXSYSTM:00/device:00/PNP0C0D:00/input/input2     U: Uniq=     H: Handlers=event2      B: PROP=0     B: EV=21     B: SW=1          I: Bus=0019 Vendor=0000 Product=0001 Version=0000     N: Name="Power Button"     P: Phys=LNXPWRBN/button/input0     S: Sysfs=/devices/LNXSYSTM:00/LNXPWRBN:00/input/input3     U: Uniq=     H: Handlers=kbd event3      B: PROP=0     B: EV=3     B: KEY=10000000000000 0          I: Bus=0011 Vendor=0001 Product=0001 Version=ab83     N: Name="AT Translated Set 2 keyboard"     P: Phys=isa0060/serio0/input0     S: Sysfs=/devices/platform/i8042/serio0/input/input4     U: Uniq=     H: Handlers=sysrq kbd event4      B: PROP=0     B: EV=120013     B: KEY=402000000 3803078f800d001 feffffdfffefffff fffffffffffffffe     B: MSC=10     B: LED=7          I: Bus=0019 Vendor=0000 Product=0006 Version=0000     N: Name="Video Bus"     P: Phys=LNXVIDEO/video/input0     S: Sysfs=/devices/LNXSYSTM:00/device:00/PNP0A08:00/LNXVIDEO:00/input/input6     U: Uniq=     H: Handlers=kbd event6      B: PROP=0     B: EV=3     B: KEY=3e000b00000000 0 0 0          I: Bus=0000 Vendor=0000 Product=0000 Version=0000     N: Name="HDA Intel PCH HDMI/DP,pcm=3"     P: Phys=ALSA     S: Sysfs=/devices/pci0000:00/0000:00:1b.0/sound/card0/input7     U: Uniq=     H: Handlers=event7      B: PROP=0     B: EV=21     B: SW=140          I: Bus=0000 Vendor=0000 Product=0000 Version=0000     N: Name="HDA Intel PCH Mic"     P: Phys=ALSA     S: Sysfs=/devices/pci0000:00/0000:00:1b.0/sound/card0/input8     U: Uniq=     H: Handlers=event8      B: PROP=0     B: EV=21     B: SW=10          I: Bus=0000 Vendor=0000 Product=0000 Version=0000     N: Name="HDA Intel PCH Headphone"     P: Phys=ALSA     S: Sysfs=/devices/pci0000:00/0000:00:1b.0/sound/card0/input9     U: Uniq=     H: Handlers=event9      B: PROP=0     B: EV=21     B: SW=4          I: Bus=0003 Vendor=046d Product=c050 Version=0110     N: Name="Logitech USB-PS/2 Optical Mouse"     P: Phys=usb-0000:00:14.0-3/input0     S: Sysfs=/devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3:1.0/input/input11     U: Uniq=     H: Handlers=mouse0 event5      B: PROP=0     B: EV=17     B: KEY=ff0000 0 0 0 0     B: REL=143     B: MSC=10      **lsusb**               Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub     Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub     Bus 003 Device 002: ID 0951:1642 Kingston Technology DT101 G2     Bus 003 Device 004: ID 046d:c050 Logitech, Inc. RX 250 Optical Mouse     Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub


How do I work out which port to log in on with SSH?

I have an Ubuntu 10.04 server setup remotely that I setup a while back. While I recorded the username and password, I seem to have been clever and changed the usual ssh port from 22 to... something else. How do I find out what that port might be? I do have access to the server via the hosting company's back door, so I can execute whatever Unix commands are needed - but I cannot log in using a normal putty shell on my machine.


When do you need 'nohup' if you're already forking using '&'?

First this question is related but definitely not the same as this very nice question: Difference between nohup, disown and & I want to understand something: when I do '&', I'm forking right? Is it ever useful to do "nohup ... &" or is simply & sufficient? Could someone show a case where you'd be using '&' and still would want to use 'nohup'?


Tools to dump entries from arbitrary sets of log files between 2 dates

I had a outage incident a few days ago and the support team has asked for any available logs for the period, while thinking about how to do this, it occurred to me that it would be generally handy to be able to parse many log files at once for entries between 2 dates. I see many tools that would make this possible, had we had the foresight to configure them, not least;   `splunk`, `syslog-ng`, `rsyslog`, and others that stash logs to some searchable backend such as mysql. (I am definitely planning to install a central log host to fulfill this requirement) However for the short term I am interested in a tool that would blaze through the `/var/log/*` folder and dump to stdout, preferably with a simple options syntax (find options are nice +mtime etc) and written in something that can do this fast (so probably C rather than perl or ruby) I see a bunch of tools that I am looking at which may or may not be fit for purpose, such as `mergelog`, `logpp`, `sec`, but none are really jumping out as obviously good for this, which is odd because I would expect this to be the sort of thing that is done to death on unix tools.


How to get subshell's PID in Korn Shell (equivalent of $BASHPID)

In bash you have this handy variable: $BASHPID wich always returns the currently running subshell's PID. How can I get a subshell's PID in ksh? For example see the code below:               #!/usr/bin/ksh93          echo "PID at start: $$"          function run_in_background {       echo "PID in run_in_background $$"       run_something &       echo "PID of backgrounded run_something: $!"     }          function run_something {       echo "*** PID in run_something: $$"       sleep 10;     }              run_in_background     echo "PID of run in background $!"      This outputs the following:               PID at start: 5328     PID in run_in_background 5328     *** PID in run_something: 5328     PID of backgrounded run_something: 5329     PID of run in background 5329      What I want is the line starting with `****` to output the subshell's PID, in the example's case that would be 5329.


How umask() system call is masking the permission

I am using `umask()` system call to set file permission. I am using the following code :               umask(S_IWGRP | S_IWOTH);     printf("Enter file name that you want to create:");     scanf(" %s",file);     fd = open(file,O_CREAT|O_WRONLY);      But after executing it file is created with the given below permissions               --wS-----T 1 rvi rvi     0 Oct  2 15:20 test.txt      What is this `S` bit and `T` bit for ? and why it is modified automatically ?


bash PS1 256 colors with bold

I want to list all colors that I can use in bash console. And after it I want to set my prompt to be bold and orange like color. I'm using this to do listing color codes for me:               for code in {0..255}; do echo -e "\e[38;05;${code}m $code: Test"; done      But the question is how to make it **bold** and keep colors? I looked for some advice about making it bold here: http://misc.flogisoft.com/bash/tip_colors_and_formatting but I couldn't found any code that combines bold and one of 256 colors.


stdin : is not in tty

I am trying to make backup from server1 to server2 by using below command in ssh               [user1@server1 ~]$ mysqldump -u dbuser -p"dbpwd" --opt  dbname        \                           | gzip -c                                       \                           | ssh  -o StrictHostKeyChecking=no              \                                  -o UserKnownHostsFile=/...../known_hosts \                                  -l deploy                                \                                  -i  /...../id_rsa                        \                                  -v  user2@server2                        \                                  "/bin/cat > /.../test.sql.gz" \                           2>&1       I got the error as below               debug1: Sending command: /bin/cat > -t user2@server2:/..../test.sql.gz     stdin: is not a tty     /bin/cat: user20@server2:/..../test.sql.gz     debug1: client_input_channel_req: channel 0 rtype exit-status reply 0     debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0     : No such file or directory     debug1: channel 0: free: client-session, nchannels 1     debug1: fd 0 clearing O_NONBLOCK     Transferred: sent 265040, received 2552 bytes, in 0.0 seconds     Bytes per second: sent 6736670.0, received 64865.6     debug1: Exit status 1     mysqldump: Got errno 32 on write      can any one resolve this issue? **Updation** I removed 'user2@server2' and 'deploy -i' from backup command and run it. It gives me below messages               debug1: Sending env LANG = en_US.UTF-8     debug1: Sending command: /bin/cat > -t /....../test.sql.gz     stdin: is not a tty     debug1: client_input_channel_req: channel 0 rtype exit-status reply 0     debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0     /bin/cat: /......./test.sql.gz: No such file or directory     debug1: channel 0: free: client-session, nchannels 1     debug1: fd 0 clearing O_NONBLOCK     Transferred: sent 248608, received 2536 bytes, in 0.1 seconds     Bytes per second: sent 4628197.5, received 47211.3     debug1: Exit status 1     mysqldump: Got errno 32 on write


What is the best way to restraint/secure a workstation?

I want to prevent users to copy on usb devices and some others actions. I was thinking of using polkit. Do you think it is a good solution or does someone know some alternatives ? EDIT: I also need to disable cd/dvd writing. How could I achieve this ? Polkit doesn't to be shipped with this kind of policy. I was thinking of disabling cdrecord for users. Thanks


How to create a function based on commands not defined yet?

I have some scripts (that are out of my control) that loads some environment settings to my session. So whenever I want to load I have to execute a series of commands:               export SOME_VAR=/path/to/main/folder     source $SOME_VAR/loading/stuff.sh --quiet     loadApp1     loadApp2     loadApp3     loadApp4      I want to do this with a single command, so I created a function (pretty much the lines above), but it doesn't work. I think it's because the loadApps are aliases, loaded in the `stuff.sh` so at time Bash parses my functions it doesn't know the aliases yet. How could I do this with a single command without losing portability? PS: I do not want to copy the alias to my `$HOME/.bashrc` because they can be changed elsewhere and I won't see it.


Restrictions of /etc/profile in Gnome

I have an issue which bugs me for a long time. I'm using the Intel C++ compiler which includes shell scripts to set up environment variables for library paths, include paths and more. _Sourcing_ these scripts in `.bashrc` works like a charm for the terminal. Unfortunately, I need the environment variables in _Mathematica_ and _NetBeans C++_ too, which brings me to the question, how to source the Intel scripts so that they are known by the GUI programs I start. I searched the net carefully and I think I have tracked the issue down, although I don't have an explanation. One way of setting environment variables for Gnome seems to be to be to create an `*.sh` script in `/etc/profile.d/` which is then executed by `/etc/profile`. Although, regarding to this information the `/etc/profile` is not recommended, please note that I have a shell script which needs to be sourced and not only some `export VAR=blub` settings. If I do this with the e.g. `mklvars.sh` script, it seems that not the complete file is sourced. Let me give a snip from the file to show what I mean               #! /bin/sh     #     # Copyright (C)      # ...lot of boring stuff          CPRO_PATH=/opt/intel/composer_xe_2013_sp1.0.080     export MKLROOT=${CPRO_PATH}/mkl          SCRIPT_NAME=$0     MOD_NAME=mod          # .... some more code here ...          if [ -z "${MKL_TARGET_ARCH}" ] ; then              echo         echo "ERROR: architecture is not defined. Accepted values: ia32, intel64, mic"         mkl_help              else              if [ -n "${LD_LIBRARY_PATH}" ] ; then OLD_LD_LIBRARY_PATH=":${LD_LIBRARY_PATH}"; fi         export LD_LIBRARY_PATH="${CPRO_PATH}/compiler/lib/${MKL_TARGET_ARCH}: #.....      When I now logout/login again, the `MKLROOT` variable is defined but `LD_LIBRARY_PATH` was not adjusted. It seems anything which is a bit more complex than a simple `export VAR` is skipped when sourcing the `.profile`. * * * **Question:** Is there a convenient way of sourcing the compiler-variable scripts for an X-Session (in my case Gnome)? Does someone know what goes wrong here? * * * The obvious hack around this issue is to use the final variable definitions after sourcing the scripts manually and put them in the global `profile`. This has the disadvantage that I do this over and over again with every new update of the compiler. # Step-by-Step Let me give a step-by-step showcase so that you see that I'm not completely nuts. For this I put the Math Kernel Library Script on pastebin and I start with the following situation:   * I have not sourced the script in any `bashrc`, `profile` or other file.   * I have logged out and logged in again For the test we look at the `$MKLROOT` and `$LD_LIBRARY_PATH` which both should be changed by the script. Currently, they are not set when I check their values by               echo $LD_LIBRARY_PATH     echo $MKLROOT      When I source the file manually, I get:               source /opt/intel/composer_xe_2013_sp1.0.080/mkl/bin/mklvars.sh intel64     echo $MKLROOT     echo $LD_LIBRARY_PATH          # Output:     # /opt/intel/composer_xe_2013_sp1.0.080/mkl     # opt/intel/composer_xe_2013_sp1.0.080/compiler/lib/intel64:/opt/intel/composer_xe_2013_sp1.0.080/mkl/lib/intel64      When I put the `source` line into my `~/.bashrc` and open a new terminal, both variables are set correctly as shown above. Now, I remove the `source` line from `~/.bashrc` and put it into `/etc/profile.d/intelCC.sh`, save it and log off/on. After the login, none of the variables are set, but I have an error message in my `~/.xsession-errors` saying:               /usr/sbin/lightdm-session: 1: /etc/profile.d/intelCC.sh: source: not found      Now I replace `source` by a simple `.` so that `/etc/profile.d/intelCC.sh` contains now               . /opt/intel/composer_xe_2013_sp1.0.080/mkl/bin/mklvars.sh intel64      Same again: Save, log off and log on. Now there seem to be no errors in `.xsession-errors` related to this and finally:               echo $MKLROOT     # /opt/intel/composer_xe_2013_sp1.0.080/mkl          echo $LD_LIBRARY_PATH     # empty


Vim syntax highlight length-delimited fields

I'm trying to write a vim syntax file for SVN dump files. The part I can't figure out is the section like this:               Fooprop: Val1     Text-content-length: 20     Barprop: Val2                                            <- Blank line     abcdefghi     abcdefghi          Next-item-prop: Val3      How do I set up a syntax rule that says "N characters after the first blank line following 'Text-content-length: N' where N is a number"?


what does the "a" in chattr +ia do?

what does the `a` in `chattr +ia <filename>` do? and why would you add the `a` in combination with the `i`? _note: I know the`i` is for immutable_


How do I view the IO priority of a process?

How can I view the IO priority of a process? like to see for example if something has been `ionice`-ed.


Service not starting at boot

Im on Ubuntu 12.10. I have a service that runs well when I do `sudo service myservice start/stop` at installation, I did `sudo update-rc.d myservice defaults` and I see that there are in rc*.d some symlinks S93myservice and K93... pointing to /etc/init.d/myservice But... after doing reboot I can see that my service is not running (`status`). Why ?


Delay when iptables icmp rules take effect

I have setup my iptables to disable all incoming connection, i.e.               :INPUT DROP [0:65535]      When the iptables has been started, I run the following command to enable ping:               /usr/sbin/iptables -A INPUT -m icmp --icmp-state 8 -j ACCEPT     /usr/sbin/iptables -A INPUT -m icmp --icmp-state 0 -j ACCEPT      I saw the iptables rules are added from `/etc/init.d/iptables status`. I can ping the device from both Windows and Linux PC. Now I run the following command to remove them:               /usr/sbin/iptables -D INPUT -m icmp --icmp-state 8 -j ACCEPT     /usr/sbin/iptables -D INPUT -m icmp --icmp-state 0 -j ACCEPT      I saw the iptables rules are removed from `/etc/init.d/iptables status`. I cannot ping the device from Linux PC which is expected. However, I can ping the device from Windows PC for 1-2 minutes and then I cannot ping it afterwards. I do not ping the device indefinitely (i.e. without -t) from my Windows XP PC but why do I get this results?


How to install FTP server on Red Hat VM?

I have a windows machine and I need to transfer files from my machine to another Linux virtual machine which I have created. How do I install a FTP server on those VM's to transfer files via FTP protocol? I'd appreciate it if anyone can direct me to a link which gives a clear idea regarding what all FTP is all about?