Problem in writing message from one terminal to another terminal

I have a user of name `x` in tty1 and `y` in tty2. `x` wants to write some message to `y` and vice-versa. When I typed `write y tty2` in the tty1 terminal, it said:               write:you have write permission turned off     write:y has messages disabled      I then tried to enable messages:               $ mesg     is n     $ mesg y      Now I can successfully write a message from `x` to `y` or vice-versa, but the first line of error continues to appear. I have tried logging out and back in again, but the symptom doesn't change. I also looked through the file `/etc/default/devpts` and saw that `TTYMODE=620`.


How do I configure the GNOME gdm login screen?

I recently installed Arch Linux and have it mostly set up. With many other Linux distributions, there is a tool that is used to configure the look and feel of the login screen. I would like to change the wallpaper used, the date/time format from something like "Sat 6:27 PM" to "26 Feb 11 18:27", and the refresh rate of the monitor (it's fine when I'm logged in, but not at the login screen). Where can I find these configuration options or (preferably) a GNOME application to allow for me to make these configuration changes?


verify: command not found exception when trying to get value from user

**Code Explanation:** The below code is a simple script written by me to send a Installation status alert mail. It will be sent after completion of a linux software installation. In this code, If the user accept the mail notification he will be asked to enter his mail id. Then the mail will be send to him after installation completed.               #!/bin/bash          #######################################     # Independent Variables and  Properties Here     #######################################     PL_EMAIL_ALERT=""     #######################################     # User to get Email Alert     #######################################     echo "This will help user to get an email of an installation status."     verify -s "Do want to send Email"     if [ "$VerAns" = "y" ]     then         read -e -p "Enter Email ID: " PL_EMAIL_ALERT     fi     #######################################     # Sending Email Alert     #######################################     echo "Sending Mail"     if [ ${#PL_EMAIL_ALERT} -ne 0 ]     then         mail -s "software INSTALLATION MAIL ALERT" $PL_EMAIL_ALERT <<< "message1"     fi     echo ""     echo "Final step"     echo ""      **Problem:** My problem is when I try to execute the code I am getting the following error. _`verify: command not found`_ As I am very new to linux I am unable to fix this issue. Can you please help me to understand what exactly I missed.


CentOS 6.5 installation hangs on first screen

I'm trying to install CentOS 6.5 in Virtual Box. The problem is, the installation hangs on the first screen after waiting about 10 seconds. How can I pass this screen? The steps I installed: 1) Create virtual machine ![enter image description here](http://i.stack.imgur.com/TJNl6.png) 2) Start it It shows "Automatic boot in 10 seconds" and count down, then it freezes as below ![CentOS 6.5 Installation Screen](http://i.stack.imgur.com/ykq2u.png) After many times failing, I tried to press Print key. It shows multiple options, choosing any option causes hanging. The only selectable option is "Install (Text Mode)", press it, it shows `"This kernel requires an x86-64 CPU, but only detected an i686 CPU. Unable to boot - please use a kernel appropriate for your CPU"`.


Running time command with cron

So I have a crontab that have this line:               30 16 * * * (time sysbench --test=cpu --cpu-max-prime=20000 run) 2>> ~/cpu.out      I use this because time output goes by default to stderr and I want to redirect it to a file When I run the command in the terminal it does write the output I need:               real X.XXXs     user X.XXXs     sys  X.XXXs      But when I run with cron it writes this to the file:               39.69 user 0.92 system 0:40.67elapsed 99%CPU (0avgtext+0avgdata 1400maxresident)k0inputs+1outputs (0major+450minor) pagefaults 0swaps      Can someone help me? PS: In the man page there is the -o option but it is not working, if I try that I get an error


notify-send command with -u critical and -t option

I sometimes see the command :               notify-send -u critical -t 3000 "Example"      However, with `-u critical`, it seems like the notification doesn't time out. What is the purpose of adding a timeout option then? Do you have a link which explains exactly what the `notify-send` does? The ones I found were not very detailed in their explanations. What is the purpose of the `-u` option, btw?


Decreasing mouse sensitivity at kernel level

I have developed a custom-GUI Server, which runs on virtual console of Linux.For mouse-handling purpose, it reads the mouse device file               /dev/input/mice       and retrieves the event data and updates the pointer position.How can I add the facility of the feature of changing mouse-sensitivity to this software?               One solution may be is to change the mouse driver config file.      But i dont know where it is located or is there any such options, that fulfills my need.Thank you


svn switch --relocate: wrong uuid?

I am trying to switch to a new SVN repository. I currently have the following checkout:               $ svn info     svn+ssh://some.server.edu/home/name/svn-repositories/proj/trunk      Now I wanted to switch, but I get an error:               $ svn switch --relocate \       svn+ssh://some.server.edu/home/name/svn-repositories/proj/trunk \       https://subversion.assembla.com/svn/name/trunk/proj .     svn: The repository at 'https://subversion.assembla.com/svn/name/trunk/proj'      has uuid '...', but the WC has '...'      I thought the whole point of `svn switch --relocate` was that there are two repositories with different uuids? How can I correctly switch to the new repos? BTW, the directories should be correct: The old `proj/trunk` and the new `trunk/proj` contain exactly the same files etc.:               $ svn ls https://subversion.assembla.com/svn/<name>/trunk/proj     foo.txt     $ svn ls svn+ssh://some.server.edu/home/name/svn-repositories/proj/trunk     foo.txt      I am using svn 1.6.5 on the Mac.


How can I solve the error in svn mailer.py?

I got this error, please help me:               Sep  6 18:29:50 dmayavanlo1 logger: Going to execute the email notification command         Sep  6 18:29:50 dmayavanlo1 logger:   File "/home/bugzilla/mysvn/hooks/mailer.py", line 972         Sep  6 18:29:50 dmayavanlo1 logger:     if data.commit_url         Sep  6 18:29:50 dmayavanlo1 logger:     ^         Sep  6 18:29:50 dmayavanlo1 logger: IndentationError: unexpected indent         Sep  6 18:42:38 dmayavanlo1 logger: Going to execute the email notification command         Sep  6 18:42:38 dmayavanlo1 logger:   File "/home/bugzilla/mysvn/hooks/mailer.py", line 972         Sep  6 18:42:38 dmayavanlo1 logger:     if data.commit_url:         Sep  6 18:42:38 dmayavanlo1 logger:     ^         Sep  6 18:42:38 dmayavanlo1 logger: IndentationError: unexpected indent


How to customize vertical panel in cinnamon menu?

