title: Revoke directory access for a particular user in Solaris

text: I have a need to allow directory access to a particular user on my file system. I want this user to be unable to access any other directory in my file system (initially anyway. It may need access to some directories later). For example: I have a directory called `/opt/mydir`.   * I want my dedicated user to only be able to access this directory, and nothing else.   * I want all other users to be able to access this directory as normal. I'm new to Unix and its permissions. I've read a fair bit of background material but I'm a little confused. Is there anyway to revoke permissions to /opt/mydir for a single dedicated user? A possible flawed method would be to only allow access to /opt/mydir and exclude every other user. This won't work because I want all other users to work as normal; accessing the directory. I'm working on Solaris 10. Any suggestions are appreciated.


title: Running Python script via cron with sudo?

text: Im using Linux Mint. I have written a python script that is designed to not be accessible to the logged in standard user but is still be executed while they are logged in. It is to run and log them out if a certain field is set in a mysql database and show a dialog saying "you're being logged out blah". If I run the python script as the standard user all is well and they get logged out. If I run the python script as the admin user I get:               glib.GError: Unable to connect to server      when it tries to show the dialog box If I re-run the script with the admin user and `sudo`, it works. The idea is for this to run from cron, and unless I can get cron to run the script as the admin user with `sudo` it's not going to work. Any help? EDIT this is the two gui parts of the script this part is called every time the script runs and will show a notification with the amount of time the user has left                   u.get_time_left()         n = pynotify.Notification("Time Left", str(u.timeLeft / 60)+" Minutes remaining")              n.set_urgency(pynotify.URGENCY_CRITICAL)         n.set_timeout(10000) # 10 seconds         n.set_category("device")         helper = gtk.Button()         icon = helper.render_icon(gtk.STOCK_DIALOG_WARNING, gtk.ICON_SIZE_DIALOG)         #n.set_icon_from_pixbuf(icon)         try :             n.show()      This part only runs if certain conditions are met ie the time they have left is under 5 mins.               def getText():         #base this on a message dialog         dialog = gtk.MessageDialog(             None,             gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,             gtk.MESSAGE_QUESTION,             gtk.BUTTONS_OK,             None)         dialog.set_markup('Your time limit is nearing the end')         entryUser = gtk.Entry()         entryPass =gtk.Entry()         entryUser.connect("activate", responseToDialog, dialog, gtk.RESPONSE_OK)         hbox = gtk.HBox()         hbox.pack_start(gtk.Label("Username:"), False, 5, 5)         hbox.pack_start(entryUser)         hbox.pack_start(gtk.Label("Password:"), False, 5, 5)         hbox.pack_start(entryPass)         dialog.format_secondary_markup("Please enter a new voucher Username and password to carry on your current session")         dialog.vbox.pack_end(hbox, True, True, 0)         dialog.show_all()         dialog.run()         username = entryUser.get_text()         password = entryPass.get_text()         dialog.destroy()         voucher = {'username':username,'password':password}         return voucher


title: Unix date difference

text: I am getting error for this script can any one help for this one               #!/bin/bash     echo enter first time stamp     read d1_1 d1_2     echo enter second time stamp     read d2_1 d2_2     secdiff=$((     $(date -d "$d2_1 $d2_2" +%s) - $(date -d "$d1_1 $d1_2" +%s)     ))     nanosecdiff=$((     $(date -d "$d2_1 $d2_2" +%N) - $(date -d "$d1_1 $d1_2" +%N)     ))     printf "%s %s - %s %s = %d milliseconds\n" $d2_1 $d2_2 $d1_1 $d1_2 $((     (secdiff * 1000) + (nanosecdiff / 1000000)     ))          secdiff=`expr $secdiff \\* 1000`     nanosecdiff=`expr $nanosecdiff / 1000000`     difference=`expr $secdiff + $nanosecdiff`     echo $difference     x=`expr $difference / 1000`     seconds=`expr $x % 60`     x=`expr $x / 60`     minutes=`expr $x % 60`     x=`expr $x / 60`     hours=`expr $x % 24`     x=`expr $x / 24`     days=$x     echo "$days days $hours:$minutes:$seconds,$nanosecdiff                       enter first time stamp     2014-07-18 19:10:30.332     enter second time stamp     2014-07-18 19:00:30.332     date: illegal option -- d     usage: date [-u] mmddHHMM[[cc]yy][.SS]     date [-u] [+format]     date -a [-]sss[.fff]     date: illegal option -- d     usage: date [-u] mmddHHMM[[cc]yy][.SS]     date [-u] [+format]     date -a [-]sss[.fff]     ./text_123.sh: line 11:


title: Plymouth scrolling text

text: Is it possible to have it default to scrolling text on boot/shutdown versus the Fedora icon? I know I can get it by hitting various keys, but can I get it to default to text and those messages?


title: not able to create xorg.conf file

text: I want to change my colour depth. I posted this, and got the following answer: > Create an `xorg.conf` file by running `Xorg -configure`. Then edit the > `Depth` entry in the `Display` subsection of the `Screen` section. > > You can start an X server with a non-default depth by running e.g. `startx > -- -depth 8`. So I run `sudo Xorg -configure`, but I get this error:               Fatal server error:     Server is already active for display 0             If this server is no longer running, remove /temp/.X0-lock             and start again.      So I run `sudo rm -rf /temp/.X0-lock`. And then I run `sudo Xorg -configure`, but get this:               _XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed     _XSERVTransMakeAllCOTSServerListeners: server already running          Fatal server error:     Cannot establish any listening sockets - Make sure an X server isn't already running      What do I do? I have a PowerBook G4 running XFCE Debian. `Ctrl` + `Alt` + `Backspace` doesn't (seem to) do anything. (?)


title: Why is echo ignoring my quote characters?

