Bluetooth was working but just stopped?

I recently upgraded to the latest FGLRX driver on my MacBook Pro and I noticed that Bluetooth was having some issues afterward. I tried reinstalling bluetooth and bluez, but it didn't seem to fix things. Before the FGLRX upgrade, it was working just fine. Unfortunately, it's a really big hassle to downgrade from FGLRX, and I don't have the time to spend in getting it back to 11.12. I do have `etckeeper` installed and I've checked out the revision before I did any changes, restarted bluetooth, and it's still giving me the same error in syslog when I try to connect my keyboard:               $ tail -f /var/log/syslog | grep "blue"     Jan 30 11:56:31 work-macbook bluetoothd[9457]: Refusing input device connect: No such file or directory (2)     Jan 30 11:56:31 work-macbook bluetoothd[9457]: Refusing input device connect: No such file or directory (2)      I have no idea what file it's looking for. Is there a way for me to either:   1. Revert all of my changes and just get Bluetooth working again.   2. Enable Bluez logging to be able to see what it's unable to find? This is super weird. Can anyone help me debug this?


Photoshop in Wine won't open, gives "File not found" error

Ever since moving to Linux Mint 14, Photoshop CS 2 in Wine has been unreliable. It ran a couple times after my first install, but now it has settled into never running, and instead, it just returns an error saying "File not found". ![file not found](http://i.stack.imgur.com/oleup.png) I tried re-installing, and also installing into a custom directory, but that hasn't helped. I tried restarting the Wine server with `wineserver -k`, and rebooting, but neither helped. I get the same error if I try to run `Photoshop.exe` from the command line, even if I'm in the directory where the file is and I can see it listed when I run an `ls` command. So I don't think this is a matter of the `Photoshop.exe` file not being found, it is some system file or Wine setting. How can I get past this error and have Photoshop running consistently?


How to randomly sample a subset of a file

Is there any Linux command one can use to sample subset of a file? For instance, a file contains one million lines, and we want to randomly sample only one thousand lines from that file. For random I mean that every line gets the same probability to be chosen and none of the lines chosen are repetitive. `head` and `tail` can pick a subset of the file but not randomly. I know I can always write a python script to do so but just wondering is there a command for this usage.


download multiple files from sourceforge

Is there any way to download / mirror a folder structure with **many** files from sourceforge using wget/curl/similar tool? I've seen some examples using rsync or scp but I think that works only for SF project owners (cause it needs login, password and filesystem path).


Replace all files except one with rsync

I'm currently using `rsync` as follows               rsync -az --delete ...      What option can I use with `rsync` to replace all destination files that already exist except for one specific file that should not be replaced if already exists? Sure, if the file doesn't exist at the destination, it should be put there.


SSH through router to internal file server

This is a real beginner question, I know. But I really don't seem to be able to wrap my head around the terminology to get what I want working. And since I want to do this on a router that 40-50 people rely on for internet, my usual approach of breaking things until it works is also not going to work. So here's what I want to do. I have a router (a Debian box with shorewall) with a static IP `cable.example.com`. I have an internal fileserver assigned `192.168.0.3`. I can currently `ssh` into the router, and from there `ssh` into the filesever. However, I want to make the fileserver available externally for both myself and others with a typical `sftp` client. Could someone at least give me an idea of what I'm looking for? Tunneling out, tunneling in, port forwarding, iptables – they all seem to describe what I want to do, but I can't get a firm idea of how to get it to work.


Active Directory Domain with SAMBA or Other Tool

Can I create a domain using SAMBA and set up Active Directory with SAMBA on it? And by this I mean no windows servers involved. I would also like to be able to log in from a Windows machine. Preferably on OpenSuSE. My objective is to have a domain with centralized authentication just like AD. I want to be able to log in using both Windows and Linux computers.   * How can I do that in SAMBA?   * What other solution you guys recommend if Samba4 is not a viable one?


Viewing large image on Linux

I need to view a large (50000x40000 px) png image on Linux. Unfortunately most tools (eog, convert etc.) either crashes or fail with note about too little memory. Is there a way to view this image (I would prefer to see both the resized image and details)?


Is there a way to make Screen scroll like a normal terminal?

I love screen, but it drives me nuts that I have to stop typing input, hit `CTRL+A [`, and then find what I need. Is there a way to make the scroll wheel function normally, rather than scrolling commands? Also, is it possible to enable Shift+PageUp/PageDn?


What is $debian_chroot in .bashrc?

What is the `debian_chroot` variable in my bashrc file? and what is it doing here? `PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '`


In Bash, why is PROMPT_COMMAND set to something invisible?

On RHEL6 and CentOS 6, `/etc/bashrc` sets `PROMPT_COMMAND` here:               case $TERM in     xterm*)         if [ -e /etc/sysconfig/bash-prompt-xterm ]; then             PROMPT_COMMAND=/etc/sysconfig/bash-prompt-xterm         else             PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}"; echo -ne "\007"'         fi         ;;     screen)         if [ -e /etc/sysconfig/bash-prompt-screen ]; then             PROMPT_COMMAND=/etc/sysconfig/bash-prompt-screen         else             PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}"; echo -ne "\033\\"'         fi      All of these options, as far as I know, are printed invisibly. What is the use of this? I know that `PROMPT_COMMAND` is to be executed before display the prompt (`PS1` usually). I do not understand why echoing something that is not visible is of any use.


Android - what's the permission difference on normal and rooted devices

I have two android phones, one rooted the other not. When I run following code without asking for root permission on the two phones,               system("echo \"abc\" > /data/a.txt\n");      the rooted phone returns me error-2 (512); the normal phone returns error-1 (256, permission denied). So my question is, what makes this difference.


Download files and create same file structure as the source

I have a config file which consists of list of URIs I want to download. For example,                 http://xyz.abc.com/Dir1/Dir3/sds.exe       http://xyz.abc.com/Dir2/Dir4/jhjs.exe       http://xyz.abc.com/Dir1/itr.exe      I want to read the config file and and copy each URL but at the same time create the same directory structure as on the host. For example, for the first line in the config file, I want to create the directory structure Dir1/Dir3 on my local machine (if it doesn't exist) and then copy sds.exe to .../Dir1/Dir3/ I found that I can download all the URLs in a file using 'wget -i' but how can I create the corresponding directory structure with that


Ubuntu: how do you swap eth0 and eth1? (Ubuntu 13.10 server in a VirtualBox VM)

I installed Ubuntu 13.10 server (64-bit) in a VirtualBox 4.3.6 VM (Windows host) with one NAT adapter assigned. The only non-default software selected during installation was OpenSSH. So far so good... I could ping the world and the address is 10.0.2.15 as would be expected (per ifconfig the NAT adapter is eth0 at this point). I want to access the VM via the host without any port-mapping. Since bridging isn't an option (I can't get a second direct IP from outside the host) I created a host-only adapter (with DHCP enabled and all), edited /etc/network/interfaces (duplicating the eth0 defaults for eth1), shut the VM down, attached the new host-only adapter (selected paravirtualized), and rebooted. At this point /etc/network/interfaces contained the following:               auto lo     iface lo inet loopback          auto eth0     iface eth0 inet dhcp          auto eth1     iface eth1 inet dhcp      And indeed it all works... but per ifconfig the NAT adapter is now eth1, while the newly-added host-only adapter is eth0. I want it the other way around - and that leads to all kinds of problems! First I tried adding the MAC addresses to the interfaces file, e.g., "hwaddress ether xx:xx:xx:xx:xx:xx" as I expect it to be for eth0 and eth1. No joy... that ends up breaking networking entirely. I commented out those lines and rebooted (I actually had to disable that host-only adapter and reboot again, then I could finally re-enable it... this may be a clue.) Reading further, I see many references to updating /etc/udev/rules.d/70-persistent-net.rules to swap the MAC addresses. Great idea! Except that _other than a README file /etc/udev/rules.d is completely empty._ I tried "sudo udevadm trigger" (and a few permutations thereof)... no change. **So question #1: what happened to 70-persistent-net.rules? Is that deprecated? /etc/udev/rules.d is empty except for a README file.** Next, I tried the following: sudo ifconfig eth0 down sudo ifconfig eth1 down sudo ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx sudo ifconfig eth1 hw ether yy:yy:yy:yy:yy:yy sudo ifconfig eth0 up sudo ifconfig eth1 up Hmm. ifconfig now reports the expected mac addresses but the IP addresses are still as they were. So I reboot... And again, networking is broken (it is around this point that one learns the merit of editing /etc/init/failsafe.conf to shorten network delays during the networking debug process). The contents of /etc/network/interfaces are unchanged from how they look above. ifconfig now reports that eth0 and eth1 have the same (NAT adapter MAC) address even though I really did swap the MAC addresses above. Restore the MACs per the same procedure and reboot and we're back where we started (eth0 = host-only and eth1 = NAT). **Therefore, the main question is: how do you swap eth0 and eth1 correctly on Ubuntu 13.10?** On CentOS (given DHCP) it was as easy as swapping the MAC addresses in /etc/sysconfig/network-scripts/ifcfg-eth0 and ifcfg-eth1 and then rebooting. On Ubuntu _it's like pulling teeth_... everything that should work won't work, and I am stumped. I suspect there's something relatively new going on under the hood (thus the "missing" rules files and so on) but what could it be? Note that the network-manager isn't installed by default either (and it's definitely not present). * * * **Update:** Just for grins I created another VM with the same default server setup (including OpenSSH as before), with one network adapter (NAT). No change - networking works as it normally would for this configuration, but there's nothing in /etc/udev/rules.d except a README file (I even checked as root... nothing).


Overwriting line in unix shell after printing

How can I modify a line after printing it in unix shell.We can delete the line and write again by using `\r` as shown below,but how can I overwrite on existing line and not delete it completely and get the output as in Expected output below. **Command:**               printf "12345";printf "\r67";      **Output:**               67      **Expected Output**               67345


Debian wheezy re - installation

