RAID-1 mirror has become a single hard disk

I have an HP N40L microserver, with 2 identical drives, I used the system to hardware-RAID them as a mirror. I then installed mint on the system about a year ago. This has been running perfectly, updating, etc. until I upgraded to Mint 17. I thought everything was fine, but I've noticed that mint is only using 1 of the drives to boot, then for some reason was showing the contents of the other drive. i.e. it boots `sdb1`, but `df` shows `sda1`. I'm _sure_ `df` used to show a `/dev/mapper/pdc_bejigbccdb1` drive which was the RAID array. Thus any updates to Grub go to `sda1`, but it boots `sdb1` then loads the fs `sda1`.               N40L marty # df     Filesystem     1K-blocks      Used Available Use% Mounted on     /dev/sda1      233159608 113675036 107617644  52% /     none                   4         0         4   0% /sys/fs/cgroup     /dev             2943932        12   2943920   1% /media/sda1/dev     tmpfs             597588      1232    596356   1% /run     none                5120         0      5120   0% /run/lock     none             2987920         0   2987920   0% /run/shm     none              102400         4    102396   1% /run/user      From `cat /etc/fstab`               N40L marty # cat /etc/fstab     # /etc/fstab: static file system information.     #     # Use 'blkid' to print the universally unique identifier for a     # device; this may be used with UUID= as a more robust way to name devices     # that works even if disks are added and removed. See fstab(5).     #     # <file system> <mount point>   <type>  <options>       <dump>  <pass>     proc            /proc           proc    nodev,noexec,nosuid 0       0     /dev/mapper/pdc_bejigbccdb1 /               ext4    errors=remount-ro 0       1     /dev/mapper/pdc_bejigbccdb5 none            swap    sw              0       0      If I do `ls /dev/mapper/` I get               N40L marty # ls /dev/mapper     total 0     crw------- 1 root root 10, 236 Jul 24 17:03 control      How do I get my raid back and how do I get grub to boot to it? * * * Further update:               N40L grub # dmraid -r     /dev/sdb: pdc, "pdc_bejigbccdb", mirror, ok, 486328064 sectors, data@ 0     /dev/sda: pdc, "pdc_bejigbccdb", mirror, ok, 486328064 sectors, data@ 0          N40L grub # dmraid -s     *** Set     name   : pdc_bejigbccdb     size   : 486328064     stride : 128     type   : mirror     status : ok     subsets: 0     devs   : 2     spares : 0          N40L grub # dmraid -ay -vvv -d     WARN: locking /var/lock/dmraid/.lock     NOTICE: /dev/sdb: asr     discovering     NOTICE: /dev/sdb: ddf1    discovering     NOTICE: /dev/sdb: hpt37x  discovering     NOTICE: /dev/sdb: hpt45x  discovering     NOTICE: /dev/sdb: isw     discovering     DEBUG: not isw at 250059348992     DEBUG: isw trying hard coded -2115 offset.     DEBUG: not isw at 250058267136     NOTICE: /dev/sdb: jmicron discovering     NOTICE: /dev/sdb: lsi     discovering     NOTICE: /dev/sdb: nvidia  discovering     NOTICE: /dev/sdb: pdc     discovering     NOTICE: /dev/sdb: pdc metadata discovered     NOTICE: /dev/sdb: sil     discovering     NOTICE: /dev/sdb: via     discovering     NOTICE: /dev/sda: asr     discovering     NOTICE: /dev/sda: ddf1    discovering     NOTICE: /dev/sda: hpt37x  discovering     NOTICE: /dev/sda: hpt45x  discovering     NOTICE: /dev/sda: isw     discovering     DEBUG: not isw at 250059348992     DEBUG: isw trying hard coded -2115 offset.     DEBUG: not isw at 250058267136     NOTICE: /dev/sda: jmicron discovering     NOTICE: /dev/sda: lsi     discovering     NOTICE: /dev/sda: nvidia  discovering     NOTICE: /dev/sda: pdc     discovering     NOTICE: /dev/sda: pdc metadata discovered     NOTICE: /dev/sda: sil     discovering     NOTICE: /dev/sda: via     discovering     DEBUG: _find_set: searching pdc_bejigbccdb     DEBUG: _find_set: not found pdc_bejigbccdb     DEBUG: _find_set: searching pdc_bejigbccdb     DEBUG: _find_set: not found pdc_bejigbccdb     NOTICE: added /dev/sdb to RAID set "pdc_bejigbccdb"     DEBUG: _find_set: searching pdc_bejigbccdb     DEBUG: _find_set: found pdc_bejigbccdb     DEBUG: _find_set: searching pdc_bejigbccdb     DEBUG: _find_set: found pdc_bejigbccdb     NOTICE: added /dev/sda to RAID set "pdc_bejigbccdb"     DEBUG: checking pdc device "/dev/sda"     DEBUG: checking pdc device "/dev/sdb"     DEBUG: set status of set "pdc_bejigbccdb" to 16     DEBUG: checking pdc device "/dev/sda"     DEBUG: checking pdc device "/dev/sdb"     DEBUG: set status of set "pdc_bejigbccdb" to 16     RAID set "pdc_bejigbccdb" was not activated     WARN: unlocking /var/lock/dmraid/.lock     DEBUG: freeing devices of RAID set "pdc_bejigbccdb"     DEBUG: freeing device "pdc_bejigbccdb", path "/dev/sda"     DEBUG: freeing device "pdc_bejigbccdb", path "/dev/sdb"      So my system sees the two drives and sees they should be part of an array, but will not activate the array and this not create `/dev/mapper/pdc_bejigbccdb` so I cannot load grub to it and boot from it. How do I get dmraid to activate and create the mapper entry?


why are there 3 debian DVD isos + 2 update DVD isos in my local debian mirror?

I want to try Debian for the 1st time and I wanted to download the full DVD so I went to my local Debian mirror and what I see are 3 DVDs and 2 update DVDs. what is each? Do I need more than just the 1st DVD?


Is PAM a user authentication method?

If someone asks that **PAM is a user authentication method**? Then can we say yes? Or no?


How to su to www on OpenBSD?

I have a PHP script that I wish to run under the www account. The account has nologin as shell and is used by Apache. When I run "su -l www -s /bin/ksh" as root, I get the following message: This account is currently not available. I use OpenBSD 5.2


What does the Chromium option `--no-sandbox` mean?

I'm running Chromium like so : `chromium --no-sandbox` I'm doing this because I'm running Debian Squeeze on an OpenVZ VM Container and it's the only way I can get it to work. Though I keep reading **this is terrible**. But I want to know why exactly. Can someone please explain it to me? Does someone need to hack into your computer to do damage? Or does the vulnerability come from a file on the web like a JavaScript file? What if I locked browsing down to only a handful of "trusted" sites? (Gmail, stackexchange (ofcourse), and facebook)


How to force lp from CUPS to print in grayscale?

I want to print an image from a command line:               lp -o scaling=//100// image.jpg      How can I force it to be printed in grayscale?


Cannot install Fedora 18

I have a Dell Inspiron laptop with 2.5GB RAM and 120GB HDD. I have windows 7 and Ubuntu installed side by side. I have another 30GB space where I want to install Fedora 18 but when I try to install it, I get the following error               /dev/root not found      Can anyone tell me how to overcome this. I get the error as soon as I click to install it.


eCryptFS automounting issue

I'm running Arch Linux and am trying to setup an encrypted folder with eCryptFS. I've followed the tutorial on Arch's Wiki for manual installation, it's actually working. The problem occurs when I try to automount this directory on boot time. I have this entry in my `/etc/fstab`:               /home/henrique/.secret /home/henrique/secret ecryptfs user,rw,nosuid,nodev,relatime,ecryptfs_fnek_sig=5fe512dc3ad6af7e,ecryptfs_sig=e7a764a16f23b1e4,ecryptfs_cipher=aes,ecryptfs_key_bytes=16,ecryptfs_unlink_sigs  0 0      When booting, I obtain this in my journal:               Jun 08 01:45:15 henrique-pc kernel: Key type trusted registered     Jun 08 01:45:15 henrique-pc kernel: sha256_ssse3: Using AVX optimized SHA-256 implementation     Jun 08 01:45:15 henrique-pc kernel: Key type encrypted registered     Jun 08 01:45:15 henrique-pc mount.ecryptfs[595]: Key module [openssl] does not have a subgraph transition node; attempting to build a linear subgraph from its parameter list     Jun 08 01:45:15 henrique-pc mount.ecryptfs[595]: Key module [openssl] has empty parameter list     Jun 08 01:45:15 henrique-pc mount[594]: Select key type to use for newly created files:     Jun 08 01:45:15 henrique-pc mount[594]: 1) passphrase     Jun 08 01:45:15 henrique-pc mount[594]: 2) openssl     Jun 08 01:45:15 henrique-pc mount[594]: Selection: Error attempting to evaluate mount options: [-5] Input/output error     Jun 08 01:45:15 henrique-pc mount[594]: Check your system logs for details on why this happened.     Jun 08 01:45:15 henrique-pc mount[594]: Try updating your ecryptfs-utils package, and/or     Jun 08 01:45:15 henrique-pc mount[594]: submit a bug report on https://bugs.launchpad.net/ecryptfs     Jun 08 01:45:15 henrique-pc systemd[1]: home-henrique-secret.mount mount process exited, code=exited status=251     Jun 08 01:45:15 henrique-pc systemd[1]: Failed to mount /home/henrique/secret.     -- Subject: Unit home-henrique-secret.mount has failed     -- Defined-By: systemd     -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel     --      -- Unit home-henrique-secret.mount has failed.     --      -- The result is failed.     Jun 08 01:45:15 henrique-pc systemd[1]: Dependency failed for Local File Systems.     -- Subject: Unit local-fs.target has failed     -- Defined-By: systemd     -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel     --      -- Unit local-fs.target has failed.     --      -- The result is dependency.     Jun 08 01:45:15 henrique-pc systemd[1]: Triggering OnFailure= dependencies of local-fs.target.     Jun 08 01:45:15 henrique-pc systemd[1]: Unit home-henrique-secret.mount entered failed state.     Jun 08 01:45:15 henrique-pc systemd[1]: Closed CUPS Printing Service Sockets.     -- Subject: Unit cups.socket has finished shutting down     -- Defined-By: systemd     -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel      I've configured my `/etc/security/pam_mount.conf.xml` just as the tutorial says so:               <luserconf name=".pam_mount.conf.xml" />     <mntoptions require="" />      <lclmount>mount -i %(VOLUME) "%(before=\"-o\" OPTIONS)"</lclmount>       Here is the `systemctl status` of this process. I think it's strange that the mount script doesn't use the `-i` option that I've declared in my `/etc/security/pam_mount.conf.xml`:               ● home-henrique-secret.mount - /home/henrique/secret        Loaded: loaded (/etc/fstab)        Active: failed (Result: exit-code) since Dom 2014-06-08 02:11:24 BRT; 1min 42s ago         Where: /home/henrique/secret          What: /home/henrique/.secret          Docs: man:fstab(5)                man:systemd-fstab-generator(8)       Process: 433 ExecMount=/bin/mount /home/henrique/.secret /home/henrique/secret -t ecryptfs -o user,rw,nosuid,nodev,relatime,ecryptfs_fnek_sig=5fe512dc3ad6af7e,ecryptfs_sig=e7a764a16f23b1e4,ecryptfs_cipher=aes,ecryptfs_key_bytes=16,ecryptfs_unlink_sigs (code=exited, status=251)[/b]          [b]Jun 08 02:11:24 henrique-pc mount[433]: Select key type to use for newly created files:     Jun 08 02:11:24 henrique-pc mount[433]: 1) passphrase     Jun 08 02:11:24 henrique-pc mount[433]: 2) openssl     Jun 08 02:11:24 henrique-pc mount[433]: Selection: Error attempting to evaluate mount options: [-5] Input/output error     Jun 08 02:11:24 henrique-pc mount[433]: Check your system logs for details on why this happened.     Jun 08 02:11:24 henrique-pc mount[433]: Try updating your ecryptfs-utils package, and/or     Jun 08 02:11:24 henrique-pc mount[433]: submit a bug report on [url]https://bugs.launchpad.net/ecryptfs[/url]     Jun 08 02:11:24 henrique-pc systemd[1]: home-henrique-secret.mount mount process exited, code=exited status=251     Jun 08 02:11:24 henrique-pc systemd[1]: Failed to mount /home/henrique/secret.     Jun 08 02:11:24 henrique-pc systemd[1]: Unit home-henrique-secret.mount entered failed state.      The problem, I think, is that my keyring is empty, but I'm not prompted to enter a passphrase. Although, I really shouldn't be prompted and the passphrase should be loaded with this script:               #!/bin/sh     #     #    /usr/local/bin/doecryptfs          exit $(/usr/sbin/pmvarrun -u$PAM_USER -o0)      I've configured the files `system-auth`, `login` and `gdm` inside the `/etc/pam.d` directory with this:               auth    [success=ignore default=1]    pam_exec.so     quiet /usr/local/bin/doecryptfs      But it doesn't work. **Another important thing:** It seems like the `$PAM_USER` variable is never set, so this probably makes the script fail. In order to mount this folder, I need to login first (without the entry in `/etc/fstab`), add the passphrases to my keyring and only after that, I can't mount it using `mount.ecryptfs_private` command. The tutorial is kind of confusing. I'm not sure if I didn't screw it up at some point.