text: The `echo` command isn't including the complete text that I give it. For example, if I do:                  $ echo ' echo PARAM=`  grep  $ARG  /var/tmp/setfile  | awk '{print $2}' `    '      It outputs:               echo PARAM=`  grep  $ARG  /var/tmp/setfile  | awk {print } `      The single quotes (`'`) I had in my echo command aren't included. If I switch to double quotes:               $ echo " echo PARAM=`  grep  $ARG  /var/tmp/setfile  | awk '{print $2}' `  "      `echo` doesn't output anything at all! Why is it leaving out the single quotes in the first example and outputting nothing in the second? How do I get it to output exactly what I typed?


title: mount ramfs as user

text: My fstab entry:               none    /home/jreinhart/ramdisk    ramfs    defaults,user   0 0      The directory _before_ mounting:               drwxrwxr-x  2 jreinhart jreinhart  4096  Oct 17 11:31 ramdisk      The directory after `mount ramdisk`:               drwxr-xr-x  2 root     jreinhart  4096  Oct 17 11:31 ramdisk      So, you can see the problem. Once I mount, the _owner_ changes to root, and the group permissions go to `r-x` so I cannot use this ramdisk. What gives? I'm trying to do this without having to `su`.


title: Mail reader that displays any mbox file or Maildir

text: Is there a GUI-based mail reader that I can call with the path to an arbitrary mbox file or Maildir directory? In other words, a mail reader that does not insist on storing all mail in a single place in the file system? I'd like to store mail and other files organized by task or topic, for easier backup and sharing.


title: find top 10 latest modified files

text: How do I get the last 10 files that were modified on my system. I have a system where its disk usage is maxed out I am not sure which files is increasing rapidly. I have a mysql instance stored on a separate mounted device and I just created a softlink unto my /var/lib directory on my root device. I know symlinks does not affect disk usage.


title: nsswitch cache and nscd

text: I have an LDAP directory server installed that stores all the user data in one server and I have an ongoing authentication mechanism using pam to request user information from it. This works very well but, whenever one of my clients is disconnected from the main server no user can login. My idea was to install nscd on every client and to change the nsswitch lookup order so that all requests find the cache first. This is how it's configured:               passwd:         cache files ldap     group:          cache files ldap     shadow:         cache files ldap     hosts:          files dns     networks:       files     protocols:      db files     services:       db files     ethers:         db files     rpc:            db files     netgroup:       nis      I added the "cache" spec to achieve this. My nscd is configured like so:               enable-cache        passwd      yes     positive-time-to-live   passwd      36600     negative-time-to-live   passwd      20     suggested-size      passwd      211     check-files     passwd      yes     persistent      passwd      yes     shared          passwd      yes     max-db-size     passwd      33554432     auto-propagate      passwd      yes          enable-cache        group       yes     positive-time-to-live   group       36600     negative-time-to-live   group       60     suggested-size      group       211     check-files     group       yes     persistent      group       yes     shared          group       yes     max-db-size     group       33554432     auto-propagate      group       yes          enable-cache        hosts       yes     positive-time-to-live   hosts       36600     negative-time-to-live   hosts       20     suggested-size      hosts       211     check-files     hosts       yes     persistent      hosts       yes     shared          hosts       yes     max-db-size     hosts       33554432          enable-cache        services    yes     positive-time-to-live   services    28800     negative-time-to-live   services    20     suggested-size      services    211     check-files     services    yes     persistent      services    yes     shared          services    yes     max-db-size     services    33554432      I tried disconnecting my ethernet connection to test if the lookups are done correctly but when I check the /var/log/auth log, I see that my client is still looking for the ldap server. What can be wrong?? I'm using Ubuntu 10.04 Thanks


title: Two interfaces, two addresses, two gateways?

text: I have a system that has two network interfaces with different IP adresses, both of which are in the public address range (albeit via NAT in the case of the first one) and both of which have different gateways. (Long story, it's for testing purposes) The problem is that right now, if I try to ping the address on the second interface, the default route points out via the first interface - and never arrives properly. Is it possible to make sure that responses always go out over the same network interface (and with the same source IP) as they came in on? And if so, how?


title: Throughput test setup with two local Ethernet interfaces

text: I'm currently testing the routing performance of a hardware device (DUT - Device Under Test) with the following setup (all addresses start with `192.168.`):               eth0 (29.2) <---> eth1 (29.1)  eth2 (30.1) <---> eth0 (30.2)     HOST1             |~~~~~~~~~DUT~~~~~~~~~~|       HOST2      `Iperf` is working just fine in this setup. However, I want to get rid of HOST2, since another Ethernet card is available on HOST1. This is what I want to achieve:               eth0 (29.2) <---> eth1 (29.1)  eth2 (30.1) <---> eth1 (30.2)     HOST1             |~~~~~~~~~DUT~~~~~~~~~~|       HOST1      How can I configure the Linux routing on HOST1 such that the packets from eth0 to eth1 would go through the DUT and not internally though the kernel? I'm running Debian with a 3.0 kernel. The iproute2 version is `ss110629`.


title: osCommerce hacked

text: I had my osCommerce hacked a few moments ago and the morons are using it to send emails. I have identified that they placed scripts inside osCommerce images directory. Is there a way to forbid certain directories like those containing images from running scripts using .htaccess or something? Using simply               <Files *.*>     order allow,deny     deny from all     </Files>      on .htaccess is not good because images will not appear on the site. What can I do beyond applying all osCommerce patches to make it stronger?


title: Creating a terminal device for interprocess communication

text: I'd like to know how to create a terminal device to simulate a piece of hardware connected through a serial port. Basically, tty device with a certain baud rate that can be read from and written to between two processes. From what I understand, a psuedo-terminal is what I'm looking for, and the `makedev` can apparently make one. I've also found the following set of instructions:               su to root     cd /dev     mkdir pty     mknod pty/m0 c 2 0     mknod pty/s0 c 3 0     ln -s pty/m0 ttyp0     ln -s pty/s0 ptyp0     chmod a+w pty/m0 pty/s0      Is there a better way of making pseudo-terminal, or is this pretty much the standard way of make one in the shell?


title: How can a non-root user check if a FS has been exported to a server?

text: Consider I am on server1 logged in as a non-root user. How do I check if a NAS FS has been exported onto the server SERVER1? I have already tried the below commands.               bash-3.2$ dfshares  SERVER1     nfs dfshares:SERVER1: RPC: Program not registered     bash-3.2$ showmount -e  SERVER1     showmount: SERVER1: RPC: Program not registered     bash-3.2$     bash-3.2$ cat  /etc/dfs/sharetab     bash-3.2$ share     bash-3.2$ cat  /etc/vfstab # No root access     cat: cannot open /etc/vfstab


title: Unable to install the php-posix package on CentOS 5.6

text: I have the following PHP packages installed on my CentOS 5.6 host and I am trying to install `php-posix`. When I run `yum install php-posix` I receive an error saying that `php53-common` conflicts with `php-common`.               [root@dev ~]# yum list installed | grep php     php.x86_64                               5.3.10-1.w5                   installed     php-cli.x86_64                           5.3.10-1.w5                   installed     php-common.x86_64                        5.3.10-1.w5                   installed     php-devel.x86_64                         5.3.10-1.w5                   installed     php-gd.x86_64                            5.3.10-1.w5                   installed     php-ldap.x86_64                          5.3.10-1.w5                   installed     php-mcrypt.x86_64                        5.3.10-1.w5                   installed     php-mysql.x86_64                         5.3.10-1.w5                   installed     php-pdo.x86_64                           5.3.10-1.w5                   installed     php-pear.noarch                          1:1.9.4-1.w5                  installed     php-soap.x86_64                          5.3.10-1.w5                   installed     php-xml.x86_64                           5.3.10-1.w5                   installed               [root@dev ~]# yum install php-posix     Loaded plugins: fastestmirror     Loading mirror speeds from cached hostfile      * base: mirror.krystal.co.uk      * epel: ftp.uni-koeln.de      * extras: mirror.krystal.co.uk      * rpmforge: mirror.nl.leaseweb.net      * updates: mirror.krystal.co.uk     Setting up Install Process     Resolving Dependencies     --> Running transaction check     ---> Package php53-process.x86_64 0:5.3.3-7.el5_8 set to be updated     --> Processing Dependency: php53-common = 5.3.3-7.el5_8 for package: php53-process     --> Running transaction check     ---> Package php53-common.x86_64 0:5.3.3-7.el5_8 set to be updated     --> Processing Conflict: php53-common conflicts php-common     --> Finished Dependency Resolution     php53-common-5.3.3-7.el5_8.x86_64 from updates has depsolving problems       --> php53-common conflicts with php-common     Error: php53-common conflicts with php-common      You could try using --skip-broken to work around the problem      You could try running: package-cleanup --problems                             package-cleanup --dupes                             rpm -Va --nofiles --nodigest     The program package-cleanup is found in the yum-utils package.      What is preventing me from installing `php-posix`?


title: Minimal Linux with kernel and BusyBox: /etc/inittab is ignored, only /init is executed

text: I managed to create a small and fully functional live Linux CD which contains only kernel (compiled with default options) and BusyBox (compiled with default options + static, all applets present, including `/sbin/init`). I had no issues to create `initrd` and populate `/dev`, `/proc` and `/sys` and also I had no issues at all with my `/init` shell script. Recently I read that BusyBox supports `/etc/inittab` configurations (at least to some level) and I very much would like to do either of the following:   * Forget about my `/init` shell script and rely entirely on `/etc/inittab` configuration.   * Use both `/init` shell script and `/etc/inittab` configuration. Now the actual problem - it seems that `/etc/inittab` is completely ignored when my distro boots up. The symptoms are:   * When I remove `/init` and leave only `/etc/inittab` I end up with kernel panic. My assumption is that kernel doesn't execute `/sbin/init` at all, or that `/sbin/init` doesn't find (or read) `/etc/inittab`.   * I read that BusyBox should work fine even without `/etc/inittab`. So, I removed both `/init` and `/etc/inittab` and guess what - kernel panic again.   * I tried to execute `/sbin/init` from my shell and after several guesses which included `exec /sbin/init`, `setsid /sbin/init` and `exec setsid /sbin/init` I ended up with kernel panic. Both with and without /etc/inittab being present on the file system. Here is the content of my `/init` shell script:               #!/bin/sh     dmesg -n 1     mount -t devtmpfs none /dev     mount -t proc none /proc     mount -t sysfs none /sys     setsid cttyhack /bin/sh      At this point I don't care what the content of the `/etc/inittab` would be, as long as I have a way to know that the configuration there actually works. I tried several `/etc/inittab` configurations, all based on the information which I found here. As a bare minimum my /etc/inittab contained just this one line:               ::sysinit:/bin/sh      Again - I ended up with kernel panic and it seems that `/etc/inittab` was ignored. Any suggestions how to force my little live distro to work fine with BusyBox's `/etc/inittab` are highly appreciated! **Update:**   * Just to make it clear - I **do not** have kernel panic troubles with my current `/init` shell script both with and without `/etc/inittab`. It all works fine, my `/bin/ash` console works great and I don't experience any unexpected troubles. The only issue is that `/etc/inittab` is completely ignored, as I described above.   * I examined 3 different live Linux distributions: Slax, Finnix and SysResCD. All of them have `/init` and none of them have `/etc/inittab`. In addition this Wiki article concludes my suspicion that `/sbin/init` is not invoked at all.


title: Lock Parted Magic?

text: Is it possible to lock the Parted Magic screen so that others don't tamper with it while it's in the middle of long operations?


title: How to change title bar name color in KDE4 on Debian7?

text: How can I change the colour of the white text (title bar name?) marked as red to something else then white? ![enter image description here](http://i.stack.imgur.com/S4jAP.png)


title: Use mogrify to resize large files while ignoring small ones

text: I'm running the following command:               mogrify -resize '400x400>' *.png      Notice the ">". Supposedly it will ignore smaller files, but although it doesn't resize them, it edits them (modification date and file size are changed). Is there a way to make it actually just leave the smaller files alone? I'd like to avoid several thousand unnecessary write operations.


title: apt-get dist-upgrade wants to remove too much packages

text: I'm upgrading from Mint 13 to Mint 15 using `apt-get dist-upgrade`. It want to remove 277 packages, which I find quite a lot. Among those packages are `acroread, xmlcopyeditor, wine1.4, skype` and others. Can I avoid removing these packages or I don't have a choice? The tool also says               The following packages have been kept back:       cpp g++ g++-multilib gcc gcc-4.7-base gcc-multilib mint-themes winetricks      How can I find out what keeps these packages back?


title: Bash script and processes

text: I have created a bash script for use with a graphical bar in Linux, however the script seems to spawn too many processes. The script:               #!/usr/bin/bash          executable="/usr/local/bin/bar"     monitor=${1:-0}     monitor_geometry=($(hc monitor_rect) $monitor)     x=${monitor_geometry[0]}     y=${monitor_geometry[1]}     panel_width=${monitor_geometry[2]}     panel_height=20     line_height=2     font="-*-terminesspowerline-medium-*-*-*-12-*-*-*-*-*-*-*"     bgcolor="#ff073642"     selbgcolor="#fffdf6e3"     selfgcolor="#ffeee8d5"     normfgcolor="#ff586e75"     urgentcolor="#ffdc322f"     separator="   "     icon_signal_max="|||"     icon_signal_med="||-"     icon_signal_min="|--"     icon_battery_charging="-"     icon_battery_discharging="x"     icon_arrow_up=""               # function declarations          hc() {         "${herbstclient_command[@]:-herbstclient}" "$@";         }          unique() {         awk '$0 != l { print; l=$0; fflush(); }' "$@"     }          get_datetime() {         {             while true; do                 date +"datetime %a %d-%m-%Y (%V) %H:%M"                 sleep 60             done         } | unique     }          get_power_status() {         {             while true; do                 acpi_status=$(acpi --battery | cut -d' ' -f3 | sed 's/,//')                 charge_percentage=$(acpi --battery | cut -d' ' -f4 | sed 's/%.*//')                      if [[ $acpi_status ]]; then                     if [[ "$acpi_status" == "Charging" ]]; then                         status="$charge_percentage%%"                     elif [[ "$acpi_status" == "Discharging" ]]; then                         status="$charge_percentage%%"                     elif [[ "$acpi_status" == "Unknown" ]]; then                         status=""                     fi                 fi                      if [[ "$charge_percentage" -le "20" ]]; then                     status="%{F$urgentcolor}$status{F-}"                 fi                      echo "power_status $status"                 sleep 1             done         } | unique     }          get_network_status() {         {             while true; do                 wlan_ssid=$(iwgetid -r)                      if [ -n $wlan_ssid ]; then                     signal_strength=$(cat /proc/net/wireless | awk 'NR==3 {print $3}' | sed 's/\.//')                     if [ "$signal_strength" -ge 65 ]; then                         status="$wlan_ssid $icon_signal_max"                     elif [ "$signal_strength" -lt 65 -a "$signal_strength" -ge 40 ]; then                         status="$wlan_ssid $icon_signal_med"                     else                         status="$wlan_ssid $icon_signal_min"                     fi                 else                     status=""                 fi                      echo "network_status $status"                 sleep 1             done         } | unique     }          get_cpu_status() {         {             while true; do                 no_cores=$(nproc)                 loadavg=$(cat /proc/loadavg | awk '{print $1}')                      if [ $(echo "$loadavg >= $no_cores" | bc) -ne 0 ]; then                     status="%{F${urgentcolor}}${loadavg}%{F${normfgcolor}}"                 else                     status="$loadavg"                 fi                      echo "cpu_status $status"                 sleep 1             done         } | unique     }          # register panel     hc pad $monitor $panel_height               # event multiplexer     {         get_datetime &         children[1]=$!              get_power_status &         children[2]=$!              get_network_status &         children[3]=$!              get_cpu_status &         children[4]=$!              hc --idle              for pid in ${children[@]}; do             kill $pid         done     } 2> /dev/null | {         tags=$(hc tag_status $monitor)         unset tags[${#tags[@]}-1]         visible=true              while true ; do             echo -n "%{c}"             for i in ${tags[@]}; do                 case ${i:0:1} in                     '.') # empty tag                         echo -n "%{-uF${normfgcolor}}"                         ;;                     '#') # current tag                         echo -n "%{+u U${selfgcolor} F${selfgcolor}}"                         ;;                     '+') # active on other monitor                         echo -n "%{-uF$selfgcolor}"                         ;;                     ':') # tag with window(s)                         echo -n "%{-uF$selfgcolor}"                         ;;                     '!') # urgent tag                         echo -n "%{-uF${urgentcolor}}"                         ;;                     *)                         echo -n "%{-uF${normfgcolor}}"                         ;;                 esac                 echo -n "  ${i:1}  "             done                  # align left             echo -n "%{lF$selfgcolor}"             echo -n " "             echo -n "$power_status"             echo -n "$network_status"             echo -n "$cpu_status"                  # align right             echo -n "%{r}"             echo -n "$datetime"             echo -n " "             echo                  # wait for next event             read line || break             cmd=( $line )                  # find out event origin             case ${cmd[0]} in                 tag*)                     tags=$(hc tag_status $monitor)                     unset tags[${#tags[@]}-1]                     ;;                 datetime)                     datetime="${cmd[@]:1}"                     ;;                 power_status)                     power_status="${cmd[@]:1}"                     ;;                 network_status)                     network_status="${cmd[@]:1}"                     ;;                 cpu_status)                     cpu_status="${cmd[@]:1}"                     ;;                 reload)                     exit                     ;;                 quit_panel)                     exit                     ;;             esac         done     } 2> /dev/null | $executable -g ${panel_width}x${panel_height}+${x}+${y} -f $font -u $line_height -B $bgcolor -F $selfgcolor      `ps` output:               jakob@jw-laptop:~%  ps faux | grep panel.sh     jakob    26906  0.0  0.0  12908  2324 pts/1    S+   02:34   0:00      \_ grep --color panel.sh     jakob    26616  0.0  0.0  15780  3220 ?        S    02:34   0:00 /usr/bin/bash /home/jakob/.config/herbstluftwm/panel.sh 0     jakob    26619  0.0  0.0  15780  1880 ?        S    02:34   0:00  \_ /usr/bin/bash /home/jakob/.config/herbstluftwm/panel.sh 0     jakob    26622  0.0  0.0  15780  1624 ?        S    02:34   0:00  |   \_ /usr/bin/bash /home/jakob/.config/herbstluftwm/panel.sh 0     jakob    26625  0.0  0.0  15780  1752 ?        S    02:34   0:00  |   |   \_ /usr/bin/bash /home/jakob/.config/herbstluftwm/panel.sh 0     jakob    26627  0.0  0.0  15780  1752 ?        S    02:34   0:00  |   |   \_ /usr/bin/bash /home/jakob/.config/herbstluftwm/panel.sh 0     jakob    26624  0.0  0.0  15780  1628 ?        S    02:34   0:00  |   \_ /usr/bin/bash /home/jakob/.config/herbstluftwm/panel.sh 0     jakob    26633  0.0  0.0  15912  2496 ?        S    02:34   0:00  |   |   \_ /usr/bin/bash /home/jakob/.config/herbstluftwm/panel.sh 0     jakob    26634  0.0  0.0  15780   480 ?        S    02:34   0:00  |   |   \_ /usr/bin/bash /home/jakob/.config/herbstluftwm/panel.sh 0     jakob    26626  0.0  0.0  15780  1628 ?        S    02:34   0:00  |   \_ /usr/bin/bash /home/jakob/.config/herbstluftwm/panel.sh 0     jakob    26631  0.0  0.0  15912  2560 ?        S    02:34   0:00  |   |   \_ /usr/bin/bash /home/jakob/.config/herbstluftwm/panel.sh 0     jakob    26632  0.0  0.0  15780   480 ?        S    02:34   0:00  |   |   \_ /usr/bin/bash /home/jakob/.config/herbstluftwm/panel.sh 0     jakob    26628  0.0  0.0  15780  1624 ?        S    02:34   0:00  |   \_ /usr/bin/bash /home/jakob/.config/herbstluftwm/panel.sh 0     jakob    26637  0.0  0.0  15784  2556 ?        S    02:34   0:00  |   |   \_ /usr/bin/bash /home/jakob/.config/herbstluftwm/panel.sh 0     jakob    26638  0.0  0.0  15780   476 ?        S    02:34   0:00  |   |   \_ /usr/bin/bash /home/jakob/.config/herbstluftwm/panel.sh 0     jakob    26620  0.0  0.0  15912  2556 ?        S    02:34   0:00  \_ /usr/bin/bash /home/jakob/.config/herbstluftwm/panel.sh 0     jakob@jw-laptop:~%      Why so many processes, when there's only four places where I daemonize? If this script is using too many resources I would like to fix it.


title: What permissions do I need to write to a card reader?

text: I have a card reader attached on `/dev/sdb`. What I do is giving all permissions to owner, group and the rest of the world, using:               sudo chmod 777 /dev/sdb      Can I just use another combination, allowing only the owner (me) to use the card reader? There is only one user account on Ubuntu Linux 14.04.


title: How can I read lines at a fixed speed?

text: I need to read a large log file and send it over a local network using (netbsd) netcat between two VMs on the same host workstation. I know that netcat has an interval, but as far as I can tell, the smallest interval you can use is 1 line/second. Most of the files I need to send this way have hundreds of thousands of lines, and some close to a million lines, so one line per second isn't feasible. If I just use cat, my host computer/workstation winds up getting bogged down to the point of being unusable. Using bash and common *nix tools, is there a way I can send the files, but feed it to netcat at a rate of say, 5-10 lines/second or something like that? The end goal of this is to allow me to do some proof of concept testing for a centralized log database I am considering.


title: Given a .gif, return the color components as X11-style hexadecimal specifiers (or equivalents)

text: I am a fan of `potrace`, and I recently read the Potrace FAQ. The FAQ includes this beautiful one-liner:               cat img.gif | giftopnm | ppmcolormask #641b1b | potrace      The command I am looking for would return the codes of all the colors to be parsed by `ppmcolormask`. It could return, according to `man ppmcolormask`:                  You can specify color five ways:             o      An X11-style color name (e.g.  black).             o      An  X11-style  hexadecimal specifier: rgb:r/g/b, where r g and b               are each 1- to 4-digit hexadecimal numbers.             o      An X11-style decimal specifier: rgbi:r/g/b, where r g and b  are               floating point numbers between 0 and 1.             o      For  backwards  compatibility, an old-X11-style hexadecimal num‐               ber: #rgb, #rrggbb, #rrrgggbbb, or #rrrrggggbbbb.             o      For backwards compatibility, a triplet of numbers  separated  by               commas:  r,g,b,  where  r  g  and  b  are floating point numbers               between 0 and 1.  (This style was added before MIT came up  with               the similar rgbi style.)


title: Installing Linux on a single primary partition

text: Is it possible to install Linux on a single primary partition? I already have three primary partitions occupied by Windows 7 which I cannot give up.


title: yum command is not working Fedora 20

text: My machine is running Fedora 20. The `yum` command was working last week, but now it is not working. When I try `yum update` or `yum clean all` it is not showing anything. This is my yum.conf               [main]     cachedir=/var/cache/yum/$basearch/$releasever     keepcache=0     debuglevel=2     logfile=/var/log/yum.log     exactarch=1     obsoletes=1     gpgcheck=1     plugins=1     installonly_limit=3      This is my yum.repos.d files               fedora.repo                  google-talkplugin.repo       rpmfusion-free-updates-testing.repo  rpmfusion-nonfree-updates-testing.repo     fedora-updates.repo          rpmfusion-free-rawhide.repo  rpmfusion-nonfree-rawhide.repo     fedora-updates-testing.repo  rpmfusion-free.repo          rpmfusion-nonfree.repo     google-chrome.repo           rpmfusion-free-updates.repo  rpmfusion-nonfree-updates.repo      How can I debug it? What is the issue? I already checked the yum log. It is showing nothing.


title: History of WINE

text: I will be doing a talk about WINE and how it has changed the situation for new Linux users that come from Windows and how it has matured from the start till know. I have much info already about it and from experience but right now I am looking for the history of how it has evolved in regards to compatibility or better support for video and audio features such as:   * DirectX 9, 10, 11   * Pixel Shading   * Vertex Shader   * Bump Mapping, Tessellation...   * Sound Stereo, 5.1...   * OpenGL supports And around what version this features happened. Does not matter if they are not complete but at least some support about them. I have already read some links like: http://wiki.winehq.org/WineHistory http://wiki.winehq.org/WineReleaseCriteria?action=show&redirect=WineReleasePlan but still I do not have enough information to tell for example in what version or versions WINE got support for important video/sound features. This is what I am basically looking for but any other info that I can talk about would be good to.


title: Differentiate between Galaxy Nexus and Galaxy Tab in UDEV rule?

text: I love Samsung devices, I have a Samsung Series 9 Laptop, Galaxy Nexus Phone (SCH-i515), and a Galaxy Tab 8.9 (GT-P7310) Tablet. For the most part, they're all great products. Samsung made one major mistake though; the vendor and product IDs (as well as other attributes) of both Android devices are the SAME! I have a UDEV rule written which runs a script to mount (mtpfs) the Galaxy Nexus when plugged in, after which, it will automatically sync photos and use `notify-send` to create a nice little Gnome notification when the sync is done. I want something similar to happen when the tablet is plugged in, but with a different mount point, not syncing photos (I don't use the camera on the tab), etc. Unfortunately, I'm not sure where to turn at this point. `mtpfs` sees them as the same device as well. Any thoughts on where to turn next?


title: System files with strict permissions

text: Usually, when we run               ls -l      we can see such picture -rwx...- so the owner always has the full stack of permissions. And usually the owner of the system files is the root. Are there any system files where the root doesn't have all permissions, e.g. only read? If they exist, why do they have so strict permission policy even for the root?


title: How to create backup from symbolic links?

text: I have a directory with symbolic links to other directories. I want to archive the symbolic links, not as links but as archives containing the files of directories they refer to, using tar command. How can I do this?


title: How do I get a Qt app running on MATE to open embedded URLs?

text: I'm running Linux Mint with the MATE desktop. I'm using Everpad, which is a Python app that uses Qt. When I click on an http URL in the text, nothing happens. I assume this is because Qt doesn't have the setting to find a handler for the link. How can I fix this so it opens it with Firefox?


title: Host domain name pointer in linux

text: I setup a Linux server and run a command, `host wan ip` in terminal and it shows `... domain name pointer mail.domain.com`. How do i replace current new `mail.domain.com` to `mail.newdomain.com`?


title: Transfer Ubuntu server 10.04 to another 13.04

text: I am totally new to Linux administration and now I have big problem. I have old server with some sites, databases, programs etc that is Ubuntu 10.04. Because of too much users I rented new better and faster server but with Ubuntu 13.04. So my question is: Does anyone know easy way to transfer all server data, sites, databases, mail server etc etc on new Ubuntu 13.04 server? My hosting provider will do IP changes when I ask them but I need to transfer everything else alone and they don't provide software support.


title: Open a text file in a terminal and auto-refresh it whenever it is changed

text: How do I open a text file in a terminal with instant auto-refresh every time it is changed? I've looked at `vim` with `:set autoread`, but it requires some elementary input (such as a keypress inside `vim`) to trigger the refresh. I want the auto-refresh to be hands-free. Is there some hack to do this? I'm using Crunchbang 11, but I'm quite comfortable with the terminal.


title: How to use a samba login to mount a luks container?

text: Our server has an (dm-crypt/LUKS) encrypted project directory which is currently mounted via SSH before its samba share can be accessed - and obviously no one remembers to unmount it afterwards. (How) can samba be configured such that it mounts the container via the windows credentials transmitted either way and such that ideally it unmounts the container after either all users disconnected or after a given timeout?


title: How do I format c while installing Ubuntu?

text: I would like to try out Linux but I did not find how to format c while installing. There are 3 requirements at the beginning:   * 2.6 (?) GB storage   * Internet - this is ok   * And something else I have forgotten Could somebody help me?


title: Making an ext3 filesystem image without mkfs.ext3

text: On ubuntu I'm using the following to create a ext3 filesystem image `system.img`.               dd if=/dev/zero of=./system.img bs=1000000 count=200     mkfs.ext3 ./system.img      I'm attempting to do the same on android platform. But the problem is I can't find a `mkfs.ext3` binary for armv7 android. But I have `mkfs.ext2` , `mke2fs` , `tune2fs` and `e2fsck`. So my question is, Is it possible to achieve the same result with the available binaries? If yes, how to do it?


title: How do I run safecopy in terminal?

text: I'm very new to terminal and Linux so apologies! I have a crashed external hard drive that is spinning but wont appear on the desktop. I ran `safecopy` from terminal and this is what it said at the end               Description of output:     . : Between 1 and 1024 blocks successfully read.     _ : Read of block was incomplete. (possibly end of file)         The blocksize is now reduced to read the rest.     |/| : Seek failed, source can only be read sequentially.     > : Read failed, reducing blocksize to read partial data.     ! : A low level error on read attempt of smallest allowed size         leads to a retry attempt.     [xx](+yy){ : Current block and number of bytes continuously                  read successfully up to this point.     X : Read failed on a block with minimum blocksize and is skipped.         Unrecoverable error, destination file is padded with zeros.         Data is now skipped until end of the unreadable area is reached.     < : Successful read after the end of a bad area causes         backtracking with smaller blocksizes to search for the first         readable data.     }[xx](+yy) : current block and number of bytes of recent                  continuous unreadable data.      I don't know what to do next? Is it telling me that it cannot be resurrected or is it telling me that it is waiting for me to do something?


title: Does GPL mean that whole software is public?

text: I'm doing on one open-source application. Now I'm choosing it's license and I'm thinking about GPL. But there I've got few questions:   * Is anyone allowed to share modified program using same name?    * Do I have any ownership on software?   * Do I take any responsibility for program usage, unexpected behavior,...?


title: Encrypted Zorin 7 Partition HELP!

text: I had Zorin 7 Encrypted Harddrive option installed on my laptop. I accidentally deleted important GRUB data trying to make more room in the boot folder i think? So the computer would no longer boot up. Anyways, I installed a second Linux OS on the same laptop, but I am unable to access all of my important information that is still on the encrypted partition. When I go to mount it to access everything, it asks for the encryption password... however, it tells me the password is incorrect, which I know 100% that it is the correct password. Someone please help me! Inform me how I can access this encrypted partition or restore the data so that I can boot the computer in Zorin 7 again.


title: Debian and system clock change?

text: If I change my system time on Debian which files would be modified? Would it be /etc/default/rcS? Also, is default time on Debian Dec 31 1969?


title: Can't write via FTP despite apparently correct permissions

text: I have the same problem no matter if I'm using `pure-ftpd` or `vsftpd`. In Debian Wheezy. The user can browse the directories in `/var/www/foo`, but when the file transfer is uploading I get '550 cannot change directory' errors. Also '550 Can't check for file existance'. And all my uploads go to 'Retrying in foo seconds' mode. I've done   * `chown -R username:ftpgroup /var/www`   * `chmod -R 777 /var/www` So the user should be able to write to these directories. In `pure-pw list`, it shows the user with his home dir as `/var/www/`. -- When I was using `vsftpd`, I used the same config file that worked in Ubuntu, and it didn't work in Debian Wheezy. I don't know what's different, but I have to use Debian because `s3fs-fuse` won't run in Ubuntu for me but it will in Debian. I don't know what else to check, I've set permissions to be as lenient as I can.


title: Can I see what HDD I have installed?

text: I use `lspci` for pci devices and `lsusb` to list the usb hardware devices, is there something similar to list my SATA HDD model ?


title: How do I determine the make & model of my storage devices?

text: > **Possible Duplicate:**   >  How do I find out what hard disks are in the system? I'm running a CentOS 5.5 system. This system has 4 disks and a 3ware RAID controller. How can I determine the make and model of my drives? `/proc/scsi/scsi` and `parted --list` shows the RAID controller (3ware 9650SE-4LP):               # cat /proc/scsi/scsi      Attached devices:     Host: scsi0 Channel: 00 Id: 00 Lun: 00       Vendor: AMCC     Model: 9650SE-4LP DISK  Rev: 4.06       Type:   Direct-Access                    ANSI SCSI revision: 05          # parted --list          Model: AMCC 9650SE-4LP DISK (scsi)     Disk /dev/sda: 2000GB


title: Bandwidth control in linux

text: How do I control both the inbound and outbound bandwidth in a RHEL 5 router?


title: mounting on boot - how to edit

text: How does linux know which partition should be mounted at which directory? Where is this info stored?


title: Dirty in /proc/meminfo for dd

text: I read from here that the below command gives me the amount of data that needs to be written to the disk.               grep ^Dirty /proc/meminfo      It particularly says _Ever ask yourself "How much data would be lost if I pressed the reset button?"_ I wanted to test the above command and so I did the following.               dd if=/dev/urandom of=sample.txt bs=1G count=1      Now, in another shell I ran the above command.               grep ^Dirty /proc/meminfo     Dirty:                44 kB     grep ^Dirty /proc/meminfo     Dirty:                36 kB      However, if I do a file copy using `cp` it reports,               grep Dirty /proc/meminfo     Dirty:            387680 kB     grep Dirty /proc/meminfo     Dirty:            609172 kB      I see from this page what Dirty does. > Dirty — The total amount of memory, in kilobytes, waiting to be written back > to the disk. Why **Dirty** is not reporting any size in case of `dd`?


title: Linux, how to change HDD state from ReadOnly after temporarly crash?

text: At this time no ansver for this problem. Usually after some problems with readings or writings to block device, kernel decides to switch flag for WHOLE DEVICE as read-only. After this any writings to any partition / filesystem located on this device cause switch it as readonly together with device state, because any writings are impossible. Example from dmesg, this is simulation for guest linux on windows8 using VirtualBox when defrag takes guests device image:               [11903.002030] ata3.00: exception Emask 0x0 SAct 0x1 SErr 0x0 action 0x6 frozen     [11903.003179] ata3.00: failed command: READ FPDMA QUEUED     [11903.003364] ata3.00: cmd 60/08:00:a8:77:57/00:00:00:00:00/40 tag 0 ncq 4096 in     [11903.003385]          res 40/00:01:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)     [11903.004074] ata3.00: status: { DRDY }     [11903.004248] ata3: hard resetting link     [11903.325703] ata3: SATA link up 3.0 Gbps (SStatus 123 SControl 300)     [11903.327097] ata3.00: configured for UDMA/133     [11903.328025] ata3.00: device reported invalid CHS sector 0     [11903.329664] ata3: EH complete     [11941.000472] ata3.00: exception Emask 0x0 SAct 0x1 SErr 0x0 action 0x6 frozen     [11941.000769] ata3.00: failed command: READ FPDMA QUEUED     [11941.000952] ata3.00: cmd 60/08:00:c8:77:57/00:00:00:00:00/40 tag 0 ncq 4096 in     [11941.000961]          res 40/00:01:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)     [11941.001353] ata3.00: status: { DRDY }     [11941.001504] ata3: hard resetting link     [11941.320297] ata3: SATA link up 3.0 Gbps (SStatus 123 SControl 300)     [11941.321252] ata3.00: configured for UDMA/133     [11941.321379] ata3.00: device reported invalid CHS sector 0     [11941.321553] ata3: EH complete     [11980.001746] ata3.00: exception Emask 0x0 SAct 0x11fff SErr 0x0 action 0x6 frozen     [11980.002070] ata3.00: failed command: WRITE FPDMA QUEUED     [11980.002255] ata3.00: cmd 61/18:00:28:23:59/00:00:00:00:00/40 tag 0 ncq 12288 out     [11980.002265]          res 40/00:01:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)     -------------------     There are many other errors, like "lost write page", "Journal has aborted", "Buffer I/O error", "hard resetting link" and many others.      After this, remount cause:               mount / -o remount,rw     mount: cannot remount block device /dev/sda1 read-write, is write-protected      because WHOLE device sda keeping rootfs sda1 is READONLY. In my experience this occurs in situations:   1. HDD is really damaged. Returned writing problems are depended on HDD condition   2. Host machine is overloaded, then linux guest virtual HDD writings are timeouted   3. FC cable or SAN device (array disks over Fibre Channel) is overloaded   4. Momentary lost connection over FC or FCoE. Maybe lost/timeouted FC packet At this situations device is really read-write, but linux kernel marks this device internally as read-only and is used as read-only. This is kernel functionality maked for damage prevention, but it is useable only at 1. point. **Question is. How to manually tell to kernel, hdd block device operates normally?** Witiout this, kernel serve device as read-only, like 'CD-ROM', and no other command has chance to works properly, including mount/remount -o read-write , fsck and others. > Unusable ansvers, really qualified as spam from people who wants to help, > but doesn't understand about problem nature: > >   1. Try remount as read-write (impossible, device is R-O) >   2. fsck this (what for? device is R-O, no repair is possible) >   3. 'I don't know' (first with sense, but unusable) >   4. 'Replace your device' *(usually the problem is something else) > Has anybody any formula for question above? Switch flag for writeable block device that reverts it from read-only to read-write state ? At this time it seems that no-one know how. It is some workarounds, but usually semiusable or unusable:   1. Remove module supports access to specified hdd or storage array. Unfortunately usually damaged device keeps rootfs, or driver keeps both damaged device and device that keeps rootfs   2. Remove FC access to device and join this again (fctools), not allways possible, not allways works.   3. Restart WHOLE machine. Usually only this is allways possible and we allways forced to. At points 1. and 2. we tell to kernel that we completly disconnect device and connect to it again. Kernel recognized this as joining new properly operatings device. We can simulate this using USB device and momentary remove power. Point 3. is last chance and usually works. But why we should restart all? Unfortunately at all points we lost all journals updates and dirty buffers. _Notice, at the same situations I have no problems with Windows (desktop and server)._


title: Red Hat Network (RHN) and package updates

text: I was just reading about Linux servers and Red Hat Enterprise Linux. What exactly is the Red Hat Network (RHN)? From what I've gathered, you subscribe to it to be able to update your system. Does this mean that you won't be able to update the packages (using `yum`) if you don't have a subscription? Doesn't yum just look in repos just like `apt-get` in Debian distros? Pardon me, but this is coming from an Ubuntu Desktop user, so I'm used to a simple `apt-get upgrade` to upgrade packages; I don't know much about the server side of Linux, let alone Red Hat-based distros. Also, is this RHN subscription a paid one? Also, how does CentOS differ from RHEL? Which is used more commonly as a server?


title: KSH script missinterpreting alias stored in SQL oracle DB

text: I have stored the path of my file in a table with as an alias (as the complete path was too long for the table's field). However, in my KSH script, when I am doing :               nomtmp=`sqlplus -S bla/bla <<ENDOFSQL      select myPath        ||'/'        || 'myFileName'        || '.xml'        from myTable;      exit     ENDOFSQL`      (myPath contains $fic) $fic is not interpreted as an alias, and thus the script is looking for the file in the directory'$fic' it does not interpret it as an alias. I can't modify the content of my table. How can I make it knows that it should deal with it as with an alias ? Thank you very much.


title: Fedora 18 doesn't shutdown , restart or sleep / can not unmount all file systems

text: When I _do something_ (whatever) that results in a shut down, restart or sleep (for example usual shut down or restart, closing the lid, etc.), fedora 18 (x86_64 , GNOME desktop) comes up with an error (below). Can you help me with this?               Not all file systems unmounted, 1 left     cannot finalize remaining file systems and devices, giving up      ### screenshot     ![http://i.stack.imgur.com/iYvEO.jpg](http://i.stack.imgur.com/3GF9H.jpg) Should I unmount added devices (other drives) manually before shutdown? ### EDIT #1 I tried, as user:IBr suggested, to reboot from tty and it worked. So the problem occurs only in GNOME.


title: MDADM Array Detection Slowing Down Boot - Why?

text: I have an AMD64 Gentoo (running `systemd`) build with a RAID0 root and some other arrays (RAID1 boot, RAID1 home etc..). The boot process is being slowed down quite dramatically as `mdadm` searches the arrays at boot (from the initramfs). I've tried:               mdadm --detail –scan >> /etc/mdadm.conf      Removing info about metadata etc.. (as suggested elsewhere), and then telling Gentoo's genkernel to pull in the `mdadm.conf` into the initramfs through `genkernel.conf`. But it's still holding up the boot process. I have an alternate distro (Debian) installed on a separate partition which also runs systemd and which boots much quicker. Any ideas?


title: Finding the absolute path of shared libraries used by an executable

text: Considering `lshw` as a sample program, here is what `ldd` gives:               $ ldd /usr/sbin/lshw              linux-vdso.so.1 =>  (0x00007fff8bdaf000)     libresolv.so.2 => /lib64/libresolv.so.2 (0x000000360e400000)     libsqlite3.so.0 => /lib64/libsqlite3.so.0 (0x0000003631600000)     libstdc++.so.6 => /lib64/libstdc++.so.6 (0x000000360ec00000)     libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x000000360d800000)     libc.so.6 => /lib64/libc.so.6 (0x000000360c000000)     libpthread.so.0 => /lib64/libpthread.so.0 (0x000000360cc00000)     libdl.so.2 => /lib64/libdl.so.2 (0x000000360c800000)     libm.so.6 => /lib64/libm.so.6 (0x000000360c400000)     /lib64/ld-linux-x86-64.so.2 (0x000000360bc00000)      If I want to find the absolute locations of the shared libraries (and want to exclude linux-vdso.so.1 for obvious reasons), how do I go about it? Using awk with regular expressions seems brittle here. `ldd` has a verbose flag (-v) which does print the complete paths of the shared libraries, but it is not very friendly for machine reading. Is there another way to go about this? If someone knows of a system call to do so, I am fine with that too. PS: For a bit of context, I want to run this program in `chroot` jail, so I need to make sure that the shared libraries are all available. Compiling it statically works without all this drama, but that is a path I am looking to avoid. **Update:** I think I _may_ have found something which may be more suitable while reading Michael Kerrisk's book, "The Linux Programming Interface". If I run a program as `$ LD_DEBUG=libs lshw`, it outputs various helpful information. For example:               $ LD_DEBUG=libs lshw           32058:     find library=libresolv.so.2 [0]; searching          32058:      search cache=/etc/ld.so.cache          32058:       trying file=/lib64/libresolv.so.2          32058:          32058:     find library=libstdc++.so.6 [0]; searching          32058:      search cache=/etc/ld.so.cache          32058:       trying file=/lib64/libstdc++.so.6          32058:          32058:     find library=libgcc_s.so.1 [0]; searching          32058:      search cache=/etc/ld.so.cache          32058:       trying file=/lib64/libgcc_s.so.1          32058:          32058:     find library=libc.so.6 [0]; searching          32058:      search cache=/etc/ld.so.cache          32058:       trying file=/lib64/libc.so.6          32058:          32058:     find library=libm.so.6 [0]; searching          32058:      search cache=/etc/ld.so.cache          32058:       trying file=/lib64/libm.so.6          32058:          32058:          32058:     prelink checking: ok          32058:          32058:     calling init: /lib64/ld-linux-x86-64.so.2          32058:          32058:          32058:     calling init: /lib64/libc.so.6          32058:          32058:          32058:     calling init: /lib64/libm.so.6          32058:          32058:          32058:     calling init: /lib64/libgcc_s.so.1          32058:          32058:          32058:     calling init: /lib64/libstdc++.so.6          32058:          32058:          32058:     calling init: /lib64/libresolv.so.2                    <more output>      I think, if I look for the 'calling init' lines, I will have the shared library paths it is initializing before starting to execute the program.


title: Changing username still leaves old traces

text: I changed my username about a month ago, and although I have forgotten the specificities of how I had done so, I'm pretty sure I followed the instructions on the Arch Wiki. Since then, some programs, such as `gnome- boxes`, have been mistakenly identifying me by my old username - `zheoffec`:               [marcoms@baguette16 Downloads]$ gnome-boxes           (gnome-boxes:10440): Boxes-WARNING **: libvirt-broker.vala:86: Failed to start storage pool: cannot open path '/home/zheoffec/.local/share/gnome-boxes/images': No such file or directory      Of course, my new `$HOME` is `/home/marcoms/`, and running `grep -i zheoffec * --recursive` as root from the root directory only returns strings from `.bash_history` and `fish_history` (`fish` is another shell). How can I remove all traces of my old username?


title: Is it possible to have comments in multiline commands in fish?

text: In `bash` it's possible to do               my_function() {       echo "hello" |       #remove 'l'       tr -d 'l'     }      but in `fish` ( http://fishshell.com ) I wasn't able to do the same:               function my_function       echo "hello" | \       # remove 'l'        tr -d 'l'     end      I've tried with backslash at the end of the comment too but no luck. I tend to use this idiom a lot in `bash`, piping several commands and splitting each command in its own line with a commment for each. Is there any way to achieve something similar in `fish`?


title: Root Password Policy and Refresh

text: Unfortunately the infrastructure I work in has static root passwords that are very rarely refreshed. So people leaving the company will have our root passwords and it can potentially be leaked to others inside the organization. So with that problem stated, what is the best method of executing a password refresh policy on linux/unix platforms? If it's the modification of the sudoers files on each host and disabling root passwords, how do you manage these sudoers files and keep everything up to date and consistent? If it's just using root keys, what can be done to protect/refresh these keys on a regular basis? Basically, how are others using tools to perform regular refreshes to ensure security?


title: My laptop shuts down every time I unplug it

text: I am using a Lenovo G580 with Linux Mint 14 updated. My laptop shuts off every time I unplug it as if there is no battery even when I am using the BIOS. But, It detects the battery as "84% charging" and stuck in that way. Should I replace the battery? If so, why does it detect it?


title: SSH slow after configuring TCP Wrappers

text: We have SSH open on one of our production servers leaving it prone to various brute force attacks to break in. I reduced the attempts by changing the default port from 22. I want to further harden security by allowing ssh login from a particular country domain `.in` only. For this I can configure `/etc/hosts.deny` or `/etc/hosts.allow` . For `hosts.allow`, I have added the following entry `sshd: in` If I use `hosts.deny`, then my entry is like this `sshd: !in` After configuring any one of the above, I am noticing that it takes more time to connect to the `ssh` server. With verbose it is showing hanging here for some time before providing the login attempt               ssh -vv  103.8.X.X     OpenSSH_5.9p1 Debian-5ubuntu1.4, OpenSSL 1.0.1 14 Mar 2012     debug1: Reading configuration data /etc/ssh/ssh_config     debug1: /etc/ssh/ssh_config line 19: Applying options for *     debug2: ssh_connect: needpriv 0     debug1: Connecting to 103.8.X.X [103.8.X.X] port 565.     debug1: Connection established.     debug1: identity file /home/amin/.ssh/id_rsa type -1     debug1: identity file /home/amin/.ssh/id_rsa-cert type -1     debug1: identity file /home/amin/.ssh/id_dsa type -1     debug1: identity file /home/amin/.ssh/id_dsa-cert type -1     debug1: identity file /home/amin/.ssh/id_ecdsa type -1     debug1: identity file /home/amin/.ssh/id_ecdsa-cert type -1  (<-- hangs here for arnd 30 secs)       It takes more time with putty , after setting rules for tcp wrappers.


title: Unable to set wifi frequency/channel on Raspbian

text: Hey I'm trying to configure my Raspberry Pi to connect to my router on channel 8 (2.447G). The WiFi network adapter I have for my Pi seems to be stuck on channel 1. `iwlist scan` only lists the one ap near me on channel 1, my router is on 8. `iwlist frequency` lists all 14 channels as available and that its current is 1. I've tried `iwconfig wlan0 freq 2.447G`. It completes but running `iwconfig` still shows frequency at 2.412G I'm using a Realtek 8188CUS adapter. Any ideas?


title: Compiling for Red Hat 5.9

text: I need to compile a C++ application to run on Red Hat 5.9, but I don't have access to a development server that runs Red Hat 5.9. My current executable compiled on Ubuntu 10.04 produces the error message > `/lib/libc.so.6: version`GLIBC_2.11' not found` which probably means that RedHat is using an older libc. Which free Linux distribution should I use to compile for Read Hat 5.9 ? I read that Red Hat is based on Fedora and RHEL 5.x is based on Fedora Core 6. Do I really have to use such an old system to compile for a rather recent RHEL 5.9?