I am new to linux and I wanted to start learning it. So, I had installed debian. But while installation, I forgot to give username and password for login and also for root. Is it possible to log in to debian now without the username and password being set during installation? If that is not possible, how do I re-install debian. Shall I just do it the same way I did the last time(by inserting the DVD?)? If I re-install then during partitioning should I free both the main partition and the "Swap" partition or is it enough if I just delete the main partition.


Renaming a bunch of files but keeping the number part

I have a bunch of files like this:               pic100.png     pig102.png     box103a.png     superb103b.png     px103c.png     rotor110 - new.png     ready1323 (yellow car).png     motorhome1036x red circle.png     ...      so, you can notice that files may have 3 parts:   * a prefix that can be any string   * a number that may contain a suffix like "a", "b", etc.   * an optional ending, that is always a string and starts with a space, like " (yellow car)", " red circle", etc. What I need is this: I want in one operation to:   * change the prefix to the one I want   * keep the number and the suffix (a, b, c...) if there's one    * get rid of the ending using the first example, I may want to transform that in               object100.png     object102.png     object103a.png     object103b.png     object103c.png     object110.png     object1323.png     object1036x.png      how do I do that? As you see the only thing I am keeping is the number and the suffix "a, b, c" when there is one... To make it simple, the command must operate in all files in a given directory. Thanks in advance.


How to loop over the lines of a file?

Say I have this file:               hello     world     hello world      This program               #!/bin/bash          for i in $(cat $1); do         echo "tester: $i"     done      outputs               tester: hello     tester: world     tester: hello     tester: world      I'd like to have the `for` iterate over each line individually ignoring whitespaces though, i.e. the last two lines should be replaced by               tester: hello world      Using quotes `for i in "$(cat $1)";` results in `i` being asigned the whole file at once. What should I change?


What is the fastest way to process line by line in bash?

> **Possible Duplicate:**   >  How to loop over the lines of a file? Let's say I `cat` a file and I want to run a bash command on each line and write each line as output. How can I run a bash command on a single line the most succinct way?               cat something | lineBylineInplpace grep -E "spo" > &1 (I forget the standard descriptor symbol = / ) Should output the output of each line to the new file in place with the line it used for input. I realize that this is very similar to awk. Is there a bash builtin kind of way to make this faster?


How do I tell if a program is printing to stderr or stdout in the terminal?

**NOTE:** a newline appears but od -c doesn't display it. My music player's status command (`quodlibet --status | od -c`) has three states, and I'm trying to write a conditional based on that output. The outputs from that command are like this (may differ depending on the configuration).   1. I think this is printing to stderr because `od -c` doesn't display properly, even though it does for the other commands.              not-running     0000000        2. paused              0000000   p   a   u   s   e   d       P   a   n   e   d   B   r   o   w     0000020   s   e   r       1   .   0   0   0       s   h   u   f   f   l     0000040   e       o   n       0   .   2   2   8  \n     0000053        3. playing              0000000   p   l   a   y   i   n   g       P   a   n   e   d   B   r   o     0000020   w   s   e   r       1   .   0   0   0       s   h   u   f   f     0000040   l   e       o   n       0   .   2   3   2  \n     0000054      My goal is to remove everything except "not-running", "paused", or "playing" and use that in a conditional, like this:               #!/bin/bash          status=$(quodlibet --status | awk '{split($0,m," "); printf "%s",m[1]}' | tr -d '\000\007\010\n')     if [ "$status" = "playing" ]; then       quodlibet --print-playing '<artist>: <title>' | cut -c1-45     else       echo -n "$status"     fi      In the case where the player isn't running though this always prints a newline in the terminal after "not-running." Even if I do something like this               echo -n "$(quodlibet --print-playing '<artist>: <title>' | cut -c1-45)"      If I pipe that output to `od -c`, I get the same               not-running     0000000      which isn't right. The newline doesn't show up, but its their in the terminal. ### Questions   * What's causing this?   * Is the command printing to standard error when the program isn't running?   * How can I determine this?


Max Brightness too low on Debian

Using Debian wheezy 7.5 x64 on a Acer Aspire 5738Z, I found that maximum brightness (value '9' in `/sys/class/backlight/acpi_video0/max_brightness`) is much lower than maximum brightness offered by hardware (i.e., when using windows on the same machine is almost 1.5 times!). Considering that:   1. many googled related questions suggest that `max_brightness` should be '15' on Debian;   2. the file `max_brightness` is not modifiable by root even with rwx permissions (it says I/O error) Is there any workaround to this boundary?


skip line that doesn't contain perticular character eg .colon

I am reading lines from the file in while loop.               while read line     do       #process line     done      I want to skip the line that does not contain colon. Any help?


In zsh, what is the meaning of the '$==*' idiom

I have found the `$==*` idiom in several zsh solutions that I use. It seems to be equivalent to `$argv`. But I don't know how it gets interpreted. Could you explain?


How to install Tuxpaint on Debian 7?

I want to use tuxpaint in Debian 7. Is there any software to get this software? I can't change my operating system. When I try to install through `apt-get`, I get this:               utkarsh@Utkarsh[~]$sudo apt-get install tuxpaint     [sudo] password for utkarsh:      Reading package lists... Done     Building dependency tree      Reading state information... Done     E: Unable to locate package tuxpaint     utkarsh@Utkarsh[~]$      ### EDIT #1               root@Utkarsh[utkarsh]#lsb_release -a     LSB Version:    core-2.0-ia32:core-2.0-noarch:core-3.0-ia32:core-3.0-noarch:core-3.1-ia32:core-3.1-noarch:core-3.2-ia32:core-3.2-noarch:core-4.0-ia32:core-4.0-noarch:core-4.1-ia32:core-4.1-noarch:cxx-3.0-ia32:cxx-3.0-noarch:cxx-3.1-ia32:cxx-3.1-noarch:cxx-3.2-ia32:cxx-3.2-noarch:cxx-4.0-ia32:cxx-4.0-noarch:cxx-4.1-ia32:cxx-4.1-noarch:desktop-3.1-ia32:desktop-3.1-noarch:desktop-3.2-ia32:desktop-3.2-noarch:desktop-4.0-ia32:desktop-4.0-noarch:desktop-4.1-ia32:desktop-4.1-noarch:graphics-2.0-ia32:graphics-2.0-noarch:graphics-3.0-ia32:graphics-3.0-noarch:graphics-3.1-ia32:graphics-3.1-noarch:graphics-3.2-ia32:graphics-3.2-noarch:graphics-4.0-ia32:graphics-4.0-noarch:graphics-4.1-ia32:graphics-4.1-noarch:languages-3.2-ia32:languages-3.2-noarch:languages-4.0-ia32:languages-4.0-noarch:languages-4.1-ia32:languages-4.1-noarch:multimedia-3.2-ia32:multimedia-3.2-noarch:multimedia-4.0-ia32:multimedia-4.0-noarch:multimedia-4.1-ia32:multimedia-4.1-noarch:printing-3.2-ia32:printing-3.2-noarch:printing-4.0-ia32:printing-4.0-noarch:printing-4.1-ia32:printing-4.1-noarch:qt4-3.1-ia32:qt4-3.1-noarch:security-4.0-ia32:security-4.0-noarch:security-4.1-ia32:security-4.1-noarch     Distributor ID: BOSS     Description:    BOSS GNU/Linux 5.0 (anokha)     Release:    5.0     Codename:   anokha


crash shell: any way to check if a command executed Successfully

I'm automating a test using crash package. Is there some thing like `$?`, which can be used to check if the previous command executed successfully or not inside a crash shell? For example, when command:               crash> bt -a      Is executed, how do I know if it was successful or not? The only solution in my mind is greping through the results, but it's not reliable when the environment changes. This is what i get when I try `echo $?`:               crash> bt asd     bt: invalid task or pid value: asd     crash> $?     crash: command not found: $?     crash> echo $?     0     crash>     crash> q     root@at0012-ubuntu:~/crashKernel#       `$?` always appears to be 0. I already asked this question on superuser a few days back, but no help from there. Any help would be appreciated.


Installing Elementary OS on a MacBook Pro 13" Early 2011 (8,1)

I'm trying to install elementaryOS (which is based on Ubuntu 10.10) on my MacBook Pro 13" Early 2011 (model No 8,1). I have resized a partition on my hard drive, and I've installed refit. Two things I've noticed:   1. refit doesn't notice the optical Drive, however pressing `c` allows me to boot the CD.   2. When I try to install or "try" the OS, I always end up with the following message:  > `(initramfs) unable to find a medium containing a live filesystem`   3. I think these two things are connected - perhaps the OS isn't giving access to the optical drive somehow?


ACPI wakeup from keyboard/mouse via /proc/acpi/wakeup after suspend. How to find the correct device?

I'd like to wakeup my system via keyboard or mouse. This can be done via _/proc/acpi/wakeup_ and a simple               echo DEVNAME > /proc/acpi/wakeup      my wakeup file looks like this                      Device   S-state   Status   Sysfs node       ---------------------------------------       1. P0P2     S4    *disabled  pci:0000:00:01.0       2. P0P3     S4    *disabled         3. P0P1     S4    *disabled  pci:0000:00:1e.0       4. UAR1     S4    *disabled  pnp:00:0c       5. EUSB     S4    *disabled  pci:0000:00:1d.7       6. USBE     S4    *disabled  pci:0000:00:1a.7       7. P0P5     S4    *disabled         8. P0P6     S4    *disabled         9. P0P7     S4    *disabled         10. P0P8    S4    *disabled  pci:0000:00:1c.4       11. P0P9    S4    *disabled  pci:0000:00:1c.5       12. GBEC    S4    *disabled         13. USB0    S4    *disabled  pci:0000:00:1d.0       14. USB1    S4    *disabled  pci:0000:00:1d.1       15. USB2    S4    *disabled  pci:0000:00:1d.2       16. USB3    S4    *disabled         17. USB4    S4    *disabled  pci:0000:00:1a.0       18. USB5    S4    *disabled  pci:0000:00:1a.1       19. USB6    S4    *disabled  pci:0000:00:1a.2       20. P0P4    S4    *disabled  pci:0000:00:1c.0      My question is: **How can I find out which (USB) device belongs to my mouse/keyboard?** I failed with _lsusb_ so far, but maybe I just missed the right switches.