Where is the documentation for net.ipv4.conf.all.log_martians?

Where is the documentation for `net.ipv4.conf.all.log_martians` sysctl setting? There are man pages for various other TCP/IP/UDP (`man 7 tcp`, `man 7 upd`, `man 7 ip`) settings, but I cant find the `net.ipv4.conf.all.log_martians` docs. Note: I want official documentation from Linux; not random sites from google.


Java fails with “Could not find the main class”

I want to run a jar file in Linux (CentOS, 32-bit). But the following error occurs. What is the reason?               [root@server ~]# java -jar keygen.jar     Exception in thread "main" java.lang.UnsupportedClassVersionError: org/dgt/jl/App : Unsupported major.minor version 51.0             at java.lang.ClassLoader.defineClass1(Native Method)             at java.lang.ClassLoader.defineClass(ClassLoader.java:643)             at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)             at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)             at java.net.URLClassLoader.access$000(URLClassLoader.java:73)             at java.net.URLClassLoader$1.run(URLClassLoader.java:212)             at java.security.AccessController.doPrivileged(Native Method)             at java.net.URLClassLoader.findClass(URLClassLoader.java:205)             at java.lang.ClassLoader.loadClass(ClassLoader.java:323)             at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)             at java.lang.ClassLoader.loadClass(ClassLoader.java:268)     Could not find the main class: org.dgt.jl.App. Program will exi      My Java version:               java version "1.6.0_24"     OpenJDK Runtime Environment (IcedTea6 1.11.14) (rhel-1.42.1.11.14.el5_10-i386)     OpenJDK Client VM (build 20.0-b12, mixed mode)


Start and stop multiple executable for easy debugging

I'm debugging a networking project, which involves interacting of 3 programs, ie a server, two different clients. However I find it difficult to start and stop them for debugging. Some methods I have tried so far:   * Start 3 terminals. Run `./server`, `./client1`, `./client2`. The problem with this method is I need to switch back and forth between windows.   * Start 1 terminal. Put these in a script: `./server &;./client1 &;./client2 &`. Run the script. The problem with this method is killing the processes after debugging is hard. Need to look up PID and type `kill <PID>`. Is there a better way to do this? How do people usually debug in that situation?


Case-insensitive substring search in a shell script

I'm trying to create a script which runs a command and compares the output of that command to a certain string to see if it contains that substring, ignoring the case of the string needed to be compared. I hope what I'm asking is clear, though.


grep and brackets in text

I store downloaded files in a log like this:               [source] filename      To avoid downloading a file more than once I grep for `[source] filename` before:               if ! grep "$signature" downloaded.log > /dev/null; then         wget ...     fi      **but** starting my line with `[` grep does not work the way I need:               signature="[source] filename"     echo $signature | grep "$signature"     echo $signature | grep "\$signature" #trying to escape first bracket      both return nothing. Any smart workaround? It would be nice also having no need to change the code switching to parens `()`, braces `{}`, or whatever `<>`


Font rendering - Infinality patches on Ubuntu

There is a Ubuntu PPA https://launchpad.net/~no1wantdthisname/+archive/ppa?field.series_filter= with patches for Infinality оn Freetype and Cairo for 11.04 11.10 12.04 12.10 13.04 But the updates are done only for 12.10 and 13.04. For 12.10 and 13.04 the patches are only for Freetype. I want to update the packages. How to apply these patches? I want to apply a patch to Cairo against 12.10 and 13.04. There is a How to Enable Infinality Font Rendering but I can not get it to apply without error. How to acheive this?


how to install ast python package

I'm using django constance in my project. This app used a python package ast. When I try to install that package using command `pip-2.7 install ast`, it results as "`Could not find any downloads that satisfy the requirement ast`". Can some one help me how to install this package in CentOS? I tried searching in google, unfortunately I couldn't find any link.


conceal home folder completely - is ecryptfs the right choice?

On my Debian-Testing-System, I want to completely conceal the home folders. That means, I not only want the data to be encrypted, but I also want to preclude determining any (or most) information from the encrypted data. For instance, also file names should be encrypted. But not being an expert for data protection, maybe also other file/folder attributes need to be encrypted to grant privacy. I considered ecryptfs to achieve this (Package ecryptfs-utils) However, is this the right choice for my needs? I also would appreciate links to step-by-step instructions on the implementation of encrypted home-folders in Debian very much! [edit] I do a fresh install, therefore it's not necessary to migrate a previously unencrypted home folder.


Is it better to set -j REJECT or -j DROP in iptables?

There's an example of iptables rules on archlinux wiki:               # Generated by iptables-save v1.4.18 on Sun Mar 17 14:21:12 2013     *filter     :INPUT DROP [0:0]     :FORWARD DROP [0:0]     :OUTPUT ACCEPT [0:0]     :TCP - [0:0]     :UDP - [0:0]     -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT     -A INPUT -i lo -j ACCEPT     -A INPUT -m conntrack --ctstate INVALID -j DROP     -A INPUT -p icmp -m icmp --icmp-type 8 -m conntrack --ctstate NEW -j ACCEPT     -A INPUT -p udp -m conntrack --ctstate NEW -j UDP     -A INPUT -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -m conntrack --ctstate NEW -j TCP     -A INPUT -p udp -j REJECT --reject-with icmp-port-unreachable     -A INPUT -p tcp -j REJECT --reject-with tcp-reset     -A INPUT -j REJECT --reject-with icmp-proto-unreachable     COMMIT     # Completed on Sun Mar 17 14:21:12 2013      A few days ago my friend asked me why is there `REJECT` in the last three rules. He told me that there should be `DROP` instead, and he mentioned something about better security in case of `DROP`. So, I have two questions:   1. What do the three rules do?   2. Does it make any difference when I put there `DROP` in place `REJECT --reject-with` ? If yes, what is the difference?


tcpdump of SCCP or GSM MAP messages

Right now I'm using `tcpdump -i <interface_name> -p <port> -s0 -w /tmp/file.cap` and then filter the capture in wireshark. How can I take packet capture with tcpdump only on SCCP or GSM_MAP protocols and drop the sctp heartbeat messages? Any other solution will also be good :) OS: RedHat


Mutt index disappearing on IMAP reconnect

`Mutt` IMAP is working just fine ... until IMAP server drops the connection. Then `mutt` automatically reconnects to the server - also just fine, according to the messages in the status line - but! **it clears the list of messages in its index screen** upon reconnect and requires manual reentry into the mailbox to regenerate the message list, which is virtually equal to a `mutt` restart! Happens with all IMAP servers I tried: Gmail, Dovecot, CyrusIMAP. This is a major annoyance especially when you have done a big selection of messages for a group operation and suddenly you have start all over. Or am I perhaps missing something? May it be that `mutt` doesn't reconnect really, gives misleading status messages and I need a `mutt next generation`?


GUI for find which can show video thumbnails

Is there a GUI for `find` (or just a graphical search tool which supports regex searches on filenames starting from a specific directory) which is able to show thumbnails found video and image files? I don't want something which uses an index like `recoll`, `tracker` or something like that in this case.


What is causing my UMTS modem to hang up?

I am trying to established PPP communication to my mobile ISP with `wvdial`, but I always get **modem hang up** message. In my `syslog` I can see some activity:               Oct 29 07:48:47 linuxbox kernel: [31222.852253] PPP generic driver version 2.4.2     Oct 29 07:48:47 linuxbox pppd[24590]: pppd 2.4.5 started by root, uid 0     Oct 29 07:48:47 linuxbox pppd[24590]: Using interface ppp0     Oct 29 07:48:47 linuxbox pppd[24590]: Connect: ppp0 <--> /dev/ttyUSB2     Oct 29 07:48:47 linuxbox pppd[24590]: CHAP authentication succeeded     Oct 29 07:48:47 linuxbox pppd[24590]: CHAP authentication succeeded     Oct 29 07:48:47 linuxbox kernel: [31223.014123] PPP BSD Compression module registered     Oct 29 07:48:47 linuxbox kernel: [31223.061839] PPP Deflate Compression module registered     Oct 29 07:48:47 linuxbox ifplugd(ppp0)[24612]: ifplugd 0.28 initializing.     Oct 29 07:48:47 linuxbox ifplugd(ppp0)[24612]: Using interface ppp0/00:00:00:00:00:00     Oct 29 07:48:47 linuxbox ifplugd(ppp0)[24612]: Using detection mode: IFF_RUNNING     Oct 29 07:48:47 linuxbox ifplugd(ppp0)[24612]: Initialization complete, link beat detected.     Oct 29 07:48:47 linuxbox ifplugd(ppp0)[24612]: Executing '/etc/ifplugd/ifplugd.action ppp0 up'.     Oct 29 07:48:47 linuxbox ifplugd(ppp0)[24612]: client: Ignoring unknown interface ppp0=ppp0.     Oct 29 07:48:47 linuxbox ifplugd(ppp0)[24612]: Program executed successfully.     Oct 29 07:49:08 linuxbox pppd[24590]: Modem hangup     Oct 29 07:49:08 linuxbox pppd[24590]: Connection terminated.     Oct 29 07:49:08 linuxbox avahi-daemon[1946]: Withdrawing workstation service for ppp0.     Oct 29 07:49:08 linuxbox pppd[24590]: Exit.     Oct 29 07:49:08 linuxbox ifplugd(ppp0)[24612]: Link beat lost.     Oct 29 07:49:08 linuxbox ifplugd(ppp0)[24612]: Exiting.     Oct 29 07:49:13 linuxbox pppd[24697]: pppd 2.4.5 started by root, uid 0     Oct 29 07:49:13 linuxbox pppd[24697]: Using interface ppp0     Oct 29 07:49:13 linuxbox pppd[24697]: Connect: ppp0 <--> /dev/ttyUSB2     Oct 29 07:49:14 linuxbox pppd[24697]: CHAP authentication succeeded     Oct 29 07:49:14 linuxbox pppd[24697]: CHAP authentication succeeded     Oct 29 07:49:14 linuxbox ifplugd(ppp0)[24711]: ifplugd 0.28 initializing.     Oct 29 07:49:14 linuxbox ifplugd(ppp0)[24711]: Using interface ppp0/00:00:00:00:00:00     Oct 29 07:49:14 linuxbox ifplugd(ppp0)[24711]: Using detection mode: IFF_RUNNING     Oct 29 07:49:14 linuxbox ifplugd(ppp0)[24711]: Initialization complete, link beat detected.     Oct 29 07:49:14 linuxbox ifplugd(ppp0)[24711]: Executing '/etc/ifplugd/ifplugd.action ppp0 up'.     Oct 29 07:49:14 linuxbox ifplugd(ppp0)[24711]: client: Ignoring unknown interface ppp0=ppp0.     Oct 29 07:49:14 linuxbox ifplugd(ppp0)[24711]: Program executed successfully.     Oct 29 07:49:35 linuxbox pppd[24697]: Modem hangup     Oct 29 07:49:35 linuxbox pppd[24697]: Connection terminated.     Oct 29 07:49:35 linuxbox avahi-daemon[1946]: Withdrawing workstation service for ppp0.     Oct 29 07:49:35 linuxbox pppd[24697]: Exit.     Oct 29 07:49:35 linuxbox ifplugd(ppp0)[24711]: Link beat lost.     Oct 29 07:49:36 linuxbox ifplugd(ppp0)[24711]: Exiting.      What is causing this problem?