title: Revert custom launcher ICON to default in GNOME 2/MATE

text: I need to figure out how to revert a custom icon for a file type/launcher to it's default state. I have looked around the internet and apparently no one can tell me how to do this. Basically I tried to change the default icon for my usb flash drive to the "flash drive" icon and then I cannot revert it back so that it changes from one icon theme to another. I've dug across the internet and no one can help me. I'm using MATE and it obviously uses GNOME2 like system, and I imagine this is similar for xfce. Iv'e tried purging various . files in my home directory that likely hold such info and it's still there.


title: break out of find if an -exec fails

text: Is there a way to write an `find` so that it breaks if one of the `-exec` operations fails on a file? E.g. (`javac` is conveniently used as a program that can return an exit code of 1 on some files and for no other reason):               $ echo "public classXX A{}" >> A.java     $ echo "public class B{}" >> B.java     $ find . -iname \*.java -exec javac {} \;     ./A.java:1: error: class, interface, or enum expected     public classXX A{}            ^     1 error      In the example above, although the `exec` on the file `A.java` failed (and returned an exit code of 1), the `find` command proceeded and compiled file `B.java` as well. Is there a way to break out of `find` or should I use some form of `for` instead? My version of find:               $ find -version  | head -1     find (GNU findutils) 4.4.2