sed one-liner to delete any line that begins with a digit

![enter image description here](http://i.stack.imgur.com/tGD5v.png) Pretend I am working with this file. The beginning of the first visible line is obscured, so ignore that. 43 is the beginning of the next line, and that line would be deleted. The next line (which begins with 44 and ends with a period) would be deleted. The next line (which consists solely of 424) is also gone. The next line (which consists of '11. King and Hero') is also gone. The next line stays.


I want to create a folder inside `/home` directory and another one inside `/home/$USER` directory. Does another user on the same system may be able to access the folder which was inside the `/home` directory? Is there any disadvantage of creating a folder just inside `/home` directory? What are the differences between creating a directory inside /home and /home/$USER directories?


How can number of subdirectories and files be determined from ls -ld command?

How can number of subdirectories and files be determined from the output of using ls -ld command? I realize that this command only lists the directories.


device mapper on RHEL6 unable to create devs for LVM logical volume

I have XEN guest running RHEL6, and it has a LUN presented from the Dom0. This contains an LVM volume groups called vg_ALHINT (INT for Integration and ALH is an abbreviation of its Oracle database name). The data is Oracle 11g. The VG was imported, activated and udev created the maps for each logical volume. However device mapper did not create mappings for one of the logical volumes [LV], and for the LV in question it created /dev/dm-2 with different major minor number compared to the rest of LVs.               #  dmsetup table     vg_ALHINT-arch: 0 4300800 linear 202:16 46139392     vg0-lv6: 0 20971520 linear 202:2 30869504     vg_ALHINT-safeset2: 0 4194304 linear 202:16 35653632     vg0-lv5: 0 2097152 linear 202:2 28772352     vg_ALHINT-safeset1: 0 4186112 linear 202:16 54528000     vg0-lv4: 0 524288 linear 202:2 28248064     vg0-lv3: 0 4194304 linear 202:2 24053760     vg_ALHINT-oradata:     **     vg0-lv2: 0 4194304 linear 202:2 19859456     vg0-lv1: 0 2097152 linear 202:2 17762304     vg0-lv0: 0 17760256 linear 202:2 2048     vg_ALHINT-admin: 0 4194304 linear 202:16 41945088      ** You can see above vg_ALHINT-oradata is empty.               # ls -l /dev/mapper/     total 0     [root@iui-alhdb01 ~]# ls -l /dev/mapper/     total 0     crw-rw---- 1 root root  10, 58 Apr  3 13:43 control     lrwxrwxrwx 1 root root       7 Apr  3 13:43 vg0-lv0 -> ../dm-0     lrwxrwxrwx 1 root root       7 Apr  3 13:43 vg0-lv1 -> ../dm-1     lrwxrwxrwx 1 root root       7 Apr  3 14:35 vg0-lv2 -> ../dm-2     lrwxrwxrwx 1 root root       7 Apr  3 13:43 vg0-lv3 -> ../dm-3     lrwxrwxrwx 1 root root       7 Apr  3 13:43 vg0-lv4 -> ../dm-4     lrwxrwxrwx 1 root root       7 Apr  3 13:43 vg0-lv5 -> ../dm-5     lrwxrwxrwx 1 root root       7 Apr  3 13:43 vg0-lv6 -> ../dm-6     lrwxrwxrwx 1 root root       7 Apr  3 13:59 vg_ALHINT-admin -> ../dm-8     lrwxrwxrwx 1 root root       7 Apr  3 13:59 vg_ALHINT-arch -> ../dm-9     brw-rw---- 1 root disk 253,  7 Apr  3 14:37 vg_ALHINT-oradata     lrwxrwxrwx 1 root root       8 Apr  3 13:59 vg_ALHINT-safeset1 -> ../dm-10     lrwxrwxrwx 1 root root       8 Apr  3 13:59 vg_ALHINT-safeset2 -> ../dm-11      vg_ALHINT-oradata was not created until when I ran `dmsetup mknodes`               # cat /proc/partitions     major minor  #blocks  name           202        0   26214400 xvda      202        1     262144 xvda1      202        2   25951232 xvda2      253        0    8880128 dm-0      253        1    1048576 dm-1      253        2    2097152 dm-2      253        3    2097152 dm-3      253        4     262144 dm-4      253        5    1048576 dm-5      253        6   10485760 dm-6      202       16   29360128 xvdb      253        8    2097152 dm-8      253        9    2150400 dm-9      253       10    2093056 dm-10      253       11    2097152 dm-11      dm-7 would have been vg_ALHINT-oradata and it's missing. I ran `dmsetup mknodes` and `dm-7` was created yet still missing from `/proc/paritions`.               # ls -l /dev/dm-7     brw-rw---- 1 root disk 253, 7 Apr  3 13:59 /dev/dm-7      Its major and minor numbers are `253:7` yet the devices and the same LVs in its VG have 202:nn `lvs` tells me this LV was suspended:               # lvs         Logging initialised at Thu Apr  3 14:44:19 2014         Set umask from 0022 to 0077         Finding all logical volumes       LV       VG        Attr       LSize   Pool Origin Data%  Move Log Cpy%Sync Convert       lv0      vg0       -wi-ao----   8.47g       lv1      vg0       -wi-ao----   1.00g       lv2      vg0       -wi-ao----   2.00g       lv3      vg0       -wi-ao----   2.00g       lv4      vg0       -wi-ao---- 256.00m       lv5      vg0       -wi-ao----   1.00g       lv6      vg0       -wi-ao----  10.00g       admin    vg_ALHINT -wi-a-----   2.00g       arch     vg_ALHINT -wi-a-----   2.05g       oradata  vg_ALHINT -wi-s-----  39.95g       safeset1 vg_ALHINT -wi-a-----   2.00g       safeset2 vg_ALHINT -wi-a-----   2.00g         Wiping internal VG cache      The disc was created from a snapshot from our production databases. Oracle was shutdown and VG had been exported prior to the snapshot. I should note I perform this same take for 100s of databases weekly via a script. Because this was a snapshot then I have the table from device mapper from the original and I used this to try and recreate its missing table:               0 35651584 linear 202:16 2048     35651584 4087808 linear 202:16 50440192     39739392 2097152 linear 202:16 39847936     41836544 41943040 linear 202:16 58714112      After suspending the device with `dmsetup suspend /dev/dm-7` I ran `dmsetup load /dev/dm-7 $table.txt` Next I tried to resume this device,               # dmsetup resume /dev/dm-7     device-mapper: resume ioctl on vg_ALHINT-oradata failed: Invalid argument     Command failed     #      Any ideas because I'm really lost. (Yep I've rebooted and re-snapshotted this lots and always have the same problem. I've even reinstalled this server and run `yum update`.) // EDIT. I forgot to add that this is the original dmsetup table from our production environment and I tried to load the oradata layout into our integration server like I noted above.               #  dmsetup table     vg_ALHPRD-safeset2: 0 4194304 linear 202:32 35653632     vg_ALHPRD-safeset1: 0 4186112 linear 202:32 54528000     vg_ALHPRD-oradata: 0 35651584 linear 202:32 2048     vg_ALHPRD-oradata: 35651584 4087808 linear 202:32 50440192     vg_ALHPRD-oradata: 39739392 2097152 linear 202:32 39847936     vg_ALHPRD-oradata: 41836544 41943040 linear 202:32 58714112     vg_ALHPRD-admin: 0 4194304 linear 202:32 41945088      //EDIT I ran vgscan --mknodes and had:               The link /dev/vg_ALHINT/oradata should have been created by udev but it was not found. Falling back to direct link creation.                    # ls -l /dev/vg_ALHINT/oradata     lrwxrwxrwx 1 root root 29 Apr 3 14:50 /dev/vg_ALHINT/oradata -> /dev/mapper/vg_ALHINT-oradata      Still cannot activate this and had this error message:               device-mapper: resume ioctl on failed: Invalid argument Unable to resume vg_ALHINT-oradata (253:7)       //EDIT I see stack traces in /var/log/messages:               Apr  3 13:58:09 iui-alhdb01 kernel: blkfront: xvdb: barriers disabled     Apr  3 13:58:09 iui-alhdb01 kernel: xvdb: unknown partition table     Apr  3 13:59:35 iui-alhdb01 kernel: device-mapper: table: 253:7: xvdb too small for target: start=58714112, len=41943040, dev_size=58720256     Apr  3 14:02:31 iui-alhdb01 ntpd[1093]: 0.0.0.0 c612 02 freq_set kernel 5.242 PPM     Apr  3 14:02:31 iui-alhdb01 ntpd[1093]: 0.0.0.0 c615 05 clock_sync     Apr  3 14:30:13 iui-alhdb01 kernel: device-mapper: table: 253:2: xvdb too small for target: start=58714112, len=41943040, dev_size=58720256     Apr  3 14:33:34 iui-alhdb01 kernel: INFO: task vi:1394 blocked for more than 120 seconds.     Apr  3 14:33:34 iui-alhdb01 kernel:      Not tainted 2.6.32-431.11.2.el6.x86_64 #1     Apr  3 14:33:34 iui-alhdb01 kernel: "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.     Apr  3 14:33:34 iui-alhdb01 kernel: vi            D 0000000000000000     0  1394   1271 0x00000084     Apr  3 14:33:34 iui-alhdb01 kernel: ffff88007aef19b8 0000000000000082 ffff88007aef1978 ffffffffa000443c     Apr  3 14:33:34 iui-alhdb01 kernel: ffff88007d208d80 ffff880037cabc08 ffff880037cda0c8 ffff8800022168a8     Apr  3 14:33:34 iui-alhdb01 kernel: ffff880037da45f8 ffff88007aef1fd8 000000000000fbc8 ffff880037da45f8     Apr  3 14:33:34 iui-alhdb01 kernel: Call Trace:     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffffa000443c>] ? dm_table_unplug_all+0x5c/0x100 [dm_mod]     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffff810a7091>] ? ktime_get_ts+0xb1/0xf0     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffff811bf1f0>] ? sync_buffer+0x0/0x50     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffff815286c3>] io_schedule+0x73/0xc0     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffff811bf230>] sync_buffer+0x40/0x50     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffff8152918f>] __wait_on_bit+0x5f/0x90     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffff811bf1f0>] ? sync_buffer+0x0/0x50     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffff81529238>] out_of_line_wait_on_bit+0x78/0x90     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffff8109b310>] ? wake_bit_function+0x0/0x50     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffff811bf1e6>] __wait_on_buffer+0x26/0x30     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffffa0085875>] __ext4_get_inode_loc+0x1e5/0x3b0 [ext4]     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffffa0088006>] ext4_iget+0x86/0x7d0 [ext4]     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffffa008ec35>] ext4_lookup+0xa5/0x140 [ext4]     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffff81198b05>] do_lookup+0x1a5/0x230     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffff81198e90>] __link_path_walk+0x200/0xff0     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffff8114a667>] ? handle_pte_fault+0xf7/0xb00     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffff811a3c6a>] ? dput+0x9a/0x150     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffff81199f3a>] path_walk+0x6a/0xe0     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffff8119a14b>] filename_lookup+0x6b/0xc0     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffff8119b277>] user_path_at+0x57/0xa0     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffff8104a98c>] ? __do_page_fault+0x1ec/0x480     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffff8119707b>] ? putname+0x2b/0x40     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffff8118eac0>] vfs_fstatat+0x50/0xa0     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffff811c4645>] ? nr_blockdev_pages+0x15/0x70     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffff8115c4ad>] ? si_swapinfo+0x1d/0x90     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffff8118ec3b>] vfs_stat+0x1b/0x20     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffff8118ec64>] sys_newstat+0x24/0x50     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffff810e2057>] ? audit_syscall_entry+0x1d7/0x200     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffff8100b072>] system_call_fastpath+0x16/0x1b     Apr  3 14:35:34 iui-alhdb01 kernel: INFO: task vi:1394 blocked for more than 120 seconds.     Apr  3 14:35:34 iui-alhdb01 kernel:      Not tainted 2.6.32-431.11.2.el6.x86_64 #1     Apr  3 14:35:34 iui-alhdb01 kernel: "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.     Apr  3 14:35:34 iui-alhdb01 kernel: vi            D 0000000000000000     0  1394   1271 0x00000084     Apr  3 14:35:34 iui-alhdb01 kernel: ffff88007aef19b8 0000000000000082 ffff88007aef1978 ffffffffa000443c     Apr  3 14:35:34 iui-alhdb01 kernel: ffff88007d208d80 ffff880037cabc08 ffff880037cda0c8 ffff8800022168a8     Apr  3 14:35:34 iui-alhdb01 kernel: ffff880037da45f8 ffff88007aef1fd8 000000000000fbc8 ffff880037da45f8     Apr  3 14:35:34 iui-alhdb01 kernel: Call Trace:     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffffa000443c>] ? dm_table_unplug_all+0x5c/0x100 [dm_mod]     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff810a7091>] ? ktime_get_ts+0xb1/0xf0     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff811bf1f0>] ? sync_buffer+0x0/0x50     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff815286c3>] io_schedule+0x73/0xc0     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff811bf230>] sync_buffer+0x40/0x50     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff8152918f>] __wait_on_bit+0x5f/0x90     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff811bf1f0>] ? sync_buffer+0x0/0x50     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff81529238>] out_of_line_wait_on_bit+0x78/0x90     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff8109b310>] ? wake_bit_function+0x0/0x50     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff811bf1e6>] __wait_on_buffer+0x26/0x30     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffffa0085875>] __ext4_get_inode_loc+0x1e5/0x3b0 [ext4]     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffffa0088006>] ext4_iget+0x86/0x7d0 [ext4]     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffffa008ec35>] ext4_lookup+0xa5/0x140 [ext4]     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff81198b05>] do_lookup+0x1a5/0x230     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff81198e90>] __link_path_walk+0x200/0xff0     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff8114a667>] ? handle_pte_fault+0xf7/0xb00     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff811a3c6a>] ? dput+0x9a/0x150     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff81199f3a>] path_walk+0x6a/0xe0     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff8119a14b>] filename_lookup+0x6b/0xc0     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff8119b277>] user_path_at+0x57/0xa0     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff8104a98c>] ? __do_page_fault+0x1ec/0x480     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff8119707b>] ? putname+0x2b/0x40     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff8118eac0>] vfs_fstatat+0x50/0xa0     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff811c4645>] ? nr_blockdev_pages+0x15/0x70     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff8115c4ad>] ? si_swapinfo+0x1d/0x90     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff8118ec3b>] vfs_stat+0x1b/0x20     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff8118ec64>] sys_newstat+0x24/0x50     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff810e2057>] ? audit_syscall_entry+0x1d7/0x200     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff8100b072>] system_call_fastpath+0x16/0x1b     Apr  3 14:35:34 iui-alhdb01 kernel: INFO: task vgdisplay:1437 blocked for more than 120 seconds.     Apr  3 14:35:34 iui-alhdb01 kernel:      Not tainted 2.6.32-431.11.2.el6.x86_64 #1     Apr  3 14:35:34 iui-alhdb01 kernel: "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.     Apr  3 14:35:34 iui-alhdb01 kernel: vgdisplay     D 0000000000000000     0  1437   1423 0x00000080     Apr  3 14:35:34 iui-alhdb01 kernel: ffff88007da35a18 0000000000000086 ffff88007da359d8 ffffffffa000443c     Apr  3 14:35:34 iui-alhdb01 kernel: 000000000007fff0 0000000000010000 ffff88007da359d8 ffff88007d24d380     Apr  3 14:35:34 iui-alhdb01 kernel: ffff880037c8c5f8 ffff88007da35fd8 000000000000fbc8 ffff880037c8c5f8     Apr  3 14:35:34 iui-alhdb01 kernel: Call Trace:     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffffa000443c>] ? dm_table_unplug_all+0x5c/0x100 [dm_mod]     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff810a7091>] ? ktime_get_ts+0xb1/0xf0     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff815286c3>] io_schedule+0x73/0xc0     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff811c8a9d>] __blockdev_direct_IO_newtrunc+0xb7d/0x1270     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff811c4400>] ? blkdev_get_block+0x0/0x20     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff811c9207>] __blockdev_direct_IO+0x77/0xe0     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff811c4400>] ? blkdev_get_block+0x0/0x20     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff811c5487>] blkdev_direct_IO+0x57/0x60     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff811c4400>] ? blkdev_get_block+0x0/0x20     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff811217bb>] generic_file_aio_read+0x6bb/0x700     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff811c5fd0>] ? blkdev_get+0x10/0x20     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff811c5fe0>] ? blkdev_open+0x0/0xc0     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff8118617f>] ? __dentry_open+0x23f/0x360     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff811c4841>] blkdev_aio_read+0x51/0x80     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff81188e8a>] do_sync_read+0xfa/0x140     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff810ec3f6>] ? rcu_process_dyntick+0xd6/0x120     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff8109b290>] ? autoremove_wake_function+0x0/0x40     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff811c479c>] ? block_ioctl+0x3c/0x40     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff8119dc12>] ? vfs_ioctl+0x22/0xa0     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff8119ddb4>] ? do_vfs_ioctl+0x84/0x580     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff81226496>] ? security_file_permission+0x16/0x20     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff81189775>] vfs_read+0xb5/0x1a0     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff811898b1>] sys_read+0x51/0x90     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff810e1e4e>] ? __audit_syscall_exit+0x25e/0x290     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff8100b072>] system_call_fastpath+0x16/0x1b     Apr  3 14:39:19 iui-alhdb01 kernel: device-mapper: table: 253:7: xvdb too small for target: start=58714112, len=41943040, dev_size=58720256     Apr  3 14:53:57 iui-alhdb01 kernel: device-mapper: table: 253:7: xvdb too small for target: start=58714112, len=41943040, dev_size=58720256     Apr  3 15:02:42 iui-alhdb01 yum[1544]: Installed: sos-2.2-47.el6.noarch     Apr  3 15:52:29 iui-alhdb01 kernel: device-mapper: table: 253:7: xvdb too small for target: start=58714112, len=41943040, dev_size=58720256     Apr  3 15:59:08 iui-alhdb01 kernel: device-mapper: table: 253:7: xvdb too small for target: start=58714112, len=41943040, dev_size=58720256


Postfix email bounced (mail for domain loops back to myself)

I have problem when i send a mail to example@orbialia.es for example2@orbialia.es My emails has bounced for this error: `status=bounced (mail for orbialia.es loops back to myself)`               May  9 09:33:58 ns3285243 postfix/smtpd[1606]: connect from localhost.localdomain[127.0.0.1]     May  9 09:33:58 ns3285243 postfix/smtpd[1606]: 1EF6FA1DB9: client=localhost.localdomain[127.0.0.1]     May  9 09:33:58 ns3285243 postfix/cleanup[1584]: 1EF6FA1DB9: message-id=<004801cf6b58$a6516540$f2f42fc0$@orbialia.es>     May  9 09:33:58 ns3285243 postfix/qmgr[1575]: 1EF6FA1DB9: from=<jonatan.soler@orbialia.es>, size=7184, nrcpt=1 (queue active)     May  9 09:33:58 ns3285243 postfix/smtpd[1606]: disconnect from localhost.localdomain[127.0.0.1]     May  9 09:33:58 ns3285243 amavis[15721]: (15721-16) Passed CLEAN {RelayedInbound}, [79.145.170.251]:1991 [79.145.170.251] <jonatan.soler@orbialia.es> -> <consultanos@orbialia.es>, Queue-ID: 9D0DCA1DB4, Message-ID: <004801cf6b58$a6516540$f2f42fc0$@orbialia.es>, mail_id: 8JHrgdOkE3Pw, Hits: -0.999, size: 6675, queued_as: 1EF6FA1DB9, 26690 ms     May  9 09:33:58 ns3285243 postfix/smtp[1588]: 9D0DCA1DB4: to=<consultanos@orbialia.es>, relay=127.0.0.1[127.0.0.1]:10024, delay=28, delays=1/0.02/0.01/27, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as 1EF6FA1DB9)     May  9 09:33:58 ns3285243 postfix/qmgr[1575]: 9D0DCA1DB4: removed     May  9 09:33:58 ns3285243 postfix/smtp[1607]: 1EF6FA1DB9: to=<consultanos@orbialia.es>, relay=none, delay=0.11, delays=0.09/0.02/0/0, dsn=5.4.6, status=bounced (mail for orbialia.es loops back to myself)     May  9 09:33:58 ns3285243 postfix/cleanup[1584]: 42EC4A1DB4: message-id=<20140509073358.42EC4A1DB4@rentabiliza.net>     May  9 09:33:58 ns3285243 postfix/bounce[1608]: 1EF6FA1DB9: sender non-delivery notification: 42EC4A1DB4     May  9 09:33:58 ns3285243 postfix/qmgr[1575]: 42EC4A1DB4: from=<>, size=9465, nrcpt=1 (queue active)     May  9 09:33:58 ns3285243 postfix/qmgr[1575]: 1EF6FA1DB9: removed     May  9 09:33:58 ns3285243 postfix/smtp[1607]: 42EC4A1DB4: to=<jonatan.soler@orbialia.es>, relay=none, delay=0.05, delays=0.04/0/0/0, dsn=5.4.6, status=bounced (mail for orbialia.es loops back to myself)     May  9 09:33:58 ns3285243 postfix/qmgr[1575]: 42EC4A1DB4: removed      This is my postfix config               alias_database = hash:/etc/aliases     alias_maps = hash:/etc/aliases     append_dot_mydomain = no     biff = no     config_directory = /etc/postfix     content_filter = smtp-amavis:[127.0.0.1]:10024     inet_interfaces = all     mailbox_command = procmail -a "$EXTENSION"     mailbox_size_limit = 0     milter_default_action = accept     milter_protocol = 2     mydestination = localhost, ns3285243.ip-5-135-177.eu     myhostname = rentabiliza.net     mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128     myorigin = /etc/mailname     non_smtpd_milters = inet:localhost:8891     policy-spf_time_limit = 3600s     readme_directory = no     recipient_delimiter = +     relayhost =     smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)     smtpd_milters = inet:localhost:8891     smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination check_policy_service unix:private/policy-spf     smtpd_sasl_auth_enable = yes     smtpd_sasl_path = private/auth     smtpd_sasl_type = dovecot     smtpd_tls_auth_only = yes     smtpd_tls_cert_file = /etc/ssl/certs/dovecot.pem     smtpd_tls_key_file = /etc/ssl/private/dovecot.pem     smtpd_use_tls = yes     virtual_alias_domains = mysql:/etc/postfix/sql-domain-aliases.cf     virtual_alias_maps = mysql:/etc/postfix/sql-aliases.cf, mysql:/etc/postfix/sql-domain-aliases-mailboxes.cf, mysql:/etc/postfix/sql-email2email.cf, mysql:/etc/postfix/sql-catchall-aliases.cf     virtual_mailbox_domains = mysql:/etc/postfix/sql-domains.cf     virtual_mailbox_maps = mysql:/etc/postfix/sql-mailboxes.cf     virtual_transport = lmtp:unix:private/dovecot-lmtp      I use virtual domains/users in a mysql database hostname: `ns3285243.ip-5-135-177.eu` hostname -f: `ns3285243.ip-5-135-177.eu` /etc/hosts               # Do not remove the following line, or various programs     # that require network functionality will fail.     127.0.0.1 localhost.localdomain localhost     5.135.177.115           ns3285243.ip-5-135-177.eu       ns3285243     2001:41D0:8:B873::1     ns3285243.ip-5-135-177.eu       ns3285243          # The following lines are desirable for IPv6 capable hosts     #(added automatically by netbase upgrade)          ::1     ip6-localhost ip6-loopback     fe00::0 ip6-localnet     ff00::0 ip6-mcastprefix     ff02::1 ip6-allnodes     ff02::2 ip6-allrouters     ff02::3 ip6-allhosts      When i try to send mail to gmail.com to destination it recieve the email succesfully If i put orbialia.es to mydestination i recieve this:               May  9 09:47:28 ns3285243 postfix/smtpd[2601]: NOQUEUE: reject: RCPT from 251.Red-79-145-170.dynamicIP.rima-tde.net[79.145.170.251]: 550 5.1.1 <consultanos@orbialia.es>: Recipient address rejected: User unknown in local recipient table; from=<jonatan.soler@orbialia.es> to=<consultanos@orbialia.es> proto=ESMTP helo=<50l3rport>      i have multiple virtual domains. How can resolve it?