Flash samsung wave (alternative for Multiloader)

There is a suitable software for flashing Samsung Wave named "Multiloader". But its a Microsoft windows software. Is there any suitable program, an alternative for Multiloader in Linux?


dav2fs caching problem on Debian Squeeze

I have `apache`/`mod_dav` and `davfs2` all on the same host. `davfs2` is used to mount what Apache is serving to the local filesystem - a sort of loopback. The purpose is that the content of the files served is dynamic and comes from a postgres database via php. In this case the file is an email footer/disclaimer that changes periodically and is read by the mail program. This mostly works well, but when I try to `cp` a file from the dav directory to another part of the filesystem, it `cp` does not seem to trigger the 'has the file changed' check in davfs2 - it just gets the cached copy. Note the php file has not changed, only the dynamic content because something has been updated in the database. On the other hand, if I `cp` again 5 seconds later, the correct file contents is copied. I've ended up with a script like this:               #!/bin/bash     cp /root/pgdav/disclaimer.html /etc/postfix/disclaimer.html     sleep 5     cp /root/pgdav/disclaimer.html /etc/postfix/disclaimer.html      Caching related headers in php are set as follows:               header("Cache-Control: no-store, no-cache, must-revalidate");     header("Cache-Control: post-check=0, pre-check=0", false);     header("Pragma: no-cache");      I've set `file_refresh 0` in `davfs2.conf`. My question is: Is there some other setting I am missing to correct this behaviour?


RDP only Operating System

I am looking for an operating system where the login screen asks for a username and password for an rdp login prompt. I want an administrator to also be able to login to change the i.p. address for the server that hosts the accounts. Any suggestions?


Samba: Sharing some folders without duplicate?

I keep all my `Photos` on my Share: `//COMPUTERNAME/Photos` In the `Photos` share, it contains all the years folders follow by album name, example:               //COMPUTERNAME/Photos/2012/New York/     //COMPUTERNAME/Photos/2011/France/     //COMPUTERNAME/Photos/2011/Party Night/      Only I have access to `Photos` share with username and password, it is not accessible by anyone. However, I want to share a few photos albums for my family but I don't want them to have access to the `Photos` share. I can create a share called `//COMPUTERNAME/PhotosShare/` but I don't want to copy a few photos albums from `Photos` share. In the `//COMPUTERNAME/PhotosShare/` share I want something like this: `//COMPUTERNAME/PhotosShare/2012 New York` link with `//COMPUTERNAME/Photos/2012/New York/` Is it possible to use `ln` command? I don't think that going to work due to user permission access on Samba. What is the solution?


How can I convert this bash function to the fish shell

I'm trying out the fish shell 2.0 to replace bash. I'm trying to convert the following bash function to a fish function, but its giving me hell. I have a several similar functions so if someone could point me in the right direction with an example I would be very grateful               connect() {         if [ "$2" != "" ]         then                 ssh -ti ~/.ssh/work/id_rsa user@host$1.domain.com "sudo ssh $2"         fi         if [ "$2" == "" ]         then                 ssh -ti ~/.ssh/work/id_rsa user@host$1.domain.com "sudo -i"         fi     }      Tried just replacing $1 and $2 with $argv[1] and $argv[2] but it complains about not being able to locate the end of block. I know its because the scripting synxtax is quite different in fish. I tried starting from a simpler function and had troubles with figuring out how to get it to do one thing if 1 variable is passed, and another thing if 2 variables are passed:               function testvarz         switch "$argv[2]";                 case ""                         echo "no second variable passed"                 case != ""                         echo "second variable passed"         end          end      but that doesn't work, if you pass 2 variable it does nothing, if you pass 1 it complains about


Safe way to pass password for >1 programs in bash

I'm writing a `bash` script, and need to ask user for his password and pass it to `openssl`. Whilst `openssl` can read the password itself, I need for two runs of the program and don't want to ask the user twice. Here is the script:               cp file{,.old}     read -sp 'Enter password. ' PASS; echo     export PASS          # decode | edit | encode     openssl enc -d -aes-256-cbc -k "$PASS" -in file.old | \       sed ... | openssl enc -e -aes-256-cbc -k "$PASS" -out file          unset PASS      This is not safe as the password is easily available by looking at the command line; somebody can read it using `ps`, for example. `openssl` can read a password from an environment variable, so I can replace `-k "$PASS"` with `-pass env:PASS`, but it's still not safe; the environment variables of any process can be read freely (again, `ps` can do it). So, how can I safely pass the password to the two `openssl` instances?


Backed an ipod up with dd, how to retrieve all tracks in one go with gnupod?

I have had gnupod for a while. Still haven't figured out how to use it though. I usually just go for gtkpod. So this question, in case anyone had any doubts after reading everything below, _is purely about gnupod syntax_. Recently I decided to get my ipod replaced under this replacement scheme. (I don't like proprietary hardware, etc., but if someone is going to give me a brand new piece of hardware... for something that was originally a gift... hmm...) Anyway, long story short, I backed up my old ipod using dd:               dd if=/dev/sdb2 of=ipodbk      and just tried running gtkpod (with ipodbk mounted as `-t vfat -o loop`) to see if it would pick it up, like it does when an ipod is attached, which it does. But this question is not about that. I don't want to waste time with gtkpod's bugginess when it comes to exporting an entire ipod's files (tried it before. ended up with a lot of 0 byte files... no thanks). I just want to be able to export all the tracks from the disk image in one go. The command probably looks something like               gnupod_something (some switches) -m /home/user/ipodbkmount/ (some stuff?)      and the output probably looks something like               (window flooded with 1000 lines of text)      but I've never really been able to get `gnupod` to work. I'm sure it's a great program, and I have to usually invoke it as `gnupod_check -m ipod --fixit` once in a while when `gtkpod` loses track of what it's doing and makes errors when it writes files to the device. As for `gnupod`, I'm just not intelligent enough to figure out its syntax on the more routine ipod manipulations, I think. So, yeah, what's that command?


Did all of the Requests for Comments directly affect the design of Unix networks?

_I want to know more about Linux_ must be one of my most enduring sentiments. But I often find that I learn the most, or perhaps just feel the most satisfied with what I have learned, when I simply crack open the history books. What's hiding in `/etc` and `/dev` that I don't know about? Well, files. Everything is a file. But what put those files there? History put them where they are, and history dictated how they were written, yadda yadda yadda. According to `man hosts`                  Historical Notes            RFC 952 gave the original format for the host table, though it has since changed.                 Before the advent of DNS, the host table was the only way of resolving hostnames on the fledgling Internet.  Indeed, this file could            be created from the official host data base maintained at the Network Information Control Center (NIC), though  local  changes  were            often  required to bring it up to date regarding unofficial aliases and/or unknown hosts.  The NIC no longer maintains the hosts.txt            files, though looking around at the time of writing (circa 2000), there are historical hosts.txt files on the  WWW.   I  just  found            three, from 92, 94, and 95.      Great. So that gives me something to chew on. I wanna know how Linux works, and in particular I wanna know why Linux networking looks the way it does, so I'll just go read RFC 952. But, oh, wait... It's _really short_. And there are hundreds of RFC documents. Hmm... Before trying to tackle these, I gotta know, did _all_ of the Request for Comments (RFC) documents directly impact the design of Unix and Linux? Should I be trying to get my head around all of them, or just a subset?


iptables, how to redirect port from loopback?

The main rules are:               OUTIF=eth0      /sbin/iptables --policy INPUT DROP      /sbin/iptables --policy FORWARD DROP      /sbin/iptables --policy OUTPUT ACCEPT      /sbin/iptables -A INPUT -i lo -j ACCEPT      /sbin/iptables -A INPUT -i $OUTIF -m state --state RELATED,ESTABLISHED -j ACCEPT      I want mysql to listen on `lo` at port 3306 port. And I also want it to listen at port 33060 on the WAN interface (`eth0`) as I want to keep it away from bots. I've tried several redirections with no success. For example:               /sbin/iptables -A INPUT -p tcp -i $OUTIF --dport 34306 -j ACCEPT     /sbin/iptables -A PREROUTING -t nat -p tcp -s 0/0 --dport 34306 \                    -j DNAT --to 127.0.0.1:3306      How can I do this? EDITED: I'm going to use redir however I still want to know how to do this with iptables.


How to download .pdf files from pubmed

I can't download `.pdf` files from http://www.ncbi.nlm.nih.gov/pmc/articles, I already have some document IDs such as PMC3404089. I tried to issue the following command:               curl -o file.pdf http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3404089       The command downloaded a file, `file.pdf`, but it is an empty file.


How to remove character and space from a string

Hello I have one file with output               Name        : ABC     Name        : CDE     Name        : ZYS      I want to get the result               ABC     CDE     ZYS      How can i get it through SED command. I have tried. `sed s/'Name'` but it returns me the output like`: ABC` I want to trim the space and also `:` from the string.


OpenSSL buffering problem

I have a stream that I would like to encrypt in real time, but the problem is that `openssl` encrypt only when it could read from stdin enough bytes, otherwise it waits. Look at those examples:               $ (echo Hello world; sleep 3) | cat -     Hello world     $ (echo Hello world; sleep 3) | openssl base64 | openssl base64 -d     Hello world      In the first case you see the output immediately, in the second one you have to wait three seconds. How could I could avoid this behavior? I tried `unbuffer -p` and `stdbuf -i0`, but they don't work in this case. In order to be more clear, I show you how I'm trying to use it (those are commands in order to send an audio stream over the network):               ### Not encrypted: works well     # Server     nc -ul 1234 | gst-launch fdsrc ! opusparse ! opusdec ! fdsink | pacat --latency-msec=20     # Client     parec --latency-msec=20 | gst-launch fdsrc ! audioparse rate=48000 channels=2 ! opusenc ! fdsink | nc -u localhost 1234          ### Encrypted: doesn't work     # Server     nc -l -u 1234 | openssl aes-256-cbc -pass pass:test -salt -d | gst-launch fdsrc ! opusparse ! opusdec ! fdsink | pacat --latency-msec=20     # Client     parec --latency-msec=20 | gst-launch fdsrc ! audioparse rate=48000 channels=2 ! opusenc ! fdsink | openssl aes-256-cbc -pass pass:test -salt | nc -u localhost 1234


