title: Debugging a Solaris network issue

text: I'm running a Solaris 11 x86 file server. The file-server part is ZFS + Samba. It's been up running for three or four years now without major problems. The Samba shares start out visible to other PCs on the network. I can read from the file server reliably. I can ping the server. I can ping other PCs from the server. I can ping the default gateway from the server. Starting a few weeks ago, when I attempt to write to the file server, the shares disappear after a few seconds (or maybe after a few hundred megabytes). The issue is apparently with the network. The server is still alive, though. If I hook up a mouse and keyboard and monitor I can still interact with the server. It doesn't seem like the problem is with the hard drives or with Samba. Tried:   * zpool status   * fmadm faulty   * svcadm restart samba No errors. No faulty devices. Samba doesn't appear to be the problem. After the problem happens, I cannot ping the default gateway from the file server anymore. I cannot ping other machines from the file server anymore. I cannot ping the server from other machines. **Network Debugging Steps** I've tried:   * ifconfig skge0 down/ifconfig skge0 up.   * Power cycling the switch that the Solaris box is plugged into   * Power cycling the router that the Solaris box is plugged into The Solaris box appears to think it's still connected to the network. Resetting the Solaris box (init 6) will bring the shares back, but only until I attempt to write them again. **I tried netstat -rn** before and after the problem. Everything looks pretty normal. Below is "after":               Routing Table: IPv4     Destination           Gateway           Flags  Ref     Use     Interface      -------------------- -------------------- ----- ----- ---------- ---------      default              10.1.10.1            UG       27        456 skge0          10.1.10.0            10.1.10.254          U         6    2536350 skge0          127.0.0.1            127.0.0.1            UH        2        252 lo0                 Routing Table: IPv6       Destination/Mask            Gateway                   Flags Ref   Use    If        --------------------------- --------------------------- ----- --- ------- -----      ::1                         ::1                         UH      2       4 lo0         "Before" has 27 instead of 17 in the "Ref" column for the 1st entry. "After" has slightly higher numbers for "Use" - probably normal. **I tried netstat -an** before and after the problem, too. This one may have more of a clue. There are a number of UDP connections that are present before the problem that all vanish. Before:               UDP: IPv4        Local Address        Remote Address      State     -------------------- -------------------- ----------         --truncated entries that are present in both before/after--     10.1.10.254.40504    10.1.10.1.53         Connected     10.1.10.254.39900    10.1.10.1.53         Connected     10.1.10.254.40129    10.1.10.1.53         Connected     10.1.10.254.37892    10.1.10.1.53         Connected     10.1.10.254.61658    10.1.10.1.53         Connected      After, those five entries are gone, but one new one is present:               UDP: IPv4        Local Address        Remote Address      State     -------------------- -------------------- ----------         --Again, truncated--     10.1.10.254.53920    10.1.10.1.53         Connected      I can't find any information about what port 53920 is used for. On the gateway side, port 53 appears to be used for DNS - not sure if this is a clue or not. **Doesn't seem terribly helpful** Down in the TCP portion, there are a whole bunch of entires that are "ESTABLISHED" _before_ that are either gone in _after_ or they've transitioned to either TIME_WAIT or FIN_WAIT_1. This seems to jive with what I already know. There's only one reference to IP of the computer that I used to crash the network: Before:               TCP: IPv4        Local Address        Remote Address    Swind Send-Q Rwind Recv-Q    State     -------------------- -------------------- ----- ------ ----- ------ -----------     10.1.10.254.445      10.1.10.132.53487    64512      0 128480      0 ESTABLISHED      After:               TCP: IPv4        Local Address        Remote Address    Swind Send-Q Rwind Recv-Q    State     -------------------- -------------------- ----- ------ ----- ------ -----------     10.1.10.254.445      10.1.10.132.53487    64256      0 128480      0 ESTABLISHED      The only difference is in the Swind (send window?) column. It's strange that the state is still listed as established. **I did the netstat -an experiment again** The only difference before and after, was related to the IP address of the PC I used to crash the share. Before:               TCP: IPv4        Local Address        Remote Address    Swind Send-Q Rwind Recv-Q    State     -------------------- -------------------- ----- ------ ----- ------ -----------     10.1.10.254.445      10.1.10.132.53613    380416      0 128480      0 ESTABLISHED      After:               10.1.10.254.445      10.1.10.132.53613    65280       0 128480      0 ESTABLISHED      Again, the only difference is in the Swind column - the number got smaller. **I've reached the end of what I know** about this kind of thing. netstat seems to be telling me what I already know. Short of buying another network card and just trying it, or reinstalling Solaris, I've got no idea. Can anybody clue me in as to the next step here? **Edit** I'm buying another network card and just trying it. It's going to take about a week to get here, so I'll keep poking at this in the meantime.


title: Change the default desktop manager on Scientific Linux

text: I am trying to boot into KDE from the login screen and failed and also changed the `/etc/sysconfig/desktop`                DESKTOP=”KDE”      DISPLAYMANAGER=”KDE”      Still Scientific Linux boots into Gnome.


title: PHP appears to be encountering segfault when using finfo_file method