How to install sshfs on Linux Mint?

I am trying to install `sshfs` on Linux Mint to mount remote folders over SSH. I've Googled up and down on how to install `sshfs` (as the command is not available to me) and I'm beating my head against the wall because I cannot find the repository it is in.               ~ $ sshfs     The program 'sshfs' is currently not installed. You can install it by typing:     sudo apt-get install sshfs     ~ $ sudo apt-get install sshfs     [sudo] password for XXXX:      Reading package lists... Done     Building dependency tree            Reading state information... Done     E: Unable to locate package sshfs      **Edit:** Adding response to @Nate from Kalamazoo's answer here for code formatting:               ~ $ sudo apt-get install sshfs-fuse     Reading package lists... Done     Building dependency tree            Reading state information... Done     E: Unable to locate package sshfs-fuse     ~ $ apt-cache search sshfs     ~ $       **Edit:** Adding output of `cat /etc/apt/sources.list /etc/apt/sources.list.d/*.list`:               deb http://packages.linuxmint.com/ olivia main upstream import     deb http://ppa.launchpad.net/dockbar-main/ppa/ubuntu raring main     deb-src http://ppa.launchpad.net/dockbar-main/ppa/ubuntu raring main     ### THIS FILE IS AUTOMATICALLY CONFIGURED ###     # You may comment out this entry, but any other modifications may be lost.     deb http://dl.google.com/linux/chrome/deb/ stable main     #deb file:///usr/share/local-repository binary/          deb http://ppa.launchpad.net/nuvola-player-builders/stable/ubuntu raring main     deb-src http://ppa.launchpad.net/nuvola-player-builders/stable/ubuntu raring main     # Do not edit this file manually, use Software Sources instead.          deb http://packages.linuxmint.com olivia main upstream import  #id:linuxmint_main          deb http://archive.ubuntu.com/ubuntu raring main restricted universe multiverse     deb http://archive.ubuntu.com/ubuntu raring-updates main restricted universe multiverse          deb http://security.ubuntu.com/ubuntu/ raring-security main restricted universe multiverse     deb http://archive.canonical.com/ubuntu/ raring partner     deb http://ppa.launchpad.net/webupd8team/jupiter/ubuntu raring main     deb-src http://ppa.launchpad.net/webupd8team/jupiter/ubuntu raring main     deb http://ppa.launchpad.net/webupd8team/sublime-text-2/ubuntu raring main     deb-src http://ppa.launchpad.net/webupd8team/sublime-text-2/ubuntu raring main      All tutorials I find don't mention adding any repositories, just to do the usual install. I'm at a loss. Can someone help me out on this relatively simple issue?