Uniquely identifying java processes with same name

I have two java processes which run using the same file name, `MyApp.jar` (for example).               /usr/java/latest/bin/java -jar MyApp.jar      These jars exist in different places and use different configurations. I want to be able to kill one process, but don't know how to distinguish between the two. I execute:                ps aux | grep [M]yApp.jar      And get:               admin    21509  0.8  0.1 1199908 20484 ?       Sl   08:21   0:00 /usr/java/latest/bin/java -jar MyApp.jar     admin    21585  6.7  0.1 1199764 20084 ?       Sl   08:21   0:00       I've thought of creating the process with some dummy parameter to be able to distinguish them:               /usr/java/latest/bin/java -jar MyApp.jar MyAppTheFirst      and               /usr/java/latest/bin/java -jar MyApp.jar MyAppTheSecond      But this seems a bit wrong to me. Is there a better way?


How do you create and execute a bash script which calls an executable from higher folder?

I'm attempting to write a very simple script which calls an executable from a higher level folder. If I were just typing the command into the console, I would type               ../filenamehere {options} {parameters}      When I try to do the same thing in a .sh file in order to run multiple processes at the same time, I attempt to write the following:               ../filename {options} {parameters} &     ../filename {options2} {parameters} &     ../filename {options3} {parameters} &     ../filename {options4} {parameters} &      Then, to run the file, I entered               chmod a+x script_file.sh     ./script_file.sh      After which point I was given a "command not found" error 3 times. I assume this means that 1 of my 4 commands executed, but the other 3 didn't. If I type directly into the console exactly the same commands as I put in the .sh file, nothing goes wrong. What do I need to do to make this file run?


Determining the particular processor on which a process is running

I have access to an 8-core node of a Linux cluster. When logged in to the node, I can see a list of processors using this command:               more /proc/cpuinfo      In my 8-core node, the processors are numbered from 0 to 7. Each processor is an Intel Xeon CPU (E5430 @ 2.66GHz). Now suppose I call the program `foo` with some arguments `args`:               foo args      The program `foo` takes a long time to execute (hours or days, for example). Having called `foo`, is it possible to determine the _particular_ processor (i.e., 0 to 7) on which `foo` is running? The `top` program shows me the process ID and similar information, but I don't see the processor _number_. Is such information available?


Safer way for granting permissions for self user?

I know sometimes we can do `chmod 777` so we have a directory at our complete reach for accessing, reading and writing. But usually I prefer to do a `sudo chown {myusername} {directory}`. Obviously, the `chmod 777` leaves a directory completely open to anyone, but, does my practice of using `sudo chown ...` actually offer protection to my directories vs. the `chmod 777`?


Can I safely delete the Ubuntu 12.04 partition and use the unallocated space for my Elementary OS?

I have this setup: ![image](http://i.stack.imgur.com/9zfOg.png) I've decided to switch to Elementary OS Luna (fork of Ubuntu 12.04) as my main Linux distro. Now I need to delete my Ubuntu partition so I could add capacity to my eOS which only has 10Gb. Currently my eOS is in `/dev/sda9`, and Ubuntu in `/dev/sda8/`. I forgot where my bootloader is installed, so I ran bootinfoscript, which returned this: `============================= Boot Info Summary: =============================== => Grub2 (v1.99) is installed in the MBR of /dev/sda and looks at sector 1 of the same hard drive for core.img. core.img is at this location and looks in partition 94 for . sda1: **___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __**               File system:       ntfs     Boot sector type:  Windows Vista/7: NTFS     Boot sector info:  No errors found in the Boot Parameter Block.     Operating System:       Boot files:        /bootmgr /Boot/BCD      sda2: **___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __**               File system:       ntfs     Boot sector type:  Windows Vista/7: NTFS     Boot sector info:  No errors found in the Boot Parameter Block.     Operating System:  Windows 7     Boot files:        /bootmgr /Boot/BCD /Windows/System32/winload.exe      sda3: **___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __**               File system:       ntfs     Boot sector type:  Windows Vista/7: NTFS     Boot sector info:  No errors found in the Boot Parameter Block.     Operating System:       Boot files:        /bootmgr /boot/bcd      sda4: **___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __**               File system:       Extended Partition     Boot sector type:  -     Boot sector info:       sda5: **___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __**               File system:       ntfs     Boot sector type:  Windows Vista/7: NTFS     Boot sector info:  According to the info in the boot sector, sda5 starts                         at sector 2048.     Operating System:       Boot files:              sda6: **___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __**               File system:       swap     Boot sector type:  -     Boot sector info:       sda7: **___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __**               File system:       ext4     Boot sector type:  Grub2 (v1.99)     Boot sector info:  Grub2 (v1.99) is installed in the boot sector of sda7                         and looks at sector 851823520 of the same hard drive                         for core.img, but core.img can not be found at this                         location.     Operating System:       Boot files:        /grub/grub.cfg /extlinux/extlinux.conf      sda8: **___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __**               File system:       ext4     Boot sector type:  Grub2 (v1.99)     Boot sector info:  Grub2 (v1.99) is installed in the boot sector of sda8                         and looks at sector 860224256 of the same hard drive                         for core.img. core.img is at this location and looks                         for (,msdos9)/boot/grub on this drive.     Operating System:  Ubuntu 13.04     Boot files:        /etc/fstab      sda9: **___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __**               File system:       ext4     Boot sector type:  -     Boot sector info:      Operating System:  elementary OS Luna     Boot files:        /boot/grub/grub.cfg /etc/fstab /boot/grub/core.img`      I need advice as to how to proceed. I mean, does removing the Ubuntu and the /dev/sda7/ partition NOT mess up my GRUB? Please help, thank you.


How to config my.cfg file for mysql which was installed from sources?

I installed MySQL 5.6 from sources on debian. MySQL folder is /usr/local/mysql. Here is several question: 1) I would like to config my.cfg. But I couldn't find several parameters:                  socket          = /var/run/mysqld/mysqld.sock (file is missing)        pid-file        = /var/run/mysqld/mysqld.pid (file is missing)        !includedir    /etc/mysql/conf.d/ (folder is missing)      Where are they? 2) I would like to make autostart on reboot system. But earlier I've installed from apt-get install source and had _/etc/init.d/mysqld start_ and it would run automatically. Now I should run manually _/etc/init.d/mysql.server start_. So, how to run it automatically?


Read files owned by another user as non-root

I'm backing up servers on a backup server. Each server which is backed up has it's own account on the backup server, and the files are rsynced. It is important that the permissions remain intact (using rsync -p) to simplify restores. I'm trying to create a script which can read the files and create some statistics. I don't like that script to be running under the root user, and it it also impossible to run it for every backup user, as the script should be able to read all files from all users. However, this creates a problem when a file is for example chmodded 600. I don't want to touch permissions, but another user except for root and the owner can't read it. A specific - non root - user should be able to read all files in a directory or partition, regardless the permission levels (and the owner of the files should have no way to prevent it). Is there a way to achieve this? I'm running FreeBSD with a ZFS volume.


How do I allow rwx access to a specific group with ACLs?

How do I grant read, write and execute to specific group? What I did:               adduser test     addgroup developer     setfacl -m g:developer:rwx /opt/spago41/      When I login as test I can't run:               startup.sh in /opt/spago41/      Is the `setfacl` command not working?


Computer wont boot with any media after installing wine on Ubuntu 13.10

Yup. I can boot into anything (meaning the os part), like a cd/dvd, a live usb, or the os on the HDD. i can boot into the first screen, which i think is called the grub selection screen and whatever else there are. but when i select something to boot. i just get a screen with a blinking line. i tried booting into a live usb of knoppix, is stops reading from the usb after saying "Booting into kernel". the other os's dont say anything. they all have the same result. im pretty sure i cant boot into a kernel at all. i can boot into the Ultimate Boot CD and do CPU burn in, i was hoping it would get the cpu going or something. UPDATE: on the Knoppix cd, there is a debug64. i chose that and got passed the "booting into kernel" message, then the boot stopped at "[2.444305]registered taskstats version 1". Link to my G+ post on this matter. https://plus.google.com/107988923652678124819/posts/TbbzrrpycNQ


How to give permissions to user (regarding an NFS share)

There are two machines: "A" and "B". OS is SLES 9.4. "A" is the NFS server, "B" is the NFS client. "A" has exported an FS to "B". "B" mounted the NFS share. On both machines I have root permission. There is an "XY" user on the NFS client: "B". The mounted NFS looks like this on "B":               SERVER:/foo # ls -la /foo/     total 28     drwxr-xr-x   4 bar  admin  4096 Dec 18 07:35 .     drwxr-xr-x  34 root root   4096 Dec 17 10:20 ..     drwxrwxr-x   7 bar  admin  4096 Dec 15 03:03 zzz     drwx------   2 root root  16384 Dec  2  2013 lost+found     SERVER:/foo #       The "bar" user isn't "XY" user and I can't add it to the "admin" group. **My question** : How can I give the "XY" user full write permission to the /foo/ on the NFS client, "B"? with ACL's? How? UPDATE: I just found out ACL's doesn't work via NFS :D      UPDATE#2: no, modifying the permissions on the /foo isn't good, because the /foo is used on "A".


Get list of unread emails from Unix server

We are trying to get a list of unread emails from our Unix server using `mailx -L`. However, the email subject gets truncated if its length is greater than 25 characters. How can this be resolved?


Keyboard backlight is very dim

I have a Samsung Series 9 running Fedora. It has a backlit keyboard but even at the maximum setting, keys are not readable. The functions keys controlling the level are working, the OSD indicator pops up and looks fine, but all my online searches lead to tutorials on fixing the function keys. The exact machine looks like a Christmas tree under Windows XP/7/8. How can I fix this thing?


How to remove an empty directory (btrfs filesystem)?

I'm using the experimental `btrfs` filesystem. My directory looks like this:                ls -la empytfolder      total 4      drwxr-xr-x 1 root root   0 19. Mär 14:00 .      drwxr-xr-x 1 root root 298 19. Mär 13:59 ..      I try to removed it with `rm -rf emptyfolder` but it gives the error `rm: cannot remove directory: directory not empty?` How can I remove/delete my emptyfolder? Why do I have 4 files in this folder? I'm trying to delete it as a root user. My filesystem is btrfs. `stat emptyfolder` gives me:                Datei: „emptyfolder“      Größe: 0           Blöcke: 0          EA Block: 4096   Verzeichnis      Gerät: 21h/33d Inode: 256         Verknüpfungen: 1      Zugriff: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)      Zugriff    : 2012-03-19 14:00:28.205205566 +0100      Modifiziert: 2012-03-19 14:00:23.925025572 +0100      Geändert   : 2012-03-19 14:00:23.925025572 +0100      Geburt    : -      I've some problems with my system clock. Sometimes it's showing the wrong time.               $ lsof +D emptyfolder     lsof: WARNING: can't stat() fuse.gvfs-fuse-daemon file system /home/user     /.gvfs Output information may be incomplete.      What is this gvfs-fuse-daemon? How can I delete it? I've tried fuser -uv /dev/disk to no avail. There isn't any process accessing the folder. I've moved the folder to tmp.


How to print keypresses in .inputrc format?