text: I have encountered a strange bug. When trying to determine mime type of file using Fileinfo (http://www.php.net/manual/en/function.finfo-file.php) extension, PHP (or Apache? see below.) is appearing to be crashing. Code:               <?php     $finfo = finfo_open(FILEINFO_MIME_TYPE, null);     $info = finfo_file($finfo, "index.php");      When opening from web (through apache2), segfault is reported in error log:               [Wed Oct 23 14:32:25 2013] [notice] child pid 29084 exit signal Segmentation fault (11)      When executing from cli e.g. `php -q test.php`, output is okay.               php -v     PHP 5.5.4-pl0-gentoo (cli) (built: Oct 18 2013 19:11:02)     Copyright (c) 1997-2013 The PHP Group     Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies         with Zend OPcache v7.0.3-dev, Copyright (c) 1999-2013, by Zend Technologies          /usr/sbin/apache2 -v     Server version: Apache/2.2.25 (Unix)     Server built:   Sep 20 2013 14:16:11      Any clues?


title: how to swap ctrl and capslock using xmodmap?

text: I know this xmodmap script can swap ctrl and capslock:               remove Lock = Caps_Lock     remove Control = Control_L     keysym Caps_Lock = Control_L     keysym Control_L = Caps_Lock     add Lock = Caps_Lock     add Control = Control_L      I don't quite understand it. So I tried this:               remove Lock = Caps_Lock     remove Control = Control_L     add Lock = Control_L     add Control = Caps_Lock      And this script doesn't work.   Could some explain this(why the 1st script works and the other one doesn't) in simple words?


title: I fail to fetch GPG keys over HKPS with "gpgkeys: HTTP fetch error 1: unsupported protocol" error

text: I'm trying to fetch some GPG keys over keys.gnupg.net and hkps.pool.sks- keyservers.net and both fails with:               gpg: requesting key 1F41B907 from hkps server hkps.pool.sks-keyservers.net     gpgkeys: HTTP fetch error 1: unsupported protocol      I'm using Debian testing. `gpg --version` yields `gpg (GnuPG) 1.4.16`


title: Why is swap used when a lot of memory is still free?

text: In the below 2.6.18 Linux Kernel (Red Hat) server, there is a lot of free memory, but I see some swap is used. I always thought of swap as an overflow when memory has been depleted. Why would it swap with about 7GB (50%) free memory? Swappiness is 60 (default). Meminfo output:               MemTotal:     16436132 kB     MemFree:       7507008 kB     Buffers:        534804 kB     Cached:        2642652 kB     SwapCached:      39084 kB     Active:        6001828 kB     Inactive:      2532028 kB     HighTotal:           0 kB     HighFree:            0 kB     LowTotal:     16436132 kB     LowFree:       7507008 kB     SwapTotal:     2097144 kB     SwapFree:      1990096 kB     Dirty:             236 kB     Writeback:           0 kB     AnonPages:     5353644 kB     Mapped:          45764 kB     Slab:           330660 kB     PageTables:      34020 kB     NFS_Unstable:        0 kB     Bounce:              0 kB     CommitLimit:  10315208 kB     Committed_AS: 14836360 kB     VmallocTotal: 34359738367 kB     VmallocUsed:    264660 kB     VmallocChunk: 34359472735 kB     HugePages_Total:     0     HugePages_Free:      0     HugePages_Rsvd:      0     Hugepagesize:     2048 kB


title: can I get the shell to decide ls or less depending on filetype?

text: Very often I find myself looking through directories using 'ls', then when I find the file I want, I use 'less' to look at the file.               So for example to find a mysql log file I might type     ls /var          then:     ls /var/log/          and then:     ls /var/log/mysql          and finally:     less /var/log/mysql/mysql.log      (its a bit of a contrived example, but hopefully you know what I am doing) I find it annoying that I need to decide if the command should be ls or less. Why can't 'less' determine if it has been given a directory and act as 'ls' ? Is there a command that I can use instead of less that will act as ls or less depending on the file type ? Or is there a common alias that people use ?


title: What is the meaning of "1-" in the output of ps?

text: This is the output of the command `ps -ef | grep java` on one of our machines.               jboss     1965  1935  1  2013 ?        04:41:05 java XXXXXXXXXXXXXXXXX       jboss     2170  2141  0  2013 ?        00:42:57 java XXXXXXXXXXXXXXXXX     jboss     2708  2679  7  2013 ?        1-04:38:51 java XXXXXXXXXXXXXXXXX     tomcat    6845     1  1  2013 ?        03:28:03 XXXXXXXXXXXXXXXXX     jboss    24651 24622  0  2013 ?        03:03:27 XXXXXXXXXXXXXXXXX     tomcat   32533     1  0  2013 ?        00:12:08 XXXXXXXXXXXXXXXXX      (XXXs added to hide the guilty!) What is the meaning of the `1-` on the third line?


title: Windows 7 guest fails to boot on Fedora 20 host

text: In `virt-manager` Windows boots (in safe mode) up to loading `classpnp.sys`. CPU usage then stays at 100%. In VirtualBox I get a blue-screen-of-death right after loading `classpnp.sys` and then it reboots. The image worked fine on Fedora 19. I checked Fedora 20 known bugs and Google but could not find anything. Any ideas?


title: XTerm not closing using -e option

text: I have an tcl script running in MWM and it starts xterm terminals with:                .menu.utils.m add command -label {Xterm} -command {             exec xterm -sb -T "Xterm" -sl 10000 -e su - int &       }      Doing this, the terminals can't be closed using Alt+F4 or the Menu bar. Is there a way to fix this?


title: Process overwrite access restriction

text: I want to run a program so that it can only **create new** files and not **overwrite** existing ones. Does something like this exist?               $ fsaccess --can read,write --not overwrite --command bash -c 'echo "stuff" > filetim; echo "Woohoo I did it"'      Now if filetim doesn't exist, then the command should run just fine, but if filetim did exist then fsaccess would exit with a message like               Killed child! Command tried to overwrite a file. It does not have permission to do that!


title: Why is it possible to leave CHROOT with this sftp config?

text: I'm trying to create the user lenny, that has read and write permissions in the folder `/home/lenny/` and has no shell but only access via SFTP. I'm doing the following:               useradd lenny     mkdir /home/lenny     usermod -d /home/lenny lenny     passwd lenny     chown lenny:lenny /home/lenny     chmod 755 /home/lenny     usermod -s /bin/false myuser      I then modified `/etc/ssh/sshd_config`:               Subsystem sftp internal-sftp`            Match User lenny     ChrootDirectory /home/lenny     ForceCommand internal-sftp      Now when I do `sftp lenny@server` I can leave the CHROOT easily by doing `cd /` and `ls -la`, I see everything! Why is that??? I don't get it, configuration should be okay, or am I wrong?


title: Is there a tool or method for magnifying existing PostScript or PDF files for printing - not just for display

text: Almost all my printing, including web pages and emails works fine and has done so for years, but ... When I print web pages and emails, I routinely run into a few that print in something like 1 point type and are unreadable. I usually print them to a file first anyway, so I have the generated PostScript or PDF files available (until I delete them after they're printed). For these cases, it doesn't seem to matter whether I print to a PostScript or PDF file or direct to the printer. I can select any of these options. When this happens, I have some workarounds like copying and pasting the original content into LibreOffice writer or into kate, but these don't always have the desired effect. Sometimes writer hangs completely and has to be killed and while using kate always works, the formatting can be ugly and, of course, all graphic elements are lost. Is there any tool/method which can magnify the print file for printing? I imagine ghostscript can do things like this, but I have no idea how to use it. Programs all seem to have zoom options that work on the display, but have no effect on what prints. This is a generic question, but I will detail my system particulars in case it makes a difference. kubuntu precise (12.04) 64-bit on a notebook   Firefox 25.0.1   Thunderbird 24.1.1   HP LaserJet 1020 and HP LaserJet p1006


title: Where to install mininet

text: I read some posts and parts of FHS to understand which directory I should install packages in. As far as I could understand `/opt` is for independent packages and `/usr/local` is for packages that are not maintained by distro repo's. I want to install a network emulator called "mininet" on my Debian wheezy, so that all users can use it. It has an install.sh script which installs both types of packages: maintained by repo & not maintained by repo. As the first step of the installation I can indicate where I want my base directory to be. Now my question is which directory I should indicate as the base directory? should it be: "`/usr/local`", "`/usr/local/mininet`", "`/usr/local/bin`", "`/usr/local/bin/mininet`", "`/opt`" or some other directory? I would appreciate if you could explain your answer too Thank you. EDIT: Should I specify the name of the package in the path like we do when installing in `/opt` (e.g. `/usr/local/mininet/`) or I shouldn't?


title: What's the purpose of `rm -P`?

text: I was reading the man page for `rm` when I came across this option:               -P    Overwrite regular files before deleting them.  Files are overwritten            three times, first with the byte pattern 0xff, then 0x00, and            then 0xff again, before they are deleted.      I guess `-P` is meant for thoroughly deleting a file, but wouldn't setting all the bytes to `0xff` or `0x00` be enough? Why does it have to toggle between the two three times?


title: How to handle binary data in Linux

text: One of the my servers gives me data with `Content-Type: application/binary`, i.e data that I am getting looks like some alien data. Now I need to convert that data into plain data, but I am not aware of any way to do that. I am trying to do this using the command line. After googling, I found one way: I need to delete the first 10 char and last 8 char from my data and then use `gunzip` with that. Then I will get the original data. But when I try to delete those characters, as it is binary output, it cuts more than that or less than 10+8 characters. Actually `echo` is not able to print the data properly. So, please, does anyone know how to handle binary data?


title: How to check/test .tar.bz archives?

text: I've been using tar with its "--use-compress-prog=pbzip2" function to archive my files then compress them with pbzip2 to get an "*.tar.bz" archive. Afterwards I checked the resulting file with pbzip2's "-t" switch, and it passed the test. However, to great surprise, I got "file incomplete" or other integrity errors when trying to extract the archive! Is it because there might be something wrong with the tar file, but not when it was compressed by pbzip2? If so, is there a way to check the tar file itself? If not, what other problem might this be? Also, are there ways to recover data from tar files with errors? I am afraid I might have already lost some important data through this process... The point is, I would like to know a method to test the integrity of my archives after they are created.


title: Perl and Python wrongly interpreted via shebang on Linux

text: that problem just drives me crazy. All my Python and Perl scripts are simply NOT iterpreted via shebang. Never. But they work as expected when I explicitly call the binary. I double checked my Perl and Python installations, it is just too strange: they shebang-way execution works very well in the target system chroot on a sane host but not in the actual running system. I'm desperate now! I work on a homemade Linux system which worked just great before that problem appeared. See by yourself: A test on the 'xscreensaver-text' Perl program, once via shebang then with the interpreter on the CLI:               $ LC_ALL=C LANG=C /usr/bin/xscreensaver-text     /usr/bin/xscreensaver-text: line 23: require: command not found     /usr/bin/xscreensaver-text: line 25: use: command not found     /usr/bin/xscreensaver-text: line 29: BEGIN: command not found     /usr/bin/xscreensaver-text: line 31: use: command not found     /usr/bin/xscreensaver-text: line 32: syntax error near unexpected token `('     /usr/bin/xscreensaver-text: line 32: `use POSIX qw(strftime);'          $ LC_ALL=C LANG=C perl /usr/bin/xscreensaver-text     poopy     Linux 3.11.1          Sat Oct  5 23:07:33 2013          up 11:35,  2 users     load average: 0.09, 0.08, 0.06      SO this for Perl programs but the same happens with Python scripts. We've been messing with encodings and terminfo's and different kernel, still no success. I've even rebuilt my entire system. It works just great in a chroot env, but once I boot it I have this problem. Here's an strace output:               $ LC_ALL=C LANG=C strace /usr/bin/xscreensaver-text     execve("/usr/bin/xscreensaver-text", ["/usr/bin/xscreensaver-text"], [/* 50 vars */]) = -1 ENOEXEC (Exec format error)     write(2, "strace: exec: Exec format error\n", 32strace: exec: Exec format error     ) = 32     exit_group(1)                           = ?     +++ exited with 1 +++          $ LC_ALL=C LANG=C strace perl /usr/bin/xscreensaver-text     execve("/usr/bin/perl", ["perl", "/usr/bin/xscreensaver-text"], [/* 50 vars */]) = 0     brk(0)                                  = 0x601000     mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff12e312000     access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)     open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3     fstat(3, {st_mode=S_IFREG|0644, st_size=240674, ...}) = 0     mmap(NULL, 240674, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7ff12e2d7000     close(3)                                = 0     open("/usr/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3     read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 \37\2\0\0\0\0\0"..., 832) = 832     fstat(3, {st_mode=S_IFREG|0755, st_size=1868472, ...}) = 0     mmap(NULL, 3981888, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7ff12dd24000     mprotect(0x7ff12dee6000, 2097152, PROT_NONE) = 0     mmap(0x7ff12e0e6000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1c2000) = 0x7ff12e0e6000     mmap(0x7ff12e0ec000, 16960, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7ff12e0ec000     close(3)                                = 0     mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff12e2d6000     mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff12e2d4000     arch_prctl(ARCH_SET_FS, 0x7ff12e2d4740) = 0     mprotect(0x7ff12e0e6000, 16384, PROT_READ) = 0     mprotect(0x7ff12e313000, 4096, PROT_READ) = 0     munmap(0x7ff12e2d7000, 240674)          = 0     brk(0)                                  = 0x601000     brk(0x622000)                           = 0x622000     clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7ff12e2d4a10) = 5680     wait4(5680, poopy     Linux 3.11.1          Sat Oct  5 23:11:49 2013          up 11:39,  2 users     load average: 0.08, 0.12, 0.08          [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 5680     --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=5680, si_status=0, si_utime=2, si_stime=0} ---     exit_group(0)                           = ?     +++ exited with 0 +++      Contents (only the beginning) of the script :               $ cat /usr/bin/xscreensaver-text     #!/usr/bin/perl -w     # Copyright � 2005-2013 Jamie Zawinski      #     #     # Created: 19-Mar-2005.          require 5;     #use diagnostics;   # Fails on some MacOS 10.5 systems     use strict;          # Some Linux systems don't install LWP by default!     # Only error out if we're actually loading a URL instead of local data.     BEGIN { eval 'use LWP::UserAgent;' }     --*snip*--      I will give any extra info needed (as this is my third headache week). Thanks!


title: How can I get less or cat to use color in the output from .cat of my .bashrc, similar to vi 'ing it?

text: When I vi my .bashrc file it is colorized, i.e. ![enter image description here](http://i.stack.imgur.com/pxjgS.png) but when I `cat` or `less` the file I get all white, i.e. ![enter image description here](http://i.stack.imgur.com/4It4Z.png) How can I get `cat` (and `less`) to have color? cat does have color for my ruby `.rb` files but not for these bash dot files the way that vi does for bash dot files. less doesn't have color for ruby `.rb` files at all. Gnome terminal is `3.6.1` Ubuntu is `13.04` Bash is `v4.2.45(1)`


title: Substituting number into file name in bash

text: I'm trying to download multiple files such as:               www.example.com/v1/file.txt     www.example.com/v2/file.txt     www.example.com/v3/file.txt     ...      The following command doesn't work, as it actually looks for a file "r{1..99}/file.txt":               for i in {10..99}     do      wget "www.example.com/v"$i"/file.txt" -O "file_"$i".txt"     done      It also makes no difference if I put additional quotes " " around $i. What am I doing wrong?


title: udev rule for bluetooth device(logitec)

text: I want to write udev rule for a Logitec Bluetooth. My keyboard and mouse connect to PC as one Bluetooth device. When I monitor udev, I see there are separate events for keyboard and mouse. I want to allow mouse usage but not keyboard. If I ignore the device, I can't use the mouse. How can I achieve this? Can I ignore the keyboard event? **Mouse event**               UDEV  [325.554801] add      /devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.2/4-1.2:1.0/input/input15 (input)     ACTION=add     DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.2/4-1.2:1.0/input/input15     EV=17     ID_BUS=usb     ID_INPUT=1     ID_INPUT_MOUSE=1     ID_MODEL=USB_Receiver     ID_MODEL_ENC=USB\x20Receiver     ID_MODEL_ID=c52f     ID_PATH=pci-0000:00:1d.0-usb-0:1.2:1.0     ID_PATH_TAG=pci-0000_00_1d_0-usb-0_1_2_1_0     ID_REVISION=3000     ID_SERIAL=Logitech_USB_Receiver     ID_TYPE=hid     ID_USB_DRIVER=usbhid     ID_USB_INTERFACES=:030102:030000:     ID_USB_INTERFACE_NUM=00     ID_VENDOR=Logitech     ID_VENDOR_ENC=Logitech     ID_VENDOR_ID=046d     KEY=ffff0000 0 0 0 0     MODALIAS=input:b0003v046DpC52Fe0111-e0,1,2,4,k110,111,112,113,114,115,116,117,118,119,11A,11B,11C,11D,11E,11F,r0,1,6,8,am4,lsfw     MSC=10     NAME="Logitech USB Receiver"     PHYS="usb-0000:00:1d.0-1.2/input0"     PRODUCT=3/46d/c52f/111     PROP=0     REL=143     SEQNUM=1513     SUBSYSTEM=input     UDEV_LOG=3     UNIQ=""     USEC_INITIALIZED=325550123      **Keyboard event**               UDEV  [325.555963] add      /devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.2/4-1.2:1.1/input/input16 (input)     ABS=100000000     ACTION=add     DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.2/4-1.2:1.1/input/input16     EV=1f     ID_BUS=usb     ID_INPUT=1     ID_INPUT_KEY=1     ID_MODEL=USB_Receiver     ID_MODEL_ENC=USB\x20Receiver     ID_MODEL_ID=c52f     ID_PATH=pci-0000:00:1d.0-usb-0:1.2:1.1     ID_PATH_TAG=pci-0000_00_1d_0-usb-0_1_2_1_1     ID_REVISION=3000     ID_SERIAL=Logitech_USB_Receiver     ID_TYPE=hid     ID_USB_DRIVER=usbhid     ID_USB_INTERFACES=:030102:030000:     ID_USB_INTERFACE_NUM=01     ID_VENDOR=Logitech     ID_VENDOR_ENC=Logitech     ID_VENDOR_ID=046d     KEY=4837fff072ff32d bf54444600000000 1 20f908b17c000 677bfad9415fed 9ed68000004400 10000002     MODALIAS=input:b0003v046DpC52Fe0111-e0,1,2,3,4,k71,72,73,74,77,80,82,83,85,86,87,88,89,8A,8B,8C,8E,90,96,98,9B,9C,9E,9F,A1,A3,A4,A5,A6,A7,A8,A9,AB,AC,AD,AE,B0,B1,B2,B5,B6,CE,CF,D0,D1,D2,D4,D8,D9,DB,DF,E4,E7,E8,E9,EA,EB,F1,100,161,162,166,16A,16E,172,174,176,178,179,17A,17B,17C,17D,17F,180,182,183,185,188,189,18C,18D,18E,18F,190,191,192,193,195,198,199,19A,1A0,1A1,1A2,1A3,1A4,1A5,1A6,1A7,1A8,1A9,1AA,1AB,1AC,1AD,1AE,1B0,1B1,1B7,1BA,r6,a20,m4,lsfw     MSC=10     NAME="Logitech USB Receiver"     PHYS="usb-0000:00:1d.0-1.2/input1"     PRODUCT=3/46d/c52f/111     PROP=0     REL=40     SEQNUM=1519     SUBSYSTEM=input     UDEV_LOG=3     UNIQ=""     USEC_INITIALIZED=325514060


title: Convert a .docx to a .pdf with pandoc

text: I am trying to convert a .docx received by mail to a correct pdf by using pandoc (I am using GNU/Linux). I have an error concerning characters encoding :               $ pandoc file.docx -o file.pdf     pandoc: Cannot decode byte '\x87': Data.Text.Encoding.decodeUtf8: Invalid UTF-8 stream      I tried to identify the encoding :               $ file -i file .docx      file.docx: application/vnd.openxmlformats-officedocument.wordprocessingml.document; charset=binary      I am a little surprised by `charset=binary` (I was expecting `charset=iso8859-15`). However I tried to convert the .docx to utf8 anyway and it is not working :                $ iconv -t utf-8 file.docx     P!      $iconv: séquence d'échappement non permise à la position 16      I have the same error with the command line from pandoc documentation :               iconv -t utf-8 file.docx | pandoc | iconv -f utf-8      How can I convert this .docx to pdf with pandoc?


title: Can't boot into windows if it's not the first HDD in boot order (Linux)

text: I installed eOS recently with a custom install (selected separate home, root, and swap partitions). After the install, eOS boots perfectly. However when I try to choose the Windows 8 option it will not boot into it: it shows the Windows logo for a second then reboots my PC. I managed to boot into Windows by going into the BIOS and changing the boot order of my HDD's (the windows is on a different HDD) and then windows boots immediately (no GRUB). How can I get Windows to boot from GRUB? EDIT: This is my current config http://paste.ubuntu.com/6594815/ (Both entries of windows 8 there do the same thing). After a few boot attempts into windows I get this message: ![enter image description here](http://i.stack.imgur.com/qBQO6.jpg)


title: Method for storing/remembering one liner commands

text: Often when configuring and adjusting unix-based systems I use a lot of one- line commands that are difficult to remember. For example, to determine what version of ntp (the time server) is running, you issue the command:               ntpq -c "rv 0 version"      This is the kind of stuff I am never going to remember. Is there some way or method to store all these one-liners so I can look them easily when I need to and paste them to the command line (I use vim btw, not emacs, so an emacs- centered solution will not really help me). I was thinking there might be a way to execute the current line of text from the buffer in the shell, but could not find any such command. One idea I have had is to put the commands in a text file then in vimrc make this line:               nmap <F10> :.w !bash      Now, lets say I have this line in my file:               ntpq -c "rv 0 version"    # show current version of NTP which is running      Then, I put the cursor on this line and press F10 and it works (note that since the command is being sent to bash, you use bash comments (#), not vim comments). This seems like a step in the right direction. Any better ideas?


title: Port 22 connection refused

text: I’m trying to copy a disk image over ssh to my local machine using this tutorial on linodes website. I know this could be posted on their support forum, but im convinced its in the general realm of *unix knowledge. I’ve followed all the steps and I can get int Finnix (custom editor), checked the disk images and now I want to download it via SSH to my local machine. I keep getting: I can already ssh into the remote server, its when im in Finnix. root@hvc0~# ....               ssh root@xxxxxxxxx port 22: connection refused      after typing               ssh root@xxx.xx.xx.xx "dd if=/dev/xvdb " | dd of=/home/linode.img      So I’ve re-written the firewall rules, checked for memory leaks, reset root password, logged in via the ajax console on their site, pings, disk space and still no luck. Any suggestions on why this is?


title: How to have console messages in English?

text: I am French and use my Debian system in French. However, I would like to have error messages in terminal in English. It allows me to post them on English speaking websites. How can I change my locale to do so? I precise I don't want to have all my system in English.


title: Where to apply xmodmap for systemwide usage?

text: I need to apply a custom xmodmap for all users at the start. Where do I need to put it? I have thought at `/etc/rc.local`? Does this make sense?


title: Find all web servers in the repository

text: I need to find all the web servers available from the repository for an ARM- based Debian appliance. I ran the following, but it returns too many hits (including libraries, etc.):               apt-get update     apt-cache search http server      Is there a better command that I should use instead?


title: Virtualbox 4.2.18 Ubuntu guest -- unable to access shared folder

text: I'm using virtualbox 4.2.18 with Windows 7 host and a Ubuntu 13.10 guest. I've shared a folder from Windows host to the guest OS using the Virtualbox settings for shared-folder. At first, there was a permission denied problem. But after installing GNOME system manager and changing the group sharing option, now I'm able to open the shared folders from the Ubuntu guest. However, it keeps on showing loading at the bottom and the contents don't come at all even though there is only one file in the directory. How can I resolve this?


title: Is there a glibc API that can find the default handing application for a MIME type on linux?

text: I want to find the default handling application in my C program. Is there a C API with same functionality as `xdg-mime query default mime-type` on Linux?


title: Benefiting of sched_autogroup_enabled on the desktop

text: I am running a 2.6.37 kernel with `sched_autogroup_enabled` set to 1. I am not certain that I am seeing the benefits of this patch since:   * I am launching my applications from the desktop;   * applications launched from the desktop share the same tty;   * applications with the same tty do not benefit from the mentioned kernel feature. How can I select some applications which should be on a different tty from the rest?


title: Umask for root and other system users

text: If I am not wrong, this is how umask is calculated.               for dir,  777 - 022(root's umask value) = 755.     for file, 666 - 022(root's umask value) = 644.      Now, where this umask value is defined? Is it the `/etc/bashrc` file?. If so, then what is the file `/etc/login.defs` for? My `/etc/login.defs` file says 077 as umask - what does this mean? Also where is cmask defined? The umask can be changed using umask command, but that is temporary. Right? If I have to make it permanent, I can edit `.bashrc` file in my home dir and append "umask value" to it. Also, say I am root and I want to set a specific umask for all other users, how to do that?


title: How does linux driver update work?

text: As far as I know no update on a linux machine requires a restart. Windows however needs to restart several times for a update to complete which is understandable because the hardware might be in use at the moment and a restart ensures that no software uses the driver. But how can an OS (or linux as an example) handle such a situation where you want to update a driver but it is currently in use?


title: cron Vs. sleep - which is the better one in terms of efficient cpu/memory utilization?

text: ### The Case: I need to run some commands/script at certain intervals of time and for this I have two options - 1. set up a `cron`-job or, 2. implement a loop with `sleep` in the script itself. ### Question: Which is the better option from resource consumption point of view, why? Is `cron` the better way? Does cron use some kind of triggers or something making it efficient over the other? What procedure does cron use to check and start the jobs?


title: Emacs 24 not finding system fonts

text: Emacs doesn't offer me the possibility of installing several of the system fonts that I have. It only offers Courier and Lucida. Other programs, like LibreOffice, have no problem in using my system fonts, like DejaVu and such. I've tried putting               (set-face-attribute ':font Monaco)          (set-face-attribute 'default nil :font "Ubuntu Mono")      or               (set-face-attribute ':font "Monaco")      to no avail. What can I do?


title: bash autocompletion resets on every window

text: My terminal autocompletion does not work properly when I use root. `source /etc/bash_completion` works if I invoke that manually. I need to write above code in every new root terminal to be able to use autocompletion. Any help is appreciated!


title: Advanced file filtering

text: I have 3 distinct folders: history, inbox, backup. I need to copy all the files from 'history' to 'inbox', only if they are not present in 'backup'. How to do this?


title: What is #@(#) in Kornshell syntax

text: I'm looking at a script on an AIX box where several lines begin with `#@(#)` What does that indicate? Clearly doing a Google search is totally fruitless for symbols. Here are the lines from the script:               #!/usr/bin/ksh     #     #@(#)     #@(#) USAGE: dump_master_db [opts] SERVER [AREA]     #@(#)  opts: -p PAGENAME : send Pages to PAGENAME rather than the default (usually database)     #@(#)        -nodbcc     : will not do the DBCCs before the dump     #@(#)                     -c COMPRESSION_LEVEL : dump the database at the stated compression level.     #@(#)     #@(#) This script will do some DBCCs, truncates the log and then dumps the master database on any SERVER     #@(#) The SERVER parm is used to build the logical device name as follows:     #@(#)     SERVER_master_dump     #@(#) NOTE: There is no AREA and no stripes for this dump device.     #@(#)       COMPRESSION: VALUES 1 (least) to 9 (most compressed).     #@(#)       Currently, we only use values of none  to 1.


title: How are directories implemented in Unix filesystems?

text: My question is how directories are implemented? I can believe a data structure like a variable e.g. table, array or similar. Since UNIX is Open Source I can look in the source what the program does when it created a new directory. Can you tell me where to look or elaborate on the topic? That a directory "is" a file I could understand and is a directory really a file? I'm not sure that it is true that files are stored "in" files while still in way you could say the word file about nearly anything and I'm not sure what absolutely not is a file since you could call even a variable a file. For example a link is certainly not a file and a link is like a directory but then this violates that a directory is a file?


title: Does segfaults mean bad memory

text: This is a brand new server with a new install and fresh compile of Apache/PHP with nothing crazy. Just a WordPress site hosted and I get the following. Could this just mean bad RAM? If so how can I test it without taking the box down. I have noticed some weird memory issues with PHP despite making the php.ini settings unlimited.               conftest[31039]: segfault at 1 ip 0000000000405088 sp 00007fff92152090 error 4 in conftest[400000+a4000]         conftest[26375]: segfault at 1 ip 0000000000405088 sp 00007fffa5b0b450 error 4 in conftest[400000+a4000]         php[10669]: segfault at aec69ff1 ip 0000000000759ac1 sp 00007fff39245950 error 4 in php[400000+6dd000]         php[14634]: segfault at 0 ip 000000000073ea24 sp 00007ffffaa24c60 error 4 in php[400000+6dd000]         php[17315]: segfault at 9e979531 ip 0000000000759ac1 sp 00007fff877ba610 error 4 in php[400000+6dd000]         php[2804]: segfault at 108afe2a1 ip 0000000000759ac1 sp 00007fff53cb5210 error 4 in php[400000+6dd000]         php[6726]: segfault at 75dd5051 ip 0000000000759ac1 sp 00007ffffc9f2850 error 4 in php[400000+6dd000]         php[7701]: segfault at ffffffff ip 00000000007150cf sp 00007fff8e927650 error 4 in php[400000+6dd000]         php[13827]: segfault at 28 ip 0000000000715fa0 sp 00007fff4d9dabd0 error 4 in php[400000+6dd000]         php[12324]: segfault at ffffffff ip 00000000007150cf sp 00007fff56f62aa0 error 4 in php[400000+6dd000]         php[10609]: segfault at 7f9465fe9231 ip 0000000000759ac1 sp 00007fff83e6bd00 error 4 in php[400000+6dd000]         php[18771]: segfault at 142dcfdc1 ip 0000000000759ac1 sp 00007fff77d693d0 error 4 in php[400000+6dd000]         php[9509]: segfault at 12f8ebf71 ip 0000000000759ac1 sp 00007ffff6030d80 error 4 in php[400000+6dd000]         php[26998]: segfault at ffffffff ip 00000000007150cf sp 00007fff66777760 error 4 in php[400000+6dd000]         php[4820]: segfault at ffffffff ip 00000000007150cf sp 00007fffdc9b7020 error 4 in php[400000+6dd000]         php[4663]: segfault at bd7b35a1 ip 0000000000759ac1 sp 00007fffaaa32b80 error 4 in php[400000+6dd000]         php[4859]: segfault at a5ff560 ip 0000000000715e77 sp 00007fff5f232650 error 4 in php[400000+6dd000]         php[1020]: segfault at 7f12ce5ba831 ip 0000000000759ac1 sp 00007fffb41cc5e0 error 4 in php[400000+6dd000]         php[17655]: segfault at 122a87e81 ip 0000000000759ac1 sp 00007fffbe942040 error 4 in php[400000+6dd000]         php[11928]: segfault at 7f21b1103e31 ip 0000000000759ac1 sp 00007fff5ef70ae0 error 4 in php[400000+6dd000]         php[29523]: segfault at c42cb5a1 ip 0000000000759ac1 sp 00007fff93335a50 error 4 in php[400000+6dd000]         php[7693]: segfault at 7f511f5fe431 ip 0000000000759ac1 sp 00007fffb9802fc0 error 4 in php[400000+6dd000]         php[4186]: segfault at 7f7df67db431 ip 0000000000759ac1 sp 00007fff1dcb1f10 error 4 in php[400000+6dd000]         php[15296]: segfault at abfa3ea1 ip 0000000000759ac1 sp 00007fff88ec89e0 error 4 in php[400000+6dd000]         php[15277]: segfault at ffffffff ip 00000000007150cf sp 00007fff8419b4c0 error 4 in php[400000+6dd000]         php[6223]: segfault at f05b1401 ip 0000000000759ac1 sp 00007fff96517ea0 error 4 in php[400000+6dd000]         php[9998]: segfault at 1535be691 ip 0000000000759ac1 sp 00007fff1888ffd0 error 4 in php[400000+6dd000]         php[15664]: segfault at 6fdc57f1 ip 0000000000759ac1 sp 00007fff7c39da10 error 4 in php[400000+6dd000]         php[20894]: segfault at ffffffff ip 00000000007150cf sp 00007fff03b66430 error 4 in php[400000+6dd000]         php[20485]: segfault at 7ff9b7be7631 ip 0000000000759ac1 sp 00007fffb8a7e760 error 4 in php[400000+6dd000]         php[10195]: segfault at 105ae7d21 ip 0000000000759ac1 sp 00007fff43ed91f0 error 4 in php[400000+6dd000]


title: What are high level and low level device drivers

text: Recently I read that there are two types of drivers (at least for disk), one that are called high level drivers and another called low level device drivers. Can some one tell me what these are, and why we need drivers in two levels?\ > **A high level device driver places i/o request on queue,after threshold is > met a low level device driver will transfer it to disk**


title: I need to learn how to convert regular time and date format into unix time format

text: I am trying to edit a URL on google locatiion history. I need to know how to enter february 15 2013 in unix time format (the 10 digit format) I'm not a computer whiz so if anyone can just give me the answer and not try to teach me how right now I'd really appreciate that. If you have any suggestions on any websites I can go to and learn how later on or any suggestions on android apps that convert regular time into unix time please tell me!


title: No on-board sound on Dell Optiplex SX-280 post Linux Mint Petra Install

text: Not sure this fits in here.. We recently installed Linux Mint Petra on this small-form-factor dell desktop. The weird thing is, the sound does not work on board, but works on a speaker connected to the audio out. I've checked all details I could about the alsa mixer, sound card mute check etc. All seems fine. Also looked to see if the box had any mute on/off button but there's none in sight. Previously, when the box had Windows XP, there indeed was on-board sound, and thus there was no need to use external speakers for the audio. Has anyone come across this issue, or is there anything else I could check. Any online search result only talks about general sound-card issues, but this is specifically a case of onboard sound not working. Of course one could say why not just plug in speakers, but I would like to understand what the problem might be here and find a solution. This question was seen as not relevant in the ubuntu forum when originally posted there.               $ cat /proc/asound/cards      0 [ICH6 ]: ICH4 - Intel ICH6                 Intel ICH6 with AD1981B at irq 23          $ sudo lshw          *-multimedia         description: Multimedia audio controller         product: 82801FB/FBM/FR/FW/FRW (ICH6 Family) AC'97 Audio Controller         vendor: Intel Corporation         physical id: 1e.2         bus info: pci@0000:00:1e.2         version: 03         width: 32 bits         clock: 33MHz         capabilities: pm bus_master cap_list         configuration: driver=snd_intel8x0 latency=0         resources: irq:23 ioport:ec00(size=256) ioport:e8c0(size=64) memory:dfebfe00-dfebffff memory                    $ lsmod | grep pcspkr     pcspkr 12630 0          $ lsmod | grep snd       snd_intel8x0 33069 3     snd_ac97_codec 105668 1 snd_intel8x0     ac97_bus 12642 1 snd_ac97_codec     snd_pcm 89488 3 snd_ac97_codec,snd_intel8x0     snd_page_alloc 14230 2 snd_intel8x0,snd_pcm     snd_seq_midi 13132 0     snd_seq_midi_event 14475 1 snd_seq_midi     snd_rawmidi 25094 1 snd_seq_midi     snd_seq 55383 2 snd_seq_midi_event,snd_seq_midi     snd_seq_device 14137 3 snd_seq,snd_rawmidi,snd_seq_midi     snd_timer 24447 2 snd_pcm,snd_seq     snd 60790 13   snd_ac97_codec,snd_intel8x0,snd_timer,snd_pcm,snd_seq,snd_rawmidi,snd_seq_device,snd_seq_midi     soundcore 12600 1 snd


title: compare files line by line and create new one bash programming

text: I have two text files. File 2 has logs over 1,000,000. File 1 has IP addresses line by line. I want to read file 2 lines and search these lines in file 1, I mean: file 1:               34.123.21.32     45.231.43.21     21.34.67.98      file 2 :               34.123.21.32 0.326 - [30/Oct/2013:06:00:06 +0200]     45.231.43.21 6.334 - [30/Oct/2013:06:00:06 +0200]     45.231.43.21  3.673 - [30/Oct/2013:06:00:06 +0200]     34.123.21.32 4.754 - [30/Oct/2013:06:00:06 +0200]     21.34.67.98 1.765 - [30/Oct/2013:06:00:06 +0200]     ...      I want to search for the IP from file 1 line by line in file 2 and print time arguments (example: 0.326) to a new file. How can I do this?


title: tar with relative paths

text: I try to create an archive with tar using relative paths. I use the following command:               tar czf ~/files/wp/my-page-order.tar.gz -C ~/webapps/zers/wp-content/plugins/ ~/webapps/zers/wp-content/plugins/my-page-order      But the archived files still have absolute paths. How can I use tar with relative paths?


title: "Access denied" when logging to Solaris virtual machine using ssh

text: I have got a Solaris 10 on a VMware virtual machine in Windows. This is what I did: 1) Installed PuTTY. 2) Checked whether ssh is running or or not in my Solaris desktop as below:                   bash-3.00# ps -ef | grep sshd         root  2001  2000   0 01:21:37 ?           0:00 /usr/lib/ssh/sshd         root   602     1   0 23:28:23 ?           0:00 /usr/lib/ssh/sshd         root  2000   602   0 01:21:37 ?           0:00 /usr/lib/ssh/sshd      3) Checked IP of my Solaris 10 VM:               bash-3.00# ifconfig -a     lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1             inet 127.0.0.1 netmask ff000000     e1000g0: flags=1004843<UP,BROADCAST,RUNNING,MULTICAST,DHCP,IPv4> mtu 1500 index 2             inet 192.168.79.128 netmask ffffff00 broadcast 192.168.79.255             ether 0:c:29:b6:1f:ec     lo0: flags=2002000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv6,VIRTUAL> mtu 8252 index 1             inet6 ::1/128     e1000g0: flags=2004841<UP,RUNNING,MULTICAST,DHCP,IPv6> mtu 1500 index 2             inet6 fe80::20c:29ff:feb6:1fec/10             ether 0:c:29:b6:1f:ec      I am trying to connect using PuTTY with IP `192.168.79.128` on port `22` but this is what I am getting:               login as: root     Using keyboard-interactive authentication.     Password:     Access denied     Using keyboard-interactive authentication.     Password:      What am I missing?


title: Install Slackware on a USB Pendrive

text: I have a nice, smooth flash drive which requires a mounting of a DVD ISO image for Slackware to install. For whatever reason, Ubuntu's Startup Disk Creator refuses to notice the iso, so I can't use that. Thus, I have to do it the hard way. Before anyone mentions this, I'd like to mention that I already have looked into that and unfortunately it's not quite what I'm looking for. I need to mount the entire DVD iso image of slackware, not a small 37 mb image for USB. Is this possible at all in Ubuntu? Many please and thank yous.


title: On touching a new file why is mtime and ctime older than atime?

text: I have this:               $ ls -l ff     ls: cannot access ff: No such file or directory               $ touch ff     $ stat ff       File: `ff'       Size: 0           Blocks: 0          IO Block: 4096   regular empty file     Device: 803h/2051d  Inode: 1057193     Links: 1     Access: (0644/-rw-r--r--)  Uid: ( 1000/   abc)   Gid: (    0/    root)     Access: 2011-09-18 20:36:08.351097228 -0700     Modify: 2011-09-18 20:36:07.340839847 -0700     Change: 2011-09-18 20:36:07.340839847 -0700      Why are mtime and ctime older than atime?


title: Allocate file at a specific offset in ext3/4

text: For benchmark and testing purposes I need to be able to allocate a file at a specific offset from the start of the partition. When I create a new file normally, its blocks are placed wherever the file system decides, but I want to control that. In other words, I want to manually pick which blocks are assigned to a file. I've looked at debugfs, but I can't find any way to do what I want. Though I can mark blocks as allocated and modify the inode, this only works for the first 12 blocks. After that I need to be able to create indirect and double indirect blocks as well, which it doesn't look like debugfs has any capability for. Is there any way to do this? Any tool that could help me? You may assume that the file system is either ext3 or ext4 and that it has been freshly formatted (no other files exist). Thanks in advance.


title: Why doesn't "cvs --help | less" work?

text: I don't know why, but piping `cvs --help` to `less` doesn't work. Probably it's because `cvs --help` outputs not to standard output(1) or error output(2), but somewhere else. Could you tell me where does it output?


title: Allow www-data to execute a a script

text: I am trying to execute a script that will read a file written by PHP. The problem is that the script opens and some other files (C-ISAM file based database) and i have no clue what permisions to give at these files.. Should i add www-data to my group ?


title: Where does /etc/profile file in Debian come from?

text: Does it belong to some package or is it generated on install time? It looks like it isn't contained in any packages.


title: "Symbolic link not allowed or link target not accessible" / Apache on CentOS 6

text: I've got a brand new CentOS 6 installation, which has a symlink in the document root to my development files:               [root@localhost html]# ls -l     total 4     -rwxrwxrwx. 1 root root  0 Sep 18 20:16 index.html     -rwxrwxrwx. 1 root root 17 Sep 18 20:16 index.php     lrwxrwxrwx. 1 root root 24 Sep 18 20:19 refresh-app -> /home/billy/refresh-app/      My httpd.conf has this:               <Directory "/">         Options All         AllowOverride None         Order allow,deny         Allow from all     </directory>      The target of the symbolic link has permissions which should allow apache to read anything it wants:                [root@localhost billy]# ls -l     total 40 (Some entries were omitted because the list was too long     drwxr-xr-x. 7 billy billy 4096 Sep 18 20:03 refresh-app      I've also tried disabling SELinux by changing `/etc/selinux/conf`:               SELINUX=disabled      Yet no matter what I do, when someone tries to go to that link, `http://localhost/refresh-app/`, I get a 403 FORBIDDEN error page and this is written in the `/var/log/httpd/error_log`:               Symbolic link not allowed or link target not accessible      Why can't Apache access the target of the symlink?


title: How to figure out the exact package name of a `.so` file, so that it can be installed through `zypper`?

text: anisha@linux-dopx:~/tarBalls/qtFlash/bin> ./flashscript      ./flashscript: error while loading shared libraries: libqtnmedia.so.2: cannot open shared object file: No such file or directory          anisha@linux-dopx:~/tarBalls/qtFlash/bin> cnf libqtnmedia.so.2     libqtnmedia.so.2: command not found                                       Is there a pattern somewhere? How do YOU install a `.so` file through the package manager?


title: Booting native Arch Linux on an Android device

text: I have a Galaxy Note 10.1 (n8010) and I want to make it boot Arch Linux natively. I mean boot Arch Linux instead of android. All that I need is to alter the initramfs, which I can't find anywhere in the world. My questions:   * Do I need to alter only the initramfs, or I have to cope with other things too? (such as the kernel itself)   * [DONE] Where an I get the CyanogenMod 10.1's official initramfs (github maybe)? Or I have to self-compile the CyanogenMod's kernel and extract it from the zImage?   * [PROBABLY] Can I have the Arch linux root inside the android data partition? (e.g. /data/linux) Or I have to buy an SD card?   * What else do I need to know/do? Edit: I found how to alter the initramfs :)   1. unzip rom (CM10.1 for n8013 used)   2. wget http://whiteboard.ping.se/uploads/Android/unmkbootimg.gz   3. gunzip unmkbootimg.gz   4. ./unmkbootimg boot.img (save the command given with mkbootimg!)   5. mkdir initramfs && cd initramfs   6. gzip -cd initramfs.cpio.gz | cpio -i   7. Alter the init scripts <- testing that right now, I'll post the correct once done   8. find . | cpio -o -H newc | gzip > ../initramfs.cpio.gz (not sure if the command is right...)   9. cd .. && clean the directory so that only initramfs.cpio.gz and zImage is left...   10. execute the mkbootimg command you saved before...   11. flash the new boot.img :) For those that don't have mkbootimg (you get that by compiling a kernel) I found a precompiled one Links:   * mkbootimg: http://forum.xda-developers.com/showpost.php?p=4575685&postcount=2   * resource 1: http://whiteboard.ping.se/Android/Debian   * unpacking and altering initramfs: http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack%2C_Edit%2C_and_Re-Pack_Boot_Images   * unmkbootimg: http://whiteboard.ping.se/Android/Unmkbootimg


title: How can I search for a user account in various sudo related config files?

text: I'm a scripting newbie...and I would like to search multiple servers for user `ss7459` in the following files `/etc/sudoers`, `/etc/sudoers.d/itse`, `/etc/sudoers.d/dbas` and `/etc/group`. **NOTE:** The numbers after the `ss` may not be constant across all the servers... on some it may be `ss3945...` and so on but it all starts with `ss`. Can someone please help me write a script for this? Also, I'll be running this on a satellite with all servers on it thus the main aim is to find out all the servers with that user (ss7***) on them. I'll also be needing a way to get the servers name and compile a list of those servers.


title: Can I include another file in fstab

text: Can I include another file in my `fstab` file? I.e. can I have `fstab` execute lines from another file at an arbitrary point, and then return to the main file when completed?


title: How to match a file name suffix

text: How to verify if the name of a `.xml` file name ended with `.any-string`? e.g. .previous or .backup or bck12 etc ... I need to print the XML file name except for XML files that end with `.any- string` or have anything after the `.xml` How to verify this with grep or awk or sed or perl or any other idea? Something like                file=machine_configuration.xml      file=machine_configuration.xml.previos      file=machine_configuration.xml.backup      echo $file | .....      Examples:   1. `machine_configuration.xml`: yes   2. `machine_configuration.xml.OLD`: no   3. `machine_configuration.xml-HOLD: no   4. `machine_configuration.xml10`: no   5. `machine_configuration.xml@hold`: no   6. `machine_configuration.xml_need_to_verifi_this`: no


title: Where can I find mailfromd RPM's for CentOS 6?

text: I have been trying to locate an RPM for GNU Mailfromd and it's dependencies and have been quite surprised to find it absolutely nowhere on the 'net. Only place I could find any RPM's were for ALTLinux. Anyone know where I could find it? I have some advanced filtering needs for postfix and it seems to be the most flexible solution available. I've had a lot of trouble trying to compile the dependencies (also not available it seems) myself (GNU mail-tools, guile, etc). Does GNU have an RPM repository somewhere?


title: Suddenly, I Can't login with correct password (greeter & tty)

text: This might be a duplicate of other password related questions but it's somehow eccentric. I have 3 accounts in my **Ubuntu 12.10** system (one standard and two administrators). One of the administrator accounts is my main development account and suddenly before yesterday, it started to act weird (since the latest updates - Kernel and others:   * At the **greeter stage** , when I enter my password, it instantly returns 'Incorrect password'. It does not even check. (N.B: The password is absolutely correct)   * At **TTY** , impossible to login, once I enter my login name and then the password, it instantly re-prompts me to enter the login name...It feels like tha path to authenticate this account has been accidently locked or access-sealed. I logged in with my second admin account and changed the password for the troublesome account, but no luck, reverted the password back to its original value and set the account to auto-login. rebooted and then, indeed the account logged in. Yet, the abonormality remains:   * I **cannot perform root privilege actions (sudo & gksudo)**. Once I enter my password, nothing happens. The only time when the password is accepted is when the screen is locked and that I am prompted to enter the password to unlock it. I checked the ownership of my home folder and it's ok. Some help is very appreciated. So to summarize: - Can't login through lightdm - sudo, gksudo & pkexec do not succeed - su command fails - if I provide the sudo command with an incorrect password, it checks and it return "Password incorrect", but if I provide the correct password, it does return nothing. - The password keyring is accepted when I autologin. - The password is accepted when I unlock the screen.   * I already changed the password and checked if my username belongs to groups like (sudo, admin, adm,....). * * * *Ubuntu 12.10 Unity uname: Linux l502x 3.5.0-23-generic #35-Ubuntu SMP Thu Jan 24 13:15:40 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux* -------Some logs----------- ** > cat /var/log/auth.log | grep hanine **               Feb 12 03:21:05 l502x lightdm: pam_succeed_if(lightdm:auth): requirement "user ingroup nopasswdlogin" not met by user "hanine"     Feb 12 03:21:05 l502x lightdm: pam_unix(lightdm:auth): auth could not identify password for [hanine]     Feb 12 03:21:05 l502x lightdm: pam_succeed_if(lightdm:auth): requirement "user ingroup nopasswdlogin" not met by user "hanine"     Feb 12 03:21:06 l502x lightdm: pam_succeed_if(lightdm:auth): requirement "user ingroup nopasswdlogin" not met by user "hanine"     Feb 12 03:21:38 l502x lightdm: pam_succeed_if(lightdm:auth): requirement "user ingroup nopasswdlogin" not met by user "hanine"     Feb 12 03:21:43 l502x lightdm: pam_succeed_if(lightdm:auth): requirement "user ingroup nopasswdlogin" not met by user "hanine"     Feb 12 03:23:36 l502x sudo:    admin : TTY=pts/0 ; PWD=/home/hanine ; USER=root ; COMMAND=/usr/bin/passwd hanine     Feb 12 03:23:36 l502x passwd[5502]: pam_smbpass(passwd:chauthtok): Failed to find entry for user hanine.     Feb 12 03:23:52 l502x passwd[5502]: pam_unix(passwd:chauthtok): password changed for hanine     Feb 12 03:23:52 l502x passwd[5502]: pam_smbpass(passwd:chauthtok): Failed to find entry for user hanine.     Feb 12 03:24:17 l502x sudo:    admin : TTY=pts/0 ; PWD=/home/hanine ; USER=root ; COMMAND=/usr/bin/passwd hanine     Feb 12 03:24:17 l502x passwd[5520]: pam_smbpass(passwd:chauthtok): Failed to find entry for user hanine.     Feb 12 03:24:24 l502x passwd[5520]: pam_unix(passwd:chauthtok): password changed for hanine     Feb 12 03:24:24 l502x passwd[5520]: pam_smbpass(passwd:chauthtok): Failed to find entry for user hanine.     Feb 12 03:27:51 l502x sudo:    admin : TTY=pts/0 ; PWD=/home/hanine ; USER=root ; COMMAND=/bin/rm .xsession-errors     Feb 12 03:28:42 l502x sudo:    admin : TTY=pts/0 ; PWD=/home/hanine ; USER=root ; COMMAND=/bin/rm .Xauthority     Feb 12 03:29:22 l502x sudo:    admin : TTY=pts/0 ; PWD=/home/hanine ; USER=root ; COMMAND=/bin/mkdir .xsession-errors-old-files     Feb 12 03:29:36 l502x sudo:    admin : TTY=pts/0 ; PWD=/home/hanine ; USER=root ; COMMAND=/bin/mv .xsession-errors.old .xsession-errors_OLD1 .xsession-errors-old-files .xsession-errors-old-files/     Feb 12 03:34:15 l502x sudo:    admin : TTY=pts/2 ; PWD=/home/hanine ; USER=root ; COMMAND=/usr/bin/sakis3g connect     Feb 12 14:10:08 l502x lightdm: pam_succeed_if(lightdm:auth): requirement "user ingroup nopasswdlogin" not met by user "hanine"     Feb 12 14:10:15 l502x lightdm: pam_succeed_if(lightdm:auth): requirement "user ingroup nopasswdlogin" not met by user "hanine"     Feb 12 14:13:23 l502x accounts-daemon: request by system-bus-name::1.66 [gnome-control-center user-accounts pid:3028 uid:1001]: enable automatic login for user 'hanine' (1000)     Feb 12 14:16:54 l502x lightdm: pam_succeed_if(lightdm:auth): requirement "user ingroup nopasswdlogin" not met by user "hanine"     Feb 12 14:16:54 l502x lightdm: pam_unix(lightdm:auth): auth could not identify password for [hanine]     Feb 12 14:16:55 l502x lightdm: pam_succeed_if(lightdm:auth): requirement "user ingroup nopasswdlogin" not met by user "hanine"     Feb 12 14:16:55 l502x lightdm: pam_succeed_if(lightdm:auth): requirement "user ingroup nopasswdlogin" not met by user "hanine"     Feb 12 14:16:57 l502x lightdm: pam_unix(lightdm:auth): authentication failure; logname= uid=0 euid=0 tty=:1 ruser= rhost=  user=hanine     Feb 12 14:16:59 l502x lightdm: pam_succeed_if(lightdm:auth): requirement "user ingroup nopasswdlogin" not met by user "hanine"     Feb 12 14:17:43 l502x lightdm: pam_succeed_if(lightdm:auth): requirement "user ingroup nopasswdlogin" not met by user "hanine"     Feb 12 14:18:00 l502x lightdm: pam_unix(lightdm:auth): authentication failure; logname= uid=0 euid=0 tty=:0 ruser= rhost=  user=hanine     Feb 12 14:18:02 l502x lightdm: pam_succeed_if(lightdm:auth): requirement "user ingroup nopasswdlogin" not met by user "hanine"     Feb 12 14:18:06 l502x lightdm: pam_succeed_if(lightdm:auth): requirement "user ingroup nopasswdlogin" not met by user "hanine"     Feb 12 14:18:14 l502x lightdm: pam_succeed_if(lightdm:auth): requirement "user ingroup nopasswdlogin" not met by user "hanine"     Feb 12 14:18:17 l502x lightdm: pam_succeed_if(lightdm:auth): requirement "user ingroup nopasswdlogin" not met by user "hanine"     Feb 12 14:19:05 l502x lightdm: pam_unix(lightdm-autologin:session): session opened for user hanine by (uid=0)     Feb 12 14:20:04 l502x gnome-keyring-daemon[2173]: keyring alias directory: /home/hanine/.local/share/keyrings     Feb 12 14:50:18 l502x gnome-screensaver-dialog: pam_unix(gnome-screensaver:auth): authentication failure; logname= uid=1000 euid=1000 tty=:0.0 ruser= rhost=  user=hanine     Feb 12 14:55:48 l502x sudo:    admin : TTY=pts/3 ; PWD=/home/admin ; USER=root ; COMMAND=/bin/chown hanine:hanine /home/hanine/     Feb 12 14:59:22 l502x polkitd(authority=local): Operator of unix-session:/org/freedesktop/ConsoleKit/Session1 successfully authenticated as unix-user:admin to gain TEMPORARY authorization for action com.ubuntu-tweak.daemon.clean for system-bus-name::1.138 [/usr/bin/python /usr/bin/ubuntu-tweak] (owned by unix-user:hanine)     Feb 12 15:56:26 l502x polkitd(authority=local): Operator of unix-session:/org/freedesktop/ConsoleKit/Session1 FAILED to authenticate to gain authorization for action org.gnome.controlcenter.user-accounts.administration for unix-process:10018:582882 [gnome-control-center user-accounts] (owned by unix-user:hanine)     Feb 12 16:16:41 l502x sudo:    admin : TTY=tty2 ; PWD=/home/admin ; USER=root ; COMMAND=/usr/sbin/adduser hanine sudo     Feb 12 16:16:49 l502x sudo:    admin : TTY=tty2 ; PWD=/home/admin ; USER=root ; COMMAND=/usr/sbin/adduser hanine admin     Feb 12 16:16:49 l502x gpasswd[17020]: user hanine added by root to group admin     Feb 12 17:11:49 l502x lightdm: pam_unix(lightdm-autologin:session): session closed for user hanine     Feb 12 17:11:49 l502x lightdm: pam_xdg_support(lightdm-autologin:session): Could not delete directory /run/user/hanine     Feb 12 17:23:58 l502x lightdm: pam_succeed_if(lightdm:auth): requirement "user ingroup nopasswdlogin" not met by user "hanine"     Feb 12 17:23:58 l502x lightdm: pam_unix(lightdm:auth): auth could not identify password for [hanine]     Feb 12 17:23:58 l502x lightdm: pam_succeed_if(lightdm:auth): requirement "user ingroup nopasswdlogin" not met by user "hanine"     Feb 12 17:23:59 l502x lightdm: pam_succeed_if(lightdm:auth): requirement "user ingroup nopasswdlogin" not met by user "hanine"     Feb 12 17:24:04 l502x lightdm: pam_succeed_if(lightdm:auth): requirement "user ingroup nopasswdlogin" not met by user "hanine"     Feb 12 17:24:08 l502x lightdm: pam_unix(lightdm:auth): authentication failure; logname= uid=0 euid=0 tty=:0 ruser= rhost=  user=hanine     Feb 12 17:24:10 l502x lightdm: pam_succeed_if(lightdm:auth): requirement "user ingroup nopasswdlogin" not met by user "hanine"     Feb 12 17:25:36 l502x lightdm: pam_unix(lightdm-autologin:session): session opened for user hanine by (uid=0)     Feb 12 17:26:29 l502x gnome-keyring-daemon[2147]: keyring alias directory: /home/hanine/.local/share/keyrings     Feb 12 17:42:29 l502x sudo:    admin : TTY=pts/2 ; PWD=/home/admin ; USER=root ; COMMAND=/bin/chown -R hanine:hanine /home/hanine     Feb 12 17:47:36 l502x gnome-screensaver-dialog: pam_unix(gnome-screensaver:auth): authentication failure; logname= uid=1000 euid=1000 tty=:0.0 ruser= rhost=  user=hanine     Feb 12 17:56:14 l502x su[17624]: pam_unix(su:auth): authentication failure; logname=hanine uid=1000 euid=0 tty=/dev/pts/4 ruser=hanine rhost=  user=root     Feb 12 17:56:16 l502x su[17624]: FAILED su for root by hanine     Feb 12 17:56:16 l502x su[17624]: - /dev/pts/4 hanine:root     Feb 12 17:56:57 l502x su[17888]: pam_unix(su:auth): authentication failure; logname=hanine uid=1000 euid=0 tty=/dev/pts/4 ruser=hanine rhost=  user=root     Feb 12 17:56:59 l502x su[17888]: FAILED su for root by hanine     Feb 12 17:56:59 l502x su[17888]: - /dev/pts/4 hanine:root     Feb 12 17:59:07 l502x polkitd(authority=local): Operator of unix-session:/org/freedesktop/ConsoleKit/Session1 FAILED to authenticate to gain authorization for action org.freedesktop.policykit.exec for unix-process:16882:180734 [bash] (owned by unix-user:hanine)     Feb 12 17:59:07 l502x pkexec[18604]: hanine: Error executing command as another user: Request dismissed [USER=root] [TTY=/dev/pts/4] [CWD=/home/hanine] [COMMAND=/usr/bin/gedit]     Feb 12 18:17:33 l502x lightdm: pam_unix(lightdm-autologin:session): session closed for user hanine     Feb 12 18:17:33 l502x lightdm: pam_xdg_support(lightdm-autologin:session): Could not delete directory /run/user/hanine     Feb 12 18:32:48 l502x lightdm: pam_unix(lightdm-autologin:session): session opened for user hanine by (uid=0)     Feb 12 18:33:39 l502x gnome-keyring-daemon[2142]: keyring alias directory: /home/hanine/.local/share/keyrings     Feb 12 19:05:48 l502x lightdm: pam_succeed_if(lightdm:auth): requirement "user ingroup nopasswdlogin" not met by user "hanine"     Feb 12 19:07:38 l502x sudo:    admin : TTY=pts/2 ; PWD=/home/admin ; USER=root ; COMMAND=/usr/bin/passwd hanine     Feb 12 19:07:38 l502x passwd[17421]: pam_smbpass(passwd:chauthtok): Failed to find entry for user hanine.     Feb 12 19:07:44 l502x passwd[17421]: pam_unix(passwd:chauthtok): password changed for hanine     Feb 12 19:07:44 l502x passwd[17421]: pam_smbpass(passwd:chauthtok): Failed to find entry for user hanine.     Feb 12 19:08:03 l502x lightdm: pam_succeed_if(lightdm:auth): requirement "user ingroup nopasswdlogin" not met by user "hanine"     Feb 12 19:08:13 l502x lightdm: pam_unix(lightdm:auth): authentication failure; logname= uid=0 euid=0 tty=:1 ruser= rhost=  user=hanine     Feb 12 19:08:15 l502x lightdm: pam_succeed_if(lightdm:auth): requirement "user ingroup nopasswdlogin" not met by user "hanine"     Feb 12 19:08:18 l502x lightdm: pam_unix(lightdm:auth): authentication failure; logname= uid=0 euid=0 tty=:1 ruser= rhost=  user=hanine     Feb 12 19:08:20 l502x lightdm: pam_succeed_if(lightdm:auth): requirement "user ingroup nopasswdlogin" not met by user "hanine"     Feb 12 19:09:47 l502x lightdm: pam_unix(lightdm-autologin:session): session opened for user hanine by (uid=0)     Feb 12 19:10:39 l502x gnome-keyring-daemon[2099]: keyring alias directory: /home/hanine/.local/share/keyrings     Feb 12 19:11:27 l502x sudo: pam_unix(sudo:auth): authentication failure; logname=hanine uid=1000 euid=0 tty=/dev/pts/0 ruser=hanine rhost=  user=hanine     Feb 12 19:12:31 l502x sudo:    admin : TTY=pts/1 ; PWD=/home/admin ; USER=root ; COMMAND=/usr/bin/passwd hanine     Feb 12 19:12:31 l502x passwd[4491]: pam_smbpass(passwd:chauthtok): Failed to find entry for user hanine.     Feb 12 19:12:38 l502x passwd[4491]: pam_unix(passwd:chauthtok): password changed for hanine     Feb 12 19:12:38 l502x passwd[4491]: pam_smbpass(passwd:chauthtok): Failed to find entry for user hanine.     Feb 12 22:44:16 l502x sudo: pam_unix(sudo:auth): authentication failure; logname=hanine uid=1000 euid=0 tty=/dev/pts/0 ruser=hanine rhost=  user=hanine     Feb 13 13:24:01 l502x lightdm: pam_unix(lightdm-autologin:session): session opened for user hanine by (uid=0)     Feb 13 13:24:52 l502x gnome-keyring-daemon[2061]: keyring alias directory: /home/hanine/.local/share/keyrings     Feb 13 13:40:49 l502x polkitd(authority=local): Operator of unix-session:/org/freedesktop/ConsoleKit/Session1 FAILED to authenticate to gain authorization for action org.freedesktop.policykit.exec for unix-process:3554:15127 [bash] (owned by unix-user:hanine)     Feb 13 13:40:49 l502x pkexec[8783]: hanine: Error executing command as another user: Request dismissed [USER=root] [TTY=/dev/pts/0] [CWD=/home/hanine] [COMMAND=/usr/bin/apt-get update]     Feb 13 13:49:13 l502x polkitd(authority=local): Operator of unix-session:/org/freedesktop/ConsoleKit/Session1 FAILED to authenticate to gain authorization for action org.freedesktop.policykit.exec for unix-process:10395:133011 [bash] (owned by unix-user:hanine)     Feb 13 13:49:13 l502x pkexec[11324]: hanine: Error executing command as another user: Request dismissed [USER=root] [TTY=/dev/pts/2] [CWD=/home/hanine] [COMMAND=/usr/bin/gedit]      **Summary of other logs** (the one that got modified right after an unsuccessfull login): **-----OUTPUT in auth.log between 14:52 & 14:53---**               Feb 13 14:52:37 l502x lightdm: pam_unix(lightdm-greeter:session): session opened for user lightdm by (uid=0)     Feb 13 14:52:37 l502x lightdm: pam_ck_connector(lightdm-greeter:session): nox11 mode, ignoring PAM_TTY :2     Feb 13 14:52:37 l502x dbus[959]: [system] Rejected send message, 2 matched rules; type="method_call", sender=":1.50" (uid=1000 pid=2758 comm="/usr/lib/indicator-session/indicator-session-servi") interface="org.freedesktop.DBus.Properties" member="GetAll" error name="(unset)" requested_reply="0" destination=":1.14" (uid=0 pid=1528 comm="/usr/sbin/console-kit-daemon --no-daemon ")     Feb 13 14:52:37 l502x dbus[959]: [system] Rejected send message, 2 matched rules; type="method_call", sender=":1.114" (uid=1001 pid=17063 comm="/usr/lib/indicator-session/indicator-session-servi") interface="org.freedesktop.DBus.Properties" member="GetAll" error name="(unset)" requested_reply="0" destination=":1.14" (uid=0 pid=1528 comm="/usr/sbin/console-kit-daemon --no-daemon ")     Feb 13 14:52:38 l502x lightdm: pam_succeed_if(lightdm:auth): requirement "user ingroup nopasswdlogin" not met by user "admin"     Feb 13 14:52:38 l502x lightdm: pam_succeed_if(lightdm:auth): requirement "user ingroup nopasswdlogin" not met by user "admin"     Feb 13 14:52:38 l502x dbus[959]: [system] Rejected send message, 2 matched rules; type="method_call", sender=":1.165" (uid=110 pid=5906 comm="/usr/lib/indicator-session/indicator-session-servi") interface="org.freedesktop.DBus.Properties" member="GetAll" error name="(unset)" requested_reply="0" destination=":1.14" (uid=0 pid=1528 comm="/usr/sbin/console-kit-daemon --no-daemon ")     Feb 13 14:52:39  dbus[959]: last message repeated 9 times     Feb 13 14:52:39 l502x dbus[959]: [system] Rejected send message, 2 matched rules; type="method_call", sender=":1.170" (uid=110 pid=5908 comm="/usr/lib/indicator-datetime/indicator-datetime-ser") interface="org.freedesktop.DBus.Properties" member="GetAll" error name="(unset)" requested_reply="0" destination=":1.14" (uid=0 pid=1528 comm="/usr/sbin/console-kit-daemon --no-daemon ")     Feb 13 14:52:40 l502x lightdm: pam_succeed_if(lightdm:auth): requirement "user ingroup nopasswdlogin" not met by user "hanine"     Feb 13 14:53:05  lightdm: last message repeated 2 times      **-------OUTPUT in syslog between 14:52 & 14:53-----**-               Feb 13 14:39:01 l502x CRON[32704]: (root) CMD (  [ -x /usr/lib/php5/maxlifetime ] && [ -d /var/lib/php5 ] && find /var/lib/php5/ -depth -mindepth 1 -maxdepth 1 -type f -ignore_readdir_race -cmin +$(/usr/lib/php5/maxlifetime) ! -execdir fuser -s {} 2>/dev/null \; -delete)     Feb 13 14:52:34 l502x acpid: client 1468[0:0] has disconnected     Feb 13 14:52:34 l502x acpid: client connected from 16547[0:0]     Feb 13 14:52:34 l502x acpid: 1 client rule loaded     Feb 13 14:52:36 l502x acpid: client connected from 5795[0:0]     Feb 13 14:52:36 l502x acpid: 1 client rule loaded     Feb 13 14:52:38 l502x rtkit-daemon[2221]: Successfully made thread 5947 of process 5947 (n/a) owned by '110' high priority at nice level -11.     Feb 13 14:52:38 l502x rtkit-daemon[2221]: Supervising 7 threads of 3 processes of 3 users.     Feb 13 14:52:39 l502x goa[5965]: goa-daemon version 3.6.0 starting [main.c:112, main()]     Feb 13 14:52:39 l502x rtkit-daemon[2221]: Successfully made thread 5977 of process 5947 (n/a) owned by '110' RT at priority 5.     Feb 13 14:52:39 l502x rtkit-daemon[2221]: Supervising 8 threads of 3 processes of 3 users.     Feb 13 14:52:39 l502x rtkit-daemon[2221]: Successfully made thread 5979 of process 5947 (n/a) owned by '110' RT at priority 5.     Feb 13 14:52:39 l502x rtkit-daemon[2221]: Supervising 9 threads of 3 processes of 3 users.     Feb 13 14:52:39 l502x rtkit-daemon[2221]: Successfully made thread 5985 of process 5985 (n/a) owned by '110' high priority at nice level -11.     Feb 13 14:52:39 l502x rtkit-daemon[2221]: Supervising 10 threads of 4 processes of 3 users.     Feb 13 14:52:39 l502x pulseaudio[5985]: [pulseaudio] pid.c: Daemon already running.     Feb 13 14:53:11 l502x acpid: client 16547[0:0] has disconnected     Feb 13 14:53:11 l502x acpid: client 5795[0:0] has disconnected     Feb 13 14:53:11 l502x acpid: client connected from 16547[0:0]     Feb 13 14:53:11 l502x acpid: 1 client rule loaded      **----------------OUTPUT in Xorg.0.log between 14:52 & 14:53---------------** ...               [  5193.182] (II) XKB: reuse xkmfile /var/lib/xkb/server-2A7E24AED066D4B3B8BAB98261965C829292FC7F.xkm     [  5195.444] (II) XKB: reuse xkmfile /var/lib/xkb/server-2A7E24AED066D4B3B8BAB98261965C829292FC7F.xkm     [  5200.561] (II) XKB: reuse xkmfile /var/lib/xkb/server-2A7E24AED066D4B3B8BAB98261965C829292FC7F.xkm     [  5202.771] (II) XKB: reuse xkmfile /var/lib/xkb/server-2A7E24AED066D4B3B8BAB98261965C829292FC7F.xkm     [  5244.342] (II) XKB: reuse xkmfile /var/lib/xkb/server-2A7E24AED066D4B3B8BAB98261965C829292FC7F.xkm     [  5244.724] (II) XKB: reuse xkmfile /var/lib/xkb/server-2A7E24AED066D4B3B8BAB98261965C829292FC7F.xkm     [  5296.302] (II) XKB: reuse xkmfile /var/lib/xkb/server-2A7E24AED066D4B3B8BAB98261965C829292FC7F.xkm     [  5298.589] (II) XKB: reuse xkmfile /var/lib/xkb/server-2A7E24AED066D4B3B8BAB98261965C829292FC7F.xkm     [  5336.975] (II) AIGLX: Suspending AIGLX clients for VT switch      **----------------OUTPUT in Xorg.1.log between 14:52 & 14:53---------------**               [  2466.917] (**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2.2/2-1.2.2:1.0/input/input16/event14"     [  2466.917] (II) XINPUT: Adding extended input device "DELL DELL USB Laser Mouse" (type: MOUSE, id 12)     [  2466.918] (II) evdev: DELL DELL USB Laser Mouse: initialized for relative axes.     [  2466.918] (**) DELL DELL USB Laser Mouse: (accel) keeping acceleration scheme 1     [  2466.918] (**) DELL DELL USB Laser Mouse: (accel) acceleration profile 0     [  2466.918] (**) DELL DELL USB Laser Mouse: (accel) acceleration factor: 2.000     [  2466.918] (**) DELL DELL USB Laser Mouse: (accel) acceleration threshold: 4     [  5336.975] (II) Open ACPI successful (/var/run/acpid.socket)     [  5336.975] (II) AIGLX: Resuming AIGLX clients after VT switch     [  5336.996] (II) intel(0): EDID vendor "AUO", prod id 8940     [  5336.996] (II) intel(0): Printing DDC gathered Modelines:     [  5336.996] (II) intel(0): Modeline "1366x768"x0.0   65.10  1366 1382 1390 1398  768 771 775 776 +hsync -vsync (46.6 kHz eP)     [  5337.061] (--) synaptics: SynPS/2 Synaptics TouchPad: touchpad found     [  5339.035] (II) AIGLX: Suspending AIGLX clients for VT switch     [  5373.403] (II) Open ACPI successful (/var/run/acpid.socket)     [  5373.403] (II) AIGLX: Resuming AIGLX clients after VT switch     [  5373.416] (II) intel(0): EDID vendor "AUO", prod id 8940     [  5373.416] (II) intel(0): Printing DDC gathered Modelines:     [  5373.416] (II) intel(0): Modeline "1366x768"x0.0   65.10  1366 1382 1390 1398  768 771 775 776 +hsync -vsync (46.6 kHz eP)     [  5373.481] (--) synaptics: SynPS/2 Synaptics TouchPad: touchpad found     [  5408.188] (II) intel(0): EDID vendor "AUO", prod id 8940     [  5408.188] (II) intel(0): Printing DDC gathered Modelines:     [  5408.188] (II) intel(0): Modeline "1366x768"x0.0   65.10  1366 1382 1390 1398  768 771 775 776 +hsync -vsync (46.6 kHz eP)     [  5412.873] (II) intel(0): EDID vendor "AUO", prod id 8940     [  5412.873] (II) intel(0): Printing DDC gathered Modelines:     [  5412.873] (II) intel(0): Modeline "1366x768"x0.0   65.10  1366 1382 1390 1398  768 771 775 776 +hsync -vsync (46.6 kHz eP)      **----------------OUTPUT in Xorg.3.log between 14:52 & 14:53---------------**               [  5339.350] (**) evdev: Dell WMI hotkeys: Device: "/dev/input/event5"     [  5339.350] (--) evdev: Dell WMI hotkeys: Vendor 0 Product 0     [  5339.350] (--) evdev: Dell WMI hotkeys: Found keys     [  5339.350] (II) evdev: Dell WMI hotkeys: Configuring as keyboard     [  5339.350] (**) Option "config_info" "udev:/sys/devices/virtual/input/input5/event5"     [  5339.350] (II) XINPUT: Adding extended input device "Dell WMI hotkeys" (type: KEYBOARD, id 15)     [  5339.350] (**) Option "xkb_rules" "evdev"     [  5339.350] (**) Option "xkb_model" "pc105"     [  5339.350] (**) Option "xkb_layout" "fr"     [  5373.402] (II) AIGLX: Suspending AIGLX clients for VT switch     [  5373.543] (II) evdev: Dell WMI hotkeys: Close     [  5373.543] (II) UnloadModule: "evdev"     [  5373.543] (II) UnloadModule: "synaptics"     [  5373.543] (II) evdev: AT Translated Set 2 keyboard: Close     [  5373.543] (II) UnloadModule: "evdev"     [  5373.543] (II) evdev: DELL DELL USB Laser Mouse: Close     [  5373.543] (II) UnloadModule: "evdev"     [  5373.543] (II) evdev: Laptop_Integrated_Webcam_2HDM: Close     [  5373.543] (II) UnloadModule: "evdev"     [  5373.543] (II) evdev: Sleep Button: Close     [  5373.543] (II) UnloadModule: "evdev"     [  5373.543] (II) evdev: Power Button: Close     [  5373.543] (II) UnloadModule: "evdev"     [  5373.543] (II) evdev: Video Bus: Close     [  5373.543] (II) UnloadModule: "evdev"     [  5373.543] (II) evdev: Video Bus: Close     [  5373.543] (II) UnloadModule: "evdev"     [  5373.543] (II) evdev: Power Button: Close     [  5373.544] (II) UnloadModule: "evdev"     [  5373.555] Server terminated successfully (0). Closing log file.      **----------------OUTPUT in lightdm.log between 14:52 & 14:53---------------**               [+5322.11s] DEBUG: Session 5897 failed during authentication     [+5322.12s] DEBUG: Session 5899 got 1 message(s) from PAM     [+5322.12s] DEBUG: Prompt greeter with 1 message(s)     [+5324.52s] DEBUG: Greeter start authentication for hanine     [+5324.52s] DEBUG: Session 5899: Sending SIGTERM     [+5324.52s] DEBUG: Started session 6005 with service 'lightdm', username 'hanine'     [+5324.52s] DEBUG: Session 5899 terminated with signal 15     [+5324.52s] DEBUG: Session 5899 failed during authentication     [+5324.53s] DEBUG: Session 6005 got 1 message(s) from PAM     [+5324.53s] DEBUG: Prompt greeter with 1 message(s)     [+5332.64s] DEBUG: Continue authentication     [+5332.67s] DEBUG: Session 6005 exited with return value 1     [+5332.67s] DEBUG: Session 6005 failed during authentication     [+5332.67s] DEBUG: Authenticate result for user hanine: Authentication stopped before completion     [+5332.67s] DEBUG: Greeter start authentication for hanine     [+5332.68s] DEBUG: Started session 6050 with service 'lightdm', username 'hanine'     [+5332.69s] DEBUG: Session 6050 got 1 message(s) from PAM     [+5332.69s] DEBUG: Prompt greeter with 1 message(s)     [+5339.70s] DEBUG: Continue authentication     [+5339.73s] DEBUG: Session 6050 exited with return value 1     [+5339.73s] DEBUG: Session 6050 failed during authentication     [+5339.73s] DEBUG: Authenticate result for user hanine: Authentication stopped before completion     [+5339.73s] DEBUG: Greeter start authentication for hanine     [+5339.73s] DEBUG: Started session 6083 with service 'lightdm', username 'hanine'     [+5339.75s] DEBUG: Session 6083 got 1 message(s) from PAM     [+5339.75s] DEBUG: Prompt greeter with 1 message(s)     [+5349.52s] DEBUG: Greeter start authentication for admin     [+5349.52s] DEBUG: Session 6083: Sending SIGTERM     [+5349.53s] DEBUG: Started session 6135 with service 'lightdm', username 'admin'     [+5349.53s] DEBUG: Session 6083 terminated with signal 15     [+5349.53s] DEBUG: Session 6083 failed during authentication     [+5349.54s] DEBUG: Session 6135 got 1 message(s) from PAM     [+5349.54s] DEBUG: Prompt greeter with 1 message(s)     [+5353.99s] DEBUG: Continue authentication     [+5354.00s] DEBUG: Session 6135 got 1 message(s) from PAM     [+5354.00s] DEBUG: Prompt greeter with 1 message(s)     [+5354.03s] DEBUG: Session 6135 authentication complete with return value 0: Success     [+5354.03s] DEBUG: Authenticate result for user admin: Success     [+5354.05s] DEBUG: User admin authorized     [+5354.06s] DEBUG: Greeter requests session ubuntu     [+5354.06s] DEBUG: Using session ubuntu     [+5354.06s] DEBUG: Switching to existing session for user admin     [+5354.06s] DEBUG: Unlocking display     [+5354.06s] DEBUG: Unlocking ConsoleKit session 771ea75a3c00ed10682632e750620a0b-1360763926.621199-1814231122     [+5354.07s] DEBUG: Activating VT 8     [+5354.65s] DEBUG: Stopping greeter display being switched from     [+5354.65s] DEBUG: Stopping display     [+5354.65s] DEBUG: Session 5800: Sending SIGTERM     [+5354.78s] DEBUG: Greeter closed communication channel     [+5354.78s] DEBUG: Session 5800 exited with return value 0     [+5354.78s] DEBUG: Greeter quit     [+5354.78s] DEBUG: Sending signal 15 to process 5795     [+5354.81s] DEBUG: Process 5795 exited with return value 0     [+5354.81s] DEBUG: X server stopped     [+5354.81s] DEBUG: Removing X server authority /var/run/lightdm/root/:2     [+5354.81s] DEBUG: Releasing VT 9     [+5354.81s] DEBUG: Display server stopped     [+5354.81s] DEBUG: Display stopped      **-------OUTPUT in x-2-greeter.log between 14:52 & 14:53---------------**               [+11.54s] DEBUG: Authentication complete for user hanine with return code 19     [+11.54s] DEBUG: Starting authentication for user hanine...     [+11.54s] DEBUG: Wrote 22 bytes to daemon     [+11.55s] DEBUG: Read 8 bytes from daemon     [+11.55s] DEBUG: Read 36 bytes from daemon     [+11.55s] DEBUG: Prompt user with 1 message(s)     [+18.57s] DEBUG: Providing response to display manager     [+18.57s] DEBUG: Wrote 24 bytes to daemon     [+18.59s] DEBUG: Read 8 bytes from daemon     [+18.59s] DEBUG: Read 18 bytes from daemon     [+18.59s] DEBUG: Authentication complete for user hanine with return code 19     [+18.60s] DEBUG: Starting authentication for user hanine...     [+18.60s] DEBUG: Wrote 22 bytes to daemon     [+18.61s] DEBUG: Read 8 bytes from daemon     [+18.61s] DEBUG: Read 36 bytes from daemon     [+18.61s] DEBUG: Prompt user with 1 message(s)     [+28.39s] DEBUG: Starting authentication for user admin...     [+28.39s] DEBUG: Wrote 21 bytes to daemon     [+28.41s] DEBUG: Read 8 bytes from daemon     [+28.41s] DEBUG: Read 35 bytes from daemon     [+28.41s] DEBUG: Prompt user with 1 message(s)     [+28.74s] DEBUG: Setting keyboard layout to 'fr'     [+32.85s] DEBUG: Providing response to display manager     [+32.85s] DEBUG: Wrote 24 bytes to daemon     [+32.86s] DEBUG: Read 8 bytes from daemon     [+32.86s] DEBUG: Read 61 bytes from daemon     [+32.86s] DEBUG: Prompt user with 1 message(s)     [+32.92s] DEBUG: Read 8 bytes from daemon     [+32.92s] DEBUG: Read 17 bytes from daemon     [+32.92s] DEBUG: Authentication complete for user admin with return code 0     [+32.93s] DEBUG: Starting session ubuntu     [+32.93s] DEBUG: Wrote 18 bytes to daemon     [+33.51s] DEBUG: Read 8 bytes from daemon     [+33.51s] DEBUG: Read 4 bytes from daemon     ** Message: PID 5902 (we are 5902) sent signal 15, shutting down...      (nm-applet:5902): libappindicator-WARNING **: Unable to send signal for NewStatus: The connection is closed **in x-2 log, authentication return code for user hanine is 19 (failure) while admin has 0 (success).**


title: Which name should be used for myhostname in Postfix's main.cf?

text: For `#myhostname`, I should uncomment and put my hostname, i.e. the name I gave my VPS, right? Or does it just go `myhostname = mydomain.net`, in other words don't edit the phrase 'myhostname' except to uncomment? And for `#myhostname = virtual.domian.tld` is that to put a subdomain? Should I add a listing for all including with and without `www`?


title: How to check from a command line that network is reachable?

text: I want to send a growl to myself after SuSE server finishes the boot process. I got this message `socket_sendto(): unable to write to socket [101]: Network is unreachable in`. How can I check from command line if the network is reachable and wait in case it is not? * * *


title: Whats the most efficient way of adding milliseconds to this code?

text: #-----------------------------------------------------------------------------     #     # Get time string     #     #-----------------------------------------------------------------------------     #     sub formatTime         {         my ( $seconds )  = @_;              my( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) =                                     localtime( $seconds );         $year += 1900;         $mon += 1;              return ( sprintf "%02d/%02d/%04d %02d:%02d:%02d",                     $mday,$mon,$year,$hour,$min,$sec );         }          #-----------------------------------------------------------------------------     #     # Extract time from the string     #     #-----------------------------------------------------------------------------     #     sub extractTime         {         my ( $edate, $time ) = @_;              my $date =  $1 if ($edate =~ /(\d+\/\d+\/\d+)/);    # remove leading '[' etc.         my ( $mday, $mon, $year ) = split( /\//, $date );         my ( $hour,$min, $sec ) = split( /:/, $time );              return (timelocal( $sec, $min, $hour, $mday, ($mon - 1), ($year - 1900 )));         }


title: Help with 64-bit integers in scripts?

text: Maybe I'm overthinking this (although I don't think I am)....or maybe there's a neater way of solving my problem ? I have a requirement that if a file is larger than 1GB, it gets split into smaller chunks for processing. No problem so far, that can easily be achieved with dd. The problem is what happens with files larger than 4GB ? My thinking at the moment is to start along the following lines ...               # Determine if file needs to be split     determineSplit() {         typeset FILE_SIZE=$(ls -l "${1}" | awk '{print $5}');         typeset -F NUMBER_OF_GIGS=$(print "${FILE_SIZE}/${BK_ONEGIG}"|bc) # using bc for >4GB         if (( ${NUMBER_OF_GIGS} >= 1 )); then             return 0         else             return 1         fi     }      Then once the need to split is determined, I know I need to call dd in a loop... but the problem is, what do I do about calculating seek points for dd if I can't use 64 bit integers in ksh conditional statements ? I'm all confused ! Edit to clarify : (1) I'm hoping to make a reasonably portable script, so preferably no GNU-only answers (2) No, split won't work for reasons outlined in my comment below ;-)


title: What is difference between POSIX and bash and other shell scripts?

text: While going through many answers on Unix.SE, I come across many of them writing their contents w.r.t to `Posix` or `Bash` or some other standard. I know of some differences like some have `arrays` and some don't, and other system level differences which I am not completely aware of. Which one of them is the most widely used? In which should we go into for advanced scripting? What are the things that matter for a bash script-er to script in another shell or standard or the other way round?


title: How to use two gateways with the same IP address?

text: I have to configure a NAT and manually split internet traffic between two gateways which are connected to a Linux box. There was no problem if each gateway has a specific IP address. I can do this by `iproute2`:               ip route add default via 192.168.1.1 dev eth1     ip route add 2.3.4.5 via 192.168.0.1 dev eth0     ip route add 8.9.4.5 via 192.168.0.1 dev eth0      But my problem is so simple! I have no access to change the gateways addresses, and network ids. I just need to use two internet gateways with the same address from a Linux box, with kernel 3.2.0 and above.                                                                       +-----------+                                                             | Gateway A |                               +-----------------------+     |192.168.0.1|                               |                   eth0+---->+-----------+                +--------------+eth2   Linux Box       |                |              |                   eth1+---->+-----------+                |              +-----------------------+     | Gateway A |                |                                            |192.168.0.1|                |                                            +-----------+       +--------+-----------+       |  Private Network   |--------> Workstation A       |                    |       |    10.0.0.0/24     |--------> Workstation B       +--------------------+      How can I solve this problem using Linux's amazing network tools (`mangling`, `snat` or something else)?


title: How to know if io stream should stay open or close each time

text: I have a program that need to write in a file every second. I thought there is a too much overhead if I open and close the file each time. So I decided to keep open the file io stream. But I don't want to rely on my unreliable hunch. How can I find the better way if I should keep file stream open or close by every additional writing? I want to check in CentOS environment.


title: Installing crontab file on Solaris?

text: Typically we use crontab -u in our recipes. However we have a few Solaris 10 boxen where the flavor of crontab won't support the -u flag. Is there a way to deploy an existing crontab file using Solaris' crontab command? How?


title: Add quotes around a value using sed

text: I created file called Test1.txt and I add a line. The file look like this,               TEST = admin      Now I want to add double quotes for TEST="admin". How to add double quotes using sed command? I want Test1.txt look like this below               TEST = "admin"


title: What could keep a process in 'Runnable' state indefinitely?

text: I am developing for embedded Linux and I have found a critical bug when stability test is performed. After 1-3 days running at some points the system becomes inoperative. Kernel network stack keep running and i can ping the router (the embedded system is a router) or i can still use the shell via serial console but some services in userland as `pppd` or web server `boa` get stuck. I have check via `/proc/meminfo` that its not a memory issue (we have fix a critical memory leak recently). Its strange for me that when i use `ps` some network services have 'R' in STAT when they has normally 'S' flag in STAT. There is a file that is updated by pppd every few seconds but when the bug appears this file is no longer updated. It seems that the process manager is not putting `pppd` process back on the cpu anymore. System use RAMFS file system in /var and squashfs filesystem for rootfs in flash. Next time the bug appears I have thought attach `strace` utility or `gdbserver` to pppd or web server but i would like any other suggestions. Anyway, what could keep a process in 'Runnable' state indefinitely?


title: AUTHBIND: Unable to authbind with tomcat 6 on redhat host

text: I have a redhat linux server with tomcat 6.0.39 installed. Before I deploy any web application and open my server to the public I would like to learn how to run tomcat startup script with my tomcat user binding to the 80 port. This is what I have done so far:   1. Changed port 8080 -> 80; 8443 -> 443 in my server.xml   2. The tomcat directory is owned by my tomcat user.   3. Installed authbind.   4. under /etc/authbind/byport I created two files 80, 443 and made them executable and changed the owner to tomcat.   5. Inside the startup.sh I changed (exec "$PGDIR"/"$EXECUTABLE" start "$@") to ("exec authbind --deep "$PGDIR"/"$EXECUTABLE" start "$@") After following those steps (which is pretty much what most articles tell you to do) I still get permission denied when starting up my tomcat, complaining that it cannot bind ports 80, 443. If you could provide any help I would greatly appreciate it, Thanks!


title: exported variable disappears when I open a new terminal

text: I type this: `export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk` so that I can access that directory by typing `cd $JAVA_HOME` but every time I close and open the terminal I have to do this again and again. Is there a way of saving this? I did some research but am not understanding how you could add it to the `bash_profile`. I'm on the latest Fedora. please explain as basic as you can as I'm a complete newbie! :)


title: How to get all files from SVN any version?

text: For example, my SVN Server have version 3 and version 4. Two files in version 3: `aaa.txt` and `bbb.txt` `aaa.txt`'s content is :               1234      `bbb.txt`'s content is :               abcd      In version 4, `aaa.txt`'s content is updated:               1234def      `bbb.txt`'s content unchanged:               abcd      Now,I want to get files from version 3 and keep `aaa.txt`'s content as `1234` and `bbb.txt`'s content as `abcd`. The same for version 4, when I get files from version 4, I want to keep `aaa.txt`'s content as `1234def` and `bbb.txt`'s content as `abcd`.


title: Search for a string in files recursively in BusyBox 1.0?

text: > **Possible Duplicate:**   >  How to grep a text recursively on BusyBox 1.0? How can I search for a string in a file recursively in BusyBox 1.0 if `find` and `grep` are not available ? (I want to telnet into the router and find out where the `iptables` rules are stored.)               BusyBox v1.00 (2011.01.13-12:30+0000) Built-in shell (msh)     Enter 'help' for a list of built-in commands.          # help          Built-in commands:     -------------------             . : break cd continue eval exec exit export help login newgrp             read readonly set shift times trap umask wait [ busybox cat chmod             cp date dmesg echo expr false ftpget ftpput hostname ifconfig             init insmod kill killall klogd linuxrc ln logger logread ls mkdir             mknod mount msh mv ping ps pwd reboot renice rm rmmod route sed             sendarp sh sysinfo syslogd test tftp top traceroute true tty             umount vconfig wget


title: Meaning of different options used while running a shell script

text: I was reading a shell script and I found the below command there. I tried searching on Google thinking `attach`, `force` and `delete` are the options used while running a script. But failed to find anything. Can anyone please explain what exactly the command below does? Please explain the usage of every single entity.               ./filename.sh -attach -force -delete -ctxtype 1


title: Which window manager has Python bindings?

text: I've been coding bits here and there with Python and I'm most interested in Desktop Environments, for which I always have ideas I want to try out. I have tried to play around with python-xlib but there is too little documentation on how to use this, and the ICCCM doc is very obscure. So I haven't been able to go very far. More over I am not so much interested in making a window manager as I am interested in making applications for the desktop environment that interact with it. e.g. a task-bar. Talking to X directly then, means bypassing the WM. So I'd like to know whether there is any of the major WM out there that have python bindings, so I could interact with them. I've found python-metacity and python-compizsettings but I've found zero documentation out there on how to use them. The overall picture is a bit depressing from the Python viewpoint. If you have any suggestions, please let me know.