How do you pronounce System V and SysV?

Is the V in System V and SysV (and sysvinit, etc) pronounced "vee" or "five"?


How to programmatically retrieve the GID of a running process

I need to write some C code to check the effective GID of a running process whose PID I know. I've not found any direct way to do this. There are a number of heavyweight kludges I could use, such as invoking `popen("/bin/ps ARGS", "r")` and parsing its output, or `fopen("/proc/PID/status", "r")` and parsing _that_ output, but I'm looking for a cleaner, more direct approach. If only `getegid()` took a PID argument...


Where are displays other than ":0"?

X Power Tools -book has a sentence about ":0": > Display 0 on the local computer, connected by a local connection scheme I tried to open a clock by "xclock -display :2", but I got an error: > Can't open display: :2 How am I supposed to program if I cannot get displays working? Can you really do everything on it? How can you run programs, such as Vim and gcc, on displays 3 and 999? Where are they?


Verify Debian ISO integrity

I recently downloaded Debian 7.5.0 Wheezy and managed to use the Release.sig signature to verify the integrity of the Release checksum file using GPG4Win. Unfortunately, I couldn't find any advice on where to find the md5/SHA1/SHA256 checksum inside the Release filw to verify that the ISO is correct/hasn't been corrupted/manipulated. Couldn't find any help regarding this specific problem on the support sites either. I am using Windows 7 if this is relevant. Hope you can help me with this. Cheers Edit: The name of my ISO file is "debian-7.5.0-amd64-netinst". Other versions can be found here (ftp://cdimage.debian.org/cdimage/release/7.5.0-live/amd64/iso-hybrid/) and offer an easier way to verify the integrity because of this file: ftp://cdimage.debian.org/cdimage/release/7.5.0-live/amd64/iso- hybrid/SHA256SUMS. I need to find something like this in the Release file I verified.


Mount /home to USB Live Linux

do you think that it would be possible to somehow mount /home folder with all the settings to Linux that runs as Live CD from USB key? Imagine that you have /home partition on the disk in the laptop and you want to run Live Linux but you want to have your old settings. Think of it as an alternative to dual boot. Do you think it is possible? What do you think it will be usable? I mean if it will be slow because of USB? What about USB 3.0 - I mean not the cheap version but really fast read/write speeds. Would 8 GB stick will be large enough?


How do I associate the Windows key with GNOME menu in Fedora?

There is a similar question: How to associate the Fedora Start menu with the Windows keyboard? but it's for KDE 4. Can someone post equivalent steps for GNOME?


How to use cron + python to regularly adjust screen brightness?