Which application can I use to figure out what to put in .inputrc for _any_ custom keyboard shortcut? I've tried a few, and none of them seem to be usable: `showkey`, `showkey -a` and `read` just print `'` if you press `Ctrl`-`'`. `xev` prints them separately, and doesn't print anything that seems usable for .inputrc.


Is it a good idea to run freenas 8 (inside virtualbox) on a lamp server?

I am redesigning my home network setup (specifically my nas and server), and recently asked a question about running a lamp server and freenas 8 on two separate machines. However, in the spirit of conserving money and electricity, i am thinking of combining the two machines using virtualbox. This way, i could run freenas 8 in a virtualbox on my lamp server (on a single machine). To prevent any conflicts between the two OS's I thought i could install both the lamp server and freenas 8 on a single usb-drive (connected to an internal usb header), and have a couple of hd's that only freenas accesses for storage (so there won't be any competition between linux and freenas for the hd's). Is this potentially a setup that could work and remain stable? And is it sensible to run an OS from flash memory for long periods of time (because it only has a limited number of read/writes), or is it an accident waiting to happen? Any possible suggestions or foreseen issues?


How to change mixing of channels by pulse audio / alsa

I have a recent problem with my sound configuration. Basically, it's way too loud until I set the volume below 10%. And then it's very quickly too silent. Using the alsa mixer, I can set the headphone volume and PCM volume to about 50% and then obtain a reasonable range on the master. But any application using pulse will reset all the non-master channels to max and kill my ears instantly. Is there a way to force pulse to NOT change the other channels? I tried to look for information, and it seems that I need to change the channels from "mixin" to "ignore" in the configuration file, but there are so many configuration files, and I haven't found which ones are actually used by my system. So in the end, I am not even sure that what I think is correct. Can someone tell me: how to find the exact configuration files I need to change, or how to override the global configuration with some local one? and what I need to actually change? Thanks.


What is using this network socket?

I'm trying to use NTP to update the time on my machine. However, it gives me an error:               host # ntpdate ntp1.example.org     10 Aug 12:38:50 ntpdate[7696]: the NTP socket is in use, exiting      What does the error "socket is in use" mean? How can I see what is using this socket? This happens on my CentOS 4.x system, but I also see it on FreeBSD 7.x, Ubuntu 10.04 and Solaris 10.


full access to remote computer without remote static IP

How can I access to remote computer that the remote computer is in a local network? I worked with reverse ssh : `http://www.vdomck.org/2005/11/reversing- ssh-connection.html` I don't want just SSH but I want other port's of remote computer too I want to connect to remote computer by http,ssh ,mysql,ppp,... ports How can I do that?


Can Linux "run out of RAM"?

I saw several posts around the web of people apparently complaining about a hosted VPS unexpectedly killing processes because they used too much RAM. How is this possible? I thought all modern OS' provide "infinite RAM" by just using disk swap for whatever goes over the physical RAM. Is this correct? What might be happening if a process is "killed due to low RAM"?


"Overlay" a shell prompt on top of a terminal session?

I have several CLI application ideas that would be nice to run as an "overlay" on top of my terminal session. In other words I would like to superimpose a box containing a real live shell prompt on top of whatever is currently displaying in my terminal. Nothing more than that. It could work exactly like `tmux` except instead of windows and panes, it would just be a one-line-high terminal on top of whatever is existing, but I don't really need a "real" one-line-high terminal; it could just be a prompt by some other means, if that's possible. Any ideas of where to start solving this?


How to create an alias for opening a directory on Mac

Trying to create an alias `hello`. After typing `hello` in `Terminal`, then `vi` opens `hello_folder`. Now, this code returns:               $ hello      -bash: hello: command not found                  1 #!/bin/bash       2 cd ~/Documents/       3        4 # create directory if it does not exists..       5 mkdir -p hello_folder       6        7 # in this dir create a dummy hello_file and write something into it.       8 cd hello_folder       9 touch hello_file.md && echo 'hello' > hello_file.md.      10       11 # go to ~/.bash_profile and create alias.      12 # instructions:      13 # if you type hello in terminal, then it opens hello_folder in vim editor      14 echo "alias hello='vi /Users/fill_your_username/Documents/hello_folder/'" > ~/.bash_profile      What is missing in the code ? - `alias` is not recognised.


How to bury an invisible mark into lines of text?

How can I bury an **invisible** mark into random lines of text? Such a mark has to be there, though it will be invisible to someone reading that text printed out on the console. I want to identify those lines by means of an invisible mark in order to, for instance, grep them in or out later. I tried `0x00` without success. I expected `grep` to print lines matching `0x00` somewhere. But this didn't work:               $ echo -e "a\0b" | hexdump -C     00000000  61 00 62 0a                                       |a.b.|     00000004     $ echo -e "a\0b" | grep "a\0b"


How to tell rsyslog to create log file if not there?

Default behaviour by rsyslog is to append traces to an _existing_ log file. Now, I've seen (CentOs, Scientific Linux) that when rsyslog is already running, you delete the log file (e.g. the one dedicated to log traces from your application), you then run your application, rsyslog **will not** create a log file and no trace will be recorded. Is there a config option somehow that can tell rsyslog to create a log file if not there before appending traces to it? **Note** : doing a `service rsyslog restart` will force creation of an empty log file. **rsyslog.conf** (nothing added to it)               # rsyslog v5 configuration file          # For more information see /usr/share/doc/rsyslog-*/rsyslog_conf.html     # If you experience problems, see http://www.rsyslog.com/doc/troubleshoot.html          #### MODULES ####          $ModLoad imuxsock # provides support for local system logging (e.g. via logger command)     $ModLoad imklog   # provides kernel logging support (previously done by rklogd)     #$ModLoad immark  # provides --MARK-- message capability          $SystemLogRateLimitInterval 1     $SystemLogRateLimitBurst 50000          # Provides UDP syslog reception     #$ModLoad imudp     #$UDPServerRun 514          # Provides TCP syslog reception     #$ModLoad imtcp     #$InputTCPServerRun 514               #### GLOBAL DIRECTIVES ####          # Use default timestamp format     $ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat          # File syncing capability is disabled by default. This feature is usually not required,     # not useful and an extreme performance hit     #$ActionFileEnableSync on          # Include all config files in /etc/rsyslog.d/     $IncludeConfig /etc/rsyslog.d/*.conf               #### RULES ####          # Log all kernel messages to the console.     # Logging much else clutters up the screen.     #kern.*                                                 /dev/console          # Log anything (except mail) of level info or higher.     # Don't log private authentication messages!     *.info;mail.none;authpriv.none;cron.none;local1.none    /var/log/messages          # The authpriv file has restricted access.     authpriv.*                                              /var/log/secure          # Log all the mail messages in one place.     mail.*                                                  -/var/log/maillog               # Log cron stuff     cron.*                                                  /var/log/cron          # Everybody gets emergency messages     *.emerg                                                 *          # Save news errors of level crit and higher in a special file.     uucp,news.crit                                          /var/log/spooler          # Save boot messages also to boot.log     local7.*                                                /var/log/boot.log          # ### begin forwarding rule ###     # The statement between the begin ... end define a SINGLE forwarding     # rule. They belong together, do NOT split them. If you create multiple     # forwarding rules, duplicate the whole block!     # Remote Logging (we use TCP for reliable delivery)     #     # An on-disk queue is created for this action. If the remote host is     # down, messages are spooled to disk and sent when it is up again.     #$WorkDirectory /var/lib/rsyslog # where to place spool files     #$ActionQueueFileName fwdRule1 # unique name prefix for spool files     #$ActionQueueMaxDiskSpace 1g   # 1gb space limit (use as much as possible)     #$ActionQueueSaveOnShutdown on # save messages to disk on shutdown     #$ActionQueueType LinkedList   # run asynchronously     #$ActionResumeRetryCount -1    # infinite retries if host is down     # remote host is: name/ip:port, e.g. 192.168.0.1:514, port optional     #*.* @@remote-host:514     # ### end of the forwarding rule ###


Nginx loadbalancing between PHP-FPM and Apache

Do the upstream PHP servers have to run the same server software? If I have the following Nginx configuration                upstream myapp1 {             server srv1.example.com;             server srv2.example.com;         }      Assuming we have shared back-end database and identical web sites, could I use Apache on srv1 and PHP-FPM on srv2 to compare the two under identical real- world load?


Hard drives goes missing until reboot - what can be the cause?

I am struggling here. My end goal is assembling a RAID-6 array on my PC, but time and again, the assemble doesn't complete (and `cat /proc/mdstat` shows that one drive dropped away). This now happened with two separate drives. The issue is - I did various tests (rebooting Ubuntu, even going into Windows and formatting (not quick format) the drives/partitions there, and no issues were picked up with the drives). I suspect it's an issue on my Ubuntu installation but dont know where to start looking in log files etc. Some output below (11 drives -boot + 10 x 1TB drives)               erwin@erwin-ubuntu:~$ sudo smartctl -i --scan     /dev/sda -d scsi # /dev/sda, SCSI device     /dev/sdb -d scsi # /dev/sdb, SCSI device     /dev/sdc -d scsi # /dev/sdc, SCSI device     /dev/sdd -d scsi # /dev/sdd, SCSI device     /dev/sde -d scsi # /dev/sde, SCSI device     /dev/sdf -d scsi # /dev/sdf, SCSI device     /dev/sdg -d scsi # /dev/sdg, SCSI device     /dev/sdh -d scsi # /dev/sdh, SCSI device     /dev/sdi -d scsi # /dev/sdi, SCSI device     /dev/sdj -d scsi # /dev/sdj, SCSI device     /dev/sdk -d scsi # /dev/sdk, SCSI device     /dev/sdl -d scsi # /dev/sdl, SCSI device      The issue is `sdd` and `sdk` (although they were available on boot), once I tried assembling on MDADM, after a few hours, a drive just drops out, and is no longer reported as available by either `gparted` or `fdisk`, etc.               erwin@erwin-ubuntu:~$ sudo fdisk /dev/sdd     fdisk: unable to read /dev/sdd: Input/output error      Capture of a working drive               erwin@erwin-ubuntu:~$ sudo smartctl -i /dev/sdb     smartctl 5.41 2011-06-09 r3365 [i686-linux-3.0.0-14-generic] (local build)     Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net          === START OF INFORMATION SECTION ===     Model Family:     Seagate Barracuda 7200.11     Device Model:     ST31000340AS     Serial Number:    9QJ0MD9F     LU WWN Device Id: 5 000c50 00cca6f07     Firmware Version: SD15     User Capacity:    1,000,203,804,160 bytes [1.00 TB]     Sector Size:      512 bytes logical/physical     Device is:        In smartctl database [for details use: -P show]     ATA Version is:   8     ATA Standard is:  ATA-8-ACS revision 4     Local Time is:    Sat Dec 17 10:59:13 2011 SAST      Capture of the two problematic drives:               erwin@erwin-ubuntu:~$ sudo smartctl -i /dev/sdd     smartctl 5.41 2011-06-09 r3365 [i686-linux-3.0.0-14-generic] (local build)     Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net          Vendor:               /6:0:0:0     Product:                   User Capacity:        600,332,565,813,390,450 bytes [600 PB]     Logical block size:   774843950 bytes     scsiModePageOffset: response length too short, resp_len=47 offset=50 bd_len=46     >> Terminate command early due to bad response to IEC mode page     A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options.               erwin@erwin-ubuntu:~$ sudo smartctl -i /dev/sdh     smartctl 5.41 2011-06-09 r3365 [i686-linux-3.0.0-14-generic] (local build)     Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net          Vendor:               /11:0:0:     Product:              0     User Capacity:        600,332,565,813,390,450 bytes [600 PB]     Logical block size:   774843950 bytes     scsiModePageOffset: response length too short, resp_len=47 offset=50 bd_len=46     >> Terminate command early due to bad response to IEC mode page     A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options.      A command recommended on another forum, `lsscsi`:               erwin@erwin-ubuntu:~$ lsscsi     [0:0:0:0]    disk    ATA      ST3500630AS      3.AA  /dev/sda     [2:0:0:0]    disk    ATA      ST31000340AS     SD15  /dev/sdb     [3:0:0:0]    disk    ATA      ST31000528AS     CC38  /dev/sdc     [6:0:0:0]    disk    ATA      ST31000340AS     SD15  /dev/sdd     [7:0:0:0]    disk    ATA      ST31000528AS     CC36  /dev/sde     [8:0:0:0]    disk    ATA      ST31000340AS     SD15  /dev/sdf     [10:0:0:0]   disk    ATA      ST31000340AS     SD15  /dev/sdg     [11:0:0:0]   disk    ATA      ST31000340AS     SD15  /dev/sdh     [12:0:0:0]   disk    ATA      ST31000340AS     SD15  /dev/sdi     [13:0:0:0]   disk    ATA      ST31000340AS     SD15  /dev/sdj     [14:0:0:0]   disk    ATA      ST31000340AS     SD15  /dev/sdk     [15:0:0:0]   disk    ATA      ST31000340AS     SD15  /dev/sdl      Will post/edit details after reboot shortly..