title: Terminate dropped SSH sessions

text: My SSH sessions seem to be dropping though that is not my major problem - the major problem is my previous sessions are still alive, worse yet one of them is running `visudo` preventing me from accessing it! `who` shows a number of sessions all except my current one I know have disconnected, how can I terminate the old ones so the release their resources?


title: What is the ^M character called?

text: TexPad is creating it. I know that it is under some deadkey. I just cannot remember it is name. The blue character: ![enter image description here](http://i.stack.imgur.com/eKvzt.png) I just want to mass remove them from my document. **How can you type it?**


title: File access time not updating in ubuntu 12.04

text: After using the `cat` command to read a file, I used the `stat` command to view it's changed access time, but it's not getting updated. I checked `/etc/fstab` file and there is no `noatime` on any of my drives, so why is the access time not getting updated? I'm using Ubuntu 12.04 Precise Pangolin.


title: How does ecryptfs (FUSE filesystems in general) interact with buffer cache?

text: My assumption (which seems to be incorrect) was that ecryptfs (FUSE filesystems in general) used the following stacking mechanism:   * User code issues `read()`   * Kernel attempts to satisfy request from existing (unencrypted) buffer   * Buffer doesn't exist, kernel asks ecryptfs to load block   * ecryptfs asks kernel to load physical (encrypted) block, kernel does this and stores it in buffer cache   * ecryptfs decrypts physical block   * kernel stores decrypted block in buffer cache   * subsequent reads are fulfilled from decrypted block in cache However, comparing the "sys" times for identical operations on encrypted and non-encrypted filesystems, it appears that the only buffer in the cache is the encrypted one, and ecryptfs decrypts on every `read()`. The diagram on the FUSE homepage doesn't mention buffer cache, but seems to indicate that operations take place at the syscall level, not the block level. Could someone who is familiar with either the internals of ecryptfs (Dustin?) or FUSE in general answer this?


title: Ubuntu - My /var/wiki folder has gone missing. Is this a Linux issue?

text: I implemented a few installations of mediawiki in a parent folder called: /var/wiki I was alerted this morning that the wikis are no longer working. Upon a little research, the /var/wiki folder is gone. Is there any Linux-based reason why this folder would be removed? If not, I'll look at hosting-related reasons. If that's not it, I'll look into personal reasons (Maybe I deleted it?). Strange thing is that the apache2 config was still pointed at /var/wiki (and the wikis were running fine for weeks)


title: Populate PS1 asynchronously

text: I have a few git svn related functions that see if I have to pull/push from/to the repository. My problem is that the functions I've wrote to gather these informations are too slow, I'd like to make them async so that PS1 shows a default, if though the data produced by the functions is ready I want it printed. I'd like to have these information in my prompt so that for example I know if I have to pull, without doing a `git svn fetch` everytime. This is the function I call to add a ↑ to my PS1 if I have to push my changes.               function hasToPush {         (($1 == 0)) &&              (git svn dcommit --dry-run 2>/dev/null | grep -q "diff-tree" && echo "↑")     }      This is the functions I call to add a ↓ if I have to pull, the first is used to refresh my index every 2 minutes, so that I can do the `(($latest > $current))` check.               function loopingGitSvnFetch {          sleep 120          git svn fetch &>/dev/null     }     loopingGitSvnFetch &     function hasToPull {         (($1 == 0)) && (             latest=$(git svn log | awk 'NR==2' | cut -d ' ' -f1 | tr -d 'r')             current=$2             (($latest > $current)) && echo "↓"         )     }      To make them async I've tried to put them together like this:               function async {         {          git diff-index --quiet --cached HEAD &>/dev/null          dirty=$(echo $?)          push=$(hasToPush $dirty)          gitsvn=$(git svn info 2> /dev/null | grep Revision)          gitsvn=${gitsvn#Revision: }          pull=$(hastoPull $dirty $gitsvn)          callback $push $pull          } &      }      But that produces the same slow behaviour. I've tried to put results in a file and then read it after, but I don't like the approach. I've thought about using `PROMPT_COMMAND` but that would not be async, it would be on demand. Could you shed some light on how PS1 behaves or on what I'm doing wrong? Thank you in advance. PS: Could someone with 300 rep add the async and ps1 tags? EDIT: I added these line to my .bashrc as a simple test, it seemed to work, so having rewrote them (I reverted my previous attempt) seems was a good thing :)               while true;     do         discoverScmInfo &>~/.ps1         sleep 1     done &     PS1='$(customW)$(cat ~/.ps1)\$ '      I'll put this in a function and check if the job is already running before calling it. Sorry about this, after all it seems that all I needed was to write about it. :)


title: How can I know which IRQ is responsible of high CPU usage

text: I've moved a server from one mainboard to another due a disk controller failure. Since then I've noticed that constantly a 25% of one of the cores goes always to IRQ however I haven't managed myself to know which is the IRQ responsible for that. The kernel is a Linux 2.6.18-194.3.1.el5 (CentOS). `mpstat -P ALL`shows:               18:20:33     CPU   %user   %nice    %sys %iowait    %irq   %soft  %steal   %idle    intr/s     18:20:33     all    0,23    0,00    0,08    0,11    6,41    0,02    0,00   93,16   2149,29     18:20:33       0    0,25    0,00    0,12    0,07    0,01    0,05    0,00   99,49    127,08     18:20:33       1    0,14    0,00    0,03    0,04    0,00    0,00    0,00   99,78      0,00     18:20:33       2    0,23    0,00    0,02    0,03    0,00    0,00    0,00   99,72      0,02     18:20:33       3    0,28    0,00    0,15    0,28   25,63    0,03    0,00   73,64   2022,19      This is the /proc/interrupts               cat /proc/interrupts                 CPU0       CPU1       CPU2       CPU3              0:        245          0          0    7134094    IO-APIC-edge  timer       8:          0          0         49          0    IO-APIC-edge  rtc       9:          0          0          0          0   IO-APIC-level  acpi      66:         67          0          0          0   IO-APIC-level  ehci_hcd:usb2      74:     902214          0          0          0         PCI-MSI  eth0     169:          0          0         79          0   IO-APIC-level  ehci_hcd:usb1     177:          0          0          0    7170885   IO-APIC-level  ata_piix, b4xxp     185:          0          0          0      59375   IO-APIC-level  ata_piix     NMI:          0          0          0          0      LOC:    7104234    7104239    7104243    7104218      ERR:          0     MIS:          0      How can I identify which IRQ is causing the high CPU usage? Edit: Output from `dmesg | grep -i b4xxp`               wcb4xxp 0000:30:00.0: probe called for b4xx...     wcb4xxp 0000:30:00.0: Identified Wildcard B410P (controller rev 1) at 00012000, IRQ 177     wcb4xxp 0000:30:00.0: VPM 0/1 init: chip ver 33     wcb4xxp 0000:30:00.0: VPM 1/1 init: chip ver 33     wcb4xxp 0000:30:00.0: Hardware echo cancellation enabled.     wcb4xxp 0000:30:00.0: Port 1: TE mode     wcb4xxp 0000:30:00.0: Port 2: TE mode     wcb4xxp 0000:30:00.0: Port 3: TE mode     wcb4xxp 0000:30:00.0: Port 4: TE mode     wcb4xxp 0000:30:00.0: Did not do the highestorder stuff     wcb4xxp 0000:30:00.0: new card sync source: port 3


title: Is there a legend some place that describes all of these color-coded values at the bottom of bash/putty/ubuntu terminal?

text: ![enter image description here](http://i.stack.imgur.com/hcQmS.png) Some of the values at the bottom of putty seem pretty clear to me. **Is there a legend some place that shows what each of these values means?** I suspect this is a feature of bash rather than putty, but I'm not positive. **Update 1: This may be an ubuntu only feature** **Update 2: This is byobu** Is there a legend available, or some place that explains this various color coded regions for byobu?


title: How to do a `tail -f` of log rotated files?

text: On a long running system I usually have a terminal with               $ tail -f /var/log/kern.log      or something like this open. But from time to time I have to restart such command because no new messages are displayed anymore. I assume this is because of the log rotating job that has replaced the log file `tail -f` was 'watching'. How can I avoid this restarting issues? Can I invoke `tail` such that it notices the rotating process and does the right thing? (I notice this issue on a Ubuntu 11.04 system that uses `rsyslogd` by default.)


title: "tail -f" show old file after file has been rotated

text: I have a script running continuously, reading `tail -f /var/log/daemon.log` The problem is, when the file `/var/log/daemon.log` gets rotated by `logrotate`, tail still has "file handle" for the old (rotated) file and no longer displays the contents of the new `/var/log/daemon.log` file Is there any way to fix this, so that `tail` shows the contents of the new file, if the file was rotated ?


title: Finding all partitions with filesystems

text: I'm writing a script that will copy all of the files on a device to a directory. The problem is that some of the devices have multiple partitions and some of the partitions don't have filesystems to copy files from. At the moment, I'm thinking about using `lsblk` to get a list of partitions on the device and `file -s` to check for a filesystem on each partition. Is there a less brute way to do what I am trying to do? * * * Here is information regarding the empty partition problem:               # /dev/sdb is a flashdrive with two partitions     # /dev/sdb1 has no filesystem     # /dev/sdb2 has an ext4 partition     $ lsblk -fi     ...     sdb    vfat   CARRIER-R C84B-6A72                                 |-sdb1 vfat   CARRIER-R C84B-6A72                                 `-sdb2 ext4   CARRIER-R 33ebb632-68a5-4bf5-bd29-90733af9699e     ...          $ lsblk -ln -o NAME,FSTYPE     ...     sdb  vfat     sdb1 vfat     sdb2 ext4     ...          # As confirmation, mounting the partition fails     $ mount -t auto /dev/sdb1 /mnt     mount: wrong fs type, bad option, bad superblock on /dev/sdb1     ...          $ dmesg | tail     ...     [  985.933627] EXT4-fs (sdb1): VFS: Can't find ext4 filesystem     [  985.935722] EXT4-fs (sdb1): VFS: Can't find ext4 filesystem     [  985.937603] EXT4-fs (sdb1): VFS: Can't find ext4 filesystem     [  985.939623] FAT-fs (sdb1): invalid media value (0xa7)     [  985.939627] FAT-fs (sdb1): Can't find a valid FAT filesystem


title: ls content of a directory ignoring symlinks

text: I have a directory in which I would like to list all the content (files and sub directories) without showing the symbolic links. I am using GNU utilities on Linux. The `ls` version is 8.13. Example: Full directory listing:               ~/test$ ls -Gg     total 12     drwxrwxr-x 2 4096 Jul  9 10:29 dir1     drwxrwxr-x 2 4096 Jul  9 10:29 dir2     drwxrwxr-x 2 4096 Jul  9 10:29 dir3     -rw-rw-r-- 1    0 Jul  9 10:29 file1     -rw-rw-r-- 1    0 Jul  9 10:29 file2     lrwxrwxrwx 1    5 Jul  9 10:29 link1 -> link1     lrwxrwxrwx 1    5 Jul  9 10:30 link2 -> link2      What I would like to get               ~/test$ ls -somthing (or bash hack)     total 12     dir1 dir2 dir3 file1 file2      NOTE: My main motivation is to do a recursive grep (GNU grep 2.10) without following symlinks.


I have a BackTrack5 r3 installed on VMware. As you see below I have internet access in it :               root@bt:~# ping www.google.com     PING www.google.com (173.194.70.105) 56(84) bytes of data.     64 bytes from fa-in-f105.1e100.net (173.194.70.105): icmp_seq=1 ttl=128 time=205 ms     64 bytes from fa-in-f105.1e100.net (173.194.70.105): icmp_seq=2 ttl=128 time=208 ms     64 bytes from fa-in-f105.1e100.net (173.194.70.105): icmp_seq=3 ttl=128 time=208 ms     64 bytes from fa-in-f105.1e100.net (173.194.70.105): icmp_seq=4 ttl=128 time=209 ms     ^C     --- www.google.com ping statistics ---     4 packets transmitted, 4 received, 0% packet loss, time 3001ms     rtt min/avg/max/mdev = 205.799/208.145/209.851/1.473 ms      The question is, why when I try to use **`apt-get update`** command, I receive error?!               root@bt:~# apt-get update      Err http://32.repository.backtrack-linux.org revolution Release.gpg                   Could not connect to 32.repository.backtrack-linux.org:80 (50.7.55.50). - connect (111: Connection refused)     Err http://32.repository.backtrack-linux.org/ revolution/main Translation-en_US       Unable to connect to 32.repository.backtrack-linux.org:http:     Err http://32.repository.backtrack-linux.org/ revolution/microverse Translation-en_US       Unable to connect to 32.repository.backtrack-linux.org:http:     Err http://32.repository.backtrack-linux.org/ revolution/non-free Translation-en_US       Unable to connect to 32.repository.backtrack-linux.org:http:     Err http://32.repository.backtrack-linux.org/ revolution/testing Translation-en_US       Unable to connect to 32.repository.backtrack-linux.org:http:     Err http://source.repository.backtrack-linux.org revolution Release.gpg               Could not connect to source.repository.backtrack-linux.org:80 (50.7.55.50). - connect (111: Connection refused)     Err http://source.repository.backtrack-linux.org/ revolution/main Translation-en_US       Unable to connect to source.repository.backtrack-linux.org:http:     Err http://source.repository.backtrack-linux.org/ revolution/microverse Translation-en_US       Unable to connect to source.repository.backtrack-linux.org:http:     Err http://source.repository.backtrack-linux.org/ revolution/non-free Translation-en_US       Unable to connect to source.repository.backtrack-linux.org:http:     Err http://source.repository.backtrack-linux.org/ revolution/testing Translation-en_US       Unable to connect to source.repository.backtrack-linux.org:http:     Err http://all.repository.backtrack-linux.org revolution Release.gpg                  Could not connect to all.repository.backtrack-linux.org:80 (50.7.55.50). - connect (111: Connection refused)     Err http://all.repository.backtrack-linux.org/ revolution/main Translation-en_US       Unable to connect to all.repository.backtrack-linux.org:http:     Err http://all.repository.backtrack-linux.org/ revolution/microverse Translation-en_US       Unable to connect to all.repository.backtrack-linux.org:http:     Err http://all.repository.backtrack-linux.org/ revolution/non-free Translation-en_US       Unable to connect to all.repository.backtrack-linux.org:http:     Err http://all.repository.backtrack-linux.org/ revolution/testing Translation-en_US       Unable to connect to all.repository.backtrack-linux.org:http:     Reading package lists... Done     W: Failed to fetch http://all.repository.backtrack-linux.org/dists/revolution/Release.gpg  Could not connect to all.repository.backtrack-linux.org:80 (50.7.55.50). - connect (111: Connection refused)          W: Failed to fetch http://all.repository.backtrack-linux.org/dists/revolution/main/i18n/Translation-en_US.bz2  Unable to connect to all.repository.backtrack-linux.org:http:          W: Failed to fetch http://all.repository.backtrack-linux.org/dists/revolution/microverse/i18n/Translation-en_US.bz2  Unable to connect to all.repository.backtrack-linux.org:http:          W: Failed to fetch http://all.repository.backtrack-linux.org/dists/revolution/non-free/i18n/Translation-en_US.bz2  Unable to connect to all.repository.backtrack-linux.org:http:          W: Failed to fetch http://all.repository.backtrack-linux.org/dists/revolution/testing/i18n/Translation-en_US.bz2  Unable to connect to all.repository.backtrack-linux.org:http:          W: Failed to fetch http://32.repository.backtrack-linux.org/dists/revolution/Release.gpg  Could not connect to 32.repository.backtrack-linux.org:80 (50.7.55.50). - connect (111: Connection refused)          W: Failed to fetch http://32.repository.backtrack-linux.org/dists/revolution/main/i18n/Translation-en_US.bz2  Unable to connect to 32.repository.backtrack-linux.org:http:          W: Failed to fetch http://32.repository.backtrack-linux.org/dists/revolution/microverse/i18n/Translation-en_US.bz2  Unable to connect to 32.repository.backtrack-linux.org:http:          W: Failed to fetch http://32.repository.backtrack-linux.org/dists/revolution/non-free/i18n/Translation-en_US.bz2  Unable to connect to 32.repository.backtrack-linux.org:http:          W: Failed to fetch http://32.repository.backtrack-linux.org/dists/revolution/testing/i18n/Translation-en_US.bz2  Unable to connect to 32.repository.backtrack-linux.org:http:          W: Failed to fetch http://source.repository.backtrack-linux.org/dists/revolution/Release.gpg  Could not connect to source.repository.backtrack-linux.org:80 (50.7.55.50). - connect (111: Connection refused)          W: Failed to fetch http://source.repository.backtrack-linux.org/dists/revolution/main/i18n/Translation-en_US.bz2  Unable to connect to source.repository.backtrack-linux.org:http:          W: Failed to fetch http://source.repository.backtrack-linux.org/dists/revolution/microverse/i18n/Translation-en_US.bz2  Unable to connect to source.repository.backtrack-linux.org:http:          W: Failed to fetch http://source.repository.backtrack-linux.org/dists/revolution/non-free/i18n/Translation-en_US.bz2  Unable to connect to source.repository.backtrack-linux.org:http:          W: Failed to fetch http://source.repository.backtrack-linux.org/dists/revolution/testing/i18n/Translation-en_US.bz2  Unable to connect to source.repository.backtrack-linux.org:http:          W: Some index files failed to download, they have been ignored, or old ones used instead.      I tried to open source.repository.backtrack-linux.org with my internet browsers, but I receive `The requested URL could not be retrieved` and `Unable to connect`. So I guess the origin of the problem is in the Backtrack support. but what shall I do now?


title: Which command would you use if you want to remove the password assigned to a group

text: Suppose I have one or more groups (as in the user database as backed by `/etc/group` or LDAP or NIS+...) configured with a password (for the `sg` or `newgrp` commands). Which command would you use to remove the password assigned to such a particular group? Does it depend on which kind of user database is used (`/etc/passwd,shadow`, NIS+, LDAP...) or on the system? I'm on Linux, but knowing the method on other systems would also be interesting.


title: Difference between long running process and daemon?

text: I'm trying to use Forever to keep my nodejs scripts up and running As per Forever's homepage it says                 [Long Running Process]         The forever process will continue to run outputting log messages to the console.         ex. forever -o out.log -e err.log my-script.js            [Daemon]         The forever process will run as a daemon which will make the target process start         in the background. This is extremely useful for remote starting simple node.js scripts         without using nohup. It is recommended to run start with -o -l, & -e.         ex. forever start -l forever.log -o out.log -e err.log my-daemon.js             forever stop my-daemon.js      However I fail to understand the difference between the two. Under what conditions should I use a long running process vs a daemon?


title: Why does PAM prevent root from using useradd?

text: I'm using Arch Linux on a single-user workstation with LXDE and lxde-session autologin to the regular user. I then "su" or "sudo" to root privileges, and try to run "useradd." useradd fails on my system. This system was re-installed from scratch less than a year ago, and has had regular "pacman -Syu" run on it. I don't do much custom system administration; mainly run LXDE and vim/gcc/make as my regular user account. useradd also fails when pacman tries to run it. I recently ran into a problem where both mariadb and percona-server would fail to start on the system after installation, and tracked it down to the mysql user not being properly created. Trying to run useradd manually, I find that that utility has broken. Googling around, people suggest this might be a problem with /etc/shadow or confg files in /etc/pam.d/, so I looked into that. The error I get is: useradd: PAM: Authentication service cannot retrieve authentication info Running strace on useradd, it seems quite capable of opening /etc/shadow and /etc/passwd, and getuid() returns 0 for "root":               open("/etc/pam.d/other", O_RDONLY)      = 3     fstat(3, {st_mode=S_IFREG|0644, st_size=127, ...}) = 0     mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f1a7c0eb000     read(3, "#%PAM-1.0\nauth\t\trequired\tpam_uni"..., 4096) = 127     read(3, "", 4096)                       = 0     close(3)                                = 0     munmap(0x7f1a7c0eb000, 4096)            = 0     getuid()                                = 0     getuid()                                = 0     open("/etc/login.defs", O_RDONLY)       = 3     fstat(3, {st_mode=S_IFREG|0644, st_size=5519, ...}) = 0     mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f1a7c0eb000     read(3, "#\n# /etc/login.defs - Configurat"..., 4096) = 4096     read(3, "gular users using chfn - use\n# a"..., 4096) = 1423     read(3, "", 4096)                       = 0     close(3)                                = 0     munmap(0x7f1a7c0eb000, 4096)            = 0     open("/etc/passwd", O_RDONLY|O_CLOEXEC) = 3     fstat(3, {st_mode=S_IFREG|0644, st_size=610, ...}) = 0     mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f1a7c0eb000     read(3, "root:x:0:0:root:/root:/bin/bash\n"..., 4096) = 610     close(3)                                = 0     munmap(0x7f1a7c0eb000, 4096)            = 0     geteuid()                               = 0     open("/etc/shadow", O_RDONLY|O_CLOEXEC) = 3     fstat(3, {st_mode=S_IFREG|0600, st_size=413, ...}) = 0     mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f1a7c0eb000     read(3, "root:x::::::\nbin:x:14871::::::\nd"..., 4096) = 413     read(3, "", 4096)                       = 0     close(3)                                = 0     munmap(0x7f1a7c0eb000, 4096)            = 0     write(2, "useradd: PAM: Authentication ser"..., 73useradd: PAM: Authentication service cannot retrieve authentication info     ) = 73      The config files look fine:               [root@robot1 jwatte]# cat /etc/pam.d/useradd      #%PAM-1.0     auth        sufficient  pam_rootok.so     auth        required    pam_unix.so     account     required    pam_unix.so     session     required    pam_unix.so     password    required    pam_permit.so          [root@robot1 jwatte]# cat /etc/pam.d/other      #%PAM-1.0     auth        required    pam_unix.so     account     required    pam_unix.so     password    required    pam_unix.so     session     required    pam_unix.so     [root@robot1 jwatte]#       How do I take the next step in resolving and debugging this issue? Is there any debug I can find anywhere about why PAM decides this should fail? Good-old /var/log/auth.log doesn't exist anymore, and journalctl -b is not very helpful:               May 17 09:52:15 robot1 sudo[676]: pam_unix(sudo:session): session opened for user root by jwatte(uid=0)     May 17 09:52:15 robot1 useradd[677]: Authentication service cannot retrieve authentication info     May 17 09:52:15 robot1 useradd[677]: failed adding user 'mysql', data deleted      I still can't get much information out of PAM -- specifically, which module fails, at what step? I've read the code for useradd, and the code for PAM (AAAUUGH! THE GOGGLES! THEY DO NOTHING!) I ended up adding pam_warn.so to "others" and "useradd" for the "account" action, and I got one (1) more line into the journalctl:               May 17 11:04:54 robot1 useradd[29944]: pam_warn(useradd:account): function=[pam_sm_acct_mgmt] service=[useradd] terminal=[<unknown>] user=[root] ruser=[<unknown>] rhost=[<unknown>]      Does it matter that terminal, ruser, and rhost are unknown? How would I found out?


title: adjusting keyboard sensitivity with kbdrate

text: The keyboard on my Laptop is too sensitive (when typing, I often type two characters instead of one). I have been googling and found `kbdrate`. But for some reason, `kbdrate` does not work properly:               # kbdrate     Typematic Rate set to 10.9 cps (delay = 250 ms)          # kbdrate -r 2     Typematic Rate set to 2.0 cps (delay = 250 ms)          # kbdrate     Typematic Rate set to 10.9 cps (delay = 250 ms)      At the beginning, `kbdrate` is set to `10.9 cps`. When I change it to 2, it reports as changed, but when I run `kbdrate` again, it is again the old value `10.9 cps`. How can I modify the sensitivity of my keyboard? I am running these commands in terminal emulator Terminator, using Debian Wheezy and LXDE desktop environment. I should add, that whatever value I use, i.e. `kbdrate -r 2 -d 500`, I see absolutely no effect


title: Bash: integer expression expected, using read/test

text: I'm learning the basics of shell programming, so I wrote something simple like               #!/bin/bash     read var1     read var2     if [ var1 -lt var2 ]; then         echo "var1 is lt var2"     else         echo "var2 is lt var1"     fi      My understanding is that variables are untyped in Bash, and that any variable may be used as an integer if it only contains digits. But I get the error "integer expression expected" when I run this... why?


title: How to tell whether RAM ECC is working?

text: I'm planning on getting some ECC RAM to replace the non-ECC RAM I currently have installed on my Asus M5A97 Pro motherboard (AMD 970 chipset, FX-6100 CPU). After I install the RAM, **how do I tell whether the ECC feature of the RAM is working properly?** I thought about `dmidecode --type memory` which currently prints among else for each RAM stick:               Error Information Handle: Not Provided     Total Width: 64 bits     Data Width: 64 bits      (For one, I would expect with 1 bit of ECC per byte the data width to remain 64 bits but the total width to read 72 bits.) Can that be used for determining whether ECC is operative? Or is dmidecode too low level for that? What else could I use (except waiting and seeing if an ECC error shows up in the logs, which would indicate it's working but not that it isn't working)? **Update:** I later thought of edac-utils. Installing them, I get `Not enabling Memory Error Detection and Correction since EDAC_DRIVER is not set`. That gave me `edac-util` and `edac-ctl` executables. Can one of those be used for this purpose?


title: Terminal colors for Vim Airline and Tmux Tmuxline

text: When using Vim on its own with Vundle and Airline the theme appears normally: ![enter image description here](http://i.stack.imgur.com/Zz1HZ.png) When I have loaded it up in Tmuxline, the theme uses different colors and even Vim looks different: ![enter image description here](http://i.stack.imgur.com/qWbE6.png) ![enter image description here](http://i.stack.imgur.com/XnnYW.png) Here's my Tmux configuration:               set -g default-terminal "screen-256color"          source-file /home/tk/.tmux/tmuxline          unbind C-b          set -g prefix C-o          bind | split-window -h     bind - split-window -v          set-window-option -g mode-keys vi          bind-key -t vi-copy 'v' begin-selection     bind -t vi-copy y copy-pipe 'xclip -in -selection clipboard'          bind C-y run "tmux save-buffer - | xclip -selection clipboard"      Here's my Vim configuration:               set nocompatible " be iMproved, required     filetype off     " required          " set the runtime path to include Vundle and initialize     set rtp+=~/.vim/bundle/Vundle.vim     call vundle#begin()     " alternatively, pass a path where Vundle should install plugins     "call vundle#begin("~/some/other/path")          " let Vundle manage Vundle, required     Plugin 'gmarik/Vundle.vim'          Plugin 'Valloric/YouCompleteMe'     Plugin 'scrooloose/syntastic'     Plugin 'bling/vim-airline'          Plugin 'godlygeek/tabular'     Plugin 'plasticboy/vim-markdown'          Bundle 'edkolev/tmuxline.vim'          " include plugins here          call vundle#end()     filetype plugin indent on          set backspace=indent,eol,start          set showcmd     set incsearch     set number     set expandtab     set tabstop=4     set shiftwidth=4     set hlsearch     set ic     set autoindent     set cmdheight=1     set laststatus=2          syntax enable          set nobackup     set noswapfile     set showmatch          " airline     let g:airline_powerline_fonts = 1     let g:airline_theme = 'kolor'          set t_Co=256      Obviously, my colors are screwed up somewhere along the line. How do I fix this?


title: Autofs doesn't mount shares on startup

text: I am using OpenSuSE 12.1 with homes shared through LDAP and NFS. ldap stores the maps. My problem is I can't have the shares mounted on boot. It's only working when restarting the autofs service manually. On a CentOS 6.3 there is no such problem. My `nsswitch.conf`:               passwd: files sss     group:  files sss          hosts:  files mdns4_minimal [NOTFOUND=return] dns     networks:       files dns          services:       files     protocols:      files     rpc:            files     ethers:         files     netmasks:       files     netgroup:       files nis     publickey:      files          bootparams:     files     automount:      files ldap     aliases:        files      My `/etc/openldap/ldap.conf`:               SIZELIMIT       20     TIMELIMIT       15     #DEREF          never     TLS_REQCERT     demand     uri     ldap://10.0.0.1     base    dc=domain,dc=com      My `/etc/sssd/sssd.conf`:               [sssd]     config_file_version = 2     reconnection_retries = 3     sbus_timeout = 30     services = nss, pam     domains = domain.com          [nss]     filter_groups = root     filter_users = root     reconnection_retries = 3          [pam]     reconnection_retries = 3          [domain/domain.com]      id_provider = ldap      auth_provider = ldap      min_id = 500      max_id = 30000      ldap_schema = rfc2307      ldap_uri =  ldaps://ldap-ms.local,  ldaps://ldap-sl.local, ldap://ldap      ldap_search_base = dc=domain,dc=com      ldap_user_search_base =  ou=People,dc=domain,dc=com      ldap_group_search_base = ou=Group,dc=domain,dc=com      ldap_tls_cacert = /etc/pki/CA/certs/domain-cacert.pem      ldap_tls_reqcert = hard      cache_credentials = true      enumerate = True      My `/etc/sysconfig/autofs`:               MASTER_MAP_NAME="auto.master"     TIMEOUT=300     BROWSE_MODE="yes"     MAP_OBJECT_CLASS="automountMap"     ENTRY_OBJECT_CLASS="automount"     MAP_ATTRIBUTE="ou"     ENTRY_ATTRIBUTE="cn"     VALUE_ATTRIBUTE="automountInformation"     USE_MISC_DEVICE="yes"      Am I missing something?


title: Unexpected results testing serial loopback using echo and cat

text: So I have a standard RS232 serial port that is looped back to itself by simply running a wire from Tx to Rx. I'm testing loopback by running `echo` and `cat` in two separate terminals:               cat /dev/ttyS1     echo "hi" > /dev/ttyS1      My issue is with the output. I would expect to see one "hi" come back on the terminal running cat but instead I get this:               hi     [2 newlines]     hi     [4 newlines]     hi     [8 newlines]     hi     [16 newlines]     hi     [32 newlines]     hi      ...and so on until I `ctrl`+`c` `cat`. After interrupting cat, if I run it again it will not output "hi"s until I run echo a second time. Is this normal? Any idea why I'm seeing this behavior? **Edit** : By newline, I mean ASCII `0x0A`. There are no carriage returns in this output.


title: Do GNUmakefile, GNUmakefile.am, and GNUmakefile.in indicate that Automake has been used?

text: The source folder of rtnet contains only the above mentioned files for compilation purposes. Remaining files are the source code of the examples. Question is that do these files indicate that they have been generated through automake? If yes, then where should I look to find out what settings where made to configure automake for generating these files?


title: How to install/uninstall .deb packages?

text: .deb is the extension of the Debian software package format and the most often used name for such binary packages. Debian packages are also used in distributions based on Debian, such as Ubuntu and others. How do I **install/uninstall** a `.deb` package directly?


title: Should I be concerned with the error xauth: /home/user/.serverauth.535 does not exist?

text: I installed a minimal Fedora system and have built it up to getting X running with Xmonad as my window manager. I can `startx` fine and so far I don't see any issues with my current setup while in X. When I leave X, the first line I see is               xauth: /home/user/.serverauth.535 does not exist      What can I do to remedy this error? I check `/var/log/Xorg.0.log` and I don't find any lines with `(EE)` so I don't think there is an error. FYI, I did not `yum group install "X Window System"` but I only installed all the `Mandatory Packages` and some select `Default Packages` in the group. Could this be causing the `xauth` error?


title: Can't upgrade VirtualBox in Mint 12

text: I'm running Linux Mint 12 x64 and can't get the latest virtualbox-4.1 update through apt. I have the following line in my /etc/apt/sources.list:               deb http://download.virtualbox.org/virtualbox/debian oneiric contrib      Launching VirtualBox (currently at v4.1.6) shows an alert that a new version (v4.1.20) is available. Visiting the Packages file on the repo page shows v4.1.20 as the currently available version. I can only assume a conflict or missing dependency exists somewhere, but I've no idea where to start looking for it. Apt doesn't report any failures on the repos, or that virtualbox is being held back.


title: Extra characters in XTerm printerCommand output

text: I've set up `.Xresources` to be able to print the terminal contents to a file when pressing `Alt`-`P`:               XTerm*printAttributes: 2     XTerm*printerCommand: cat - > "`mktemp --tmpdir xterm-screenshot.bin.XXXXXXXXXX`"     XTerm.VT100.translations: #override Meta <KeyPress> P: print() \n      This seems to work fine, except that each line in the output is prefixed by some escape characters and the literal `#5`. Compare the output at the start of the `xterm` session:               user^2@host:~     $       Is that `ESC#5ESC[0m` bit at the start normal? `less /tmp/xterm-screenshot.bin.*`:               ESC#5ESC[0muserESC[0;1;33m^2ESC[0m@host:ESC[0;1;34m~ESC[0m     ESC#5ESC[0m$ ESC[0m      `less -R /tmp/xterm-screenshot.bin.*`:               [0muser^2@host:~     [0m$      Additional info:               $ xterm -version     XTerm(271)     $ uname -a     Linux user 3.2.0-27-generic #43-Ubuntu SMP Fri Jul 6 14:46:35 UTC 2012 i686 i686 i386 GNU/Linux


title: Do I have PCLMUL instruction set support?

text: Here are the `flags` from `/proc/cpuinfo`: `fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid` I clearly have a `pclmulqdq` flag, but I'm not sure if it means PCLMUL instruction set support. How can I find what the flag means, or what flag PCLMUL corresponds to?