I want to use cron and this script (http://askubuntu.com/questions/23593/use- webcam-to-sense-lighting-condition-and-adjust-screen-brightness):               import opencv     import opencv.highgui     import time     import commands               def get_image():         image = opencv.highgui.cvQueryFrame(camera)         return opencv.adaptors.Ipl2PIL(image)          camera = opencv.highgui.cvCreateCameraCapture(-1)          while 1:         image = get_image()         image.thumbnail((32, 24, ))         image = tuple(ord(i) for i in image.tostring())         x = int((int((max(image) / 256.0) * 10) + 1) ** 0.5 / 3 * 10)         cmd = ("sudo su -c 'echo " + str(x) +             " > /sys/devices/virtual/backlight/acpi_video0/brightness'")         status, output = commands.getstatusoutput(cmd)         assert status is 0      crontab: _/30_ *** sudo python /home/username/screen.py However, there are two issues: First, can the while-loop be terminated after 5 sec or so? Second, could anyone please try to improve the script so that lower brightness-levels can be set using the script? Maybe the way the 256 brightness-levels are mapped to the ones that can be set for the screen would need to be changed. Thanks


What program constantly reads e-mails and could execute actions under certain conditions?

I need a program that would be running as a daemon, connecting to mail server and reading inbox of a specified e-mail address (provided with password, of course =) ). If certain conditions are met, it'd execute a script - and there could be many different conditions with many different scripts =) Conditions could include: sender address, e-mail topic&text, etc. Is there any program like I've described?


Read data from a pipe for a certain amount of time (in seconds)

Is there an easy way to create a pipe that only lasts for a given amount of wall time? I want to be able to take a "snapshot" of what's being written STDOUT for a period of time (rather than bytes or lines). Something like `tail -f /var/log/whatever.log | pipe_for_seconds 10 > ./10_second_sample_of_log` I'm using BASH, but if this is dramatically easier in some other shell, I'd like to hear about it.


Are there ways to break into a machine if iptables drops all traffic?

Say I install Linux on an blank computer (no other OS, disk is formatted for installation), and I configure this in iptables:               iptables -F     iptables -P INPUT DROP     iptables -P OUTPUT DROP     iptables -P FORWARD DROP      This machine is then directly connected to the internet (internet won't be functional though as no traffic goes in and out). How secure will this machine be? Are there ways to break in to this machine? Let's define 'break in' as reading any file from this machine. If the OS matters, feel free to compare how this would behave using the latest Ubuntu Server edition vs. Arch Linux with only the basics installed.


Unzipping appearing to fail

I run:               ~$ gzip -d Mom.img.gz     ^C     ~$      I created `Mom.img.gz` by piping a `dd` to `gzip`. Should I be seeing output? I tried it with the GUI too, and the progress bar didn't move.


Run emacs elisp command with next word as argument

How can I tell emacs to run my own script (which can be elisp too or something in Perl, BASH or whatever), and use the next word after the mouse cursor as argument, or maybe using a group of marked words? The output would be in another buffer.


Share Home Directory between Arch and Ubuntu

Before I start asking my question, I would like you to know that I am aware of the "Different linux distros sharing the same /home folder?" question already asked on this website. It did not quite answer my question though, and as it's too broad I don't think it ever will. Is it possible to share the user directory between Ubuntu and Arch, and how to make that work? I'm talking about what's known as `~`. I already have Ubuntu installed, but I am really annoyed by outdated packages. I would like to run them next to each other so when I need to use new software I can use ArchLinux. I could just switch completely to ArchLinux, but I don't want to take any risks. (Maybe I'll hate it) Just as a sidenote, my /home is on a different partition, but my users' directories also encrypted.


Why is my BCM43142 chipset is not recognised and device wlan0 not found?

I'm trying to setup the WiFi connection on my Lenovo B590 but I get the following error : > >       ifdown: interface wlan0 not configured wpa_supplicant: >       /sbin/wpa_supplicant daemon failed to start run-parts: >       /etc/network/if-pre-up.d/wpasupplicant exited with return code 1 >       Internet Systems Consortium DHCP Client 4.2.2 Copyright 2004-2011 >       Internet Systems Consortium. All rights reserved. For info, please >       visit https://www.isc.org/software/dhcp/ >   > > **Cannot find device "wlan0" Bind socket to interface: No such device** > Failed to bring up work-network So I looked up which firmware I need so my Debian 7 Wheezy system could find wlan0. **NOTE:** the wlan chipset is a Broadcom Corp. BCM43142 and its PCI-ID is 14e4:4365 > host@user $ lspci -vnn -d 14e4: |grep Network > > 02:00.0 Network controller [0280]: Broadcom Corporation BCM43142 802.11b/g/n > [14e4:4365] (rev 01) I found this article on the Debian Wiki giving all the steps needed to get it working, I followed them and got no errors anywhere. I set up the WiFi interface with wpa_supplicant but when I run               $ ifdown wlan0     $ ifup wlan0=work-network      I still get the error **Cannot find device "wlan0" Bind socket to interface: No such device** Do you know what is missing for it to work? **EDIT:** below is the `dmesg` output               $ dmesg |grep broadcom -i                                    [    2.574645] usb 1-1.4: Manufacturer: Broadcom Corp     [    6.828086] eth1: Broadcom BCM4365 802.11 Hybrid Wireless Controller 6.20.55.19 (r300276)     [   10.343512] Broadcom 43xx driver loaded [ Features: PMNLS ]      And here is the content of `/etc/network/interfaces`               # The loopback network interface     auto lo          # iface lo inet loopback          iface work-network inet dhcp           wpa-conf /etc/wpa_supplicant/work-network.conf          # The primary network interface     auto eth0     allow-hotplug eth0


how to find where buffers/cache are and how to clean them up?

I want to create 20gb ram disk for ANSYS to work in yet on `free -g` I see: ![enter image description here](http://i.stack.imgur.com/tzbIP.png) And personally I have not created any ram drives yet. So I wonder how to maximize avaliable ram: how to locate what is using buffers/cache and how to free desired space?


Can't login on OpenSuse:  "No logon servers"

I have installed OpenSuse at work, and my admin fixed some problems with my login. The login worked at work, I also restarted PC and tried it after restart, it was fine too. But then I came home I couldn't login (both GUI and terminal doesn't work), it says **"No logon servers"**. I thought that's only a problem at home, but I tried it at work and I'm getting the same message. Login as root works, but my login not. How can I try to fix the "No logon servers" problem?


A system-wide way to set or get $JAVA_HOME in Ubuntu?

I wonder whether Ubuntu itself provides a system-wide way to find the current JAVA_HOME or whether there is right place for setting JAVA_HOME. Mac OS X does well in this, for `/usr/libexec/java_home` command returns the current JAVA_HOME. But to Ubuntu, the materials I found always told me to set the $JAVA_PATH pointing to a static path like ````, which is stored in`~/.bash_profile```. I think, however, this approach has several drawbacks:   1. Once Java updates, the mini version number will change, which makes the static path no longer available.   2. After changing the JRE used in my system with `update-alternatives`, I have to modify $JAVA_HOME in .bash_profile. That extra work is annoying.   3. Some $JAVA_HOME-required programs, is not aware of `.bash_profile` at all. I have to set $JAVA_HOME in their start-up script, therefore a standard-and-easy way to get $JAVA_HOME seems critical to me. Well, any advice is welcomed. Thanks.


Change character position with sed

The file contains:               dateutkfilename25012009      I want to change the position of character 16th to 17th with 18th to 19th. And then change position of character 16th to 19th with 20th to 23rd... so it will be:               dateutkfilename20090125      I've tried to change position of character 16th to 17th with 18th to 19th using below code, but I don't understand why it not works:               '/dateutkfilename/s/\(.\{16\}\)\([0-9]\{2\}\)\(.*\)/\(.\{18\}\)\([0-9]\{2\}\)\(.*\)/g'


How to diagnose a reliably unreliable connection?

Where I'm living now, the internet connection (wired) shows the following weird symptoms. They seem to be independent of whether I use host names or IP addresses.   * Pinging works   * Skype works   * Wget connects, but never receives a response. (Keeps waiting at "HTTP Request sent, awaiting response" until timeout.)      * Except for a small subset of domains, for which it works.    * ssh commands (`ssh host ls`) works.    * Interactive ssh works for a short while, but hangs quickly, e.g. during the first `ls` -- at the same point every time.   * Under Windows, everything works fine. What can I do to diagnose this further? So far, I've just been looking at the application layer. Since there is an apparent internet connection, there must be some way to tunnel Firefox, but I'd like to pin down the problem first. It is very likely related to large packets not making their way through. I've found out that there is an MTU, but setting it for eth0 does not solve my problem. I think that I'm behind PPPOE and a router. The external IPs are the same on Windows and Linux. Output of some commands: `ip link show`               1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN          link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00     2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1024 qdisc mq state UP qlen 1000         link/ether 00:26:aa:aa:aa:61 brd ff:ff:ff:ff:ff:ff     3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN qlen 1000         link/ether c4:17:aa:aa:aa:ff brd ff:ff:ff:ff:ff:ff     4: virbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN          link/ether 5e:49:aa:aa:aa:27 brd ff:ff:ff:ff:ff:ff      `ip route show`               192.168.1.0/24 dev eth0  proto kernel  scope link  src 192.168.1.4  metric 1      192.168.122.0/24 dev virbr0  proto kernel  scope link  src 192.168.122.1      169.254.0.0/16 dev eth0  scope link  metric 1000      default via 192.168.1.1 dev eth0  proto static       `ip addr show`               1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 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         inet6 ::1/128 scope host             valid_lft forever preferred_lft forever     2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1024 qdisc mq state UP qlen 1000         link/ether 00:26:2d:78:ac:61 brd ff:ff:ff:ff:ff:ff         inet 192.168.1.4/24 brd 192.168.1.255 scope global eth0     3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN qlen 1000         link/ether c4:17:fe:3b:56:ff brd ff:ff:ff:ff:ff:ff     4: virbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN          link/ether 5e:49:01:03:55:27 brd ff:ff:ff:ff:ff:ff         inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0         inet6 fe80::5c49:1ff:fe03:5527/64 scope link             valid_lft forever preferred_lft forever      I can send pings up to size 1468.               tim@milagros:/$ ping -M do -c 1 -s 1470 stackexchange.com     PING stackexchange.com (64.34.119.12) 1470(1498) bytes of data.        --- stackexchange.com ping statistics ---        1 packets transmitted, 0 received, 100% packet loss, time 0ms          tim@milagros:/$ ping -M do -c 1 -s 1468 stackexchange.com     PING stackexchange.com (64.34.119.12) 1468(1496) bytes of data.     1476 bytes from stackoverflow.com (64.34.119.12): icmp_seq=1 ttl=52 time=176 ms        --- stackexchange.com ping statistics ---        1 packets transmitted, 1 received, 0% packet loss, time 0ms        rtt min/avg/max/mdev = 176.539/176.539/176.539/0.000 ms                    tim@milagros:~/projekt/perl$ ifconfig eth0     eth0      Link encap:Ethernet  HWaddr 00:26:2d:78:ac:61                 inet addr:192.168.1.4  Bcast:192.168.1.255  Mask:255.255.255.0               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:161 errors:0 dropped:0 overruns:0 frame:0               TX packets:194 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:143947 (143.9 KB)  TX bytes:67727 (67.7 KB)               Interrupt:16


