## Question How do I test hardware components to find out which one is bad? ## Details I have an old machine running debian as a file server using samba. The other day I was unable to login to my file server. When I looked at the screen on my debian server this is what I saw: ![enter image description here](http://i.stack.imgur.com/wQObB.jpg) It says its a hardware error and kinda looks like it's a bad CPU. However, I don't want to run out and buy a new CPU because I really have no idea what I am talking about. Here is what I have done:   * I tested the memory using memtest 86+ for 66 hours straight. It passed 65 times and found 0 errors. So I think bad memory is out of the question. However, I was kinda curious why it didn't crash during those 66 hours if there was some other error on the system.   * I noticed it said `java Tainted` so I thought it might be a java issue. I disabled CrashPlan Backup service since it uses java. The server ran great for 4 days. (Usually it crashed every 15-30 minutes) During the time while I had crashplan off I had two computers connect to the server, get 50 GB of HD video, encode it and place it back on the servers hard drives. Didn't have any issues. Then a day later it crashed again. Should I just assume it's a CPU issue since it mentions that? How do I test hardware components to find out which one is bad?


How to increase the speed of a text console (kernel mode setting)?

On a Fedora 17 system (i915 hardware) KMS works out of the box - and using the console (i.e. `Ctrl`+`Alt`+`F2` etc.) is very framebuffer-like. To the point that scrolling through a man page or `cat` log-files is dog-slow. How can I configure the console speed in general? Or can I increase the scroll-speed somehow?


citrix not working in Arch Linux - libraries error