How to add TileStream in autoload CentOS

I'm new with CentOS. I have a installed tilestream. Now want to tilestream start automaticaly after system restart. Do like this tutorial. /etc/init/tilestream.conf               #!upstart     #description "node.js chatapp server"     #author      "subicura"          start on startup     stop on shutdown          script        export HOME="/home/myuser"#             echo $$ > /var/run/tilestream.pid        exec /usr/bin/node /usr/bin/tilestream >> /var/log/tilestream.log 2>&1     end script          pre-start script        # Date format same as (new Date()).toISOString() for consistency        echo "[`date -u +%Y-%m-%dT%T.%3NZ`] (sys) Starting" >> /var/log/tilestream.log     end script          pre-stop script        rm /var/run/tilestream.pid        echo "[`date -u +%Y-%m-%dT%T.%3NZ`] (sys) Stopping" >> /var/log/tilestream.log     end script      In cterminal do:               /sbin/start tilestream      Output:               tilestream start/running, process 2428      In log:               [2014-06-27T08:32:55.316Z] (sys) Starting     Creating tiles dir /home/myuser#/Documents/MapBox/tiles     Started [Server Tile].     Started [Server Core:8888].      But TileStream not work. If i start it with script /etc/init.d/tilestream               #!/bin/sh     ### BEGIN INIT INFO     # Provides:          tilestream     # Required-Start:    $local_fs $remote_fs $network $syslog $named     # Required-Stop:     $local_fs $remote_fs $network $syslog $named     # Default-Start:     2 3 4 5     # Default-Stop:      0 1 6     # X-Interactive:     true     # Short-Description: Start TileStream server     ### END INIT INFO          TILESTREAM="/usr/bin/tilestream"     MAPPATH="/data"     HOST="host"     #HOST="localhost"     #UIPORT="9001"     UIPORT="8888"     #TILEPORT="9000"     TILEPORT="8888"     SUBDOMAINS="a,b,c,d"          case $1 in         start)             echo "Starting TileStream"            #$TILESTREAM --tiles=$MAPPATH --host=$HOST&            #$TILESTREAM --tiles=$MAPPATH --host=$HOST --uiPort=$UIPORT --tilePort=$TILEPORT --subdomains=$SUBDOMAINS&            $TILESTREAM --tiles=$MAPPATH --host=$HOST --uiPort=$UIPORT --tilePort=$TILEPORT&             ;;         stop)             echo "Stopping TileStream"             #PID=`ps aux | grep $TILESTREAM | grep -v grep | awk '{print $2}'`         PID=`ps aux | grep "tilestream" | grep -v grep | awk '{print $2}'`             kill -9 $PID             ;;         restart)             echo "Restarting TileStream"            $0 stop            sleep 1            $0 start            ;;         *)             echo "Usage: $0 {start|stop|restart}" >&2             exit 1             ;;         esac      In this case all work fine.   Any advices?


How to change my script to replace and add new variable in a configuration?

Well this is my script. It is to configure my systems sysctl.conf.               infile = open('sysctl.conf')     outfile = open('sysctl.conf.new', 'w')          replacements = {'Net.ipv4.icmp_echo_ignore_all' :'1',                 'Net.ipv4.icmp_echo_ignore_broadcasts' :'1',                 'Net.ipv4.ip_forward' : '0',                 'Net.ipv4.tcp_syncookies':'1',                 'Net.ipv4.conf.all.rp_filter': '1',                 'Net.ipv4.conf.all.Log.martiansd':'1',                 'Net.ipv4.conf.all.Secure_redirects' : '1',                 'Net.ipv4.conf.all.Send_redirects' : '0',                 'Net.ipv4.conf.all.Accept_Source_Route':  '0',                 'Net.ipv4.conf.all.Accept_redirects':'0',                 'Net.ipv4.tcp_max_syn_backlog': '4096',                 }          for line in infile:         if '#' in line:             pass         elif '=' in line:             w = line.split('=')             for var, value in replacements.iteritems():                 if var in w[0]:                     line=line.replace(w[1],value)         outfile.write(line)     infile.close()     outfile.close()      This script works fine but there is one problem. If any of the parameters in replacement is not present in sysctl.conf then it is not going to add it in the new configuration file.It only modifies the parameters present with my values. I want to add all parameters in the configuration or change if they are already present. How to do it? I know it should be easy but I am stuck here.


I want to create a script so that I don't have to type su and password every time

I want to create a script so that I don't have to type `su` and the password for logging into root every time.


Why doesn't my supervisor daemon start on reboot?

I have added a crontab entry via `crontab -e` for the current user:               @reboot supervisord -c /etc/supervisord.conf      Yet after the reboot, supervisord demon is not running. I need to run the command again in bash. Only a second try yields in an error I expected right away after setting up the cronjob.               $ supervisord -c /etc/supervisord.conf     $ supervisord -c /etc/supervisord.conf     Error: Another program is already listening on a port that one of our HTTP servers is configured to use.  Shut this program down first before starting supervisord.      Why doesn't my cronjob work and how do I start supervisor daemon on boot?


Cannot start xserver - "Failed to assign any connected display devices to X screen 0"