![enter image description here](http://i.stack.imgur.com/5v02c.png) I want to edit highlited area: for example, change firefox with chromium or remove any item. Menu editor can change only right part of menu, changing default application has no effect on this panel.


How to update 'command cache' after change of soft links?

I have changed multiple soft links on my system with `ln -f -s`. When I view the link with `ls -l`, I see they point to the right target. However, when I try to run the command, it still tries to use the 'old' target. Is there a Linux command to refresh the 'command cache' to tell the system to use the newly-created soft links? For example:               OPEN_MPI_PATH=/usr/lib64/mpi/gcc/openmpi     ln -f -s ${OPEN_MPI_PATH}/bin/mpirun  /usr/bin/mpirun     ls -l /usr/bin/mpirun     $ /usr/bin/mpirun -> /usr/lib64/mpi/gcc/openmpi/bin/mpirun      Execution of `mpirun -np 4 hello_world` results in a call to Intel MPI, which was an 'old' target.


What are the two head.S files in linux source ?

In the linux source there are two different head.S files located at: arch/arm/kernel/head.S arch/arm/boot/compressed/head.S What is the puprpose of each one and what is the order of there execution ?


vim/gvim failing to put X11 clipboard in registers "+ or "*?

Due to the lack of security with standard vino server, I switched to use x11vnc on my linux (with Xubuntu 14.04) box and SSVNC on the windows side. With vino, cut and paste from windows to Linux and windows, in the two directions, was flaky(1) but when it worked, it worked for every program; I could use the `vim` register `"+` without problem. I run(2)               autocutsel -fork       normally so that the "middle click" and ctrl-c/v selections are the same. Now that I use x11vnc (called with: `x11vnc -forever -repeat -safer -usepw -ssl -autoport 6000`) to have a safe, encrypted connection, a problem arose:   1. I can copy on windows and paste in the remote linux terminals, libreoffice etc. without any problem, in both directions.    2. In `vim`, or `gvim`, any attempt to paste with `"+p` or `"*p` says `E353: Nothing in register *`   3. Again in `vim` or `gvim`, the other way around does work: if I `"+yy` then I can paste the thing on the Windows side.  As anyone any clue about this problem? The strange thing is that paste works everywhere I checked but in `vim`...               Package                 Installed       Previous        Now             State     =======================-===============-===============-===============-=====     vim                     2:7.4.052-1ubuntu3  2:7.4.052-1ubuntu3  2:7.4.052-1ubuntu3  install     vim-gnome               2:7.4.052-1ubuntu3  2:7.4.052-1ubuntu3  2:7.4.052-1ubuntu3  install      _Footnotes:_ (1) can't find the bug now --- it is reported. It stops working after a while. (2) I tried with and without. No changes.


How to give Read, Write Permissions using IPs in SAMBA

I want to give Read and Write access based on the IPs instead of the Users in SAMBA using smb.conf This is the Text I copied from my smb.conf file.               [TEST]             comment = test             path = /mnt/vg-stg/storage/test             read only = no             writeable = yes             oplocks = yes             level2 oplocks = yes             force security mode = 0             dos filemode = yes             dos filetime resolution = yes             dos filetimes = yes             fake directory create times = no        browseable = yes        csc policy = manual        veto oplock files = /*.mdb/*.MDB/*.dbf/*.DBF/        veto files = /*:Zone.Identifier:*/        store dos attributes = yes        map acl inherit = yes             create mode = 0777             directory mode = 2777             printable = no             guest ok = yes             hosts allow = 10.20.20.213             #hosts readonly allow =          [TEST]             comment = test             path = /mnt/vg-stg/storage/test             read only = yes             writeable = no             oplocks = yes             level2 oplocks = yes             force security mode = 0             dos filemode = yes             dos filetime resolution = yes             dos filetimes = yes             fake directory create times = no        browseable = yes        csc policy = manual        veto oplock files = /*.mdb/*.MDB/*.dbf/*.DBF/        veto files = /*:Zone.Identifier:*/        store dos attributes = yes        map acl inherit = yes             create mode = 0777             directory mode = 2777             printable = no             guest ok = yes             hosts allow = 10.20.20.147             #hosts readonly allow =      But the Samba is not picking up the changes. Because when i try to access from explorer or Nautilus it is giving me error               Could not display "smb://XXX.XXX.XXX.XXX/Reports     The file is of an unknown type      Please give me advice what im doing wrong here


Routing 4 Networks

I've been trying for almost a week to make it work but without success. I'm starting to feel hopeless. I have 4 Ethernet adapters :               1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN         link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00         inet 127.0.0.1/8 scope host lo         inet6 ::1/128 scope host            valid_lft forever preferred_lft forever     2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000         link/ether 30:85:a9:ad:54:1e brd ff:ff:ff:ff:ff:ff         inet 10.100.36.2/29 brd 10.100.36.7 scope global eth0         inet6 fe80::3285:a9ff:fead:541e/64 scope link            valid_lft forever preferred_lft forever     3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000         link/ether a0:f3:c1:04:64:40 brd ff:ff:ff:ff:ff:ff         inet 69.70.164.242/30 brd 69.70.164.243 scope global eth1         inet6 fe80::a2f3:c1ff:fe04:6440/64 scope link            valid_lft forever preferred_lft forever     4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000         link/ether a0:f3:c1:04:a0:2f brd ff:ff:ff:ff:ff:ff         inet 10.45.13.1/24 brd 10.45.13.255 scope global eth2         inet6 fe80::a2f3:c1ff:fe04:a02f/64 scope link            valid_lft forever preferred_lft forever     5: eth3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000         link/ether 28:10:7b:c9:58:76 brd ff:ff:ff:ff:ff:ff         inet 10.45.15.1/24 brd 10.45.15.255 scope global eth3         inet6 fe80::2a10:7bff:fec9:5876/64 scope link            valid_lft forever preferred_lft forever      This is the default route my linux server (Debian) give me at startup :               69.70.164.240/30 dev eth1  proto kernel  scope link  src 69.70.164.242     10.100.36.0/29 dev eth0  proto kernel  scope link  src 10.100.36.2     10.45.15.0/24 dev eth3  proto kernel  scope link  src 10.45.15.1     10.45.13.0/24 dev eth2  proto kernel  scope link  src 10.45.13.1     default via 10.45.15.254 dev eth3     default via 10.45.13.254 dev eth2     default via 69.70.164.241 dev eth1     default via 10.100.36.1 dev eth0      Here's what I want to do. eth0 is my VDSL line and eth1 is my cable line. I want to:   * Forward all traffic from `10.45.13.0` (eth2) to the gateway `10.100.36.1` (eth0)   * Forward all traffic from `10.45.15.0` (eth3) to the gateway `69.70.164.241` (eth1) If I make this work, I would be happy enough but I would also like to make `10.45.13.0` invisible from `10.45.15.0` and vice-versa.


index.html is not working in apache document root

I have got Ubuntu 12.04. I have a file `index.html` in apache'd document root but apache lists all the files when I access the document root from the browser. It works fine if I replace `index.html` by `index.php`. My `/etc/apache2/sites-enabled/000-default`:               <VirtualHost *:80>         ServerAdmin webmaster@localhost          DocumentRoot /home/test/www     <Directory /home/test/www/>             Options Indexes FollowSymLinks MultiViews             AllowOverride All             Order allow,deny             allow from all         </Directory>                        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/         <Directory "/usr/lib/cgi-bin">             AllowOverride None             Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch             Order allow,deny             Allow from all         </Directory>              ErrorLog ${APACHE_LOG_DIR}/error.log              # Possible values include: debug, info, notice, warn, error, crit,         # alert, emerg.         LogLevel warn              CustomLog ${APACHE_LOG_DIR}/access.log combined              Alias /doc/ "/usr/share/doc/"         <Directory "/usr/share/doc/">             Options   MultiViews FollowSymLinks             AllowOverride None             Order deny,allow             Deny from all             Allow from 127.0.0.0/255.0.0.0 ::1/128         </Directory>          </VirtualHost>      I have `/etc/apache2/mods-enabled/dir.conf`:               <IfModule mod_dir.c>                    DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm          </IfModule>      I did lot of searching but don't know my why `index.html` is not working and is getting listed in the browser. If I keep both the files (index.html and index.php), then index.php works fine. Here is the output of `ls -l /home/test/www`:               total 1816236     -rw-r--r--  1 root   www-data          3 Jun  3 10:09 index.html     -rw-r--r--  1 ubuntu www-data         53 Mar  4 16:55 index.php     drwxrwsr-x  5 ubuntu www-data       4096 May 12 05:03 lifetimeholidays     -rw-r--r--  1 root   www-data 1859796992 May 29 10:32 magentolive17_4_2014.zip     drwxrwsr-x 15 ubuntu www-data       4096 May 28 15:22 railsapp     drwxr-sr-x 15 root   www-data       4096 May 28 17:15 railsapp1     drwxrwxr-x  2 ubuntu www-data       4096 Apr 29 09:05 var


Can I put 2 disks into a raid-0 array without reformating the FS?

We have an existing /dev/sda disk, we are adding an identical /dev/sdb I want to place these two disks in a raid-0 array. Can I do that without reformating /dev/sda?


Rebuild damaged system directory (for example, /lib)

Let's say I have a Linux system, either Debian, Ubuntu, or CentOS, where a user removed `/lib`, for example. Let's also say that I managed to boot this system with a livecd version of whatever OS it was running. Is it possible to run a command that will rebuild `/lib` on the damaged system? For example, I would guess that something like this could work by re- installing all packages that the target system had in use. I had a colleague encounter this situation, but the end result was a full reinstall. However, that got me thinking if a repair is possible, and perhaps quicker?


Why is du giving me unexpected output?

I'm new to Linux, so sorry for my simple question. I'm on Ubuntu. I have this directory:               $ ls -al     total 16     drwxr-xr-x 2 alberto alberto 4096 2011-04-03 16:02 .     drwxr-xr-x 4 alberto alberto 4096 2011-04-03 16:01 ..     -rw-r--r-- 1 alberto alberto    7 2011-04-03 16:02 .hidden     -rw-r--r-- 1 alberto alberto    4 2011-04-03 15:51 testfile      When I run `du`, I'm expecting this:               $ du     4   testfile     4   .hidden      But I'm getting this:               $ du     12  .     $ du *     4   testfile     $ du .*     12  .     20  ../snippet     12  ../test     52  ..     4   .hidden      Why is this happening?


Creating formatted partition from nothing

I need to create filesystem with just one partition from nothing (`/dev/zero`). I tried this sequence of commands:               dd if=/dev/zero of=mountedImage.img bs=512 count=131072     fdisk mountedImage.img         n         p          2048         131072      Basically, I need to create 64MB image file filled with zeroes. Then I use `fdisk` to add a new partition for new filesystem (which should finally be FAT32), starting at sector `2048` and using all remaining sectors.               losetup /dev/loop1 mountedImage.img     mkfs -t vfat /dev/loop1      But here I'm hitting problems. If I set up a `loop` device and format it using `mkfs -t vfat`, partition table is overwritten and filesystem (FAT32) is placed to disk. I don't need whole disk formatted with FAT32, I just need my primary partition to be so. Does anybody know how can I format only one partition of raw disk image, not whole image? Please help.


Script to restart the application

I need to write a script for the below scenario in Linux:   * Run a cron every 5 minutes.   * `grep` the application log file to see if we can see the pattern "ORA-".   * If we see this pattern:     * stop the service.     * Rename the application log file with timestamp appended.     * Start the service. So each time there is a problem, within 5 minutes the application will get restarted.


umount an external ntfs drive as non-root

I have ntfs-3g installed, and use this udev rule to auto mount external drives automatically. When I try umount it as non-root, it says:               umount: /media/umm is not in the fstab (and you are not root)      The device mounts as:               /dev/sdc1  fuseblk    150G  143G  6.6G  96% /media/umm      and is part of the `users` group. I did a `chkdsk` on a Windows machine to ensure no file system errors. Any ideas? (personally I'd prefer not to use ntfs, but I need it for sharing with all the non-UNIX systems and allow for files > 4GB).


How to find/correct error in a path

It's often that a long path is mistyped or you get a log file entry that a path does not exist. Is there a command or shell function that navigates the path hierarchy until it finds a matching path? The command line exchange could go like this:               $ ls /var/lib/my/supper/complicated/path     File or directory not found     $ fixpath /var/lib/my/supper/complicated/path     Found /var/lib/my      As a bonus feature, a similarity detection would be great:               $ fixpath /var/lib/my/supper/complicated/path     Found /var/lib/my     Did you mean /var/lib/my/super/complicated/path


Detached screen on a remote host

I have a local script that runs a remote script via ssh. The local script is minecraft.php:               ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i {$this->pemkey} {$this->ssh_user} sudo /vol/start_bukkit.sh      The remote script is /vol/start_bukkit.sh:               #!/bin/bash     cd "/vol/bukkit"     /usr/bin/screen -S bukkit -m -d /usr/local/bin/java -Xnoclassgc -Xms1024M -Xmx1024M -jar /vol/bukkit/craftbukkit.jar nogui      What happens is that the java command works, launching craftbukkit.jar, but screen doesn't launch a new window. What's going on? How can a new window be created? If I sign in to the remote server and run start_bukkit.sh then screen works as expected, creating a newly detached window running craftbukkit.jar in it. **EDIT:** I got it to work. I updated the local script by removing the sudo and putting the screen command in. Here it is:               ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i {$this->pemkey} {$this->ssh_user} /usr/bin/screen -S bukkit -m -d /vol/start_bukkit.sh      On the remote side I removed the screen command:               #!/bin/bash     cd "/vol/bukkit"     /usr/local/bin/java -Xnoclassgc -Xms1024M -Xmx1024M -jar /vol/bukkit/craftbukkit.jar nogui      I can't explain why this works.


Easiest way to sandbox an user

I'd like to sandbox a user so that they can only read files under `/media/shared/somefolder`. What's the easiest way to accomplish this? Users/groups? ACL? AppArmor? Some context: Plex Media Server is a media server with a web interface that allows you to browse all of your server's file-system searching for media files. I don't want users to be able to navigate my whole filesystem, not even in read-only mode! So I need to restrict the `plex` user.


Could not boot from an external hard drive

I burned a live session of Linux Mint 17 Cinnamon to a USB stick. Then I installed LM17C into an external hard drive by using this USB stick. I managed to do it and even successfully started on my computer. However I have tried to boot it on another computer, yet it did not started and gave the error below:               error: file '/boot/grub/i386-pc/normal.mod' not found.     entering rescue mode...     grub rescue >      My computer has an Intel processor, but the second PC has AMD. I think this is the problem. I do not know how to solve it, though.


Creating a file from another file on the basis of a numeric value in each line

We will generate a csv file with below values.               yp1234,577,1,3     yp5678,570,3,5     yp9012,132,8,9      I need to extract data and create files based on second column. If it's value greater than 577 then the whole line has to be extracted and placed in a separate file. I mean I need a file having lines with second column greater than 577. Please assist using `sed` or `awk` command.


Emacs: mode-local macro with dashes and dots

In Emacs, how can I make a macro, that is local to the HTML mode, and uses dashes and dots? Take a look at the Elisp below:               (define-abbrev-table 'html-mode-abbrev-table        '(("..." "…")   ; won't work          ("---" "—")    ; won't work          ("aaa" "…")   ; works          ("bbb" "—") )) ; works


two instances of privoxy not working

SOLVED Always check for those pesky capital letters! In the privoxytor config file I had typed that the location of the config file as privoxyTor with a capital 'T' -why privoxy needs this I have know idea as it's accessing the file already. * * * After following the instructions here: https://trac.torproject.org/projects/tor/wiki/doc/RunTwoPrivoxys And, excepting one difference - I used the name privoxytor instead of privoxy2, I can't seem to get the second instance of privoxy running and can't find any more error messages. The original still starts up fine with "service privoxy start", but the new one, while not giving any error messages does not. running "service privoxytor status" gives: "privoxytor is not running ... failed!" here is my init.d file # ! /bin/sh               ### BEGIN INIT INFO     # Provides:          privoxytor     # Required-Start:    $local_fs $remote_fs $named $network $time     # Required-Stop:     $local_fs $remote_fs $named $network $time     # Default-Start:     2 3 4 5     # Default-Stop:      0 1 6     # Short-Description: Privacy enhancing HTTP Proxy     # Description:       Privoxy is a web proxy with advanced filtering     #                    capabilities for protecting privacy, filtering     #                    web page content, managing cookies, controlling     #                    access, and removing ads, banners, pop-ups and     #                    other obnoxious Internet junk.     ### END INIT INFO          # Author: Roland Rosenfeld <roland@debian.org>          # Do NOT "set -e"          # PATH should only include /usr/* if it runs after the mountnfs.sh script     PATH=/sbin:/usr/sbin:/bin:/usr/bin     DESC="filtering parent proxy server for Tor"     NAM=privoxy     NAME=${NAM}tor     echo $NAME     DAEMON=/usr/sbin/${NAME}     echo $DAEMON     PIDFILE=/var/run/${NAME}.pid     echo $PIDFILE     OWNER=${NAME}     echo $OWNER     CONFIGFILE=/etc/${NAME}/config     echo $CONFIGFILE     DAEMON_ARGS="--pidfile $PIDFILE --user $OWNER $CONFIGFILE"     SCRIPTNAME=/etc/init.d/${NAME}     LOGDIR=/var/log/${NAME}     DEFAULTSFILE=/etc/default/${NAM}          # Exit if the package is not installed     [ -x "$DAEMON" ] || exit 0          # Read configuration variable file if it is present     [ -r $DEFAULTSFILE ] && . $DEFAULTSFILE          # Create log directory if it does not exist     if [ ! -d "$LOGDIR" ]; then         mkdir -m 750 $LOGDIR         chown $OWNER:adm $LOGDIR     fi          # Load the VERBOSE setting and other rcS variables     . /lib/init/vars.sh          # Define LSB log_* functions.     # Depend on lsb-base (>= 3.0-6) to ensure that this file is present.     . /lib/lsb/init-functions          #     # Function that starts the daemon/service     #     do_start()     {             # Return             #   0 if daemon has been started             #   1 if daemon was already running             #   2 if daemon could not be started             start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \                 || return 1             start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \                 $DAEMON_ARGS \                 || return 2             # Add code here, if necessary, that waits for the process to be ready             # to handle requests from services started subsequently which depend             # on this one.  As a last resort, sleep for some time.     }          #     # Function that stops the daemon/service     #     do_stop()     {             # Return             #   0 if daemon has been stopped             #   1 if daemon was already stopped             #   2 if daemon could not be stopped             #   other if a failure occurred             start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME             RETVAL="$?"             [ "$RETVAL" = 2 ] && return 2             # Wait for children to finish too if this is a daemon that forks             # and if the daemon is only ever run from this initscript.             # If the above conditions are not satisfied then add some other code             # that waits for the process to drop all resources that could be             # needed by services started subsequently.  A last resort is to             # sleep for some time.             start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON             [ "$?" = 2 ] && return 2             # Many daemons don't delete their pidfiles when they exit.             rm -f $PIDFILE             return "$RETVAL"     }          #     # Function that sends a SIGHUP to the daemon/service     #     do_reload() {             #             # If the daemon can reload its configuration without             # restarting (for example, when it is sent a SIGHUP),             # then implement that here.             #             start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME             return 0     }               case "$1" in       start)             if [ "$RUN_DAEMON" = "no" ]; then                 [ "$VERBOSE" != no ] && log_warning_msg "Not starting $DESC (disabled in $DEFAULTSFILE)."                 exit 0             fi                  [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"             do_start             case "$?" in                 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;                 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;             esac             ;;       stop)             [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"             do_stop             case "$?" in                 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;                 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;             esac             ;;       #reload|force-reload)             #             # If do_reload() is not implemented then leave this commented out             # and leave 'force-reload' as an alias for 'restart'.             #             #log_daemon_msg "Reloading $DESC" "$NAME"             #do_reload             #log_end_msg $?             #;;       restart|force-reload)             #             # If the "reload" option is implemented then remove the             # 'force-reload' alias             #             if [ "$RUN_DAEMON" = "no" ]; then                 [ "$VERBOSE" != no ] && log_warning_msg "Not restarting $DESC (disabled in $DEFAULTSFILE)."                 exit 0             fi                  log_daemon_msg "Restarting $DESC" "$NAME"             do_stop             case "$?" in               0|1)                 do_start                 case "$?" in                     0) log_end_msg 0 ;;                     1) log_end_msg 1 ;; # Old process is still running                     *) log_end_msg 1 ;; # Failed to start                 esac                 ;;               *)                 # Failed to stop                 log_end_msg 1                 ;;             esac             ;;       status)             status_of_proc "$DAEMON" "$NAME"             exit $?             ;;            *)             #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2             echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|status}" >&2             exit 3             ;;     esac          :      And here is the result of "strace /etc/init.d/privoxytor start"               execve("/etc/init.d/privoxytor", ["/etc/init.d/privoxytor", "start"], [/* 22 vars */]) = 0     brk(0)                                  = 0x161c000     access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)     mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f4df95c7000     access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)     open("/etc/ld.so.cache", O_RDONLY)      = 3     fstat(3, {st_mode=S_IFREG|0644, st_size=98415, ...}) = 0     mmap(NULL, 98415, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f4df95ae000     close(3)                                = 0     access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)     open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY) = 3     read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\300\357\1\0\0\0\0\0"..., 832) = 832     fstat(3, {st_mode=S_IFREG|0755, st_size=1595408, ...}) = 0     mmap(NULL, 3709016, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f4df9020000     mprotect(0x7f4df91a0000, 2097152, PROT_NONE) = 0     mmap(0x7f4df93a0000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x180000) = 0x7f4df93a0000     mmap(0x7f4df93a5000, 18520, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f4df93a5000     close(3)                                = 0     mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f4df95ad000     mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f4df95ac000     mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f4df95ab000     arch_prctl(ARCH_SET_FS, 0x7f4df95ac700) = 0     mprotect(0x7f4df93a0000, 16384, PROT_READ) = 0     mprotect(0x7f4df95c9000, 4096, PROT_READ) = 0     munmap(0x7f4df95ae000, 98415)           = 0     getpid()                                = 2698     rt_sigaction(SIGCHLD, {0x40f270, ~[RTMIN RT_1], SA_RESTORER, 0x7f4df90524f0}, NULL, 8) = 0     geteuid()                               = 0     brk(0)                                  = 0x161c000     brk(0x163d000)                          = 0x163d000     getppid()                               = 2697     stat("/etc/privoxytor", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0     stat(".", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0     open("/etc/init.d/privoxytor", O_RDONLY) = 3     fcntl(3, F_DUPFD, 10)                   = 10     close(3)                                = 0     fcntl(10, F_SETFD, FD_CLOEXEC)          = 0     rt_sigaction(SIGINT, NULL, {SIG_DFL, [], 0}, 8) = 0     rt_sigaction(SIGINT, {0x40f270, ~[RTMIN RT_1], SA_RESTORER, 0x7f4df90524f0}, NULL, 8) = 0     rt_sigaction(SIGQUIT, NULL, {SIG_DFL, [], 0}, 8) = 0     rt_sigaction(SIGQUIT, {SIG_DFL, ~[RTMIN RT_1], SA_RESTORER, 0x7f4df90524f0}, NULL, 8) = 0     rt_sigaction(SIGTERM, NULL, {SIG_DFL, [], 0}, 8) = 0     rt_sigaction(SIGTERM, {SIG_DFL, ~[RTMIN RT_1], SA_RESTORER, 0x7f4df90524f0}, NULL, 8) = 0     read(10, "#! /bin/sh\n### BEGIN INIT INFO\n#"..., 8192) = 5094     write(1, "privoxytor\n", 11privoxytor     )            = 11     write(1, "/usr/sbin/privoxytor\n", 21/usr/sbin/privoxytor     )  = 21     write(1, "/var/run/privoxytor.pid\n", 24/var/run/privoxytor.pid     ) = 24     write(1, "privoxytor\n", 11privoxytor     )            = 11     write(1, "/etc/privoxytor/config\n", 23/etc/privoxytor/config     ) = 23     geteuid()                               = 0     stat("/usr/sbin/privoxytor", {st_mode=S_IFREG|0755, st_size=273616, ...}) = 0     faccessat(AT_FDCWD, "/usr/sbin/privoxytor", X_OK) = 0     faccessat(AT_FDCWD, "/etc/default/privoxy", R_OK) = -1 ENOENT (No such file or directory)     stat("/var/log/privoxytor", {st_mode=S_IFDIR|0750, st_size=6, ...}) = 0     open("/lib/init/vars.sh", O_RDONLY)     = 3     fcntl(3, F_DUPFD, 10)                   = 11     close(3)                                = 0     fcntl(11, F_SETFD, FD_CLOEXEC)          = 0     read(11, "#\n# Set rcS vars\n#\n\n# Because /e"..., 8192) = 1228     stat("/etc/default/rcS", {st_mode=S_IFREG|0644, st_size=620, ...}) = 0     open("/etc/default/rcS", O_RDONLY)      = 3     fcntl(3, F_DUPFD, 10)                   = 12     close(3)                                = 0     fcntl(12, F_SETFD, FD_CLOEXEC)          = 0     read(12, "#\n# /etc/default/rcS\n#\n# Default"..., 8192) = 620     read(12, "", 8192)                      = 0     close(12)                               = 0     faccessat(AT_FDCWD, "/proc/cmdline", R_OK) = 0     pipe([3, 4])                            = 0     clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f4df95ac9d0) = 2703     close(4)                                = 0     read(3, "BOOT_IMAGE=/boot/vmlinuz-3.2.0-4"..., 128) = 95     read(3, "", 128)                        = 0     close(3)                                = 0     wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 2703     --- SIGCHLD (Child exited) @ 0 (0) ---     rt_sigreturn(0x11)                      = 2703     read(11, "", 8192)                      = 0     close(11)                               = 0     open("/lib/lsb/init-functions", O_RDONLY) = 3     fcntl(3, F_DUPFD, 10)                   = 11     close(3)                                = 0     fcntl(11, F_SETFD, FD_CLOEXEC)          = 0     read(11, "# /lib/lsb/init-functions for De"..., 8192) = 8192     read(11, " \" * Starting remote filesystem "..., 8192) = 3253     pipe([3, 4])                            = 0     clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f4df95ac9d0) = 2704     close(4)                                = 0     read(3, "/lib/lsb/init-functions.d/20-lef"..., 128) = 46     read(3, "", 128)                        = 0     close(3)                                = 0     wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 2704     --- SIGCHLD (Child exited) @ 0 (0) ---     rt_sigreturn(0x11)                      = 2704     faccessat(AT_FDCWD, "/lib/lsb/init-functions.d/20-left-info-blocks", R_OK) = 0     open("/lib/lsb/init-functions.d/20-left-info-blocks", O_RDONLY) = 3     fcntl(3, F_DUPFD, 10)                   = 12     close(3)                                = 0     fcntl(12, F_SETFD, FD_CLOEXEC)          = 0     read(12, "# Default info blocks put to the"..., 8192) = 1093     read(12, "", 8192)                      = 0     close(12)                               = 0     stat("/etc/lsb-base-logging.sh", {st_mode=S_IFREG|0755, st_size=11, ...}) = 0     open("/etc/lsb-base-logging.sh", O_RDONLY) = 3     fcntl(3, F_DUPFD, 10)                   = 12     close(3)                                = 0     fcntl(12, F_SETFD, FD_CLOEXEC)          = 0     read(12, "FANCYTTY=0\n", 8192)          = 11     read(12, "", 8192)                      = 0     close(12)                               = 0     read(11, "", 8192)                      = 0     close(11)                               = 0     open("/dev/null", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3     fcntl(1, F_DUPFD, 10)                   = 11     close(1)                                = 0     fcntl(11, F_SETFD, FD_CLOEXEC)          = 0     dup2(3, 1)                              = 1     close(3)                                = 0     stat("/sbin/start-stop-daemon", {st_mode=S_IFREG|0755, st_size=28152, ...}) = 0     clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f4df95ac9d0) = 2707     wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 2707     --- SIGCHLD (Child exited) @ 0 (0) ---     rt_sigreturn(0x11)                      = 2707     dup2(11, 1)                             = 1     close(11)                               = 0     clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f4df95ac9d0) = 2708     wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 1}], 0, NULL) = 2708     --- SIGCHLD (Child exited) @ 0 (0) ---     rt_sigreturn(0x11)                      = 2708     read(10, "", 8192)                      = 0     exit_group(0)


Detecting Physical Network Addresses Reliably

I'm trying to find a way to list physical (aka MAC) addresses for all network cards/interfaces attached to a certain host. The problem is, I want this functionality on my Debian live (squeeze) USB image which is plugged into many different boxes with widely diverse hardware. So the wireless driver (for example) isn't always available on my USB stick, and thus I can't obtain the physical address from `ifconfig`. I was under the impression that I could achieve this by querying `/sys/class/net/*/address` where `*` is the interface name in question. But this is not the case. I think there should be a way of querying the hardware for the physical address even if the device driver is not installed. So my questions are:   1. Is it actually possible to query the physical address of a network device even if its device driver isn't installed?   2. If it's possible, how?


What methods are used to encrypt passwords in /etc/passwd and /etc/shadow?

A careful examination of the `/etc/passwd` and `/etc/shadow` files reveal that the passwords stored are hashed using some form of hashing function. A quick Google search reveals that by default, the passwords are encrypted using DES. If an entry begins with `$`, then it indicates that some other hashing function was used. For example, some entries on my Ubuntu machine begin with `$6$`... What do the various numbers represent?


Run Ubuntu 10.04 LTS with Apache2 SSL with passphrase

I am setting up a Virtual Machine with Ubuntu 10.04 Lucid Lynx Server. I have been reading the section on setting up Apache with an SSL certificate within the book : "Beginning Ubuntu LTS Server Administration - 2nd Edition" Contrary to the official documentation, the book advises to always use a 'pass phrase' when setting up Apache with SSL (to protect your reputation if the private SSL key is compromised). If you set-up a 'pass phrased SSL key' then you are required to type a pass phrase each time you start Apache. This is a slight problem if Apache starts up automatically when Ubuntu boots up. On page 338 it then offers a tip to prevent Apache from starting up at boot time. > ...To ensure that it doesn't start automatically, enter the line > `NO_START=0` in `/etc/default/apache2` I have modified that `/etc/default/apache2` file accordingly, rebooted and Apache2 is still trying to start-up upon boot. The `NO_START=0` line seems to have no effect. As I look through forums on the web, it seems that most people have issues and then end up skirting the problem by simply using a certificate without a pass phrase. Does anyone know the the best practice method of preventing Apache from starting up at boot time for a passphrased secure _SSL'd Apache_?


What happens the most, context switches or mode switches?

Which happens the most, context switches or mode switches? I have two answers myself, but I do not know which one is correct:   1. Context switches happen in user mode, but this does not mean that a system call is needed; therefore, mode changes do not happen when a context switch occurs.   2. Context switches mean a dispatch is needed. I think this is privileged, so a mode change from user to kernel mode is needed to do a context switch. Which means a context switch goes along with a mode switch. Anyone have a definite answer to this?


Configure UML to generate core file

The User Mode Linux (UML) I run on Ubuntu crashes occasionally, but does not generate any core file. I'd like to know the necessary configuration to be applied on UML so it generates a core when it crashes. Also, additional configuration which will ease the process of analyzing the core would be appreciated.


Change view in emacs dired mode

What options are there to change the view of a directory in `emacs dired mode`? How to apply it? How can I change it on the fly? In particular I want to know:   * How to make it show the file sizes in human readable format (MB, GB, ...)?   * How to omit the permissions, owner and group in the list view?   * How to change appearance of symbolic links? (I want it to be displayed like regular files i.e. **_without_** the target, but in another color to indicate that they are links).


Add item to inittab on OpenSuse 12.1

I am currently working on a project which needs to be added to `inittab` so that the program loads during startup. The program that I am trying to start is a c# mono application. I have created a start script and if the start script is run manually the program launches fine. However, when I put it into `inittab` the program doesn't launch. I've checked in `/var/log/messages` but it doesn't say anything is wrong, it just says that it is reloading. Below is what I have added to my `inittab` script               bes:2345:respawn:/home/bits/MyProgram/start.myprogram      Thanks for any help you can provide **UPDATE** Below is the code in the start script which is located in /home/bits/MyProgram.               #!/bin/sh          cd /home/bits/MyProgram          /usr/bin/mono EmailServer.exe "$@"      I have also tried adding > mylog.txt onto the end of the line beginning with /usr/bin/mono e.g. > /usr/bin/mono EmailServer.exe "$@" > mylog.txt If I run the start script manually, even if I am not in the directory where the start script is located it works fine, its just when I add it to inittab and run telinit q it never starts and the log isn't written to but the log does get written to if I start the program manually. Thanks for any help you can provide.


Why is /etc/passwd open to public for reading?

Is there any reason that /etc/passwd should be world-wide readable ? It's not like password hashes that shouldn't be exposed, I just want to know why.


Compiling Android Image error: rebase-apply still exists but mbox given

I am building an android image on fedora, and I am running into some problems. I have done this before and had no issues. Does anyone know how to fix this problem?               error: bootable/bootloader/lk/: prior sync failed; rebase still in progress     !!!Error Downloading code!!!     Applying patches ...        applying patches on ./bootable/bootloader/lk ...      previous rebase directory /home/Max/workdir/APQ8074_M8974AAAAANLYA31050108_JB_V10/bootable/bootloader/lk/.git/rebase-apply still exists but mbox given.           FAIL: Current working dir:/home/Max/workdir/APQ8074_M8974AAAAANLYA31050108_JB_V10/bootable/bootloader/lk


Wrong PAM settings: successful login logged as failure

SERVER:/etc/pam.d # head -1 /etc/issue               SUSE LINUX Enterprise Server 9.4      SERVER:/etc/pam.d # cat login               #%PAM-1.0     auth requisite  pam_unix2.so    nullok     #set_secrpc     auth required   pam_securetty.so     auth required   pam_nologin.so     #auth    required   pam_homecheck.so     auth required   pam_env.so     auth required   pam_mail.so     #account required pam_tally.so deny=5 reset no_magic_root     account required    pam_unix2.so     password required   pam_pwcheck.so  nullok md5     password required   pam_unix2.so    nullok use_first_pass use_authtok md5     session required    pam_unix2.so    none     # debug or trace     session required    pam_limits.so      SERVER:/etc/pam.d # cat sshd               #%PAM-1.0     auth     required   pam_tally.so no_magic_root     auth     required       /lib/security/pam_unix.so   # set_secrpc     auth     required       /lib/security/pam_nologin.so     auth     required       /lib/security/pam_env.so     #account required pam_tally.so deny=5 reset no_magic_root     account  required       /lib/security/pam_unix.so     password required       /lib/security/pam_pwcheck.so     password required       /lib/security/pam_unix.so       use_first_pass use_authtok md5     session  required       /lib/security/pam_unix.so   none # trace or debug     session  required       /lib/security/pam_limits.so     SERVER:/etc/pam.d #      SERVER:/etc/pam.d #       SERVER:/etc/pam.d # faillog -u pamtest               Username   Failures  Maximum  Latest     pamtest           0        5  Thu Aug 29 13:35:15 +0200 2013 on localhost      SERVER:/etc/pam.d # ssh pamtest@localhost               pamtest@localhost's password:      Last login: Thu Aug 29 13:35:15 2013 from localhost     pamtest@SERVER:~> exit     logout     Connection to localhost closed.     SERVER:/etc/pam.d # faillog -u pamtest     Username   Failures  Maximum  Latest     pamtest           1        5  Thu Aug 29 13:39:40 +0200 2013 on localhost     SERVER:/etc/pam.d #       **Q:** Why does the system logs the successful login as failed login? "UsePAM yes" is in the sshd_config. (Does the order of the lines in the ex.: sshd file counts?)


MySQL server won't install to a new os (Debian, Ubuntu)

Today I wanted to install (on a new VPS with new OS) a MySQL server. I used this command:               apt-get install mysql-server mysql-common mysql-client-5.5      I tried with Debian 7 (x64 and x86) and Ubuntu 13.04 (x64 and x86). Every time I got this error message:               140223  9:37:33 [Warning] Using unique option prefix key_buffer instead of key_b     uffer_size is deprecated and will be removed in a future release. Please use the      full name instead.     140223  9:37:33 [Warning] Using unique option prefix myisam-recover instead of m     yisam-recover-options is deprecated and will be removed in a future release. Ple     ase use the full name instead.     140223  9:37:33 [Note] Plugin 'FEDERATED' is disabled.     140223  9:37:33 InnoDB: The InnoDB memory heap is disabled     140223  9:37:33 InnoDB: Mutexes and rw_locks use GCC atomic builtins     140223  9:37:33 InnoDB: Compressed tables use zlib 1.2.7     140223  9:37:33 InnoDB: Using Linux native AIO     140223  9:37:33  InnoDB: Warning: io_setup() failed with EAGAIN. Will make 5 att     empts before giving up.     InnoDB: Warning: io_setup() attempt 1 failed.     InnoDB: Warning: io_setup() attempt 2 failed.     InnoDB: Warning: io_setup() attempt 3 failed.     InnoDB: Warning: io_setup() attempt 4 failed.      A video in which I'm trying to install Ubuntu: http://youtu.be/nULSfa0xZdU


sendmail error dsn=5.0.0, stat=Service unavailable

i have configured an sendmail configuration in ubuntu 12.04 64 bit machine when i'm send th email through a perl script it gives the below error                dsn=5.0.0, stat=Service unavailable      and mail is not been sent. i check on with other machine wherein its sending email and functioning as designed `dsn=2.0.0, stat=sent`.. can i know how to make it work or change setting for proper functionality.. the logs are :               Sep  2 17:38:12 mail sendmail[5522]: r82C8CpE005522: from=root, size=148, class=0, nrcpts=1, msgid=<201309021208.r82C8CpE005522@mail.server.local>, relay=root@localhost     Sep  2 17:38:13 mail sm-mta[5523]: r82C8CtA005523: from=<root@mail.server.local>, size=373, class=0, nrcpts=1, msgid=<201309021208.r82C8CpE005522@mail.server.local>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]     Sep  2 17:38:13 mail sendmail[5522]: r82C8CpE005522: to=suhaskekuda@gmail.com, ctladdr=root (0/0), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=30148, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (r82C8CtA005523 Message accepted for delivery)     Sep  2 17:38:16 mail sm-mta[5525]: STARTTLS=client, relay=gmail-smtp-in.l.google.com., version=TLSv1/SSLv3, verify=FAIL, cipher=DES-CBC3-SHA, bits=168/168     Sep  2 17:38:19 mail sm-mta[5525]: r82C8CtA005523: to=<suhaskekuda@gmail.com>, ctladdr=<root@mail.server.local> (0/0), delay=00:00:06, xdelay=00:00:06, mailer=esmtp, pri=120373, relay=gmail-smtp-in.l.google.com. [173.194.79.27], dsn=5.0.0, stat=Service unavailable     Sep  2 17:38:19 mail sm-mta[5525]: r82C8CtA005523: r82C8JtA005525: DSN: Service unavailable     Sep  2 17:38:19 mail sm-mta[5525]: r82C8JtA005525: to=<root@mail.server.local>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=30000, dsn=2.0.0, stat=Sent      etc/mail/access is               Connect:localhost       RELAY     GreetPause:localhost    0     ClientRate:localhost    0     ClientConn:localhost    0          Connect:127             RELAY     GreetPause:127          0     ClientRate:127          0     ClientConn:127          0     Connect:IPv6:::1        RELAY     GreetPause:IPv6:::1     0     ClientRate:IPv6:::1     0     ClientConn:IPv6:::1     0          # Defaults     GreetPause:             5000     ClientRate:             10     ClientConn:             10          Spam:postmaster@    FRIEND     Spam:abuse@     FRIEND     Spam:spam@      FRIEND          #Connect:0      REJECT whilst invalid, this also blocks sendmail -bs -Am     Connect:169.254 REJECT     Connect:192.0.2 REJECT     Connect:224     REJECT     Connect:255     REJECT


How to mark "not fully installed" apt-get package as "successfully installed"

I have installed Debian 7.4 on my Iomega ix2-200 NAS, following this blog. The ix2-200 is running an ARM Marvel CPU and has a 128 MB NAND flash memory. The flash contains an initramfs image (uInitrd) and a kernel image (uImage) to boot the system. Sometimes, a new package (like `cryptsetup`) requieres to update the kernel and fails (`Unsupported platform`). I manually need to flash the new initramfs `initrd.img-3.2.0-4-kirkwood` and kernel `vmlinuz` via `mkimage`, which works fine. The (anoying) issue: everytime I run `apt-get upgrade` the system is showing up those unfinished packages. **How can I tell my system that everything is fine?** I have tried Google and StackExchange, but most of the posts are dealing with how to remove those unfinished/incomplete packages. I want to keep it! Please see attached code snapshot:               #> apt-get install cryptsetup     Reading package lists... Done     Building dependency tree     Reading state information... Done     The following extra packages will be installed:       console-setup console-setup-linux cryptsetup-bin kbd keyboard-configuration libcryptsetup4 xkb-data     Suggested packages:       dosfstools     The following NEW packages will be installed:       console-setup console-setup-linux cryptsetup cryptsetup-bin kbd keyboard-configuration libcryptsetup4 xkb-data     0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded.     Need to get 3,179 kB of archives.     After this operation, 11.8 MB of additional disk space will be used.     Do you want to continue [Y/n]? y          ...          Processing triggers for initramfs-tools ...     update-initramfs: Generating /boot/initrd.img-3.2.0-4-kirkwood     Unsupported platform.     run-parts: /etc/initramfs/post-update.d//flash-kernel exited with return code 1     dpkg: error processing initramfs-tools (--configure):      subprocess installed post-installation script returned error exit status 1     Errors were encountered while processing:      initramfs-tools     E: Sub-process /usr/bin/dpkg returned an error code (1)          #> apt-get upgrade     Reading package lists... Done     Building dependency tree     Reading state information... Done     0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.     1 not fully installed or removed.     After this operation, 0 B of additional disk space will be used.     Do you want to continue [Y/n]?


I Can't login as root with su command, but I can with SSH

How is it possible that I cannot log in as root by `su root` or `su` (I get incorrect password error), _but_ I can log in by `ssh root@localhost` or `ssh root@my_local_IP` with the same password? I'm using CentOS 6.4. * * * ### _Update1_ :               cat /etc/pam.d/su      gives:               #%PAM-1.0     auth        sufficient  pam_rootok.so     # Uncomment the following line to implicitly trust users in the "wheel" group.     #auth       sufficient  pam_wheel.so trust use_uid     # Uncomment the following line to require a user to be in the "wheel" group.     #auth       required    pam_wheel.so use_uid     auth        include     system-auth     account     sufficient  pam_succeed_if.so uid = 0 use_uid quiet     account     include     system-auth     password    include     system-auth     session     include     system-auth     session     optional    pam_xauth.so      ### _Update2_ :               $ sudo grep su /var/log/secure | grep -v sudo      gives :               Feb 23 13:12:17 fallah su: pam_unix(su:auth): authentication failure;     logname=fallah uid=501 euid=501 tty=pts/0 ruser=fallah rhost=  user=root      repeated about 20 times.


Is there any env variable to turn --color (and the like) on for all commands?

I do use aliases to turn on color for some commands by default. But I'm wondering if there's an easier way at telling my system, color is supported, don't make me use `\--color` for `grep`, `ls`, etc.


When wouldn't one want `cp` to be recursive?

Under what conditions might one wish to use the `cp` command on a directory yet have it _not_ be recursive? Consider:               $ tree     .     └── old         └── inner             └── a.txt          2 directories, 1 file          $ cp old/inner/ .     cp: omitting directory `old/inner/'          $ tree     .     └── old         └── inner             └── a.txt          2 directories, 1 file      What did that do at all? So why would one ever not use the `-r` flag, and therefore why isn't it implied without specifying it? Note that the `-r` flag has no ill effect on regular files:               $ cp -r old/inner/a.txt .     $ ls     a.txt  old      I do realize that I could alias `cp` to `cp -r` but my goal is to understand what is the reason, not fix anything.


Boot partiotionless disk with syslinux

A file system can be configured to span a complete disk, omitting any partition table. Notice intentionally the command to do so does not use `/dev/sda1` but the raw, unpartitioned device instead.               mkfs.btrfs /dev/sda      The Idea is mentioned in the Arch Linux Wiki article about btrfs. I tried this in a virtual machine using a btrfs file system as only storage. It can even be booted from using grub, following the instruction in the wiki. ext3, ext4 and jfs also work that way. I only tested these, but most filesystem place the first block with an offset and thus leave enough space for a boot record. Now I would like to use syslinux instead of grub. The aforementioned wiki already indicates that this makes a dedicated placement of the `ldlinux.sys` neccessary, but does not include instructions to solve this. I highly suspect that the usual `mbr.bin` file would also not be appropriate, because it is normally responsible to read the partition table and find an active bootable partition. Now, there is not partition to be found. Does someone have any experience with using syslinux with a partitionless disk? Can a partitionless disk be booted using syslinux?


pkg: fail to extract pkg-static, New to UNIX

I am very new to UNIX, running FreeBSD 10 on an ASUS M50VM series laptop. I was following along with the handbook to the point at which it gets into using pkg to find software. Every time I run pkg, with or without options or arguments, I get the following output:               $ pkg     The package management tool is not yet installed on your system.     Do you want to fetch and install it now [y/N]: y     Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/freebsd:10:x86:64/latest, please wait...     Verifying signature with trusted certificate pkg.freebsd.org.2013102301... done     pkg: fail to extract pkg-static     $      My FreeBSD laptop is connected with an Ethernet cable to my router, which I know is providing Internet access, as the Windows desktop I am currently using to post this question is also connected with a similar cable to the same router. I tried searching for the error message on Google, but most of what I found appeared to be dealing with different problems from mine. What am I missing? What are possible causes of this issue? What should I check? Thank you!


call a script if a zenity window is minimized, resized or moved

I would like to add an event-catcher, if my the `zenity` window gets minimized, resized or moved. I already call a script if the window is closed or the button is pressed in my typebreak script But I would also like to catch minimizing, resizing and moving of the zenity window too, so I can then also call the `mouse-speed` script inside my `typebreak` script. I use Unity on Ubuntu but the script already works on different window- managers too.


What utilities do I need to begin android development on Ubuntu?

I already would work by some Cortex-A boards(for instance Cubieboard, Marsboard,...) I've already started working with integrated circuits:   * Cubieboard   * Marsboard I've been directed to learn linux, but this poses a problem. I don't have enough experience with it - like the changes between distributions. In my case, I'd like to use Android and Ubuntu - but I don't want to scope my knowledge to just Cortex-A boards. Recently I've been turned on to rawbrawb in this question that I can use Android for modules. To sum it up:   1. What toolchain(s) will I **need** to work with Android on Ubuntu?   2. Is the following package suitable for android experimentation? Free Download Android OS 4.1.1 Jelly Bean


Disk is almost full on a server with CPanel

I have VHM system and I have a domain and two subdomain on this system. I tried to take a backup than after sometime I cannot access cpanel but I can access VHM. but some of the VHM options gives disk space error. which is: > The filesystem mounted at / on this server is running out of disk space. > cPanel operations have been temporarily suspended to prevent something bad > from happening. Please ask your system admin to remove any files not in use > on that partition. On VHM the disk information as follow: Disk information               Device  Mount point Usage        /dev/mapper/VolGroup00-home   /home   30% (126,759,988 of 458,391,760)     /dev/mapper/VolGroup00-root   /       100% (19,593,632 of 20,642,428)        /usr/tmpDSK                   /tmp    3% (10,601 of 495,844)


Disabling graphical login in Debian wheezy

I have installed Debian wheezy on my machine with a netinst image, now I would like to deactivate the desktop and boot straight to the command line, not only that but I would like to not waste any resource on the X11/gnome/gdm at all if not needed. I tried ( as root )               update-rc.d -f gdm remove     update-rc.d -f gdm3 remove     update-rc.d -f wdm remove      but Debian keeps booting into the login manager, I really don't need that, how I can deactivate this kind of boot and start X only when needed ?


Unable to run yum update on virtualized centOS 6.3

I am running a virtualized CentOS 6.3 on a Windows 7 computer. The computer (4 GB RAM) is connected to a corporate network. When I run yum update, it shows some progress, then eventually the VM (2 GB RAM) freezes, this has happened nearly 5 times now. I've also tried updating using the graphic package manager, same thing happens, any ideas why this is happening?


One host, two virtual machines that cannot ping each other. How to solve

We have Virtual Machines operating within the `KVM` environment. We setup one as a dev server running `Apache` etc., and the other as a `Windows` development environment. The two environments are setup and running fine. However, they cannot ping each other. I am wondering if there is a clear solution to this. This is what is happening. From Host:                 Cannot ping either of 2 VM's (one `Linux`, one `Windows`)      From Either of the VM's:                 Cannot ping host       Cannot ping each other      From other network machines (for instance my laptop from within my company network)                 Successfully ping host at 192.168.0.64       Successfully ping VM1 (Linux) 192.168.0.43       Successfully ping VM2 (Windows) 192.168.0.84


Squeeze/Lenny compilation : Library Link error

I've got a problem here : I have a C++ Library ("DataTsBroad") and a C++ Test app ("DataTsBroadTest"), to test it.   Actually, the Lib and the Test app are both compiled an a Debian Lenny. Now, i want to continue to compile my Test app on a Debian Lenny (customer constraint), but I would compile my lib on a Squeeze or a Wheezy to work on the last Debian releases. So, I successfully compiled my Lib on a Squeeze, But, after, when I try to compile my Test app with this Lib on the Lenny, it fails! There is a Link Error: > > Linking CXX executable DataTsBroadTest > /home/nis/pezierg/test/ProductMak/Export/DataTsBroad/L64/Release/libDataTsBroad64.so: > **undefined reference to `std::ctype::_M_widen_init() > const@GLIBCXX_3.4.11'**   >  collect2: ld returned 1 exit status   >  make[2]: *** [DataTsBroadTest] Error 1   >  make[1]: *** [CMakeFiles/DataTsBroadTest.dir/all] Error 2   >  make: _*_ [all] Error 2 The problem is certainly due to **ostream** C++ Lib, I tried to comment all it's uses in my Lib and it works. But how can I really fix the problem?


how does ping zero works?

can anybody explain how does `ping 0` works and it translate to `127.0.0.1`.               [champu@testsrv ]$ ping 0     PING 0 (127.0.0.1) 56(84) bytes of data.     64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.039 ms     64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.013 ms          --- 0 ping statistics ---     2 packets transmitted, 2 received, 0% packet loss, time 1000ms     rtt min/avg/max/mdev = 0.013/0.026/0.039/0.013 ms


get result text from CLI command

I'm writing a bash script and I need to capture the text resulting from the output of the `rsync` command, for instance, the following command:               rsync -av "$FOLDER1" "$FOLDER2"      prints:               ...     sent 109,423 bytes  received 352 bytes  219,550.00 bytes/sec     ...      and I want to capture that line (`sent 109,423 bytes received 352 bytes 219,550.00 bytes/sec`) and put that string in a variable in my script. How can I do that?


What happens to the files when they are being decrypted?

I have the server's webroot directory mounted on a partition which is being protected with LUKS encryption. I want to know what happens to the files within when that partition is being decrypted. Does   * a copy of the unencrypted version of these files goes to the RAM, or;   * a copy of the unencrypted version of these files goes to the temp directory, or;   * the server decrypts the files upon demand each time they are being accessed, or;   * other scenarios I have missed? The reason why I ask this is to have a better understanding on the decryption process and how it affects the server's resource in terms of CPU and RAM and whether disk encryption with LUKS is more efficient compared to file system encryption like eCryptfs. I tried looking at Wikipedia but could not find any such information. Not sure if this is the best place to ask this question. Feel free to migrate if you think otherwise. Thanks.


How to emulate a KWin effect by command line?

I would like to apply the **Toogle Invert Effect** when I start my system. So, I need to know how to call this KWin effect using the terminal. OBS.: I'd tried `xte "keydown Meta_L" "key i" "keyup Meta_L"`, but didn't work.


How to move /usr from one partition to another partition safely

Linux, Debian. Now I have:               /dev/sda5   on /     /dev/sda6   on /home     /dev/sda7   on /usr      I would like to use sda6 to hold `/usr`, then free `/dev/sda7` for other use. What is the safest way to do this? I am confused about how to create a `/usr` on `/dev/sda6` and issue copy command without confusing Linux.


vsftpd with email notification

It would be good if `vsftpd` has some kind of features that will send email notification if there are some one who are attempting to connect on ftp server and/or getting a lot of permission denied users. I would like to hear someone who knows of this kind of setup.


Using Command Line (Linux) how do I enable the Bluetooth Adapter?

I have 1 BlueTooth adapter on my laptop. Using the command line, I want to be able to enable / disable it. This would be the same functionality that is achieved using GUI -> Bluetooth settings -> Bluetooth ON | OFF.


Why does my sudo ask for password only once but evaluate thrice?

$ sudo some_command     Password:     Sorry, try again.     Sorry, try again.     Sorry, try again.     sudo: 3 incorrect password attempts     $      This is what my shell prints when I enter a wrong password to a sudoed command. Why could this happen? * * *               $ sudo -V     Sudo version 1.6.7p5     $ uname -a     Linux lazer 2.6.18-164.0.0.0.1.el5xen #1 SMP Thu Sep 3 00:34:43 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux     $


How can I install KateSql plugin on ubuntu?

I am slightly new to Ubuntu and I just installed kate by typing `sudo apt-get install kate`. Now I want to install this kate sql plugin and google is not helping me. I downloaded a punch of files from here but what should I do with these files ? Where should I put them ? Would you please tell me how can I install this ? Thanks


Convert file with integers written in ascii to binary file of integers

I have a file that contains a long list of integers written in ascii separated with newlines, like such:               -175     2     -19345     345592     -45     2355      etc... I want to convert this file into a "binary" file containing the same integers, written as actual 4 byte integers. What command-line tool can I use to achieve this?


Folder with ONLY write permission is useless... right?

Having worked with Linux for years, and finding myself with some free time, I decided to revisit some basics. So I re-read the stuff about permissions (without checking source code), and its special cases for folders, and came up with a new (to me at least...) way of thinking about folder permissions (for a specific user/group/others): I imagine a folder as a table with two columns, like so:               filename | inode         foo      | 111       bar      | 222       The **read** permission means you can read (and list) the left column of the table, the **write** permission corresponds to adding and removing entries to the table, and the **execute** permission corresponds to being able to translate from file name to inome; i.e. you can _access_ the contents of the folder. I did some experiments, and the results are all consistent with this "worldview" of mine, but one conclusion seems inescapable: that a folder with permissions `d-w-------`, is totally useless. Elaborating: you can't list its contents, you can't read any files you know exist inside (because you can't translate names into inodes), you can't remove or rename or add files, because again that would imply translation, and you can't even add hardlinks (because, I surmise, that would mean adding a name and an inode number, which means you would know both, which in turn, again surmising, violates the purpose of unsetting execution permission). And of course, if there _are_ files inside one such folder, then you can't delete that folder either, because you can't delete its contents. So... I would like to ask two questions:   1. Is this analogy of mine correct, or is it a big blunder?    2. Irrespective of the previous answer, is there _any_ situation where having a folder with permissions as described is appropriate?


How do I count the exact total of created and deleted sqlite journal files?

I'm trying to figure this out. Scenario is this: A threaded tcp socket daemon with a sqlite back-end stores information in a unique sqlite2 file per IMEI ID, in an unique sub-directory per day (`pseudo: 2012/11/01/event_$imei.sqlite`). About 3000 of them for each day. As you know, there is a phase that an sqlite journal file is being created and deleted while receiving and storing incoming data. This application only writes in either today's or yesterdays directory, (small) datafeeds can take up to 255 seconds. So there is a phase-over at 00:00 UTC. During a connection multiple writes can happen, the network link stays open and the assets can send additional bursts of new data while the connection is open. No explicit locking is going on at all, sqlite handles itself, a connection is simply unique per imei, so never there are 2 threads writing to the same file. With other words, the controlling daemon doesn't have a clue of what sqlite does nor does it care. I want to count the number of sqlite journal files ever created as a 2 totals at a given point in time of course. Essentially they are about the same but never really the same, they only live for very short amount of time anyway. Monitoring systems usually count the number of present files as a snapshot in time. That is not the sort of metric I'm looking for. So How can you accurately do this sort of count with the smallest footprint on the load ? There must be a trick, it's *nix after all. The system here is an Ubuntu server but I slightly prefer -but not limited to- a general solution. But keep in mind new directories will be created as time passes and I should be able to follow that, and I want it volatile (so a reboot can(must) reset this). Thanks in advance for bootstrapping me in any direction.


In Emacs, how do I inspect what has been modified in a buffer (before saving and overwriting the file)? (In a sense, the requested action is an analog of `git status` and `git add -i` showing what has been modified, only the comparison should be done between the buffer contents (in Emacs's memory) and the file on disk.) Sometime, I forget what has been modified in a buffer, and would like to call a command to remind me.


Share keyboard over network as separate device?

I am trying to achieve something similar to this: http://superuser.com/questions/67659/linux-share-keyboard-over-network The difference is that I need the remote keyboard to be usable _separate from my local keyboard_. The method described in the link seems to pipe the events into an existing device file. I need the remote keyboard to show as a physical (slave) device when I run `xinput list` Why do I need this? I am trying to play a two player game but I don't have an external USB keyboard, so I want to pipe the keypresses from the remote computer to a fake device (so I can assign one device per player).


Login by ssh , exec one command and i don't want to quit the bash

I want to change PS1 when i ssh another centos                   strshell = 'PS1="remote!"'         os.system("ssh -i %s -l%s -p%s %s %s"%(SSH_KEY,SSH_USER,SSH_PORT,des,strshell))        ssh quit automatically. I want to stay in this shell.How to achieve it. I just change another way to do this                tin = ' sudo -i ; export PS1="Remote! \W :"; exec /bin/bash -i'      os.system("ssh  -i%s -l%s -p%s %s -t%s" % (SSH_KEY, SSH_USER, SSH_PORT, des, tin))        but i changed my local machine prompt not the remote one. why?   **os.system is a python function**


Use Emulated Scrollwheel Instead of Real One X11

So I've got this Kensington trackball that ships with a pretty horrible scrollwheel/touchring doohicky, and only two physical buttons. I'd like to disable the touchscroll entirely, enable 3 button emulation and use the emulated third button as the emulated wheel activator. When I do               Section "InputClass"         Option "EmulateWheel" "true"         Option "EmulateWheelButton" "2"         Option "Emulate3Buttons" "true"         Option "ButtonMapping" "1 2 3 0 0"         Option "YAxisMapping" "4 5"         Option "XAxisMapping" "6 7"     EndSection      The touchscroll is disabled, but so is the logical X11 YAxis buttons (4 & 5) so I can only scroll horizontally. Anyone know if its possible to preference emulated scrolling over the wheel itself? Edit: Made some progress. X11 manual mentions the "ZAxisMapping" which changes the buttons that initiate a scroll event (I think).               Section "InputClass"         Option "EmulateWheel" "true"         Option "EmulateWheelButton" "2"         Option "Emulate3Buttons" "true"         Option "ButtonMapping" "1 2 3 0 0"         Option "YAxisMapping" "11 12"         Option "XAxisMapping" "6 7"         Option "ZAxisMapping" "11 12 6 7"     EndSection      Making the arguments match what I've mapped to the emulated scrollwheel seems to work in urxvt, but not in any gtk apps. (I assume gtk doesn't utilize the ZAxisMapping option from xorg.conf but rather continues to listen for the disabled 4 and 5 butons.)


How to get data count between two strings with multiple occurences in the same file

I have the data in my file as               START-OF-FIELDS     ID     NAME     DEPT     END-OF-FIELDS          START-OF-DATA     1|joy|cs     2|sam|ec     END-OF-DATA          START-OF-FIELDS     ID      NAME     DOB     DEPT     ADDRESS     END-OF-FIELDS          START-OF-DATA     5|joe|13/2/2001/|ee|street1     3|gwen|4/08/1999|cs|street2     END-OF-DATA      EXPECTED OUTPUT:-               ID     NAME     DEPT      Count for data set 1 is: 3               ID      NAME     DOB     DEPT     ADDRESS      Count for data set 2 is: 5 and so on for dynamic no. of data sets. I want count of data between both START-OF-FIELDS & END-OF-FIELDS & for START- OF-DATA & END-OF-DATA. can any body give me exact code to do this. I have used               sed -n '/^START-OF-FIELDS/,/END-OF-FIELDS/{s/^START-OF-FIELDS//;/^END-OF-FIELDS/d;p;}' Sourcefile.txt > START_OF_FIELDS.TXT          wc -l START_OF_FIELDS.TXT      But I am not getting desired result.


How do I create a USB image with a partition table?

I want to create an image of some directory tree that is writable directly to an USB drive, just like the images of many linux distributions. For example, with openSUSE you can download an ISO image that is writable directly the USB using `dd`.               root@computer# dd if=openSUSE.iso of=/dev/sdb      I tried to create images using `mkisofs`, but when I ran the `dd` command above with that image didn't get a partition table, which made windows not recognize the format of the drive and linux didn't present `/dev/sdb1`. I also tried to create an empty file, and then create a filesystem in that file using `mkfs.vfat`. There seem to be a lot of tutorials on the web on how to write images to USB drives as well as dumping an usb drive to file, but I haven't found anything on creating an image with a partition table. The problem I'm trying to solve with this is to distribute a preformated USB stick, so there is no need for the stick to be bootable, and I would also like to make this process scriptable.


How do I make kvkbd virtual keyboard appear on the login screen?

I am trying to set up Fedora (KDE desktop) on a PC with a touch screen. I got kvkbd working which I am finding works decently enough that I might be able to use this machine without a keyboard at all, which is the final goal. But for now I have no access to it from the login screen, so I need to use an actual keyboard just for that part. **How can I configure it to appear at login, before entering the user's desktop?** I have followed some of the directions in the 'Kvkbd Handbook' in the help menu of the software, including adding lines to /etc/kde/kdm/Xsetup and using the `\--loginhelper` parameter. So far, no luck.


Is there a condensed side-by-side diff format?

I have two log files with thousands of lines. After pre-processing, only some lines differ. These remaining lines are either real differences, or shuffled groups of lines. Unified diffs allow me to see the detailed differences, but it makes manual comparison with eye balls hard. Side-by-side diffs seems more useful for comparison, but it also adds thousands of unchanged files. Is there a way to get advantage of both worlds? Note, these log files are generated by `xscope` which is a program that monitors Xorg protocol data. I am looking for general-purpose tools that can be applied to situation similar to the above, not specialized webserver access log analysis tools for example. * * * Two example log files are available at http://lekensteyn.nl/files/qemu-sdl- debug/ (`log13` and `log14`). A pre-processor command can be found in the `xscope-filter` file which removes timestamps and other minor details.


Matching several patterns on one line

I often use a program called `tty0tty`, which creates a null modem using PTYs. Now I want to make it part of an automated process. When I start `tty0tty` it prints               (/dev/pts/1) <=> (/dev/pts/2)      Would it be possible to parse the output and use the matches as parameters to another program? So that the following lines could be automated:               linux$ tty0tty &     (/dev/pts/X) <=> (/dev/pts/Y)     linux$ someprogram /dev/pts/X &     linux$ microcom /dev/pts/Y


Why does the paste command add line breaks?

I have 2 files: _d_ and _t_. I would like to be able to combine these files so that the first line of file t is followed by a tab and then the first line of d. For shorter lines, `paste t d` seems to work fine.               $ cat d t     Highly reactive metals in group 1A of the periodic table.     Fairly reactive metals in group 2A of the periodic table.     alkali metals     alkaline earth metals     $ paste d t     Highly reactive metals in group 1A of the periodic table.   alkali metals     Fairly reactive metals in group 2A of the periodic table.   alkaline earth metals     $ paste t d     alkali mHighly reactive metals in group 1A of the periodic table.     alkalineFairly reactive metals in group 2A of the periodic table.      Trying to paste full sentences seems to act strangely. As seen above, the terms get trimmed down to the first 8 characters.               $ paste t d > temp     $ gedit temp &     $ vim temp      Opening gedit shows line breaks following each term. Vim shows this:               alkali metals^M Highly reactive metals in group 1A of the periodic table.     alkaline earth metals^M Fairly reactive metals in group 2A of the periodic table.      Well, that seems to be easy enough to fix. `:%s/^V^M//g` removes all of the carriage returns, and everything shows up correctly. But how did those carriage returns end up there in the first place? While my question does involve carriage returns in a text file from Windows making things act strangely in a Unix-like environment, it is not a duplicate of this question. The problems are similar, but the manifestations are very different. It took me around an hour to figure out that carriage returns were even the culprit because I could not find an instance of a similar enough problem through web searches. That is why I posted this after having solved it myself.


clear full-screen in script and get the previous prompts after exiting script

Today I was using `glance` tool in my office to monitor CPU utilization.When I run `glance` from terminal ,the command clears the screen and after all the work when I quit back to the terminal,the previous prompts are still there on my screen.I mean that I can see all the previous lines.My question is how is this effect of clearing screen achieved.If they had used command like `clear`,It should have cleared the whole screen,how did they manage to get back all the previous prompts ? I want to implement the same feature for some of my scripts. Similarly when using `vi` command ,the screen is fully occupied and after exiting,we are able to view previous prompts as well.


GNU/Hurd vs. GNU/Linux

I was quite surprised to learn that the GNU project has an independent kernel of their own called Hurd. And there are mainstream distributions like Arch Hurd and Debian GNU/Hurd which uses it. Is there any significant advantage for Hurd over Linux?


Having several qdisc for each device, which is the first to process?

I have read about queuing disciplines here http://lartc.org/. Having this traffic shaping policy:               ....     qdisc pfifo_fast 0: dev ppp0 root bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1     qdisc pfifo_fast 0: dev ppp2 root bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1      Assuming that there is only outgoing traffic in band 0 of ppp0 qdisc and band 2 of ppp2 qdisc, which is dequeued first? I understand that band 0 is prioritized over band 2 within same qdisc, but is band 0 of ppp0 qdisc prioritized over band 2 of ppp2 qdisc?.


What tool to edit the /usr/share/mime/packages/freedesktop.org.xml file

I edited my /usr/share/mime/packages/freedesktop.org.xml (with a text editor) to modify the file icon of application/x-7z-compressed mime type :               <mime-type type="application/x-7z-compressed">       <generic-icon name="package-x-generic"/>      I would like to know if there is a tool to edit this file (or to change the icon of a mime type) instead of using a text editor ? **EDIT:** My aim is to script my modifications of the freedesktop.org.xml file, so that an text editor is not appropriate.   I would like a command-line tool to edit the `name` attribut of the `generic- icon` tag of a chosen MIME type. **EDIT:** As @Gilles pointed it to me, it should be better to modify the `$XDG_DATA_HOME/mime/packages/Override.xml` file instead of `/usr/share/mime/packages/freedesktop.org.xml` file. But this does not really change my question.


Can anyone tell me why I need to click twice in VLC just so that a little plus button would appear?

Basically what happens is this:   I open VLC and go to my playlist and there are tons of folders there. I double-click on one and its icon changes to a folder icon and a plus sign appears next to it, but it stays closed. Then I need to double-click again to see what songs are in it. Is this normal? On Ubuntu 11.10 I didn't have this problem, but now on my Linux Mint 14 Mate...I do.


What is the difference between virbr# and vnet#?

I am running KVM on RHEL6, and I have created several virtual machines in it. Issuing `ifconfig` command to the host system command line shows a list of virbr0, virbr1... and vnet0, vnet2... Are they the IP addresses of the the guest OS? What are the differences between virbr# and vnet#?


Wine/PoL giving numerous errors in Fedora 17

I've been trying to run a handful of indy games for Windows on my laptop through Wine, but got a bunch of errors along the lines of:               wine: created the configuration directory '/home/jude/.wine'     fixme:storage:create_storagefile Storage share mode not implemented.     err:mscoree:LoadLibraryShim error reading registry key for installroot     err:mscoree:LoadLibraryShim error reading registry key for installroot     err:mscoree:LoadLibraryShim error reading registry key for installroot     err:mscoree:LoadLibraryShim error reading registry key for installroot     fixme:storage:create_storagefile Storage share mode not implemented.     err:winediag:SECUR32_initNTLMSP ntlm_auth was not found or is outdated. Make sure that ntlm_auth >= 3.0.25 is in your path. Usually, you can find it in the winbind package of your distribution.     fixme:iphlpapi:NotifyAddrChange (Handle 0xefe2c8, overlapped 0xefe2e0): stub     p11-kit: couldn't load module: /usr/lib/pkcs11/gnome-keyring-pkcs11.so: /usr/lib/pkcs11/gnome-keyring-pkcs11.so: cannot open shared object file: No such file or directory     fixme:storage:create_storagefile Storage share mode not implemented.     err:winediag:SECUR32_initNTLMSP ntlm_auth was not found or is outdated. Make sure that ntlm_auth >= 3.0.25 is in your path. Usually, you can find it in the winbind package of your distribution.     fixme:iphlpapi:NotifyAddrChange (Handle 0xece8d0, overlapped 0xece8dc): stub     wine: configuration in '/home/jude/.wine' has been updated.     wine: cannot find L"C:\\windows\\system32\\potatomanseeksdatroof.exe"      Play on Linux gives me errors about 32bit OpenGL (I run 64bit) I've been wrestling with this all day... help?


When I am in VirtualEnv and do apt-get install, is there any difference?

If I have a virtualenv activated when I do something like               sudo apt-get install python2.7-dev      should I expect different results than if I did it outside the virtual env? Limited theory says no, but I'm not sure I'm aware of everything I should be.


How to turn off permanent highlighting of all braces (not just pairs) in vim

I have no idea how I modified vim such that all braces are highlighted, not just matching ones, but I want to turn it off now. How do I do that? The usual highlighting of matching braces works fine.


Commandline e-mail client that syncs contacts with external server?

I am planning to setup a groupware server that's either Citadel or SOGo, which supports the GroupDAV, CardDAV, or SyncML protocols. Is there a commandline e-mail client that supports syncing contacts via such protocols either out of the box or with a plugin/extension?


Removing "[crap-like-this]" from strings using bash parameter expansion?

If I have the following `$STRING`               aaa.bbb.ccc.[ddd].eee.fff.[ggg].hhh      is there any way, using bash parameter expansion, to echo the following               aaa.bbb..ccc.eee.fff..hhh      That is, remove all occurrences of square brackets and everything inside those brackets? Everything I've tried ends up either removing everything in the string after the first left bracket or removing the brackets but leaving behind everything inside the brackets.


Solaris + display file time stamp [year][month][day]

I have Solaris 10 machine I need to verify time stamp of some file in my Solaris machine And to get the following format                [year][month][day]      Example of working command on Linux                 ls -l --time-style=+%Y%m%d /etc/hosts | awk '{print $6}'       20121107   <----- ( expected results )                   * remark I can't to install gnu ls on My solaris machine! On my solaris machine I try the following commands but all them not works ( because Solaris flags are different from Linux ) , and stat command not defined in my Solaris               # ls -l -T -D %Y%m%d /etc/hosts     ls: illegal option -- T     ls: illegal option -- D     usage: ls -1RaAdCxmnlhogrtuvVcpFbqisfHLeE@ [files]      #               # stat /etc/hosts | awk '/Access/{print $2}' | tail -n1 | tr -d'' '-'     ksh: stat:  not found      Please advice if there are some other ways to get stamp date of file ( not by ls or stat command ) , maybe with date command ? in order to give me the solution, As the following:                  <solaris>   command /etc/hosts                          [year][month][day]


Installing Ubuntu/Debian on 16 GB SD Card

Is it possible to install Ubuntu/Debian on my 16 GB SD Card ? Do I just during installation process chose my SD Card partition and install it (that doesn't work if we have USB) or do I need to install persistance ISO on my SD Card ? The last question how it's with the speed of such demon as this ? I will use that SD Card in laptop slot where I can insert it so I think it should be faster than using USB Adapter.


Unable to connect to wifi on Linux Mint

I installed Linux Mint and am trying to connect to wifi, but this does not work. On the system tray it shows the “connecting” icon for a while, then the “not connected” icon. How can I investigate what's going wrong and make the wifi work? Model is Intel(R) WiFi Link 1000BGN on a Dell Inspiron 14r laptop. `dmesg` says:               wlan0: authenticate with 20:4e:7f:13:e1:58 (try 1)     [  152.358450] wlan0: authenticated     [  152.371768] wlan0: associate with 20:4e:7f:13:e1:58 (try 1)     [  152.377936] wlan0: RX AssocResp from 20:4e:7f:13:e1:58 (capab=0x411 status=0 aid=1)     [  152.377939] wlan0: associated     [  152.385284] ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready     [  153.041670] wlan0: deauthenticating from 20:4e:7f:13:e1:58 by local choice (reason=3)


Why does the read command not take interactive options when run by sh?

I want to download a provisioning script that reads some configuration parameters via `read`, and execute it:               curl http://example.com/provisioning.sh | sh      The problem is, that the `read` command in the script is call with the `-i` parameter to provide a default:               read -p "Name: " -i joe name     echo $name      If I download the script, set the `+x` permission and run it, everything's fine. If I run it with `cat provisioning.sh | sh` or `sh provisioning.sh`, it fails with:               read: Illegal option -i      Why wouldn't read support providing a default if it's run via sh? But whatever, I'll remove the `-i`, being left with               read -p "Name: " name     echo $name      Now if I run the script via `cat provisioning.sh | sh`, it won't do anything. Why is that? Ubuntu 14.04.


Is there a way to execute the second-to-last command that started with a given string?

In a project with different makefiles:               $ make -f foo1.make     ... ...     $ testing testing     ... ...     $ !ma     make -f foo1.make       Good! But then if I by accident do:               $ make -f foo1.make     ... ...     $ testing testing     ... ...     $ make     make: *** No targets specified and no makefile found.  Stop.      And now I am sad:               $ !!ma     makema     No command 'makema' found, did you mean:       ... ...      Now I have to pick through all my testing commands with the up arrow like an animal. Unacceptable*! Is there any way to re-run that full `make -f foo1.make` command using `!` or some variant thereof? *: I will not even dignify the suggestion that I just retype the entire command with a response!


How to specify where files are transferred to using ssh

I know how I can send files to a specific directory on a remote server using ssh, but I don't know how to specify it.


How to find information about the RAM using the Terminal?

> **Possible Duplicate:**   >  Can I identify my RAM without shutting down linux? I need to know it to check the compatibility... **I wanna know the type/size/model, etc.** Can someone help? Thanks.


Comparing files in unix columnwise

I want to compare two files with same number of rows and columns with records in same order. Just want to highlight the differences in the column values if any. `file A`:               1,kolkata,19,ab          2,delhi,89,cd          3,bangalore,56,ef      `file B`:               1,kolkata,21,ab          2,mumbai,89,gh          3,bangalore,11,kl      Considering column `1` as primary key, we have differences in other columns. I want to highlight those differences. Output format may be (not sure):               record_number,  columns_with_diff     1               3          2               2,4          3               3,4      Can `diff` or `comm` solve my problem? If yes then what would be the exact command?


How can I Allocate More Space to a Filesystem Mounted on /?

I am new to Linux so please forgive the incorrect use of vocabulary. My company has a private cloud that provisions VM's in a KVM. I received a RHEL 6.4. When I provisioned it, I asked for 50GB of additional storage. Here is the results of `df -h`: ![enter image description here](http://i.stack.imgur.com/4Qeap.png) The filesystem /dev/mapper/VolGroup-lv_root mounted on `/` is full. After consulting my companies FAQ, I found one called "Where is my extra storage that I ordered with my VM?" and was directed to a PDF that showed me how to create a new filesystem mounted on a new directory called `/data`. I was unable to determine how to simply extend the fileysystem mounted on `/`. I did that on a different VM as a test. On the VM which I wish to extend the filesystem mounted on `/`, here are the results of `fdisk -l`: ![enter image description here](http://i.stack.imgur.com/C9OD4.png) Here are the results for `pvdisplay`: ![enter image description here](http://i.stack.imgur.com/jGMOH.png) On a test VM I issued the following commands as specified by my companies FAQ:               pvcreate /dev/vdb     vgcreate DATAVG /dev/sdb     lvcreate -L 10G -n lvdata1 DATAVG     mkfs -t ext4 /dev/DATAVG/lvdata1     tune2fs -c0 -i0 /dev/DATAAVG/lvdata1      I appended the following to `/etc/fstab`               /dev/DATAVG/lvdata1    /data    ext4    defaults    1 2      and then mounted `/data`:               mount /data      After this, a `df -h` results in: ![enter image description here](http://i.stack.imgur.com/TPnz7.png) This shows that I can successfully add storage, but I wish to add the storage to the filesystem mounted on `/` instead.


Where is the setting that disallows duplicate command history?

Let's say I type the following sequence of commands:               $ cd     $ ls     $ ls      When I go back in history by pressing `up` twice, I end up with `cd`, instead of `ls`. I've noticed this isn't always the case, so it likely is some bash setting somewhere. Which is it?


GDM hangs when home directory is inaccessible

I have setup a OpenSUSE 12.3 workstation with SSO through KRB5 and LDAP. This works pretty smoothly up to the point where GDM isn't very happy about that fact that it cannot access user's home directories that are actually nfs mounts with krb5p. If no home directory is mounted GDM works fine. If at least one home directory is mounted then GDM will crash when attempting to open the greeter / login screen. If I remove LDAP (sss) from `/etc/nsswitch.conf` then GDM will work fine even if the home directories are mounted. At first I used to have the nfs mount in fstab for `/home/users`. There GDM would crash every time. Then I have tried to switch to autofs to mount `/home/users/*` individually. There GDM would work at first but crash thereafter (when the user logs out). Now I have configured it to use pam_mount so that the home directories would get unmounted after a user logs out. Now GDM works as long as there is no other user logged on to the system. So the problem must be somehow related to the fact that if the user `gdm` that the GDM greeter uses tries to access any of the mounted home directories, its permission will be denied by the nfs server due to a missing kerberos ticket. Even root cannot access these directories. Any attempt to give GDM access to these directories before the respective user logs in, would be a security issue. Interestingly though if the home directory doesn't exist then GDM has absolutely no problem with it. So GDM does tolerate `file does not exist`, but doesn't tolerate `permission denied`. So this makes me conclude that whatever GDM is trying to access from the home directories is not required at all. So what is it that GDM is trying to get from the home directories? And more importantly, how can I disable it from trying to do so? How can I prevent it from hanging? Any ideas for some extra troubleshooting? Or how can I make the mounted home directories invisible to GDM so that it won't trip over them?


Why does debian and ubuntu default to runlevel 2?

I never thought about this before, but I was wondering why they chose runlevel 2. Every other distro and OS I've used default to runlevel 3 (with the exception of AIX which also defaults to runlevel 2).


How to login from remote server to my own PC?

For the experiment purpose I need to login to my own PC from the remote PCs which are under the same domain, i.e: university network. How can I do remote login in this case using SSH? As an example, I have accounts in two machines in University X which are `me@machine_a.cs.x.ca` and `me@machine_b.cs.x.ca`, my personal laptop account is `nawshad@ubuntu`. What extra info do I need to provide?