I have a citrix ica file that I need to open. I set the default application as wfica. I am using Arch Linux and the citrix thing worked until yesterday before setting the custom command line. It automatically worked with citrix. But, I was playing with the linux and I wanted to remove unwanted/unused packages and I typed `sudo pacman -Rsn $(pacman -Qqdt)` A bunch of packages got removed and I think that is why this citrix is not working properly. After that I also did a `sudo pacman -Syu` to update all the packages but in- vain. EDIT:               [srikanth@myhost linuxx86]$ sh wfica.sh      /home/srikanth/ICAClient/linuxx86/wfica: error while loading shared libraries: libXaw.so.7: cannot open shared object file: No such file or directory     [srikanth@myhost linuxx86]$ pwd     /home/srikanth/ICAClient/linuxx86     [srikanth@myhost linuxx86]$ whereis libXaw     libXaw: /usr/lib/libXaw7.so /usr/lib/libXaw.so /usr/lib/libXaw6.so      Looks like there is some error while loading libraries EDIT: @Kevin: still the same.               [srikanth@myhost linuxx86]$ cd /usr/lib     [srikanth@myhost lib]$ sudo ln -s libXaw7.so libXaw.so.7     ln: failed to create symbolic link `libXaw.so.7': File exists     [srikanth@myhost lib]$ pwd     /usr/lib     [srikanth@myhost lib]$ cd ~/ICAClient/linuxx86/     [srikanth@myhost linuxx86]$ ls     CHARICONV.DLL  eula.txt  install.txt  libctxssl.so  Npica     PDCRYPT1.DLL  readme.txt  util         VDSPMIKE.DLL  wfica_assoc.sh     config         help      keyboard     NDS.DLL       Npica.ad  PDCRYPT2.DLL  setupwfc    VDEUEM.DLL   wfcmgr        wfica.sh     desktop        icons     keystore     nls           npica.so  pkginf        TW1.DLL     VDSCARD.DLL  wfica     [srikanth@myhost linuxx86]$ sudo ldconfig     [srikanth@myhost linuxx86]$ sh wfica.sh      /home/srikanth/ICAClient/linuxx86/wfica: error while loading shared libraries: libXaw.so.7: cannot open shared object file: No such file or directory     [srikanth@myhost linuxx86]$ cd /usr/lib     [srikanth@myhost lib]$ ls -ltr libXaw7*     -rwxr-xr-x 1 root root 462536 Jan 19  2011 libXaw7.so.7.0.0     lrwxrwxrwx 1 root root     16 Jan 19  2011 libXaw7.so.7 -> libXaw7.so.7.0.0     lrwxrwxrwx 1 root root     16 Jan 19  2011 libXaw7.so -> libXaw7.so.7.0.0     [srikanth@myhost lib]$


Add wildcard entries to the KDE proxy settings?

I have Googled this but cannot find it. I am currently using Kubuntu 11.10 64-bit. I am trying to set up an exceptions list for my proxy using the KDE control panel but when I try use common wildcard symbols, I get the error message:               Make sure none of the addresses or URLs you specified contain invalid or      wildcard characters such as spaces, asterisks (*), or question marks(?).      Does there exist a wildcard that can be used here? If not, what is the easiest way of setting up my exceptions list?


What slows down my ssh login?

Everytime I ssh login to a server, it is always very slow. As a reply to my earlier post said, "grepping through a 200 line file should take millisecond or so, so I would doubt its that." I tried `ssh -vvv time@server` and the output has been uploaded here. I found that when proceeding to each of these three lines in the output, it is particularly slow               debug1: Next authentication method: gssapi-with-mic           debug1: Unspecified GSS failure.  Minor code may provide more information     Credentials cache file '/tmp/krb5cc_1000' not found                debug1: Unspecified GSS failure.  Minor code may provide more information     Credentials cache file '/tmp/krb5cc_1000' not found       I wonder why and what I can do to change it? Thanks and regards! * * * Update: Ignacio's reply suggests me to "disable all GSS/Kerberos auth methods in your configuration." So in `/etc/ssh/ssh_config`, do I have to make sure "no" is behind each of all options starting with "GSS": GSSAPIAuthentication, GSSAPIDelegateCredentials, GSSAPIKeyExchange, GSSAPITrustDNS, GSSAPIAuthentication, and GSSAPIDelegateCredentials? Then what are the options for "Kerberos" auth method that I need to put "no" behind? PS: following is the content of my local `/etc/ssh/ssh_config` with commented options not copied to here:               Host *         SendEnv LANG LC_*         HashKnownHosts yes         GSSAPIAuthentication yes         GSSAPIDelegateCredentials no


The most light-weight Compiz compatible environment?

I require Compiz for organizational reasons; I make heavy use of its window sorting features. But I like light-weight environments so that I can give as much of my system's resources to the applications as possible. Is there a DE that plays nice with Compiz, but is still very light?


Which laptop is most compatible with Linux?

I've always been unlucky with regards to choosing a laptop that I can install Linux on. If it's not the wireless card that's not working out of the box, it's the video card. Also, I'm still not able to hibernate my computer, close the lid and resume where I left off at a later point. I always have to shut down the laptop or leave it on. Is there a laptop vendor that is considered to have the best trade off between performance and compatibility with Linux? If not, then what should I look for when buying a laptop?


Linux fedora - httpd package and router, how to make it work?

I installed HTTPD package to setup private web server in my house on one of the computers. The server is up and running, but I can't access the server from outside by using my external IP address. I think it's because of my router, I have 3 computers in the house connected through router, and one of them is the web server, what I need to do to make it work?


"kernel driver" in "lspci" output

I often use `lspci -v` to check the LKM in use for particular hardware device. LKMs are listed as "Kernel modules" and can be seen with `lsmod`. However, what is a "Kernel driver"? For example here: ![bcma-pci-bridge on in lspci output](http://i.stack.imgur.com/oWU1p.jpg) Is the "bcma-pci-bridge" a module built into kernel(I'm using 3.11.0) and thus it's not loadable and thus it will not appear in `lsmod`, can not be unloaded with `modprobe -r` or checked with `modinfo`?


Serving webpages with Apache on Ubuntu server

I've set up an old machine running Ubuntu server 13.1. I can access it remotely with webmin and I was able to install apache that way. What I would like to be able to do is to put web pages and be able to open them in a browser on any computer connect to my local network. I'm a bit of a noob with linux and any tutorial I have followed hasn't worked for me so far. But today, using the default local server, I was able to open my webpage through webmin's HTTP tunnel with               http://localhost:80       When I try this in a browser it wont work. Could anyone help me out here and give some tips on what to do to get apache serving web pages in my browser? Edit: I belive this also needs to be mentioned :) My server ip is 192.168.1.92 but when I type this it just brings me to webmin, not my webpage. Is there some configuration I need to do to access webpages with this ip?


Need to copy files to existing directory and remove files already there with the same name but different extension

**EDIT:** Total rewrite of question for clarity. I have a directory tree ( **new** ) with a bunch of files of with an extension of `.new`. I have an identical tree ( **old** ) where many of the files have names identical to those in the **new** tree except that the extension is `.old`. I would like to copy all of the `.new` files from the **new** directory tree into the **old** directory tree which contains the `.old` files. As a file with a `.new` extension is written into the **old** directory tree, I would like to delete any file with the same name but a `.old` extension. So, if in the **new** directory tree, there is a file named `new/foo/bar/file.new`, it will be copied to the **old** directory tree as `old/foo/bar/file.new` and then the file `old/foo/bar/file.old` will be deleted if it exits. **EDIT #1** This answer was hashed out below (using the old question that had extraneous background information that was confusing). See the actual solution that I worked out below as one of the answers.


fedora 19 dependency issue

I am getting this error while updating:               Resolving Dependencies     --> Running transaction check     ---> Package openssl.x86_64 1:1.0.1e-4.fc19 will be updated     ---> Package openssl.x86_64 1:1.0.1e-29.fc19 will be an update     ---> Package openssl-devel.i686 1:1.0.1e-4.fc19 will be updated     --> Processing Dependency: openssl-devel(x86-32) = 1:1.0.1e-4.fc19 for package: 1:openssl-static-1.0.1e-4.fc19.i686     ---> Package openssl-devel.x86_64 1:1.0.1e-4.fc19 will be updated     ---> Package openssl-devel.i686 1:1.0.1e-29.fc19 will be an update     ---> Package openssl-devel.x86_64 1:1.0.1e-29.fc19 will be an update     ---> Package openssl-libs.i686 1:1.0.1e-4.fc19 will be updated     ---> Package openssl-libs.x86_64 1:1.0.1e-4.fc19 will be updated     ---> Package openssl-libs.i686 1:1.0.1e-29.fc19 will be an update     ---> Package openssl-libs.x86_64 1:1.0.1e-29.fc19 will be an update     ---> Package openssl-static.x86_64 1:1.0.1e-4.fc19 will be updated     ---> Package openssl-static.x86_64 1:1.0.1e-29.fc19 will be an update     --> Finished Dependency Resolution     Error: Package: 1:openssl-static-1.0.1e-4.fc19.i686 (@fedora)                Requires: openssl-devel(x86-32) = 1:1.0.1e-4.fc19                Removing: 1:openssl-devel-1.0.1e-4.fc19.i686 (@fedora)                    openssl-devel(x86-32) = 1:1.0.1e-4.fc19                Updated By: 1:openssl-devel-1.0.1e-29.fc19.i686 (updates)                    openssl-devel(x86-32) = 1:1.0.1e-29.fc19      You could try using --skip-broken to work around the problem      You could try running: rpm -Va --nofiles --nodigest      I have tried yum's suggestions, but still it's of no use


How to respawn vpnc when it stops?

As root, I've setup a crontab rule that launches vpnc everyday early in the morning (before I arrive at my workplace). But it often occurs that the vpn stopped mid day. As a result, I have to `sudo vpnc ...` in order to relaunch the background process. How to make the vpnc respawn automatically? Maybe initab respawn rules or something like that? How would you do? What is the preferable way to do that please?


Stuck with kde at login screen?

I installed Xubuntu, I was happy with xfce4 interface but then I decided to try out the other ones, so I installed kde and gnome just so I get to know which one is best for me. Problem is, now when I start my computer, the login screen is using KDE screen. I can still choose xfce interface when logging a user, but at the login screen I'm stuck with KDE, how do I change that without having to unistall kde?


What is the .screenrc file for?

What is the `.screenrc` file for? I have seen it in some dotfiles repos and such but I don't quite understand what it's for. Judging from the name it sets settings for the Terminal itself, not the shell, am I correct on this? I suppose not, in that case, what is it actually for? And does it change from shell to shell?


Disable bash's cache of executables in the path

On the rare occasions that I notice bash's cache of things that it has found in the path, it's not because it's helpful, it's because it's bloody annoying. An example:               ~ dc$ export PATH=$HOME/bin:$PATH     ~ dc$ cat bin/which     #!/bin/bash     echo "my which"     ~ dc$ which     my which     ~ dc$ rm bin/which     ~ dc$ which which     -bash: /Users/dc/bin/which: No such file or directory      In another shell ...               ~ dc$ which which     /usr/bin/which      I'm sure that this caching made sense back in the good old days when disks were slow and memory was expensive and limited and so you couldn't cache much - caching a path is cheaper than caching all the disk blocks necessary to find a command. But these days it provides no noticeable benefit and causes more problems than it solves. It's a misfeature, verging on being a bug. And I can't even find a way of disabling it. Any pointers?


Is there a Software-Center (like in Ubuntu) in Debian?

I wondered if there is some easy to use Software-Center in Debian as well. (You can search and install software easily with it.) ![enter image description here](http://i.stack.imgur.com/FO5zY.jpg) **Software Center** The program can be used to add and manage repositories as well as Ubuntu Personal Package Archives (PPA) and on Ubuntu, the Ubuntu Software Center also allows users to purchase commercial applications.


Coloring different sources for tail

I'm watching different logs by               tail -q -f /var/log/syslog -f /var/log/fail2ban.log -f /var/log/nginx/error.log      How can I have the output of each log colored differently?


driver(-D) option under wpa_supplicant

Before `wpa_supplicant` can do its work, the network interface must be available and the driver for the device must be loaded. `wpa_supplicant` allows one to specify driver with "-D" flag. I have tried this on few systems, but `wpa_supplicant` never seems to accept the driver I have specified. For example:               T42 ~ # lspci -v -s 02:02.0     02:02.0 Network controller: Intel Corporation PRO/Wireless 2915ABG [Calexico2] Network Connection (rev 05)         Subsystem: Intel Corporation Device 1011         Flags: bus master, medium devsel, latency 64, IRQ 11         Memory at c0214000 (32-bit, non-prefetchable) [size=4K]         Capabilities: [dc] Power Management version 2         Kernel driver in use: ipw2200         Kernel modules: ipw2200     T42 ~ # wpa_supplicant -D ipw2200 -i eth1 -c /root/wpafile      Unsupported driver 'ipw2200'.     T42 ~ #       However, if I start `wpa_supplicant` without specifying the driver like `wpa_supplicant -i eth1 -c /root/wpafile`, then it works flawlessly. Why is this so? In addition, in which case it's needed to specify driver for `wpa_supplicant`?


Run FileZilla on Debian

I'm new on Debian GNU/Linux, and I installed FileZilla but I don't know how to run it. When I execute this command:               dpkg -l | grep -i "filezilla"      I get:               ii  filezilla-common                     3.7.3-1                            all          Architecture independent files for filezilla      So I guess it installed.


Debian DNS on multiple networks

I have a Debian 7 box with two nics, each nic is on its own separate internal network. I have windows dns servers on both networks. I would like the Linux box to be able to resolve local machine names on both networks. Even though both networks are accessible, I am only able to resolve names on one or the other, but not both. Is this possible to do? This machine will be used for monitoring the two networks.


Unable to access external content with this IPTABLES ruleset

My application server is on a network protected by a organization wide firewall, and my server is also using `fail2ban`. That said, I'd like to set up an additional layer of protection with `iptables`. I'm having a little trouble with my configuration - specifically accessing external content from the application server. ### Requirements:   1. Deny access to everyone, then allow to a specific IP range (4.3.2.*)    2. Ability to retrieve external content from application server ### Knowns:   * The application server IP is 1.2.3.4   * My laptop's static IP is 4.3.2.1 ### What I've tried: Starting with a vanilla `iptables` config that allows traffic over ports 22, 80 and 443, I added the following.               # allow traffic from a specific IP range     iptables -A INPUT -s 4.3.2.0/24 -j ACCEPT          # allow traffic over LDAP port     iptables -A INPUT -p tcp --dport 636 -j ACCEPT          # keep existing traffic     iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT          # deny all traffic     iptables --policy INPUT DROP      I save that config using `service iptables save`, then restart the service. Here is `iptables -L -v -n --line-numbers`               Chain INPUT (policy DROP 461 packets, 81259 bytes)     num   pkts bytes target     prot opt in     out     source               destination              1    11835 1095K fail2ban-SSH  tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:22      2    2972K 1083M ACCEPT     all  --  *      *       4.3.2.0/24           0.0.0.0/0                3        0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:636      4    3747K  436M ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED           Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)     num   pkts bytes target     prot opt in     out     source               destination                   Chain OUTPUT (policy ACCEPT 89676 packets, 26M bytes)     num   pkts bytes target     prot opt in     out     source               destination                   Chain fail2ban-SSH (1 references)     num   pkts bytes target     prot opt in     out     source               destination              1    11776 1092K RETURN     all  --  *      *       0.0.0.0/0            0.0.0.0/0             ### Problem: I'm unable to access external content with the ruleset above. The default OUTPUT policy is ACCEPT, so I'm unsure what the problem could be. I've tested this from the application itself, and from simply going to command and using lynx https://some.site. If I change the default INPUT policy to ACCEPT, lynx is able to pull up the content. What about the INPUT policy is preventing the content from loading?


How to display the number of lines, words and characters in separate lines?

I want to display the number of lines, words and characters, in a file, in separate lines?   I don't know anymore than using `wc filename` for this.


Does 'ulimit -m' not work on (modern) Linux?

This article claims that the `-m` flag to `ulimit` does nothing in modern Linux. I can find nothing else to corroborate this claim. Is it accurate? > You may try to limit the memory usage of a process by setting the maximum > resident set size (ulimit -m). This has no effect on Linux. man setrlimit > says it used to work only in ancient versions. You should limit the maximum > amount of virtual memory (ulimit -v) instead. If it's true that it worked in older versions of Linux, which version stopped supporting this?


Two HTTP servers on port 80 and 443

I use on my home server, Apache with one main application that is OwnCloud. So to access it from Internet I use URL ->               https://my_host.no-ip.org/owncloud      I use another HTTP application on the same server. This application has its own HTTP server and it does not use Apache. So at this time it use 8080 and 8081 as HTTP/HTTPS ports. The problem is to access to the second app, when I am for example in hotel (with WiFi service) but behind proxy server. Such servers in 90% proxies only ports 80 and 443 and no other, including SOCS. Because I have only one IP address supply by my ISP I can not split access to two different IP address. So my question is. Is there any way to access my second app using URL:               https://my_host.no-ip.org      And access owncloud via URL:               https://my_host.no-ip.org/owncloud      Both on standard port 443. At this time, the firs URL is only redirection to another WEB site located somewhere in Internet, unnecessary for me. Any idea? Is it possible at all?


How to kill a process started as daemon?

I start a process using `foo &`. It outputs something like: > `[1] 16915` This is the process id, I guess. How can I store this number into a variable named `MY_PROCESS_ID` (for example)? Then I can do:               kill $MY_PROCESS_ID      and my process id will be killed.


Removing a directory from PATH

I'm trying to compile wxWidgets using MingW, and I have cygwin in my path, which seems to conflict. So I would like to remove `/d/Programme/cygwin/bin` from the PATH variable and I wonder if there is some elegant way to do this. The naive approach would be to echo it to a file, remove it manually and source it, but I bet there is better approach to this.


Fedora over-current condition on port 1

When I boot up my Fedora 18, I got this message > `[1.817675] hub 2-1:1-0: over-current condition on port 1` shown on the screen. Right after the Fedora logo disappear, and it is not yet boot into Fedora. I was stuck now since I could not do anything, could anyone please advice what should I do for this problem? Before this issue was happened, I just download the necessary development package for LibreOffice using this command > `su -c 'yum-builddep libreoffice'`, I hope this is not the root cause of the problem.


NetworkManager tries to connect to previous network after suspend, even if the network isn't there

At home I am connected to network 'A' and can see WLANs 'B' and 'C' from my neighbours. I suspend my computer and when I get to work the next day, the system still thinks it's connected to the same network 'A' and that it still can see the 'B' and 'C' networks, even though they aren't there. It will stay there forever trying to connect to the 'A' network, until it's stopped and I select the correct network. It is not a major problem (I can just open the list of networks and connect to the correct one), but is quite annoying. It is like (but is different) this bug: https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/893316 (in the bug, the system connects to a different WLAN even though the previous one is still available; with my case it's the opposite). I think it's a NetworkManager problem, because I never saw it when I used wicd. What can it be? I'm using x86-64 Arch Linux, NM 0.9.6.4, Intel Wireless 1030 card (iwlagn module).


What this Iptables rules does?

I think I can understand this iptable rule, but I want to make sure what it does, so can someone explain to me technically what this does? well this two rules combined.               /sbin/iptables -t nat -A PREROUTING -p tcp --dport 80 -d 10.13.235.42 -j DNAT --to-destination 209.208.27.224:27279          /sbin/iptables -t nat -A POSTROUTING -p tcp --dport 27279 -j MASQUERADE


Disable mail check on login?

When I login to console, e.g tty1, I usually see a message `No mail`, I know there's some program checking email on login, but I don't use that, how can I disable that command ? I tried to grep from `/etc/profile.*` and `~/.bash*`, but nothing found


Synchronize the files from One folder of a Server to other

I need a script in which Files of One server will be copied to other folder of another server ONLY AND ONLY IF the file on SOURCE SERVER file doesn't exist on DESTINATION SERVER. # Further Detail This will be running all time on a SOURCE server if the user create the FILE on SOURCE SERVER and when the file is completed and saved it(the Command or script) first check on DESTINATION SERVER if the file exist on DEST. SERVER if not then copy if to DEST. SERVER How to do that I have no idea of scripting.


Negative hdd usage. Available is larger than fullsize

Having issues with space accounting of lvm volume. 23G is available. But the full size of the partition is 20G. (So, it shows "-4.1G used" 0_O)               > df -h      Filesystem            Size  Used Avail Use% Mounted on     /dev/mapper/VolGroup00-LogVol01                            20G -4.1G   23G   -  /     /dev/mapper/VolGroup00-LogVol02                            63G   31G   29G  52% /porta_var     /dev/mapper/VolGroup00-LogVol00                            20G  3.3G   16G  18% /update_root     /dev/cciss/c0d0p1      99M   13M   82M  13% /boot     tmpfs                 7.9G     0  7.9G   0% /dev/shm      Any ideas? P.S. > uname -a Linux hostname 2.6.18-164.0.0.0.1.el5 #1 SMP Thu Sep 3 00:21:28 EDT > 2009 x86_64 x86_64 x86_64 GNU/Linux


USB SD card reader recognized with lsusb but no storage device shown with lsblk

I have a 2GB Micro SD card and a USB card reader. When I run `lsusb` I can see the card reader is recognized, but when I run `lsblk` I see no additional storage devices.               [lane@Lane-ArchSystem 19:38:08 ~]$ lsusb     Bus 001 Device 003: ID 041e:4069 Creative Technology, Ltd      Bus 002 Device 002: ID 046d:c00e Logitech, Inc. M-BJ58/M-BJ69 Optical Wheel Mouse     Bus 002 Device 003: ID 0b38:0010 Gear Head 107-Key Keyboard     Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     [lane@Lane-ArchSystem 19:38:13 ~]$ lsblk     NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT     sda      8:0    0  1.4T  0 disk      ├─sda1   8:1    0  1.4T  0 part /     ├─sda2   8:2    0    1K  0 part      └─sda5   8:5    0 1023M  0 part      sr0     11:0    1 1024M  0 rom       [lane@Lane-ArchSystem 19:38:17 ~]$       Not sure what the problem might be I've never run into anything like this before. EDIT: Forgot to mention that I did have the SD card in the reader before I plugged it into the USB port.


rsync exclude based on file size?

Is it possible to exclude files in `rsync` over a certain size (e.g. over 250 MB)? And what if I also want to exclude hidden files? How would I exclude all hidden files or directories (those that match ".*") as well as files (not directories) that are greater than 250 MB (whether hidden or not)?


Debug an ACPI resume failure

I have a machine which suspends but does not resume under Linux, but resumes perfectly under Windows 7. When I suspend (be it through `pm-suspend` or GUI), the suspend goes through, the power LED changes from solid to blinking, but after about 10 seconds it turns off completely. At the same time, USB devices plugged in stop receiving power (a smartphone stops charging). Pressing the power button makes the power LED and the CPU fan turn on, but not the screen or anything else. Pressing the reset button afterwards starts a cold boot process. Windows 7 installed on the machine suspends and resumes fine. I have tried `echo 1 > /sys/power/pm_trace && pm-suspend` as mentioned in Ubuntu manual. I do get the magic number (after the cold boot), but it changes between boots and the hash never matches anything. System configuration:   * Intel Core i7-3770   * ASUS P8Z77-I DELUXE (BIOS 0902)   * No discrete graphics (using the GPU in the processor)   * Samsung SSD 830   * Seasonic S12II 430W Power Supply I have tried the following OS, with exactly the same results:   * Ubuntu 12.10   * Ubuntu 13.04   * Ubuntu 13.04 with the latest available mainline kernel   * Fedora 18   * Current Arch Linux How do I debug this problem?


Advantages of using a RTOS such as QNX or VxWorks instead of Linux?

When developing a solution that requires a real-time operating system, what advantages would an operating system such an QNX or VxWorks have over Linux? Or to put it another way, since these operating system are designed specifically for real-time, embedded use - as opposed to Linux which is a more general system that can be tailored to real-time use - when would you _need_ to use one of these operating systems instead of Linux?


Determining which version of the NFS protocol is in use by a mounted NFS filesystem

I mounted an NFS filesytem from the shell using the code:               LINE='nfs.francky.me:/export/beatdb /beatdb nfs tcp,intr,rw 0 0'     grep "$LINE" /etc/fstab >/dev/null || echo $LINE >> /etc/fstab     mkdir /beatdb     mount -a # Remount /etc/fstab Without Reboot in Linux      How can I determining which version of the NFS protocol is in use? I tried using `nfsstat -c` as well as `rpcinfo -p nfs.francky.me`, my understanding is that the latter shows that the server supports version 2 and 3 of the NFS protocol, but I don't know which one is been used. I don't have access to the NFS server so I am looking for a solution client-side. ![enter image description here](http://i.stack.imgur.com/Mz2AC.png)


How do I join the next line when a line matches a regex for whole document in VI?

As title, for example, I have lines like               abcdefg     join!     abcdef     no join     abcdefg     join!      If a line matches regex `^a.+g$` then I would like them to be joined, so it would be:               abcdefgjoin!     abcdef     no join     abcdefgjoin!      Is there a way of doing that in `VIM`?


Unable to make .zhistory a symbolic link

Every time I try to make my Zsh history file (`.zhistory` file) a symbolic link to a file (previously existing `.zhistory` file) that lives in another folder, Zsh deletes the symbolic link and makes it a regular file. I have tried creating the symbolic link in Bash and then switching back to Zsh, but Zsh will still always remove the link and copy the file instead. Why is this? How can I have my `.zshistory` file live somewhere else ? (in my case a git repository not located in the home directory)


Why do I need to comment out the floppy in /etc/fstab in new-ish Debian versions?

I'm using a box with Debian that has gone through many updates (at least lenny, squeeze, wheezy). After a long time, I wanted to mount a floppy again which didn't work as it used to. I found a tutorial explaining I had to comment out the line about `/dev/fd0` in `/etc/fstab` because the floppy module was dropped from the kernel and isn't invoked during boot. Link: How to enable your floppy driver, refers to Can't read Floppy Disks. The fix works, I can mount the floppy just fine. But now, I'm curious. The big question: Why does commenting out the line in `/etc/fstab` fix the problem? I thought the info in `fstab` just makes typing `# mount` commands easier, allows applications to find mounting info, and lets you omit stuff like `-t` and the mount point? Commenting out a line in `/etc/fstab` will surely not load a kernel module, or does it?! Do I really enable the floppy driver itself when modifying `/etc/fstab`? **EDIT, just to be sure...** After a good comment asked if this was really the behavior of my system, I double-checked. With               /dev/fd0        /media/floppy0  auto    rw,user,noauto  0       0      in `/etc/fstab`, mounting doesn't work:               box:/home/zebonaut# mount -t vfat /dev/fd0 /media/floppy0/     box:/home/zebonaut# ls -l /media/floppy0     total 0     box:/home/zebonaut# umount /media/floppy0     umount: /media/floppy0: not mounted     box:/home/zebonaut#      With               #/dev/fd0        /media/floppy0  auto    rw,user,noauto  0       0      in `/etc/fstab`, I can mount the floppy just fine:               box:/home/zebonaut# mount -t vfat /dev/fd0 /media/floppy0/     box:/home/zebonaut# ls -l /media/floppy0     total 1241     -rwxr-xr-x 1 root root 340498 Sep  5  2002 file.01     -rwxr-xr-x 1 root root 410952 Sep  5  2002 file.02     -rwxr-xr-x 1 root root  43008 Jan 23  2000 file.03     -rwxr-xr-x 1 root root  26060 Jan  6  2005 file.04     -rwxr-xr-x 1 root root  20992 Jan 19  2000 file.05     -rwxr-xr-x 1 root root  54784 May 14  1999 file.06     -rwxr-xr-x 1 root root 217600 Apr 15  2005 file.07     -rwxr-xr-x 1 root root  32256 Mar 23  2005 file.08     -rwxr-xr-x 1 root root  32768 Jan 20  2000 file.09     -rwxr-xr-x 1 root root  91136 Jan 20  2000 file.10     box:/home/zebonaut# umount /media/floppy0     box:/home/zebonaut#      It really is this strange. I can turn on or off my ability to mount the floppy by opening `/etc/fstab` with an editor and putting a `#` in front of the line with the floppy info.