I'm using **RHEL 6.3 (2.6.32-279.el6.x86_64)**   VideoCard: **NVIDIA Quadro 410**   Installed Graphic Driver: **NVIDIA-Linux-x86_64-331.79**   I try to run Xserver, but it won't start. Here is a log file:               cat /var/log/Xorg.0.log     [   641.698]     X.Org X Server 1.10.6     Release Date: 2012-02-10     [   641.699] X Protocol Version 11, Revision 0     [   641.699] Build Operating System: x86-007 2.6.18-308.1.1.el5     [   641.699] Current Operating System: Linux mos120.cadence.com 2.6.32-279.el6.x86_64 #1 SMP Wed Jun 13 18:24:36 EDT 2012 x86_64     [   641.700] Kernel command line: ro root=UUID=af5b1128-71a2-4831-8b80-30c1fe45bcb8 intel_iommu=on rd_NO_LUKS rd_LVM_LV=vg00/lswap LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=130M@0M  KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM     [   641.701] Build Date: 28 March 2012  03:02:14PM     [   641.701] Build ID: xorg-x11-server 1.10.6-1.el6     [   641.702] Current version of pixman: 0.18.4     [   641.702]    Before reporting problems, check https://www.redhat.com/apps/support/             to make sure that you have the latest version.     [   641.703] Markers: (--) probed, (**) from config file, (==) default setting,             (++) from command line, (!!) notice, (II) informational,             (WW) warning, (EE) error, (NI) not implemented, (??) unknown.     [   641.704] (==) Log file: "/var/log/Xorg.0.log", Time: Tue Jun 17 13:45:26 2014     [   641.707] (==) Using config file: "/etc/X11/xorg.conf"     [   641.708] (==) ServerLayout "X.org Configured"     [   641.708] (**) |-->Screen "Screen0" (0)     [   641.708] (**) |   |-->Monitor "Monitor0"     [   641.708] (**) |   |-->Device "Card0"     [   641.708] (**) |-->Screen "Screen1" (1)     [   641.708] (**) |   |-->Monitor "Monitor1"     [   641.708] (**) |   |-->Device "Card1"     [   641.708] (**) |-->Screen "Screen2" (2)     [   641.708] (**) |   |-->Monitor "Monitor2"     [   641.708] (**) |   |-->Device "Card2"     [   641.708] (**) |-->Screen "Screen3" (3)     [   641.708] (**) |   |-->Monitor "Monitor3"     [   641.708] (**) |   |-->Device "Card3"     [   641.708] (**) |-->Input Device "Mouse0"     [   641.708] (**) |-->Input Device "Keyboard0"     [   641.708] (==) Automatically adding devices     [   641.708] (==) Automatically enabling devices     [   641.708] (**) FontPath set to:             catalogue:/etc/X11/fontpath.d,             built-ins,             catalogue:/etc/X11/fontpath.d,             built-ins     [   641.708] (**) ModulePath set to "/usr/lib64/xorg/modules"     [   641.708] (WW) Hotplugging is on, devices using drivers 'kbd', 'mouse' or 'vmmouse' will be disabled.     [   641.708] (WW) Disabling Mouse0     [   641.708] (WW) Disabling Keyboard0     [   641.708] (II) Loader magic: 0x7d6960     [   641.708] (II) Module ABI versions:     [   641.708]    X.Org ANSI C Emulation: 0.4     [   641.708]    X.Org Video Driver: 10.0     [   641.708]    X.Org XInput driver : 12.2     [   641.708]    X.Org Server Extension : 5.0     [   641.708] (--) PCI:*(0:5:0:0) 10de:0fff:103c:094a rev 161, Mem @ 0xee000000/16777216, 0xd0000000/268435456, 0xe0000000/33554432, I/O @ 0x0000c000/128, BIOS @ 0x????????/524288     [   641.709] (II) "extmod" will be loaded. This was enabled by default and also specified in the config file.     [   641.709] (II) "dbe" will be loaded. This was enabled by default and also specified in the config file.     [   641.709] (II) "glx" will be loaded. This was enabled by default and also specified in the config file.     [   641.709] (II) "record" will be loaded. This was enabled by default and also specified in the config file.     [   641.709] (II) "dri" will be loaded by default.     [   641.709] (II) "dri2" will be loaded. This was enabled by default and also specified in the config file.     [   641.709] (II) LoadModule: "dbe"     [   641.714] (II) Loading /usr/lib64/xorg/modules/extensions/libdbe.so     [   641.714] (II) Module dbe: vendor="X.Org Foundation"     [   641.714]    compiled for 1.10.6, module version = 1.0.0     [   641.714]    Module class: X.Org Server Extension     [   641.714]    ABI class: X.Org Server Extension, version 5.0     [   641.714] (II) Loading extension DOUBLE-BUFFER     [   641.714] (II) LoadModule: "extmod"     [   641.714] (II) Loading /usr/lib64/xorg/modules/extensions/libextmod.so     [   641.716] (II) Module extmod: vendor="X.Org Foundation"     [   641.716]    compiled for 1.10.6, module version = 1.0.0     [   641.716]    Module class: X.Org Server Extension     [   641.716]    ABI class: X.Org Server Extension, version 5.0     [   641.716] (II) Loading extension SELinux     [   641.716] (II) Loading extension MIT-SCREEN-SAVER     [   641.716] (II) Loading extension XFree86-VidModeExtension     [   641.716] (II) Loading extension XFree86-DGA     [   641.716] (II) Loading extension DPMS     [   641.716] (II) Loading extension XVideo     [   641.716] (II) Loading extension XVideo-MotionCompensation     [   641.716] (II) Loading extension X-Resource     [   641.716] (II) LoadModule: "dri2"     [   641.716] (II) Loading /usr/lib64/xorg/modules/extensions/libdri2.so     [   641.717] (II) Module dri2: vendor="X.Org Foundation"     [   641.717]    compiled for 1.10.6, module version = 1.2.0     [   641.717]    ABI class: X.Org Server Extension, version 5.0     [   641.717] (II) Loading extension DRI2     [   641.717] (II) LoadModule: "record"     [   641.717] (II) Loading /usr/lib64/xorg/modules/extensions/librecord.so     [   641.718] (II) Module record: vendor="X.Org Foundation"     [   641.718]    compiled for 1.10.6, module version = 1.13.0     [   641.718]    Module class: X.Org Server Extension     [   641.718]    ABI class: X.Org Server Extension, version 5.0     [   641.718] (II) Loading extension RECORD     [   641.718] (II) LoadModule: "glx"     [   641.723] (II) Loading /usr/lib64/xorg/modules/extensions/libglx.so     [   641.819] (II) Module glx: vendor="NVIDIA Corporation"     [   641.819]    compiled for 4.0.2, module version = 1.0.0     [   641.819]    Module class: X.Org Server Extension     [   641.819] (II) NVIDIA GLX Module  331.79  Sat May 17 23:58:32 PDT 2014     [   641.820] (II) Loading extension GLX     [   641.820] (II) LoadModule: "dri"     [   641.820] (II) Loading /usr/lib64/xorg/modules/extensions/libdri.so     [   641.821] (II) Module dri: vendor="X.Org Foundation"     [   641.821]    compiled for 1.10.6, module version = 1.0.0     [   641.821]    ABI class: X.Org Server Extension, version 5.0     [   641.821] (II) Loading extension XFree86-DRI     [   641.821] (II) LoadModule: "nvidia"     [   641.821] (II) Loading /usr/lib64/xorg/modules/drivers/nvidia_drv.so     [   641.828] (II) Module nvidia: vendor="NVIDIA Corporation"     [   641.829]    compiled for 4.0.2, module version = 1.0.0     [   641.829]    Module class: X.Org Video Driver     [   641.830] (II) NVIDIA dlloader X Driver  331.79  Sat May 17 23:37:42 PDT 2014     [   641.830] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs     [   641.830] (--) using VT number 7          [   641.842] (II) Loading sub module "fb"     [   641.842] (II) LoadModule: "fb"     [   641.842] (II) Loading /usr/lib64/xorg/modules/libfb.so     [   641.843] (II) Module fb: vendor="X.Org Foundation"     [   641.843]    compiled for 1.10.6, module version = 1.0.0     [   641.843]    ABI class: X.Org ANSI C Emulation, version 0.4     [   641.843] (II) Loading sub module "wfb"     [   641.843] (II) LoadModule: "wfb"     [   641.843] (II) Loading /usr/lib64/xorg/modules/libwfb.so     [   641.845] (II) Module wfb: vendor="X.Org Foundation"     [   641.845]    compiled for 1.10.6, module version = 1.0.0     [   641.845]    ABI class: X.Org ANSI C Emulation, version 0.4     [   641.845] (II) Loading sub module "ramdac"     [   641.845] (II) LoadModule: "ramdac"     [   641.845] (II) Module "ramdac" already built-in     [   641.846] (II) Loading /usr/lib64/xorg/modules/drivers/nvidia_drv.so     [   641.846] (II) Loading /usr/lib64/xorg/modules/libwfb.so     [   641.846] (II) Loading /usr/lib64/xorg/modules/libfb.so     [   641.847] (==) NVIDIA(0): Depth 24, (==) framebuffer bpp 32     [   641.847] (==) NVIDIA(0): RGB weight 888     [   641.847] (==) NVIDIA(0): Default visual is TrueColor     [   641.847] (==) NVIDIA(0): Using gamma correction (1.0, 1.0, 1.0)     [   641.847] (**) NVIDIA(0): Enabling 2D acceleration     [   642.374] (II) NVIDIA(0): NVIDIA GPU Quadro 410 (GK107GL) at PCI:5:0:0 (GPU-0)     [   642.374] (--) NVIDIA(0): Memory: 524288 kBytes     [   642.374] (--) NVIDIA(0): VideoBIOS: 80.07.47.00.17     [   642.374] (II) NVIDIA(0): Detected PCI Express Link width: 16X     [   642.378] (--) NVIDIA(0): Valid display device(s) on Quadro 410 at PCI:5:0:0     [   642.378] (--) NVIDIA(0):     CRT-0     [   642.378] (--) NVIDIA(0):     DFP-0 (boot)     [   642.378] (--) NVIDIA(0):     DFP-1     [   642.378] (--) NVIDIA(0):     DFP-2     [   642.378] (--) NVIDIA(0): CRT-0: 400.0 MHz maximum pixel clock     [   642.378] (--) NVIDIA(0): DFP-0: Internal Single Link TMDS     [   642.378] (--) NVIDIA(0): DFP-0: 330.0 MHz maximum pixel clock     [   642.378] (--) NVIDIA(0): DFP-1: Internal Single Link TMDS     [   642.378] (--) NVIDIA(0): DFP-1: 165.0 MHz maximum pixel clock     [   642.378] (--) NVIDIA(0): DFP-2: Internal DisplayPort     [   642.378] (--) NVIDIA(0): DFP-2: 960.0 MHz maximum pixel clock     [   642.378] (EE) NVIDIA(0): Failed to assign any connected display devices to X screen 0.     [   642.378] (EE) NVIDIA(0):     Set AllowEmptyInitialConfiguration if you want the server     [   642.378] (EE) NVIDIA(0):     to start anyway     [   642.596] (EE) NVIDIA(0): Failing initialization of X screen 0     [   642.596] (II) UnloadModule: "nvidia"     [   642.596] (II) Unloading nvidia     [   642.596] (II) UnloadModule: "wfb"     [   642.596] (II) Unloading wfb     [   642.596] (II) UnloadModule: "fb"     [   642.596] (II) Unloading fb     [   642.596] (EE) Screen(s) found, but none have a usable configuration.     [   642.596]     Fatal server error:     [   642.596] no screens found     [   642.596]     Please consult the Red Hat, Inc. support              at https://www.redhat.com/apps/support/      for help.     [   642.596] Please also check the log file at "/var/log/Xorg.0.log" for additional information.     [   642.596]           Here is xorg.conf:               # nvidia-xconfig: X configuration file generated by nvidia-xconfig     # nvidia-xconfig:  version 331.79  (buildmeister@swio-display-x86-rhel47-09)  Sun May 18 00:42:05 PDT 2014               Section "ServerLayout"         Identifier     "X.org Configured"         Screen      0  "Screen0" 0 0         Screen      1  "Screen1" RightOf "Screen0"         Screen      2  "Screen2" RightOf "Screen1"         Screen      3  "Screen3" RightOf "Screen2"         InputDevice    "Mouse0" "CorePointer"         InputDevice    "Keyboard0" "CoreKeyboard"         Option         "AllowEmptyInput" "no"     EndSection          Section "Files"         ModulePath      "/usr/lib64/xorg/modules"         FontPath        "catalogue:/etc/X11/fontpath.d"         FontPath        "built-ins"     EndSection          Section "Module"         Load           "dbe"         Load           "extmod"         Load           "dri2"         Load           "record"         Load           "glx"     EndSection          Section "InputDevice"         Identifier     "Keyboard0"         Driver         "kbd"     EndSection          Section "InputDevice"         Identifier     "Mouse0"         Driver         "mouse"         Option         "Protocol" "auto"         Option         "Device" "/dev/input/mice"         Option         "ZAxisMapping" "4 5 6 7"     EndSection          Section "Monitor"         Identifier     "Monitor0"         VendorName     "Monitor Vendor"         ModelName      "Monitor Model"     EndSection          Section "Monitor"         Identifier     "Monitor1"         VendorName     "Monitor Vendor"         ModelName      "Monitor Model"     EndSection          Section "Monitor"         Identifier     "Monitor2"         VendorName     "Monitor Vendor"         ModelName      "Monitor Model"     EndSection          Section "Monitor"         Identifier     "Monitor3"         VendorName     "Monitor Vendor"         ModelName      "Monitor Model"     EndSection          Section "Device"                  ### Available Driver options are:-             ### Values: : integer, : float, : "True"/"False",             ### : "String", : " Hz/kHz/MHz",             ### : "%"             ### [arg]: arg optional             #Option     "SWcursor"                  # []             #Option     "HWcursor"                  # []             #Option     "NoAccel"                   # []             #Option     "ShadowFB"                  # []             #Option     "UseFBDev"                  # []             #Option     "Rotate"                    # []             #Option     "VideoKey"                  #              #Option     "FlatPanel"                 # []             #Option     "FPDither"                  # []             #Option     "CrtcNumber"                #              #Option     "FPScale"                   # []             #Option     "FPTweak"                   #              #Option     "DualHead"                  # []         Identifier     "Card0"         Driver         "nvidia"         BusID          "PCI:5:0:0"     EndSection          Section "Device"                  ### Available Driver options are:-             ### Values: : integer, : float, : "True"/"False",             ### : "String", : " Hz/kHz/MHz",             ### : "%"             ### [arg]: arg optional             #Option     "SWcursor"                  # []             #Option     "HWcursor"                  # []             #Option     "NoAccel"                   # []             #Option     "ShadowFB"                  # []             #Option     "UseFBDev"                  # []             #Option     "Rotate"                    # []             #Option     "VideoKey"                  #              #Option     "FlatPanel"                 # []             #Option     "FPDither"                  # []             #Option     "CrtcNumber"                #              #Option     "FPScale"                   # []             #Option     "FPTweak"                   #              #Option     "DualHead"                  # []         Identifier     "Card1"         Driver         "nvidia"         BusID          "PCI:5:0:0"     EndSection          Section "Device"                  ### Available Driver options are:-             ### Values: : integer, : float, : "True"/"False",             ### : "String", : " Hz/kHz/MHz",             ### : "%"             ### [arg]: arg optional             #Option     "ShadowFB"                  # []             #Option     "Rotate"                    #              #Option     "fbdev"                     #              #Option     "debug"                     # []         Identifier     "Card2"         Driver         "nvidia"         BusID          "PCI:5:0:0"     EndSection          Section "Device"                  ### Available Driver options are:-             ### Values: : integer, : float, : "True"/"False",             ### : "String", : " Hz/kHz/MHz",             ### : "%"             ### [arg]: arg optional             #Option     "ShadowFB"                  # []             #Option     "DefaultRefresh"            # []             #Option     "ModeSetClearScreen"        # []         Identifier     "Card3"         Driver         "nvidia"         BusID          "PCI:5:0:0"     EndSection          Section "Screen"         Identifier     "Screen0"         Device         "Card0"         Monitor        "Monitor0"         SubSection     "Display"             Viewport    0 0         EndSubSection         SubSection     "Display"             Viewport    0 0             Depth       4         EndSubSection         SubSection     "Display"             Viewport    0 0             Depth       8         EndSubSection         SubSection     "Display"             Viewport    0 0             Depth       15         EndSubSection         SubSection     "Display"             Viewport    0 0             Depth       16         EndSubSection         SubSection     "Display"             Viewport    0 0             Depth       24         EndSubSection     EndSection          Section "Screen"         Identifier     "Screen1"         Device         "Card1"         Monitor        "Monitor1"         SubSection     "Display"             Viewport    0 0         EndSubSection         SubSection     "Display"             Viewport    0 0             Depth       4         EndSubSection         SubSection     "Display"             Viewport    0 0             Depth       8         EndSubSection         SubSection     "Display"             Viewport    0 0             Depth       15         EndSubSection         SubSection     "Display"             Viewport    0 0             Depth       16         EndSubSection         SubSection     "Display"             Viewport    0 0             Depth       24         EndSubSection     EndSection          Section "Screen"         Identifier     "Screen2"         Device         "Card2"         Monitor        "Monitor2"         SubSection     "Display"             Viewport    0 0         EndSubSection         SubSection     "Display"             Viewport    0 0             Depth       4         EndSubSection         SubSection     "Display"             Viewport    0 0             Depth       8         EndSubSection         SubSection     "Display"             Viewport    0 0             Depth       15         EndSubSection         SubSection     "Display"             Viewport    0 0             Depth       16         EndSubSection         SubSection     "Display"             Viewport    0 0             Depth       24         EndSubSection     EndSection          Section "Screen"         Identifier     "Screen3"         Device         "Card3"         Monitor        "Monitor3"         SubSection     "Display"             Viewport    0 0         EndSubSection         SubSection     "Display"             Viewport    0 0             Depth       4         EndSubSection         SubSection     "Display"             Viewport    0 0             Depth       8         EndSubSection         SubSection     "Display"             Viewport    0 0             Depth       15         EndSubSection         SubSection     "Display"             Viewport    0 0             Depth       16         EndSubSection         SubSection     "Display"             Viewport    0 0             Depth       24         EndSubSection     EndSection      **UPD**. Could this be a symptom of the problem? It cannot see the model of the card.               $ lspci -nn | grep VGA     05:00.0 VGA compatible controller [0300]: NVIDIA Corporation Device [10de:0fff] (rev a1)