What are software and hardware interrupts, and how are they processed?

I am not sure if I understand the concept of hardware and software interrupts. If I understand correctly, the purpose of a hardware interrupt is to get some attention of the CPU, part of implementing CPU multitasking.   1. Then what issues a hardware interrupt? Is it the hardware driver process?   2. If yes, where is the hardware driver process running? If it is running on the CPU, then it won't have to get attention of the CPU by hardware interrupt, right? So is it running elsewhere?   3. Does a hardware interrupt interrupt the CPU directly, or does it first contact the kernel process and the kernel process then contacts/interrupts the CPU? * * * On the other hand, I think the purpose of a software interrupt is for a process currently running on a CPU to request some resources.   1. What are the resources? Are they all in the form of running processes? For example, do CPU driver process and memory driver processes represent CPU and memory resources? Do the driver process of the I/O devices represent I/O resources? Are other running processes that the process would like to communicate with also resources?   2. If yes, does a software interrupt contact the processes (which represent the resources) indirectly via the kernel process? Is it right that unlike a hardware interrupt, a software interrupt never directly interrupts the CPU, but instead, it interrupts/contacts the kernel process?


How to start an xterm from Nautilus, running in the folder I'm viewing?

This was easy in Thunar, but now I'm on a machine where I'm trying to do everything in the Gnome desktop world. In Nautilus, I'm in some deep-down folder. How do I open an xterm (rxvt, aterm, gnome's terminal app, whichever) with its working directory already set to the location Nautilus is showing?


Help with using rsync or cpio to do an incremental backup

I'm trying to do an incremental backup of all files on my NAS box that where modified in the last 24 hours (or so, can be more flexible). I'm using PuTTY to connect through SSH to a ReadyNAS 102 which has BusyBox v1.20.2 and uses Bash. I origianlly used: `find . -mtime -2 | cpio -cm /media/USB_FLASH_2` And then tried: `find . -mtime -2 | cpio -o | { cd /media/USB_FLASH_2 && cpio -imd; }` which got me the error: BusyBox v1.20.2 (Debian 1:1.20.0-7) multi-call binary. Usage: cpio [-dmvu] [-F FILE] [-H newc] [-tio] [EXTR_FILE]... Extract or list files from a cpio archive, or create an archive using file list on stdin Main operation mode: -t List -i Extract EXTR_FILEs (or all) -o Create (requires -H newc) -d Make leading directories -m Preserve mtime -v Verbose -u Overwrite -F FILE Input (-t,-i,-p) or output (-o) file -H newc Archive format.


Ubuntu load and hang on live USB

I seem to have run into some difficulties trying to install Linux alongside my USB. I made a bootable USB stick and done all the UEFI firmware settings from which I disabled fast boot. Now when I run my USB from the boot menu, the first screen shown is the options for Linux: "try it for free", "install Ubuntu" and so on. Regardless of the option I choose, the screen just goes blank and that's it. Does anyone have any suggestions?


Booting directly in debian linux without giving username and password

I would like to skip the username and password prompt at boot-up from debian linux. I want to boot directly to the system without giving username and password.


How to put fixed-width, vertically-oriented key-value pairs in a CSV file?

I have a text file with the following type of content: `OPERATION_CONTEXT VMD1HTE1A71_ns:.oc.GJ_OAD2 alarm_object 1130 On director: VMD1HTE1A71_ns:.temip.VMD1HTE1A71_director AT Fri 18 Oct 2013 06:56:39 All Attributes`                                        Identifier = 1130                                   State = Terminated                          Problem Status = Closed                   Clearance Report Flag = True                         Escalated Alarm = False                   Close User Identifier = "Auto-Clear"             Termination User Identifier = "Auto-Clear"                        Close Time Stamp = Fri 18 Oct 2013 05:01:46                  Termination Time Stamp = Fri 18 Oct 2013 05:01:46                      Creation Timestamp = Fri 18 Oct 2013 04:37:29                    Clearance Time Stamp = Fri 18 Oct 2013 05:01:40             Last Modification Timestamp = Fri 18 Oct 2013 05:01:46                          Previous State = Outstanding                          Managed Object = Alcatel_5529OAD VMD1HTE1A71_ns:.OAD2 MD "AMS" Node "INGJJMGRJMTSNB0001AG2OLT001"                         Target Entities = { Alcatel_5529OAD VMD1HTE1A71_ns:.OAD2 MD "AMS" Node "INGJJMGRJMTSNB0001AG2OLT001" }                              Alarm Type = CommunicationsAlarm                              Event Time = Fri 18 Oct 2013 05:01:40                          Probable Cause = Unknown                       Specific Problems = {  }                 Notification Identifier = 160315                                  Domain = Domain VMD1HTE1A71_ns:.dm.GJ_OAD2                            Alarm Origin = IncomingAlarm                      Perceived Severity = Major                         Additional Text = "                                                                       nativeProbableCause: Attempt Threshold Crossed                                                                       osTime: 20131018163727.250+0530                                                                       neTime: 20131011174021.0+0530                                                                       notificationId: AMS:160315                                                                       portNumber:                                                                       ftpNumber:                                                                       meNm: INGJJMGRJMTSNB0001AG2OLT001                                                                       mdNm: AMS                                                                       objectType: OT_MANAGED_ELEMENT                                                                       aliasValue: MGMT Security                                           Access:INGJJMGRJMTSNB0001AG2OLT001:IP10.70.6.6.T0.S841 "                       Original Severity = Major                     Original Event Time = Fri 11 Oct 2013 05:40:21      I want to create a CSV file from this text file with Column headers as the values before = in each line like Identifier, State, Problem Status and all the next lines containing the values under each Column header like 1130, Terminated, Closed etc. Apart from the lines with "=" i don't want anything else to be extracted into the CSV file. Another complication i faced in this is, some fields have a new line character like Additional Text. I want to get all the value for Additional Text in one column under Additional Text Column. Since i am new to Linux/Unix, i am not able to find a way to do this. What is the best way to do this?


How to debug random reboots, with no kernel panic, of an embedded system?

I have two aValue RPC-10W1 embedded systems that reboots by themselves after 1-2 hours. Facts:   * The board will reboot within a time span of 1 to 2½ hours.   * The issue is present on two identical systems.   * The issue is present using aValue's own Linux firmware (Ubuntu 10.04).   * The issue is present with nothing other than power supply connected.   * The board is using Linux kernel 2.6.35.3.   * No kernel panic is shown in terminal. The Linux terminal is directed to a serial port at bootup.   * No warnings or errors are shown from `dmesg`. Things I've tried:   * Different root file systems:      * Stock Ubuntu 10.04 from aValue.     * Custom minimal file system created using LTIB. In aValue's user manual they describe how to use LTIB for their board.   * Compile my own kernel using the kernel sources supplied from aValue (came on a CD). Things I haven't tried:   * Check if the issue is present on their Android or WinCE releases. I've compared the Linux kernel source I received from aValue with the Freescale kernel source and they are the same + a huge single patch file from aValue. How can I proceed to determine what is causing these reboots?


Add <script> to the bottom of a html file?

I have a bunch of HTML files, and I need to add `<script src="ga.js"></script>` before each search instance of "`</body></html>`". How would I add that to the bottom of all these files?


How can I verify SSL certificates on the command line?

I'm trying to validate/verify that the rsa key, ca-bundle, and certificate stored here are ok. They are not being served by a webserver. How can I verify them?


Insert Lines after Multi-Line Regex Match

I've got an XML file I need to append to after a specific set of tags. Basically the file structure looks like this:               <key>servers</key>     <dict>     ... Server Details ...     </dict>      I would like to match on the lines:               <key>servers</key>     <dict>      and append a block of XML specifying a server connection immediately after `<dict>`. I've got the new XML block in its own text file as it's quite long. I've looked at `sed` and `awk` to do this but I've come up against a wall. I've also seen examples of using `perl` to accomplish this but I'm not so familiar with Perl. From what I understand though, `sed` and `awk` aren't great at multiline matching. The reason I need to do multiline matching is because the `<dict>` tag is used frequently within the XML file and I need to append a block into the `<key>servers</key>` section, as opposed to replacing its entire contents.


How to fake a filesystem that cannot be mounted by others

I'm currently working on a project. There's an Ubuntu Linux system installed on a disk, DA, mounting the other disk, DB. What it requires is that DB can be only mounted by DA in order to prevent data stealing. I planned to use encryption tools provided by Ubuntu to encrypt the whole disk DB. Other Linux won't be able to mount DB since they don't have the right key. However, my colleague told me it is possible to modify the kernel to make a "fake" new filesystem, say, ext9, and this new filesystem is actually `ext3` or `ext4`. Since only the new kernel knows this "new" filesystem, other Linux would never get it mounted. And since it in fact is `ext3`, software like Apache or MySQL could run normally. Is this possible or not.


Backup remote management protocol in case of faulty SSH server