What does gpg error code 2(GPG_ERR_UNKNOWN_PACKET) mean?

I am tasked to explain the variation of gpg errors that happened in one of my batch script. Currently when I perform gpg decrypt for a specified file it returns 2. The problem with this is when I search the form, it shows that the file has been decrypted properly but the error code is causing the script to stop because it only assumed that 0 is the only success value.               gpg -o XXX --decrypt XXX.gpg     RETVAL=$?     if [ RETVAL -ne 0 ]; then         exit 1     fi      I searched the net and found the header list for gpg. It defines error 2 as Unknown Packet. http://www.gnu-darwin.org/www001/src/ports/security/libgpg-error/work/libgpg- error-1.5/src/err-codes.h.in The normal error text being displayed is [gpg: [don't know]: invalid packet (ctb=14)]. What exactly does the unknown packet mean? I am trying to search any documents on understanding the error codes. After showing all the verbose information using the [-vv] option. I compared the resulting gpg file decryption with a file that returns 0 code. The only thing I noticed is the byte of the key is different. The decryption of the gpg that is error free have the following log:               :pubkey enc packet: version 3, algo 16, keyid <16-hexdigit>         data    1023 bits         data    1024 bits      The decryption of the gpg causing error have the following log:               :pubkey enc packet: version 3, algo 16, keyid <16-hexdigit>         data    1022 bits         data    1022 bits      What does this mean? why can it still be decrypted properly even if the key bit is not the same? Note that the key-id and passphrase used to decrypt the two file are the same. Also, does anyone know any detailed resource on explaining the error of gpg.


How to turn off lines under entire text in Kate editor?