right way to mount sdcard in linux

i have a problem with mounting my camcoder with sdcard as volume. It seems it is sdcard problem, can it be repaired? I have reformated sdcard in windows system but this did'nt solve problem all remained the same.               #lsubs:Bus 001 Device 011: ID 0603:8611 Novatek Microelectronics Corp.        # lsblk     NAME                        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT          sdb                           8:16   1  29.8G  0 disk      └─sdb1                        8:17   1  29.8G  0 part      sr0                          11:0    1  1024M  0 rom       # mount /dev/sdb /mountpoint     mount: /dev/sdb: can't read superblock         #dmesg:     [  393.331415] sd 2:0:0:0: [sdb]  Sense Key : Medium Error [current]      [  393.331428] sd 2:0:0:0: [sdb]  Add. Sense: Unrecovered read error     [  393.331443] sd 2:0:0:0: [sdb] CDB: Read(10): 28 00 00 00 00 02 00 00 02 00     [  393.331470] end_request: critical target error, dev sdb, sector 2     [  393.331497] EXT4-fs (sdb): unable to read superblock     [  393.338515] sd 2:0:0:0: [sdb] Unhandled sense code     [  393.338525] sd 2:0:0:0: [sdb]  Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE     [  393.338538] sd 2:0:0:0: [sdb]  Sense Key : Medium Error [current]      [  393.338551] sd 2:0:0:0: [sdb]  Add. Sense: Unrecovered read error     [  393.338565] sd 2:0:0:0: [sdb] CDB: Read(10): 28 00 00 00 00 40 00 00 02 00     [  393.338593] end_request: critical target error, dev sdb, sector 64     [  393.338621] isofs_fill_super: bread failed, dev=sdb, iso_blknum=16, block=32     [  393.346514] sd 2:0:0:0: [sdb] Unhandled sense code     [  393.346524] sd 2:0:0:0: [sdb]  Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE     [  393.346537] sd 2:0:0:0: [sdb]  Sense Key : Medium Error [current]      [  393.346550] sd 2:0:0:0: [sdb]  Add. Sense: Unrecovered read error     [  393.346564] sd 2:0:0:0: [sdb] CDB: Read(10): 28 00 00 00 00 00 00 00 01 00     [  393.346592] end_request: critical target error, dev sdb, sector 0     [  393.346619] FAT-fs (sdb): unable to read boot sector


How to adjust time command to measure a program elapsed time

I'm trying to get the time that my program takes to finish (aka elapsed time) so I'm using the common `time`. What I get by doing this is 3 measurements: user, system and total. This is fine but I found that the user time that I'm interested in has only two decimal places and I would need more. Is there any way I can get more decimal places out of my time command? Example: `time ./myCProgram`   Output: 0.17s user 1.21s system 130% cpu 0.187 total Wished output wanted: 0.17000s user 1.21s system 130% cpu 0.187 total (or more decimal places)


How can I combine grep with file and extra regex

I have a file of strings in each line. For example:               AAAAA        BBBBB        CCCCC       etc        I want to check each string one by one whether it exists in a series of files in a specific directory. I know that I can do: `grep -f filename` to do the search. But what I need is to use one more regular expression per line to get more specific results. The file with the strings is big and changes often so it does not make sense to modify each line to add an expression. So what I need is to combine the `grep -f filename` to loop over each line of the file (and grep for it in the files) but add some more conditions. E.g. that `AAAAA` exists **and** `[0-9]{1,3}$` exists as well in the same line.


Ubuntu 12.04 liveusb/cd - Mount in Read Write Mode?

How do you mount a drive (internal or external) in READ/WRITE mode using the Ubuntu 12.04 Live CD / USB? I can boot the computer with the LiveUSB but Ubuntu is only mounting the drives as read only ...


mailing thru ssh

(I am a Linux only user & MELT software developer, and use Linux since kernel 0.99.15 e.g. the previous century) I have a VPS host `ovh.starynkevitch.net` (running Linux) which is also the _MX_ host for my email. It is getting emails only for less than a dozen users (my relatives, i.e. kids, grand-children, wife). So a quite small traffic. the MTA is `exim4` ... I specifically don't want to use _gmail_ I have secure `ssh` (public-key, so without passwords) access to that machine (from every -latop or desktop machine I am working on). I want to be able to read (and post, but SMTP forwarding is not an issue) my email thru it. Up to now, I forwarded my email (to some home server). In practice, I want to run some graphical MUA (e.g. `sylpheed` or `evolution` ...) because I am tired of `mutt`... I also want to be able to use some spam filter like spamoracle; it has to run on my VPS host (not locally on the MUA machines). And I need to conveniently be able (with a single keystroke!) to improve (by the usual machine learning techniques) its filtering. I was thinking of installing some IMAP server (like the `imapd` from GNU mailutils). But then, it is less easy to use _spamoracle_ with it. I thought of:   1. Using `imapd` above SSL or some other secure transport. But then I am not familiar with the configuration, and I have no idea if the SSL should be related to my `ssh` settings or not.   2. doing port redirection with `ssh` Any hints or some other solutions?


Log if no network

I have a router with OpenWRT. I noticed that sometimes (during night time) I have no internet connection. How can I log when this happens?


make a linux "from scratch" using package manager?

Is there an easy way yet to make a linux system "from scratch" using a package manager like pacman, dpkg, etc.? For example, something with which you can just say you want a working computer system with the `python` and `perl` packages, and then you get an installer (or filesystem image, or the like) with everything needed for those programs to run (the dependencies of the packages, and things needed to run programs at all)?


'E:The package linux-headers-3.5.0-54 needs to be reinstalled, but I can't find an archive for it. ' when upgrading the system

I am using Ubuntu 12.04, and I try to upgrade to 14.04.1 using the terminal using:               do-release-upgrade      but I keep getting the following error:               SystemError: E:The package linux-headers-3.5.0-54 needs to be      reinstalled, but I can't find an archive for it.       How can I fix the error and go on with the upgrade? Output for `sudo apt-get check` is:               Reading package lists... Done     Building dependency tree            Reading state information... Done     E: The package linux-headers-3.5.0-54 needs to be reinstalled, but I can't find an archive for it.      Output for `sudo dpkg -C`               The following packages are in a mess due to serious problems during     installation.  They must be reinstalled for them (and any packages     that depend on them) to function properly:      linux-headers-3.5.0-54 (no description available)      Out put for `cat /etc/apt/sources.list`               # deb cdrom:[Ubuntu 12.04.2 LTS _Precise Pangolin_ - Release i386 (20130213)]/ precise main restricted          # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to     # newer versions of the distribution.     deb http://us.archive.ubuntu.com/ubuntu/ trusty main restricted     deb-src http://us.archive.ubuntu.com/ubuntu/ trusty main restricted          ## Major bug fix updates produced after the final release of the     ## distribution.     deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates main restricted     deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-updates main restricted          ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu     ## team. Also, please note that software in universe WILL NOT receive any     ## review or updates from the Ubuntu security team.     deb http://us.archive.ubuntu.com/ubuntu/ trusty universe     deb-src http://us.archive.ubuntu.com/ubuntu/ trusty universe     deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates universe     deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-updates universe          ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu      ## team, and may not be under a free licence. Please satisfy yourself as to      ## your rights to use the software. Also, please note that software in      ## multiverse WILL NOT receive any review or updates from the Ubuntu     ## security team.     deb http://us.archive.ubuntu.com/ubuntu/ trusty multiverse     deb-src http://us.archive.ubuntu.com/ubuntu/ trusty multiverse     deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates multiverse     deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-updates multiverse          ## N.B. software from this repository may not have been tested as     ## extensively as that contained in the main release, although it includes     ## newer versions of some applications which may provide useful features.     ## Also, please note that software in backports WILL NOT receive any review     ## or updates from the Ubuntu security team.     deb http://us.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse     deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse          deb http://security.ubuntu.com/ubuntu trusty-security main restricted     deb-src http://security.ubuntu.com/ubuntu trusty-security main restricted     deb http://security.ubuntu.com/ubuntu trusty-security universe     deb-src http://security.ubuntu.com/ubuntu trusty-security universe     deb http://security.ubuntu.com/ubuntu trusty-security multiverse     deb-src http://security.ubuntu.com/ubuntu trusty-security multiverse          ## Uncomment the following two lines to add software from Canonical's     ## 'partner' repository.     ## This software is not part of Ubuntu, but is offered by Canonical and the     ## respective vendors as a service to Ubuntu users.     # deb http://archive.canonical.com/ubuntu precise partner     # deb-src http://archive.canonical.com/ubuntu precise partner          ## This software is not part of Ubuntu, but is offered by third-party     ## developers who want to ship their latest software.     deb http://extras.ubuntu.com/ubuntu trusty main     deb-src http://extras.ubuntu.com/ubuntu trusty main


Bash pattern to match all files but directories

In bash, how do I specify a pattern that matches everything but subdirectories in current directory. Given that the pattern `*/` matches all the subdirectories, I tried (with extglob turned on):               $ echo !(*/)      But it didn't work.


How do I set different directories for different domains on CentOS 5.5 server?

I'm running a CentOs 5.5 server and wanted to know what commands I needed to run to be able to do the following; I have 3 domains on the server - example1.com, example2.com, example3.com I wanted to set up in conf so that the file contents of each domain are in different directories, so that I can upload 3 completely different sites using the one server. ie: /home/site1/ would be the upload dir for example1.com, /home/site2/ would be for example2.com, etc. If someone could help me with a line by line for terminal it would be very much appreciated!   Thank you!