I have a remote computer which I currently cannot access with SSH. The computer responds to ping but SSH gives connection refused, so I suspect the ssh-server is not working for some reason. What would be a reasonable alternative if something goes wrong with SSH in general? I had a weird idea that would allow me to perform commands on the remote computer without SSH. I could have a bash script on my http-server that the remote machine would periodically download, say once a minute with cron, and always run this script. The file would be empty normally. The resulting output could be uploaded to the same server if needed. But is there an easier way? NOTE: I'm looking for a software solution compatible with Ubuntu 12.04.


How can I make the eth1 up and always available for remote access, where eth0 will be used for host to host IPSec VPN?

I am running Amazon EC2 instance with Red hat enterprise linux, where I have two network interface. Now:   1. eth0 is currently active having public ip where I am remotely logged in via SSH, to configure VPN (once VPN is done, I wont be able to remotely access this IP and interface anymore)   2. eth1 is showing down (using amazon I have assigned on it with another new public ip but cant ping it nor I can login on it using SSH)   3. once I have eth1 up and remotely accessable, I have to configure VPN client on eth0 to connect to another remote server How can I make the eth1 up so that I have remote access on eth1 and eth0 can be dedicated for the VPN IPSec host to host?               [ec2-user@ip-10-0-0-41 ~]$ ip addr     1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 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         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 0e:29:01:a8:c6:98 brd ff:ff:ff:ff:ff:ff         inet 10.0.0.41/24 brd 10.0.0.255 scope global eth0         inet6 fe80::c29:1ff:fea8:c698/64 scope link             valid_lft forever preferred_lft forever     3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000         link/ether 0e:29:01:a9:6e:32 brd ff:ff:ff:ff:ff:ff      EDIT:               $ system-config-network-tui     eth1 is added as dhcp          $ ifup eth1     Determining IP information for eth1...      _**EDIT:_**               $ ssh amazonec2@eth0...public...ip  - fails     $ ssh amazonec2@eth1...public...ip  - allow to login     $ ip addr     1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 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         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 0e:29:01:a8:c6:98 brd ff:ff:ff:ff:ff:ff         inet 10.0.0.41/24 brd 10.0.0.255 scope global eth0         inet6 fe80::c29:1ff:fea8:c698/64 scope link             valid_lft forever preferred_lft forever     3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000         link/ether 0e:29:01:a9:6e:32 brd ff:ff:ff:ff:ff:ff         inet 10.0.0.110/24 brd 10.0.0.255 scope global eth1         inet6 fe80::c29:1ff:fea9:6e32/64 scope link             valid_lft forever preferred_lft forever      _**EDIT:_**               $ yum install openswan     $ cat /etc/ipsec.conf     version 2.0 # conforms to second version of ipsec.conf specification     config setup         protostack=netkey         nat_traversal=yes         virtual_private=         oe=off     include /etc/ipsec.d/*.conf          $ cat /etc/ipsec.d/test.conf          ### Administrator given this to setup     # Phase1: Encryption: AES128 Integrity: MD5 IKE Lifetime: 28800 sec.     # Phase2: Encryption: AES128 Integrity: MD5 IPsec lifetime: 3600 sec.          ### Red hat we use Phase 1 and Phase 2 for IPSec      conn test         type=tunnel         authby=secret         pfs=no         # Lifetime: 1440 sec         ike=aes128-md5;modp1024!         # Lifetime: 3600 sec         phase2alg=aes128-md5;modp1024         aggrmode=no             left=194.x.x.x         right=54.x.x.x         leftsubnet=10.109.0.0/24         rightsubnet=10.0.0.0/24         #auto=start          $ service ipsec restart && ipsec auto --add test     ipsec_setup: Stopping Openswan IPsec...     ipsec_setup: Starting Openswan IPsec U2.6.32/K2.6.32-358.6.2.el6.x86_64...     ipsec_setup: /usr/libexec/ipsec/addconn Non-fips mode set in /proc/sys/crypto/fips_enabled     /usr/libexec/ipsec/addconn Non-fips mode set in /proc/sys/crypto/fips_enabled          $ ipsec auto --up test     022 "test": We cannot identify ourselves with either end of this connection.        * If add works without error then config file is correct the rest is other issues for tunnel.


problem regarding YUM

I have a problem with my Centos 6. Actually, I am trying to run any command like `yum update` or `yum upgrade` or `yum install mysqlmysql-server`. Everytime, I got an error below:               Loaded plugins: fastestmirror, refresh-packagekit, security     Loading mirror speeds from cached hostfile     Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was     14: PYCURL ERROR 22 - "The requested URL returned error: 403"     Error: Cannot find a valid baseurl for repo: base


copy filenames with special characters to an external ntfs volume

I'm trying to copy the `Documents and Settings` folder of a Windows XP system over to an NTFS external disk using a USB Live of Puppy Linux. I encountered am encoding problem for namefiles in which the system doesn't recognize italian special characters (part of utf-8) so that using `cp` or the GUI file manager will bring the error `invalid or incomplete multibyte or wide character`. How can I copy the files whose names include the special characters to the NTFS drive?


Restore using dd will not boot

My current HDD is failing and I've backed it up using `dd`. After restoring the images onto a new HDD, also using `dd`, the new system will not boot. It goes through the BIOS initialization, then screen goes black, and restarts and back through BIOS. This is the old HDD setup:                  Device Boot      Start         End      Blocks   Id  System     /dev/sda1   *        2048     1026047      512000   83  Linux     /dev/sda2         1026048   103426047    51200000   83  Linux     /dev/sda3       103426048   113666047     5120000   82  Linux swap / Solaris     /dev/sda4       113666048  1250263039   568298496    5  Extended     /dev/sda5       113668096   523268095   204800000   83  Linux     /dev/sda6       523270144   625670143    51200000   83  Linux     /dev/sda7       625672192  1250263039   312295424   83  Linux      `/dev/sda1` is `/boot` `/dev/sda2` is `/` I have `dd`'ed all these 2 partitions. `/dev/sda7` is `/home` Backed it up using `rdiff-backup`. What am I missing and how could I correct this? _**EDIT 1:_** `fstab`               UUID=80c4cde7-b697-46d5-a376-24a6d6a725af /                       ext4    defaults        1 1     UUID=c1967ecb-839c-45d1-bf5b-bba046af3892 /boot                   ext4    defaults        1 2     UUID=c18998dd-0e60-4945-999f-1296b6e69307 /home                   ext4    defaults        1 2     UUID=78d39426-74d4-4299-b3ba-c9ab27a60e17 /mnt/m                  ext4    defaults        1 2     UUID=53574e4d-8af4-4aeb-bcf5-c74c7bbe4d7c /mnt/p                  ext4    defaults        1 2     UUID=3902f59a-f7a8-4ab8-896d-93642a09f083 swap                    swap    defaults        0 0     tmpfs                   /dev/shm                tmpfs   defaults        0 0     devpts                  /dev/pts                devpts  gid=5,mode=620  0 0     sysfs                   /sys                    sysfs   defaults        0 0     proc                    /proc                   proc    defaults        0 0      _**EDIT 2:_** I ended up `dd`'ing the `MBR` as _DrGlitch_ mentioned in his answer. And also I had to manually modify the `fstab` to match the new partitions' `UUID` as shown by `blkid`.


checking running process

I am new babe to Linux. So please skip to read if you are not patient with begineer. Let's say I am asked to check and shut down the processes that I am not familiar with. So when I `ls` under bin folder, I see multiple process `.sh`. But I want to know which process is associated with which tomcat process. Is there any easy way to find out that? **Example** `startmyprocess1.sh`, but when I do `ps -ef | grep startmyprocess1` doesn't return the running process. But actually the running tomcat process name is `myprocess`, so when I do `ps -ef | grep myprocess`, I can see the running process. To know that I have to ask the responsible person. So, the names are different. If like that, I need to ask him several times. Any better way to figure this out?


Can sed be used to generate a load file for my date lookup fact table?

I have an SQL fact table which is used for looking up a date and returning another date. The table schema is as follows:               TABLE date_lookup        (     pk_date DATE,     plus1_months DATE,     plus2_months DATE,     plus3_months DATE        );          UNIQUE INDEX on date_lookup(pk_date);      I have a load file (pipe delimited) containing dates from 01-28-2012 to 03-31-2014. The following is an example of the load file:               01-28-2012|02-28-2012|03-28-2012|04-28-2012|          01-29-2012|02-29-2012|03-29-2012|04-29-2012|          01-30-2012|02-29-2012|03-30-2012|04-30-2012|          01-31-2012|02-29-2012|03-31-2012|04-30-2012|          ...          03-31-2014|04-30-2014|05-31-2014|06-30-2014|      The rules for this fact table are: If pk_date has more than 28 days in its month and plus1, plus2 or plus3_months only has 28, 29 or 30 days, then let plus1, plus2 or plus3 equal the last day of the following month. My question is: Is it possible to use sed to generate more dates past 03-31-2014 following the above rules for my load file, or should I write a program to accomplish this?


How to completely remove Java 6 and install Java/JDK 7 on Linux Mint 13

How can I completely remove Java 6 and install Java/JDK 7 on Linux Mint 13?


What's a quick Launcher app which will do auto-complete?

> **Possible Duplicate:**   >  Which run dialog I'm a unix noob, looking for a good replacement to Windows 7's start menu (pressing Windows key and typing "Ch" will bring up Chrome). I was told I can just press Alt-F2 to get a launcher, but it's a bit slow, and it doesn't seem to do auto-complete (at least not out of the box)


can the "cat" command use multi-processes

I need to merge bunch of files in a directory on a unix box that has 8 cores. I am looking for a fast way to merge these files. The cat command uses only one core... is there a way where I can make it use multiple cores for parallel processing.


No programs will launch after disconnect from a internet network

I'm using Arch Linux + Xfce. When I disconnect from a internet network(WiFi or Wire), no programs will run and gets me following error:               [kamix@localhost ~]$ gedit     No protocol specified          ** (gedit:5064): WARNING **: Could not open X display     No protocol specified     Unable to init server: Could not connect: Connection refused          (gedit:5064): Gtk-WARNING **: cannot open display: :0.0