After a recent upgrade on Kubuntu, Kate editor (v3.8.5) shows odd lines under the entire text of previously created simple text files. New files usually have only the first line underlined. Maybe if I knew what this is called, I'd be able to find something. It does the same in KWrite, so it could be something in whatever the two have in common. Highlighting is set to "None'. Here's what it looks like: ![](http://i.stack.imgur.com/feHa8.png) EDIT: Thanks, but that command doesn't seem to have any effect on this. This is KDE 4.8.5. In another example, the lines change a bit: ![Another example](http://i.stack.imgur.com/feHa8.png)


Backspace, del, arrow keys not working with interactive programs in Tilda

I currently run Openbox on a light netinstall of Debian. In Tilda, when I use a program like `nslookup` or `winexe`, some of my keys do not work properly.   * `Backspace` generates `^?`   * `Up` generates `^[[A`   * `Left` generates `^[[D`   * `Down` generates `^[[B`   * `Right` generates `^[[C`   * `Delete` generates `^[[3` This is not an issue when I am typing from the bash prompt itself, only when the programs are running within Tilda. This also does not happen when I run the same programs from an xterm window. What gives?


Double SSH tunnelling for SMB shared folder

I am actually working from `PC1` (using Mac OSX) on a distant computer(Linux) PC2 using `SSH`. This distant computer `PC2` does not have any connection to Internet but is in a network with a `PC3` (Windows XP) which has no internet connection. I shared a folder on my `PC3` desktop and I would like to be able to use it directly on `PC1`, using OSX. I think it's a double SSH tunnelling problem here. How can I double SSH my packets in a way that I will be able to use my shared folder's `PC3` from `PC1`? Everything should be done from Terminal if possible, and in a one-line command. My Mac OSX computer has an Internet access, but it's the only one.


Modify AIX print queue error notification

It seems the default behavior of the AIX print queue is to report queue errors to the user that submitted the print job. We have several hundred queues used by unattended scripts and cron jobs running under system accounts that are not intended to recieve mail. What I would like to do, and have tried unsuccessfully to do, is to stop these error reports from being directed to the users that submit jobs, and instead direct them to another address. This is what I have tried, with no effect:               chque -q'queue_name' -a"recovery_type = sendmail "'queue_errors@example.com'      This added the expected configuration to /etc/qconfig. I restarted lpd, but error messages are still being sent to users. Furthermore, error messages are not delivered to queue_errors@example.com. This is on AIX 5.3. A typical error that I'd like to redirect:               Message from queueing system:     Queue hs-3841:@print went down, job is still queued:       Backend: /usr/lib/lpd/rembak -S print.example.com -P hs-3841 -N \                /usr/lib/lpd/aixshort /var/spool/lpd/dfA731sub.sub.example.com.1280424810.1028194        Backend Exit Value: EXITFATAL (0100)       Job Submit Time: Mar 21 03:33:30 2011,  Current Time: Mar 21 12:00:51 2011     Use local problem reporting procedures.      I know I can adjust rembak to try to avoid errors due intermittent remote queue downtime, but how can I configure lpd in such a way as to direct queue errors to an address other than the user's?


Booting from USB devices on secure boot UEFI system

I'm trying to put an ArchLinux install onto a USB-HDD and want it to be bootable on BIOS systems as well as on UEFI systems that use secure boot. Therefore I have one main question. > Does an UEFI system with active secure boot permit or deny booting from USB > drives? According to this article the UEFI partition holds all the bootloaders for the OSes on a physical drive and in my scenario that partition would already exist elsewhere on the system. On the Arch-Wiki I found this article on basic decisions to use rather MBR or GPT for partitioning on the boot device (also applicalbe on USB drives) and possible bootloaders are listed here but will any of these be recognized by the UEFI Firmware?


How to comment multi-line commands in shell scripts?

When invoking long, switch-heavy commands, it's a good practice to write them in shell scripts. Is there an easy way to comment lines in such scripts? I've tried the following methods, but neither works.               # the \ is also commented out, resulting in "command" and "--good-switch".     command \       #--bad-switch \       --good-switch \          # seems to send an extra argument to the command     command \       \ #--bad-switch \       --good-switch


Is it possible to simulate "no external access" from a Linux machine when developing?

Sometimes I upload an application to a server that doesn't have external internet access. I would like to create the same environment in my machine for testing some features in the application and avoid bugs (like reading a rss from an external source). I thought about just unplugging my ethernet cable to simulate, but this seems archaic and I don't know if I'm going to raise the same exceptions (specially in Python) when doing this compared to the limitations at the server. So, how do I simulate "no external access" in my development machine? Will "deactivating" my ethernet interface and reactivating later (with a "no hassle" command) have the same behavior as the server with no external access? I'm using Ubuntu 10.04. Thanks!


Printing specific section of a line when a trigger value is present

I'm parsing data in the following format:               prop1=value1:prop2=value2:prop3=value3+prop1=value4:prop2=value5        1. parts of the string are delimited by `+`   2. properties can appear in any order   3. the desired output is the value of prop2 from the string part where prop1 has a particular value (input) Can I achieve this through standard unix command-line tools, or do I have to write a small C program? Edit - for the line shown, this is the desired functionality:               input: value1 -> output: value2     input: value4 -> output: value5


iptables - why the stun, turn ports are not working to allow end points to access the server?

I have this iptables where all working except tcp/udp port 3478 and 5349.               $ cat /etc/sysconfig/iptables     # Generated by iptables-save v1.4.7 on Thu Nov 21 10:21:41 2013     *filter     :FORWARD ACCEPT [0:0]     :INPUT ACCEPT [0:0]     :OUTPUT ACCEPT [0:0]     -A INPUT -p tcp -m tcp --dport 3478 -j ACCEPT     -A INPUT -p tcp -m tcp --dport 5349 -j ACCEPT     -A INPUT -p udp -m udp --dport 5349 -j ACCEPT     -A INPUT -p udp -m udp --dport 3478 -j ACCEPT     -A INPUT -p tcp -m tcp --dport 10000 -j ACCEPT     -A INPUT -p tcp -m tcp --dport 443 -j ACCEPT     -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT     -A INPUT -p tcp -m tcp --dport 5222 -j ACCEPT     -A INPUT -p tcp -m tcp --dport 5269 -j ACCEPT     -A INPUT -p udp -m udp -m string --dport 5080 -j DROP  --string "friendly-scanner" --algo bm --to 65535      -A INPUT -p udp -m udp -m string --dport 5060 -j DROP  --string "friendly-scanner" --algo bm --to 65535      -A INPUT -p tcp -m tcp --dport 5081 -j ACCEPT     -A INPUT -p udp -m udp --dport 5081 -j ACCEPT     -A INPUT -p tcp -m tcp --dport 5080 -j ACCEPT     -A INPUT -p udp -m udp --dport 5080 -j ACCEPT     -A INPUT -p tcp -m tcp --dport 5061 -j ACCEPT     -A INPUT -p udp -m udp --dport 5061 -j ACCEPT     -A INPUT -p tcp -m tcp --dport 5060 -j ACCEPT     -A INPUT -p udp -m udp --dport 5060 -j ACCEPT     -A INPUT -p udp -m udp --dport 16000:42000 -j ACCEPT     -A INPUT -p tcp -m tcp --dport 7007 -j ACCEPT     -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT     -A INPUT -p icmp -j ACCEPT     -A INPUT -i lo -j ACCEPT     -A INPUT -p tcp -m state -m tcp --dport 22 --state NEW -j ACCEPT     -A INPUT -j REJECT --reject-with icmp-host-prohibited     -A INPUT -s 178.162.205.224/32 -j DROP     -A INPUT -s 65.55.44.100/32 -j DROP     -A INPUT -s 178.162.205.224/32 -j DROP     -A INPUT -s 91.218.247.162/32 -j DROP     -A INPUT -s 85.25.78.58/32 -j DROP     -A INPUT -s 91.218.247.162/32 -j DROP          -A FORWARD -j REJECT --reject-with icmp-host-prohibited          -A INPUT -j ACCEPT          COMMIT     # Completed on Thu Nov 21 10:21:41 2013     # Generated by webmin     *mangle     :FORWARD ACCEPT [0:0]     :INPUT ACCEPT [0:0]     :OUTPUT ACCEPT [0:0]     :PREROUTING ACCEPT [0:0]     :POSTROUTING ACCEPT [0:0]     COMMIT     # Completed     # Generated by webmin     *nat     :OUTPUT ACCEPT [0:0]     :PREROUTING ACCEPT [0:0]     :POSTROUTING ACCEPT [0:0]     COMMIT     # Completed


Network not working after fiddling with webmin

Can some please help me restore my networking? I have a VPS CentOS 6.3. Few minutes ago it was working well, Except I couldn't connect to the Yum repository. So I thought I could change some settings in Hostname and DNS Client under webmins network configuration. I changed the nameserver IP order (8.8.8.8, 0.0.0.0, 66.215.210.17) and also I have removed routing and gateways IP (* more later). Now I can't connect from terminal. Few minutes back (from terminal using putty):               # host 66.215.210.17     17.210.215.66.in-addr.arpa domain name pointer unknown.hostforweb.net.      Now (only from hosting VPS Java client console)               # host 66.215.210.17     Host 17.210.215.66.in-addr.arpa not found: 5(REFUSED)      I have removed routing and gateways IP, because the IP there was `17.210.215.66`. I remember changing by myself from `0.0.0.0`, earlier. Instead of putting back `0.0.0.0` I left it empty and applied the change. My Bad! How can I reset it back?


Run a command on all subfolders

If you have a series of subfolders (like from `a` to `z`) and want to run a command on each one of them (like `rm *.pdf` or `ls *.pdf`), how do you do that? The "manual" approach would be `cd a`, `rm *.pdf`, or `ls *.pdf`, `cd ..`, `cd b`, ... That seems too complicated, so I believe there must be an easier approach.


Using GPG to decrypt Symantec PGP encrypted files?

Is this possible? I had an old HD encrypted with Symantec PGP. I attempted to decrypt the disk with Symantec's boot time recovery tool. It stalled 18% in, I let it sit for 16 hours, and the machine would no longer boot. I was able to recover the home directory and copy that to another machine however all of the files are encrypted. I don't have Symantec PGP on this new Linux machine, but I do have GPG installed. Is there a way to decrypt the old files? I have the correct passphrase and I believe I have the keyrings still.


How To Synchronize Directories in two different external hard disks?

I have few big folders "cosmo_sim_9", "cosmo_sim_10".... in one of my external hard disk, and a old copy of this on another external hard disk. I want to Synchronize old directories with the new one(recursively), but without overwriting already existing files(for saving time). How can I do this? My os is Fedora 20.


How to allocate more space alongside Windows

I installed Ubuntu on an old laptop, alongside WinXP. Now I'm trying to download some updates and it says that I don't have enough free disk space - I need to free some more space on "/". Since there's plenty of room on the machine, I suppose it means that not enough space is allocated for the Ubuntu partition itself, right? How can I solve this? I'm a Windows guy who hasn't so much as seen a Linux desktop up until about an hour ago. UPD Apparently it's installed in the same partition as Windows. At least, I don't remember it asking me about space allocation during installation, and when I log into Windows I can see that the disk only has one partition. I do remember it saying something about reduced disk performance if I chose a specific option - and that's the one I chose :).


How can I split a text file based on the content into multiple text files?

I have a text file called CAMS.txt that contains the following:               4153999999999991     4153999999999992     4153999999999993     4153999999999994     4801999999999991     4801999999999992     4801999999999993      I would like to split the CAMS.txt file into 2 files - CAMS1.txt and CAMS2.txt. Their contents are as follows CAMS1.txt               4153999999999991     4153999999999992     4153999999999993     4153999999999994      CAMS2.txt               4801999999999991     4801999999999992     4801999999999993      It's really splitting the file based on the first 4 digits of the original CAMS.txt file. It will always be 4153 and 4801. I'm new to the unix world =)


script to remember dir and always cd to it instead of the root dir

How can write a script to change to a given directory but also remember it so that when you do cd it always changes to that directory ?               #!/bin/bash     setdir() {         cd $1         # remember the directory we are changing to here so whenever we do cd we go back to this set dir     }          setdir "$1"


TeamViewer8 infinite loop on startup, never shows up

Using latest stuff from the ArchLinux repositories and got the following packages installed:   * dotnet2   * ntlm_auth (installed from samba)   * winetricks   * smbclient This is what it throws on console and then infinite loops:               $ teamviewer           Init...     Checking setup...     Launching TeamViewer...     fixme:service:scmdatabase_autostart_services Auto-start service L"MountMgr" failed to start: 2     fixme:service:scmdatabase_autostart_services Auto-start service L"PlugPlay" failed to start: 2     fixme:actctx:parse_depend_manifests Could not find dependent assembly L"Microsoft.Windows.Common-Controls" (6.0.0.0)     fixme:heap:HeapSetInformation (nil) 1 (nil) 0     fixme:ole:CoInitializeSecurity ((nil),-1,(nil),(nil),0,3,(nil),0,(nil)) - stub!     fixme:heap:HeapSetInformation (nil) 1 (nil) 0     fixme:process:SetProcessShutdownParameters (00000100, 00000000): partial stub.     fixme:resource:GetGuiResources (0xffffffff,0): stub     fixme:win:EnumDisplayDevicesW ((null),0,0x32dc60,0x00000000), stub!     fixme:win:EnumDisplayDevicesW (L"\\\\.\\DISPLAY1",0,0x32d918,0x00000000), stub!     fixme:win:EnumDisplayDevicesW ((null),1,0x32dc60,0x00000000), stub!


How to view only special content of a log file?

Is there an easy way to truncate a big log file? Or in other words: How to view only special contents of a log file. E.g.   * How can I extract the last 1000 lines from a log file?   * How can I extract only lines with a special string in it?   * How can I extract log files with a special date/time? I only know `tail` but this command is restricted to the last 10 lines and it is too fast. Searching in a 8 GB log file takes to much time ...


How to pull a file from a server using scp?

I am on machine A and want to pull a file from machine B.               A$ scp <myuserid>@hostB:<path of file in B> .      it says that:               scp: <path of file in B>: No such file or directory      But on machine B, this file exists in this path. What is going wrong?


Thunar keyboard shortcut to change tab

Currently in Thunar, to shift to the next tab, `Ctrl`+`Alt`+`PageDown` is to be used. I want to change it to either `Ctrl`+`Tab` or `Ctrl`+`PageDown`. Now, `~/.config/Thunar/accels.scm` is where all the shortcuts are defined in this format :               (gtk_accel_path "<Actions>/ThunarWindow/new-tab" "<Primary>t")      My question is:   1. what is the keyword for changing tab that should replace `new-tab` in the above example?   2. `Ctrl` -> `<Primary>`. So how about `Tab` -> ? and `PageDown` -> ?


Why won't Linux connect to the internet through a VPN?

When using OpenVPN on Linux, I can't connect to _anything_ on the internet. Firefox shows everything except my own router as "not found". And `curl -I google.com`, for example, gives `curl: (6) Could not resolve host: google.com`. This is very different from Windows, where I can actually access any part of the internet (that I have tried so far) using OpenVPN with the same certificate and provider. When not using OpenVPN on Linux, my systems connect just as well as with Windows. (I'm running the VPN as a client in North America; the server is presumably somewhere in Europe.) So what am I not doing that I need to do in order to connect? Edit to answer a few questions: `curl -I 74.125.224.72` (a Google ip) indeed gives a valid response (HTTP/1.1 200 OK, etc.). Not sure what the VPN peer ip is, but `ping 178.73.207.97` (the ip seen below) gives `64 bytes from 178.73.207.97: icmp_seq=1 ttl=64 time=#.### ms` (the #.### being various amounts of milliseconds). The ping goes on more than 300 times, so I think that works, but I could be wrong. Output of `ip addr` (I can't copy and paste between machines, so I may have made some errors below):               1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN         link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00         inet 127.0.0.1/8 scope host lo            valid_lft forever preferred_lft forever         inet6 ::1/128 scope host            valid_lft forever preferred_lft forever     2: eth0 <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000         link/ether 08:00:27:6f:e2:eb brd ff:ff:ff:ff:ff:ff         inet 10.0.2.15/24 brd 10.0.2.255 scope global eth0            valid_lft forever preferred_lft forever         inet6 fe80::a00:27ff:fe6f:e2eb/64 scope link            valid_lft forever preferred_lft forever     3: tap0 <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000         link/ether 2a:d6:30:43:a2:8e brd ff:ff:ff:ff:ff:ff         inet 178.73.207.97/24 brd 178.73.207.255 scope global tap0            valid_lft forever preferred_lft forever         inet6 fe80:28d6:30ff:fe43:e28e/64 scope link            valid_lft forever preferred_lft forever      Output of `ip route`:               0.0.0.0/1 via 178.73.207.1 dev tap0     default via 10.0.2.2 dev eth0  proto static     10.0.2.0/24 dev eth0  proto kernel  scope link  src 10.0.2.15  metric 1     80.67.8.218 via 10.0.2.2 dev eth0     128.0.0.0/1 via 178.73.207.1 dev tap0     178.73.207.0/24 dev tap0  proto kernel  scope link  src 128.73.207.97      Output of `iptables -L -nv`:               Chain INPUT (policy ACCEPT 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination     Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination     Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination      I downloaded the config files from the service provider, along with a certificate. On Linux, I just run `sudo openvpn config.ovpn` (inside Konsole). On Windows, I just use the GUI (not sure if that's relevant). `config.ovpn` contains (lines listed with `address` actually contain an address (not an ip), which I removed for privacy):               client          dev tap          proto udp          remote address 1194     remote address 1195     remote address 1196     remote address 1197     remote address 1198     remote address 1199     remote address 1200     remote address 1201          remote-random          resolv-retry infinite          auth-user-pass          nobind          persist-key     persist-tun          ns-cert-type server          ca ca.crt     comp-lzo          reneg-sec 0          verb 3      Aside from using the config file and certificate, I just installed openvpn (compiled to `/usr/local/sbin` and via apt-get to `/usr/sbin`; the above information is using the one in `/usr/sbin/openvpn` but they result in the same behaviour). Having looked at the above (though I'm no expert), it looks like OpenVPN is active, but the system is still defaulting to `eth0` instead of `tap0`. Question remains the same: "What am I not doing that I need to do in order to connect?"


What directory should I use for the user apache?

I have installed apache from the source with:`prefix=/usr` `sysconfdir=/etc/httpd/` `localstatedir=/var`.               useradd -g apache -d /usr/apache -s /sbin/nologin apache


Frequent command "template": remove parameter expansion escape characters

`zsh` newbie here... I find myself using a handful of long commands over and over again with slightly different arguments. For example:               rsync -havu --progress --rsh='ssh -l mylogin' some.machine.somewhere:/some/path /some/local/path      I'd like to be able to easily insert that command at my `zsh` prompt, and then navigate the command line to make the necessary changes to paths, hosts, and logins. I set up a zsh parameter:               FOO="rsync -havu --progress --rsh='ssh -l mylogin' some.machine.somewhere:/some/path /some/local/path"      Then I can expand `$FOO` at the prompt. However, the expanded command has all its spaces and quotations escaped with backslashes. Is there a way to make `zsh` not put the escape characters in the expansion? I know I can search my history for similar commands and then edit those -- I'd still have to type the long thing out once in each new shell though. I'm also open to other ways I could accomplish my purpose... I could write a python script or something but that seems like a lot of overhead for a fairly simple task.


How do I change the colour of text matching a regex in vim?

Suppose I want to make all text that matches some regex persistently and automatically (and without affecting `/` searches) appear in a different color. How would I do this in `vim 7.4`?


How can I force less to stop buffering its input line by line?

When reading from stdin, `less` does not display any output until a whole line has been read. I use a script that prints progress on one line, without printing a newline, and I would really like to be able to see this progress even when I pipe it to `less`. Here is some example bash code to demonstrate my problem:               while true ; do echo -n zzz ; sleep 1s ; done | less      Is there a button I can press to force `less` to display its collected input, or is there an option to disable this kind of buffering?


Simulate Windows Media Player media sharing

My new TV can play media that's being shared by windows computers over the local network. Unfortunately, It only sees media that's being shared by Windows Media Player (not standard file sharing), and I'm not really excited about having to reboot to windows whenever I want to stream something. Is there software for Linux that sets up a media server similar to what WMP does (whatever the protocol is called)?


Renaming files in lexicographical order with a numerical pattern that increases sequentially with fixed padding

I have files such as               a     bb     ccc     abc     emrls      I would like to rename them so that, after sorting them (for example, lexicographically), each file gets the following name:               00001     00002     00003     etc      where the # of digits for the 0 padding is specified a priori, e.g. 6 in the case above (assuming that we know how many digits are needed). Since the shell I am most comfortable with is `zsh`, I'm interested in solutions that benefit from features on `zsh` (maybe using `zsh`'s `zmv`?). I would also be interested in solutions that are compatible with Bash.


Fetching individual bytes from a binary file into a variable with bash

I need to make a fairly simple bash script to pull bytes one at a time from a binary file, send it out a serial port, and then wait for a byte to come back before I send the next one. This is effectively for an EEPROM programmer, where an off the shelf solution won't work. I'm mostly stuck at pulling the bytes out of the file into a variable, beyond that I know I can echo the values down the serial port and read them back with dd. (Is there a better way to do that also?) Thanks for the help!


How to delete duplicates of files in directory and subdirs?

Is there any fast method to delete duplicates of files based on any hash sum (i.e. SHA1 to be fast). Because I've got some mess in my music files.


How can I create a new keyboard layout for KDE 4?

I would like to define a new keyboard layout for KDE 4. In particular I would like to take the standard British layout and add Polish characters for the combinations Alt-Gr + letter. How can I do it?


How to fix unison failing with "Fatal error: Internal error: New archives are not identical" for identical paths?

When trying to sync two paths (one of which is remote) via `ssh`, unison fails with > Fatal error: Internal error: New archives are not identical. while syncing via a network mount works just fine. While `unison -debug all` yields no indication on the possible error, having it use `ssh -v` causes a lot of > channel 0: bad ext data errors. However, both machines run the same version of unison (2.40.63).


I don't have a "Desktop" bookmark in nautilus, but in Thunar?

I have xdg users configured manually, in `~/.config/user-dirs.dirs` I have:               XDG_DESKTOP_DIR="$HOME/Desktop"     XDG_DOWNLOAD_DIR="$HOME/Various"     XDG_TEMPLATES_DIR="$HOME/Templates"     XDG_PUBLICSHARE_DIR="$HOME/"     XDG_DOCUMENTS_DIR="$HOME/Papers/"     XDG_MUSIC_DIR="/Misc/Musics/"     XDG_PICTURES_DIR="$HOME/Pictures"     XDG_VIDEOS_DIR="/Application/Videos/"      But nautilus just don't show the Desktop folder, ![enter image description here](http://i.stack.imgur.com/1Yb1x.png) How should I fix that ?


SSH exits after quit case in bash script

So I have the following standard script:                   #!/bin/bash         PS3='Please enter your choice: '         options=("option 1" "Option 2" "Option 3" "Quit")         select opt in "${options[@]}"         do             case $opt in                 "Option 1")                     echo "you chose choice 1"                     ;;                 "Option 2")                     echo "you chose choice 2"                     ;;                 "Option 3")                     echo "you chose choice 3"                     ;;                 "Quit")                     break                     ;;                 *) echo invalid option;;             esac         done      But when I run the script through SSH and choose the Quit option, the SSH exits too. What might cause the problem? I only want to exit the script and to continue work in SSH. Well the problem was in .bash_aliases file which I discussed below. I was put `exec` before the script. When I remove it and run the command, everything was OK.


Ruby on Rails missing Thor

When trying to run rails g migration a, I get the following message               Thor is not available.     If you ran this command from a git checkout of Rails,     please make sure thor is installed, and run this command     as `ruby script/rails      Now few days this did work, and I did check my gemfile and I find thor like this               thor (0.16.0)      but it doesn't seem to work, what should I do?


Where does the Linux kernel reside in memory ?

From some book I have, I have in my notes that the Linux kernel resides at `0xc00000000` on 32-bit systems, and is mapped into user space for performance reasons. Is this accurate ? How can I verify this ? Also, where does the kernel reside on 64-bit systems? Is it still at `0xc00000000`, or somewhere else ?


Making ChrootDirectory directory writable by SFTP user

If a user logs into a machine via SFTP, one can make use of `ChrootDirectory` keyword to give an illusion that user is in a root directory. But that directory is only writable by `root` user. I would love for this user to have such write capabilities, and it doesn't appear that OpenSSH offers this, unless I missed something? I am aware that that SFTP user can be given write access to any file/directory inside that `ChrootDirectory`, but it's not good enough. I want the user to also create/delete the files directly under that "root" directory, without the workaround of creating a subdirectory that that user has write access to.


UEFI boot Fedora from USB 2.0 on 3.0 port (l75d-a7280)

I'm trying to make a bootable usb in ubuntu for fedora, but my settings are not working. I formatted the USB with FAT & Ext4, MBR, and Legacy BIOS bootable. My BIOS allows the USB 3.0 controller to be turned off and for UEFI to be in CSM compatibility mode. I've tried many more combinations than above, but nothing works. Once I format, I copy the ISO with `sudo dd if=~/Downloads/Fedora-Live- Desktop-x86_64-19-1.iso of=/dev/sdb1 bs=8M`. How can this be resolved? **unetbootin** I formatted FAT32 and used `unetbootin`. Still won't boot. **UEFI translation** Apparently, UEFI is MS protectionist crap. If there's a use for it, I haven't seen a single page explaining it. This should be disabled. Nevertheless, my system still says that no operating system can be found when I choose to boot from the USB. Note: the USB data doesn't even show when UEFI is enabled. Thought it was due to the way I was formatting. **ubuntu** I created a 13.04 USB, and it worked no matter what except for fast boot. When UEFI is set to CSM, and SATA to IDE, ubuntu's boot looks like an old school CRT for boot and shutdown, but the desktop loads just as in UEFI. Ubuntu's "Disks" program reports 1 parition on the entire 2gb, usb 2.0 drive:   * **Partition Type:** W95 FAT32 (LBA) Bootable)   * **Contents:** FAT (32-bit version) `gdisk` reports that the usb has _not_ been converted to GPT. In bios, the USB drive shows up no matter what configuration is used with ubuntu. With all other methods, it's a blank entry. **`dd` formatting & `async`** Using these commands, bios still cannot even see the USB drive, still a blank entry.               sudo umount /dev/sdb*     sudo dd if=/dev/zero of=/dev/sdb     sudo sync     sudo dd if=Fedora-15-x86_64-netinst.iso of=/dev/sdb     sudo sync


How to run programs in a Sandbox?

I have been using `PlayOnLinux` to run windows programs on Linux. `PlayOnLinux` creates a virtual drive for each program installed and every VD represents a different Windows XP computer. Any changes made by the program stay within its own VD only. So if I run a program with a virus I can simply delete the program's VD and all is well. Is there a similar program that allows Linux programs to be run in a virtual drive? i.e. I want `PlayOnLinux`/`Wine` minus the windows emulation.


Android strace error: "strace: 2: Syntax error: "&" unexpected"

I was using built-in `strace` given in `/system/xbin/` directory in the emulator and it was giving me wrong set of system calls such as `msgget()` and `msgrecv()` which are not supported by Android even. I downloaded a new `strace4.7` from Source Forge and built with the instructions given at this link. Then I pushed it to `/system/xbin/` directory after remounting `adb`. Now when I run               strace -p <myPID>      It gives me this error:               trace: 2: Syntax error: "&" unexpected      I have looked on the internet but nobody seems to have the same problem. Any idea where should I start debugging from or any other suggestion would be highly appreciated.


is it possible to create a file given an md5 hash

I know this is a strange question, and I know that md5sum is nearly impossible to break... but I'm just wondering if someone here knows if it is possible to recreate a file given it's md5sum hash? I mean, not necessarily the same file as the original but a file that would equate to the same md5sum hash. So far, I don't see any result from Google


“PTY allocation request failed on channel 0 stdin: is not a tty” when SSH'ing into a Debian server

My hosting space (Debian Wheezy) serves two websites (one WordPress and one Rails). Today I saw both were down and I rebooted the server. The Rails site works again and the WordPress one now says that it has an error connecting to the database. Then after the reboot (from SSH as well) I SSH'ed into the server I got the following message:               PTY allocation request failed on channel 0     stdin: is not a tty      When I run with `-v` flag I get output with nothing strange I think (just checking the public and private key). See this gist. When I SSH as follows `ssh user@host "/bin/bash -i"` I _can_ login into the remote shell. I read in another answer (which also provided also the tip with appending "bin/bash -i" and that helped) that I should manually remove and re-add the `/dev/pt*` files. The one who asked the question said that unmounting `/dev/pts` and remounting it worked. Unfortunately I get the error:               Can't find /dev/pts in /etc/fstab or /etc/mtab      My `/etc/fstab` files looks like this:               #UNCONFIGURED FSTAB FOR BASE SYSTEM      Does anyone have any idea what is going on and how I can solve this? /edit Output of `tty; ls -l /proc/self/fd` locally:               /dev/pts/2     total 0     lrwx------ 1 erwin erwin 64 Sep 13 19:01 0 -> /dev/pts/2     lrwx------ 1 erwin erwin 64 Sep 13 19:01 1 -> /dev/pts/2     lrwx------ 1 erwin erwin 64 Sep 13 19:01 2 -> /dev/pts/2     lr-x------ 1 erwin erwin 64 Sep 13 19:01 3 -> /proc/4389/fd      Output of `ls -la /dev/ptmx /dev/pts` on remote machine:               crw-rw-rw- 1 root tty  5, 2 Sep 11 00:19 /dev/ptmx          /dev/pts:     total 8     drwxr-xr-x 2 root root 4096 Mar 10  2013 .     drwxr-xr-x 3 root root 4096 Sep 11 00:35 ..


CentOS 5.5 network problem

I have been made to install CentOS-5.5 on my desktop. The network is not working. These following are the outputs of various commands.               #ifconfig     lo link encap:local loopback     inet addr 127.0.0.1 mask 255.0.0.0     .....(goes on)      There is no other device other than 'lo' in the ifconfig output.               #chkconfig --list|grep -i network     networkmanager 0:off .... (every thing off)     network (2,3,4,5 on ; and rest of them off)          #service NetworkManager status     networkmanager is stopped          #service network status     configured devices:     lo     currently active devices:     lo      there is nothing in the /etc/resolv.conf file regards


How do I fix btrfs?

I've trawled mailing lists and finally finished up on Ubuntu's `btrfs` page, and am left feeling that `btrfs` _still_ does not have a full fixing utility (as indicated on their home page). Even though months ago it was slated for being the default for Oracle's Linux and is included in many distros. So, in lieu of that, is there a troubleshooting guide somewhere about how to fix `btrfs`? Failing that, will copying my backups over the top of my FS fix things up? (While deleting snapshots if necessary for space? Or to delete corruption?) Should I instead try to revert to a previous snapshot and then restore missing files from backup? Or restore missing files from my @ and @home snapshots? _**Note** : This is a general question. I have deliberately omitted my exact FS issues (for the moment); I want to find a general/canonical workflow and troubleshooting guide._ _(Ok, ok - here's some ~~more~~ details ;))_: I powered off during a hung shutdown, and have been presented with system instability hence. The system will boot and run for some amount of time until it writes enough data and freezes. Last time I just had Thunderbird open. These require more hard resets and presumably more corruption. `sudo btrfsck /dev/sda1` oscillates between a few errors - often first time of the form               root 338 inode 7861227 errors 1000     root 338 inode 7904568 errors 1000     root 338 inode 7955174 errors 400     found 46242054144 bytes used err is 1     total csum bytes: 43112400     total tree bytes: 2074640384     total fs tree bytes: 1889853440     btree space waste bytes: 547680627     file data blocks allocated: 110756974592      referenced 68393684992     Btrfs Btrfs v0.19      oooo, now it's getty really fruity (I only expected to see `parent transid verify failed` here...)               parent transid verify failed on 14266105856 wanted 464223 found 464221     parent transid verify failed on 14266105856 wanted 464223 found 464221     Extent back ref already exists for 14261530624 parent 0 root 256      leaf parent key incorrect 14261751808     bad block 14261751808     Extent back ref already exists for 66455355392 parent 0 root 2      Extent back ref already exists for 66455257088 parent 0 root 2      Extent back ref already exists for 14257274880 parent 0 root 2      block 14262571008 rec extent_item_refs 2, passed 2     block 14262575104 rec extent_item_refs 1, passed 1     block 14262579200 rec extent_item_refs 1, passed 1     Extent back ref already exists for 14262579200 parent 0 root 257      leaf 14263906304 items 50 free space 132 generation 464224 owner 2     fs uuid 7d049403-cf6e-4b52-a624-32051e1f5b2a     chunk uuid be6f8f93-320c-4465-85d6-f53907698c32     item 0 key (14263341056 EXTENT_ITEM 4096) itemoff 3944 itemsize 51         extent refs 1 gen 464168 flags 2         tree block key (8332576 1 0) level 0         tree block backref root 257     item 1 key (14263345152 EXTENT_ITEM 4096) itemoff 3893 itemsize 51         extent refs 1 gen 464168 flags 2         tree block key (8332586 c 8332543) level 0         tree block backref root 257     failed to find block number 14263525376      (All heavily summarised of course; I never wanted to overwhelm you with these details :)) And now my final execution leaves me with the familiar:               parent transid verify failed on 14265458688 wanted 464230 found 464221     parent transid verify failed on 14265458688 wanted 464230 found 464221     parent transid verify failed on 14265458688 wanted 464230 found 464223     btrfsck: root-tree.c:46: btrfs_find_last_root: Assertion `!(path->slots[0] == 0)' failed.      , including the optional random error at the end. Oh happy joy. Note that these `verify failed`'s change as data is written to the drive. _Another random error:_               btrfsck: disk-io.c:412: find_and_setup_root: Assertion `!(!root->node)' failed.


Installing XSP on CentOS

Trying to install xsp-2.10.2. Worked fine in the past, now getting this error.               Making install in Mono.WebServer     mkdir: cannot create directory `2.0': File exists     GMCS  /out:2.0/Mono.WebServer2.dll     /usr/local/bin/mcs: line 2: /usr/local/bin/mono: No such file or directory     /usr/local/bin/mcs: line 2: exec: /usr/local/bin/mono: cannot execute: No such file or      directory     make[2]: *** [2.0/Mono.WebServer2.dll] Error 126     make[1]: *** [install-recursive] Error 1     make: *** [install-recursive] Error 1


Align columns in ASCII file

I have a text file that looks like his:               #c1     c2              c3              c4              c5              c6      c7      c8      c9      c10     c11     c12     c13     4599    995,274 2523,658        264,1417170     -33,6000        -0,3600 0,0202  0,0069  0,0227  10,1041 0,0169  0,2817  0,0239     6173    1552,290        1595,696        264,0603912     -33,4880        0,4374  0,0287  1,8123  0,0385  10,1289 0,0292  2,8445  0,0366     6456    1658,630        1529,292        264,0449377     -33,4800        0,0109  0,0234  1,0955  0,0296  10,5032 0,0223  1,7168  0,0293     8932    2750,029        1374,395        263,8866195     -33,4615        -0,3185 0,0249  0,9196  0,0302  10,5858 0,0221  1,3886  0,0296     4095    820,716 495,315 264,1658451     -33,3546        -0,4388 0,0216  0,6497  0,0252  10,6026 0,0188  1,1796  0,0258     4737    1045,289        1395,983        264,1338240     -33,4636        0,5900  0,0231  0,8853  0,0273  10,6501 0,0204  1,1661  0,0270      ie: not aligned at certain random lines (the file is ~10000 lines long) I need it to look like this:               #c1     c2              c3              c4              c5              c6      c7      c8      c9      c10     c11     c12     c13     4599    995,274         2523,658        264,1417170     -33,6000        -0,3600 0,0202  0,0069  0,0227  10,1041 0,0169  0,2817  0,0239     6173    1552,290        1595,696        264,0603912     -33,4880        0,4374  0,0287  1,8123  0,0385  10,1289 0,0292  2,8445  0,0366     6456    1658,630        1529,292        264,0449377     -33,4800        0,0109  0,0234  1,0955  0,0296  10,5032 0,0223  1,7168  0,0293     8932    2750,029        1374,395        263,8866195     -33,4615        -0,3185 0,0249  0,9196  0,0302  10,5858 0,0221  1,3886  0,0296     4095    820,716         495,315         264,1658451     -33,3546        -0,4388 0,0216  0,6497  0,0252  10,6026 0,0188  1,1796  0,0258     4737    1045,289        1395,983        264,1338240     -33,4636        0,5900  0,0231  0,8853  0,0273  10,6501 0,0204  1,1661  0,0270      So basically I'm looking for a script/command line utility to automatically align the columns of the file.


remove only the first blank line sed

there are similar questions here but none matches my problem exactly. How do I remove only the first blank line from a file using sed? Let's say I have               a          b          c      And I want               a     b          c      As output.


NFS does not work. mount: wrong fs type, bad option, bad superblock

This is what I got on server:               manuel@server ~ $ cat /etc/exports       /var/share    192.168.178.20(rw, sync)     manuel@server ~ $ cat /etc/hosts.allow        portmap: 192.168.178.20     manuel@server /etc $ cat /proc/filesystems | grep nfs       nodev nfs       nodev nfs4      This is what I get on my machine:               manuel@Timeline:~$ sudo mount -t nfs 192.168.178.2:/var/share /media/share/        mount: wrong fs type, bad option, bad superblock on 192.168.178.2:/exports/var/share,            missing codepage or helper program, or other error            (for several filesystems (e.g. nfs, cifs) you might            need a /sbin/mount.<type> helper program)            Manchmal liefert das Syslog wertvolle Informationen – versuchen            Sie  dmesg | tail  oder so      server is Raspbian (Debian Wheezy) Timeline is Ubuntu 12.04


Command line audio player that exits immediately after file finished playing back?

I am experimenting with audio players in the command line, and noticed something weird: if the sound is very short, most players will take up to a second or two after playback has finished, before they finally exit, and yield control back to the terminal! `ffplay` seems to run a spectrogram when started with an audio file, and the advice to fix that is:               <hypnocat> how can i turn off the spectrogram display?     <sacarasc_> Why would you want to?     <hypnocat> i don't want an extra window to appear, or for ffplay to waste extra processing power displaying it     <hypnocat> it's distracting, annoying, and wasteful     <sacarasc_> Minimise it, and if it's wasteful, your computer is either really, really old or you're overly sensitive to waste...     <hypnocat> my computer is old      ... so I wouldn't really count that as a command line player; but I've tried these commands on my Ubuntu 11.04's `gnome-terminal`:               aplay --buffer-size=10 -q /usr/share/sounds/speech-dispatcher/test.wav     canberra-gtk-play -c never -f /usr/share/sounds/speech-dispatcher/test.wav     mplayer -really-quiet /usr/share/sounds/speech-dispatcher/test.wav     pacat -p --rate 16000 --channels 1 --latency-msec=1 --process-time-msec=2 /usr/share/sounds/speech-dispatcher/test.wav     play -q /usr/share/sounds/speech-dispatcher/test.wav  # with sox      The `speech-dispatcher/test.wav` sound itself is 0.542 sec, yet these programs claim the terminal for about one or two seconds (or more) after that file has finished playing. Why does this happen - and how could I avoid that? If it is impossible for these applications, are there command line audio players in existence, which do exit immediately after an audio file has finished playing? EDIT: for those interested, this is what I needed this for Question #208391 : Questions : “xorg” package : Ubuntu: Getting X11 XBell event to play through PulseAudio; and I worked around the waiting time issue by starting the player (in that case, `canberra-gtk-play`) as a process (with `&`). But I'd still like to know why this exit delay happens on short files? And how come `cvlc`, as per @Anthon's answer, can for instance exit immediately??


How to make an address list in mutt

I use `Mutt` as my main client and use the `alias` command quite frequently. How to group mail addresses, or—even better—aliases into a list I can then use like an `alias` to send mail to?


How can i run a part of a script as a different user?

#!/bin/ksh     (some code)     Log=~/my.log     chown USER1 filename          su - USER1 -c "     date | tee -a ${Log} 2>&1;      cd /blah/blah     if [ SOMECONDITION ]     then     sh ./somescript.ksh > logfile     fi     exit" | tee -a ${Log} 2>&1;      The script tends to stop when it swicthes to USER1 and then it executes again when we have to exit manually.


How do I access my Windows administrative share from Linux?

I have a Windows computer on `192.168.0.103` and I want to access the `c$` administrative share from a Linux computer which has `192.168.0.110` to exchange some files. From another Windows computer on the same network, I can simply open the Run prompt and type in the UNC path `\\\192.168.0.103\c$` and hit Enter. It then prompts for user name and password, and if they are typed in correctly it would open the share location in Windows Explorer. How does this work from a Linux computer? I recently asked a question about the Run prompt, and apparently there is a similar prompt in Linux, but I can't use that to access UNC paths in the same fashion. So what kind of Linux voodoo, dark magic, incarnation, ceremony... do I need to perform before it allows me to do the same? I'm using Debian 7.1.0 Wheezy.


How can the root file system be accessed to launch cryptsetup to allow access to the root file system?

I have got laptop with full disk encryption. There is a /boot partion which is not encrypted and the other partition /dev/sda5 is. In order to decrypt, it asks me for the passphrase which is then passed to the command /sbin/cryptsetup luksOpen ${name} ${device}. How can it decrypt the partition if the command /sbin/cryptsetup is on the encrypted partition, which is not accessible. I thought maybe there is copy of the command in the /boot partition, but I have not found any. Can somebody shed some light on this?


Unzip (Info-ZIP) Permissions

Is there a way to invoke unzip (from Info-ZIP) on a Linux system without having it restore the permissions stored in the zip file? The zip files I'm restoring are enormous, so going back over the contents with something like "chmod -R" will take a while. I do not control the source of the archives, so my only choice is to handle the permissions on extraction.


How can I compile, install and run the tools inside kernel/tools?

There are some tools in side the kernel, > `<kernel source root directory>/tools` perf is one of them. In ubuntu I think the tools inside this folder is available as package linux- tools How can I compile it form source and install it and run it?


setup domain master and ldap master

I want to build active domain controller master - master as below: 1 server run windows server 2008 R2 make domain controller 1 server run CentOS 6.4 make LDAP + SAMBA Can I do this problem? Now, My system have one LDAP+SAMBA do Primary domain controller, but I want to build SQL server cluster, to do this, I must have two server run windows server which are joined domain controller. But 2 server can not join ldap to run Failure Cluster in windows. Thus, I want to build another domain by windows. Help me or give me good idea!


How to find out the manufacturing date of a battery from linux

How can I find out the manufacturing date of a battery from linux? If this is not possible are there other tests to check if the battery new and healthy which I can run under linux?


How to manage authentication with multiple VPS's and GoogleApps?

I have a bunch of VPS's and every now and then I have to create another. Currently I use AWS, Rackspace and DigitalOcean as my IAAS providers. Most of them are Ubuntu-based. Besides, I have the users managed by Google Apps. For each of the created VPS, I have to manage a root and a normal user, and multiple users must have access to the normal user credential. If a user is blocked (i.e. got fired..) he obviously should not have access to the VPS's anymore. Another must-have feature is to allow/block permissions by users group. The users group would be managed by Google Apps and the VPS's would only point to Google Apps authentication API or equivalent. I want to know if there is such way of authenticating users in multiple VPS's using Google Credentials. This way, a user should do ssh john.doe@ to access the VPS, where john.doe is valid credential managed by Google Apps. If there isn't, which is the recommended approach to my problem?


VIM as c++ IDE - autocomplete

I'm still learning C++, but I know already some stuff. I used to use Visual Studio, but after I switched to Debian, I was working with Code Blocks. Recently I heard about using VIM as IDE and started using it. Problem that appeared is autocompletion is not working. I don't know why, but recently C-P/C-N stopped working - it does completion only if a particular word is already in the code or in the code of another tab; so every time I start I have to type every first include/cout/class etc. without autocompletion. I've tried to use YouCompleteMe, but unfortunately: `YouCompleteMe unavailable: requires Vim 7.3.584+`. I'm using Debian Wheezy (stable with backports) and it doesn't have vim 7.4 in the repos. I tried to add the repo from Jessie and - using low pinn - tried to install vim 7.4, but it wanted to remove a lot of packages (like g++ and many others), so I gave up this idea. I'm not very good on Debian, I'm using it for like ~1.5 year, but more like work-machine, not something I need to learn everything about it, so I need some help in:   1. Installing vim 7.4 on Debian without removing half of the system or,    2. Make **YouCompleteMe** work or,    3. Make autocompletion in vim work (especially for C++)


How can I use 0.0.0.0/0 in ipset hash:net,port?

Right now, if I do               ipset a ansible_allowed 0.0.0.0/0,tcp:22      I get               ipset v6.19: The value of the CIDR parameter of the IP address is invalid      and instead I have to add               0.0.0.0/1,tcp:22     128.0.0.0/1,tcp:22      Are there any better workarounds or am I doing something wrong? If I add `0.0.0.0` without the CIDR, it will not match anything.


sort ls output by users

On Linux, is there a way to **sort`ls` output by users**? What I try to achieve is something like this: user_ **a**   file1   user_ **a**   file2   user_ **b**   another_file   user_ **c**   this_file   user_ **c**   that_file   user_ **d**   file3 I am aware that a listing like this would also contain file size, permissions etc. - my main concern is the sorting by users. Would be quite handy, wouln't it So far I found `ls -l | sort -k 3` to sort by column three which [if using `ls -l`] contains the file owner [thus `sort -k 4` to sort by group]. **BUT** what if the file owner isn't in row three? Is there another way to **achieve this, independent from the number of the column**? * * * **Update** : I forgot to mention that **I work in BASH** and try to stick to it for quite a while from here on so things don't become more complicated.


Flash player on Scientific Linux 6.5

After a:               yum install -y flash-plugin      and a               USERNAME="USERNAMEHERE"; mkdir -p "/home/$USERNAME/.firefox/plugins"; ln -s "/usr/lib64/flash-plugin/libflashplayer.so" "/home/$USERNAME/.firefox/plugins"      I could always install flash player for Scientific Linux. But now, after a fresh install of Scientific Linux 6.5.. I do the same, but in the about:plugins there isn't any... **My queston** : Why? What am I missing? UPDATE: yes, the Firefox is 64 bit too: it's from:               https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/latest/linux-x86_64/en-US/


Font rendering issue in urxvt -- too much space between characters

Starting earlier today I am getting font rendering issues with rxvt-unicode. Specifically with many fonts I get an abundance of extra space between characters. In other fonts rxvt refuses to change sizes. Here is an example of the spacing issue between urxvt and xterm. The fonts resources:               URxvt*font:     xft:Terminus:medium:size=10     xterm*faceName: xft:Terminus:medium:size=10      And the renderings   * urxvt ![bad fonts](http://i.stack.imgur.com/H6P99.png)   * xterm ![good fonts](http://i.stack.imgur.com/q2lnB.png) I have tried all permutations of hinting and antialiasing. Changing size or pixelsize does resize the font in urxvt but this also increases the extra spacing. Does anyone have ideas I can try to fix this?


Aliases in scripts are not set globally

I know this sound really wierd but this is exactly what happens. I have my `.profile` and `.bashrc` file set up in a way that the `.bash_aliases` file gets executed (checked it with a echo). I do not get any errors and the aliases have worked an another machine. I use the following command to see what aliases are registered.               echo $(alias | cut -d '=' -f 1 | sort -u)      I put this in the `.bash_aliases` file and it showed my aliases. Then I put it in the `.bashrc` file right after the call of the `.bash_aliases` file. The amazing thing is that the aliases, that have just bein created **and** printed, have vanished! They do no longer exist! To show it better I'm going to give you the output when I log in and the content of the files. Output:               Aliases before .bashrc          Aliases before .bash_aliases     alias alert alias dir alias egrep alias fgrep alias grep alias l alias la alias ll alias ls alias vdir     Aliases before executing .bash_aliases          Aliases after executing .bash_aliases     alias duh alias l. alias server alias sh alias testserver     Aliases after .bash_aliases     alias alert alias dir alias egrep alias fgrep alias grep alias l alias la alias ll alias ls alias vdir     Aliases after .bashrc      `.profile`:               # ~/.profile: executed by the command interpreter for login shells.     # This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login     # exists.     # see /usr/share/doc/bash/examples/startup-files for examples.     # the files are located in the bash-doc package.          # the default umask is set in /etc/profile; for setting the umask     # for ssh logins, install and configure the libpam-umask package.     #umask 022          echo Aliases before .bashrc     echo $(alias | cut -d '=' -f 1 | sort -u)          # if running bash     if [ -n "$BASH_VERSION" ]; then         # include .bashrc if it exists         if [ -f "$HOME/.bashrc" ]; then              bash "$HOME/.bashrc"         fi     fi          echo Aliases after .bashrc     echo $(alias | cut -d '=' -f 1 | sort -u)          # set PATH so it includes user's private bin if it exists     if [ -d "$HOME/bin" ] ; then         PATH="$HOME/bin:$PATH"     fi      `.bashrc`:               # ~/.bashrc: executed by bash(1) for non-login shells.     # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)     # for examples          # don't put duplicate lines or lines starting with space in the history.     # See bash(1) for more options     HISTCONTROL=ignoreboth          # append to the history file, don't overwrite it     shopt -s histappend          # for setting history length see HISTSIZE and HISTFILESIZE in bash(1)     HISTSIZE=1000     HISTFILESIZE=2000          # check the window size after each command and, if necessary,     # update the values of LINES and COLUMNS.     shopt -s checkwinsize          # If set, the pattern "**" used in a pathname expansion context will     # match all files and zero or more directories and subdirectories.     #shopt -s globstar          # make less more friendly for non-text input files, see lesspipe(1)     [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"          # set variable identifying the chroot you work in (used in the prompt below)     if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then         debian_chroot=$(cat /etc/debian_chroot)     fi          # set a fancy prompt (non-color, unless we know we "want" color)     case "$TERM" in         xterm-color) color_prompt=yes;;     esac          # uncomment for a colored prompt, if the terminal has the capability; turned     # off by default to not distract the user: the focus in a terminal window     # should be on the output of commands, not on the prompt     #force_color_prompt=yes          if [ -n "$force_color_prompt" ]; then         if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then         # We have color support; assume it's compliant with Ecma-48         # (ISO/IEC-6429). (Lack of such support is extremely rare, and such         # a case would tend to support setf rather than setaf.)         color_prompt=yes         else         color_prompt=         fi     fi          if [ "$color_prompt" = yes ]; then         PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '     else         PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '     fi     unset color_prompt force_color_prompt          # If this is an xterm set the title to user@host:dir     case "$TERM" in     xterm*|rxvt*)         PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"         ;;     *)         ;;     esac          # enable color support of ls and also add handy aliases     if [ -x /usr/bin/dircolors ]; then         test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"         alias ls='ls --color=auto'         alias dir='dir --color=auto'         alias vdir='vdir --color=auto'              alias grep='grep --color=auto'         alias fgrep='fgrep --color=auto'         alias egrep='egrep --color=auto'     fi          # some more ls aliases     alias ll='ls -alF'     alias la='ls -A'     alias l='ls -CF'          # Add an "alert" alias for long running commands.  Use like so:     #   sleep 10; alert     alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'          # Alias definitions.     # You may want to put all your additions into a separate file like     # ~/.bash_aliases, instead of adding them here directly.     # See /usr/share/doc/bash-doc/examples in the bash-doc package.          echo Aliases before .bash_aliases     echo $(alias | cut -d '=' -f 1 | sort -u)          if [ -f "$HOME/.bash_aliases" ]; then         bash "$HOME/.bash_aliases"     fi          echo Aliases after .bash_aliases     echo $(alias | cut -d '=' -f 1 | sort -u)          # enable programmable completion features (you don't need to enable     # this, if it's already enabled in /etc/bash.bashrc and /etc/profile     # sources /etc/bash.bashrc).     if ! shopt -oq posix; then         if [ -f /usr/share/bash-completion/bash_completion ]; then             bash /usr/share/bash-completion/bash_completion             elif [ -f /etc/bash_completion ]; then             bash /etc/bash_completion         fi     fi      `.bash_aliases`:               echo Aliases before executing .bash_aliases     echo $(alias | cut -d '=' -f 1 | sort -u)          alias server="bash ~/start.sh"     alias testserver="bash ~/test/start.sh"     alias sh="bash"          ## Show hidden files ##     alias l.='ls -d .* --color=auto'          memory() {       if [ $# -eq 0 ]; then         parameter=("-sc" *)       else         parameter=("$@")       fi            du -Lb "${parameter[@]}" | awk '         function hr(bytes) {           hum[1099511627776]="TiB";           hum[1073741824]="GiB";           hum[1048576]="MiB";           hum[1024]="kiB";           for (x = 1099511627776; x >= 1024; x /= 1024) {             if (bytes >= x) {               return sprintf("%8.3f %s", bytes/x, hum[x]);             }           }           return sprintf("%4d     B", bytes);         }              {           print hr($1) "\t" $2 $3 $4 $5 $6 $7 $8 $9         }       ';     }          alias duh="memory"          echo Aliases after executing .bash_aliases     echo $(alias | cut -d '=' -f 1 | sort -u)


tcpdump hello server certificate

On a device located between my local network and a router, (all the traffic pass through) I need to read the common name from Hello Server Certificate packet. So I'm trying to figure out how to get the proper filter with tcpdump. I found help from this paper : http://www.wains.be/pub/networking/tcpdump_advanced_filters.txt It explains how to use advance filter on IP and TCP fields. I try this kind of filter :               tcpdump -i any 'tcp and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)' -A -s 0 -v | grep 'Host\|id-at-commonName='      As explained in the paper, "We are matching any packet that contains data." It works for Host field as for many other data, but I can't match the field `id-at-commonName=` which is in SSL field (so in the TCP Data field ?). To be sure I captured a pcap file with the exact same filter (without the grep) and when I open it with Wireshark, I can read every Certificate Common name. I must use a tcpdump filter because I need to get the data "on the fly". Can someone tell why I can't see those data through tcpdump ?


How can I substitute one command for another temporarily?

I'd like to alias sed to gsed, but only while a particular script is running. I have a script that invokes sed. On the Mac, BSD sed doesn't support the required features, but I don't want to replace it globally with the GNU version. I can't set an alias in the invoker, as aliases aren't propagated, and I can't set it in a login script as then it will apply globally. The script can't be edited. I'm posting my current solution, using a nasty symlink/path hack, as an answer, but I'm hoping that someone will come up with a better solution.


Is the crunchbang openbox autostart script simply a bash script, thus concluding I can put anything bashy in there?? And when is the script executed (e.g. login after rc.local)? System: Crunchbang Waldorf on Debian Wheezy net install


Bad Substition how to force /bin/bash as a shell?

I have a script that is getting run by a third party environment which is running the script with "/bin/sh". Is there a way from within the script that I can force bash to be used instead, for example by wrapping the commands in `bash <<EOF ... EOF`, like this?               #!/bin/bash          bash <<EOF     IMPORTS=$(find /home/snowch -type f -name .project)          for item in ${IMPORTS[*]};     do        IMPORT="$(dirname $item)/"        echo $IMPORT     done     EOF


How do I grant someone else access to my linux server

If you administer a Linux server, what steps do you take to properly grant someone else access? Assuming they will log in over `ssh`, don't already have an account, and will need root access. (Temporarily).


how can I add (subtract, etc.) two numbers with bash?

I can read the numbers and operation in with:               echo "First number please"     read num1     echo "Second mumber please"     read num2     echo "Operation?"     read op      but then all my attempts to add the numbers fail:               case "$op" in       "+")         echo num1+num2;;       "-")         echo `num1-num2`;;     esac      Run:               First number please     1     Second mumber please     2     Operation?     +      Output:               num1+num2      ...or...               echo $num1+$num2;;          # results in: 1+2          ...or...               echo `$num1`+`$num2`;;          # results in: ...line 9: 1: command not found      Seems like I'm getting strings still perhaps when I try add add ("2+2" instead of "4").