title: Mutt imap multiple account

text: My first question on this site, I come quickly. I'm a fan of command line tools and text-based application. I use tmux with a minimalist tiling wm is qtile, I can not change the environment. I'm a developer, I mainly use Python and Perl. My first question is about mutt a great client. I use the sidebar to be able to display mailboxes. I used imap with google accounts, Here is my configuration:               account-hook . 'unset preconnect imap_user imap_authenticators'          #First account     account-hook 'imaps://hobbestigrou@domain.com@imap.gmail.com:993/' \        ' set imap_user = "hobbestigrou@domain.com" \          imap_pass = "password" '          folder-hook 'imaps://hobbestigrou@domain.com@imap.gmail.com:993/INBOX' \         ' set imap_user = "hobbestigrou@domain.com" \           imap_pass = "1password" \           smtp_url = "smtp://hobbestigrou@domain.com@smtp.gmail.com:587/" \           smtp_pass = "password" \           from = "hobbestigrou@domain.com" \           realname = "Natal Ngétal" \           folder = "imaps://hobbestigrou@domain.com@imap.gmail.com:993" \           spoolfile = "+INBOX" \           postponed="+[Gmail]/Drafts" \           mail_check=60 \           imap_keepalive=300 '          #Second account     account-hook 'imaps://hobbestigrou@domain2.com@imap.gmail.com:993/' \         ' set imap_user = "hobbestigrou@domain2.com" \           imap_pass = "password" '          folder-hook 'imaps://hobbestigrou@domain2.com@imap.gmail.com:993/INBOX' \         ' set imap_user = "hobbestigrou@domain2.com" \           imap_pass = "password" \           smtp_url = "smtp://hobbestigrou@domain2.com@smtp.gmail.com:587/" \           smtp_pass = "password" \           from = "hobbestigrou@domain2.com" \           realname = "Natal Ngétal" \           folder = "imaps://hobbestigrou@domain2.com@imap.gmail.com:993" \           spoolfile = "+INBOX" \           postponed="+[Gmail]/Drafts" \           mail_check=60 \           imap_keepalive=300 '          mailboxes + 'imaps://hobbestigrou@domain.com@imap.gmail.com:993/INBOX' \               + 'imaps://hobbestigrou@dmain2.com@imap.gmail.com:993/INBOX' \               + 'imaps://hobbestigrou@domain.com@imap.gmail.com:993/[Gmail]/Messages envoyés' \               + 'imaps://hobbestigrou@domain2.com@imap.gmail.com:993/[Gmail]/Messages envoyés' \               + 'imaps://hobbestigrou@domain.com@imap.gmail.com:993/[Gmail]/Spam' \               + 'imaps://hobbestigrou@domain2.com@imap.gmail.com:993/[Gmail]/Spam' \               + 'imaps://hobbestigrou@domain.com@imap.gmail.com:993/Divers' \               + 'imaps://hobbestigrou@domain2.com@imap.gmail.com:993/Divers' \               + 'imaps://hobbestigrou@domain.com@imap.gmail.com:993/[Gmail]/Tous les messages' \               + 'imaps://hobbestigrou@domain2.com@imap.gmail.com:993/[Gmail]/Tous les messages'          # Where to put the stuff     set header_cache = "~/.mutt/cache/headers"     set message_cachedir = "~/.mutt/cache/bodies"     set certificate_file = "~/.mutt/certificates"               set mail_check = 30     set move = no     set imap_keepalive = 900     set editor = "vim"          set date_format = "%D %R"     set index_format = "[%Z]  %D  %-20.20F  %s"     set sort = threads                         # like gmail     set sort_aux = reverse-last-date-received  # like gmail     set uncollapse_jump                        # don't collapse on an unread message     set sort_re                                # thread based on regex     set reply_regexp = "^(([Rr][Ee]?(\[[0-9]+\])?: *)?(\[[^]]+\] *)?)*"          bind index gg       first-entry     bind index G        last-entry          bind index R        group-reply     bind index <tab>    sync-mailbox     bind index <space>  collapse-thread          # Ctrl-R to mark all as read     macro index \Cr "T~U<enter><tag-prefix><clear-flag>N<untag-pattern>.<enter>" "mar          # Saner copy/move dialogs     macro index C "<copy-message>?<toggle-mailboxes>" "copy a message to a mailbox"     macro index M "<save-message>?<toggle-mailboxes>" "move a message to a mailbox"          bind index \CP sidebar-prev     bind index \CN sidebar-next     bind index \CO sidebar-open     bind pager \CP sidebar-prev     bind pager \CN sidebar-next     bind pager \CO sidebar-open          set pager_index_lines = 10 # number of index lines to show     set pager_context = 3      # number of context lines to show     set pager_stop             # don't go to next message automatically     set menu_scroll            # scroll in menus     set tilde                  # show tildes like in vim     unset markers              # no ugly plus signs          bind pager k  previous-line     bind pager j  next-line     bind pager gg top     bind pager G  bottom          bind pager R  group-reply          set quote_regexp = "^( {0,4}[>|:#%]| {0,4}[a-z0-9]+[>|]+)+"     auto_view text/html                                      # view html automatically     alternative_order text/plain text/enriched text/html          set sidebar_delim   = '│'     set sidebar_visible = yes     set sidebar_width   = 24          set status_chars  = " *%A"     set status_format = "───[ Folder: %f ]───[%r%m messages%?n? (%n new)?%?d? (%d to delete)?%?t? (%t tagged)? ]───%>─%?p?( %p postpone          set beep_new             # bell on new mails     unset mark_old           # read/new is good enough for me          color normal    white black     color attachment brightyellow black     color hdrdefault cyan black     color indicator black cyan     color markers    brightred black     color quoted    green black     color signature cyan black     color status    brightgreen blue     color tilde    blue black     color tree    red black          color index    red black ~D     color index    magenta black ~T               set signature="~/.signature"      So it works well, I can see both my inbox and when there are new posts in it. But when I open mutt it first opened a local box, I do not understand why, and to see the new posts in other inbox, I have to move first in each of they. Maybe it's normal, but how by asking mutt to open domain.com for example first and not a local one that does not exist.


title: screen /bin/bash execute script and then go to interactive shell

text: I am using .byobu/windows to start up some screen sessions, and I'm trying to start a script that will exit to an interactive shell once it has completed. Is this possible? I've tried:               screen -t test /bin/bash -i /path/to/script     screen -t test /bin/bash - /path/to/script      I realize I could just add a /bin/bash to the end of the script, but I don't want that as a solution for when I run the script in a shell...


title: very high buffer memory usage

text: Is this normal - I've never seen buffers so high?               $ cat /proc/meminfo      MemTotal: 16332808 kB     MemFree: 1112264 kB     Buffers: 10630124 kB     Cached: 699400 kB     SwapCached: 0 kB     Active: 3262924 kB     Inactive: 8132004 kB     Active(anon): 27464 kB     Inactive(anon): 38888 kB     Active(file): 3235460 kB     Inactive(file): 8093116 kB     Unevictable: 0 kB     Mlocked: 0 kB     SwapTotal: 525308 kB     SwapFree: 525308 kB     Dirty: 40 kB     Writeback: 0 kB     AnonPages: 65412 kB     Mapped: 11300 kB     Shmem: 940 kB     Slab: 3674368 kB     SReclaimable: 3652612 kB     SUnreclaim: 21756 kB     KernelStack: 1496 kB     PageTables: 3340 kB     NFS_Unstable: 0 kB     Bounce: 0 kB     WritebackTmp: 0 kB     CommitLimit: 8691712 kB     Committed_AS: 594304 kB     VmallocTotal: 34359738367 kB     VmallocUsed: 102232 kB     VmallocChunk: 34359634044 kB     HardwareCorrupted: 0 kB     DirectMap4k: 2048 kB     DirectMap2M: 16691200 kB


title: Passing the "--float" option to OpenVPN client from  NetworkManager

text: NetworkManager on Fedora14 doesn't support the "--float" parameter of OpenVPN client. Are there any workarounds to connect with NetworkManager to an OpenVPN network using the `--float` option? Or are there any other graphical Network Managers for GNOME that would have this feature?


title: XenServer how can I shrink the virtual drive of XenServer domU?

text: How can I shrink the virtual drive of XenServer image?. I gave 300Gb of space for one image (domU) and that was mistake. Now I want to shrink it. How can I do that? The system is already set up and configured, I can't just start a new server. (But if there is no other way, I will.)


title: Does GRUB consider partition order when looking for config files?

text: I have a HD which has 3 partitions, in the following order:   1. NTFS   2. FAT32   3. FAT32 (very small) I want to install GRUB into the MBR of the HD, and place the config files (`menu.lst`, etc.) into the 3rd partition. I will use the `--root-directory` command-line parameter. What happens if I change the partition layout after GRUB installation? Will GRUB be able to read those files, even if the partition they belong to becomes the 2nd or 4th one on the disk?


title: 32 or 64 bit class file

text: I have a Java `.class file`. Now I want to check it was compiled on a 32 bit machine or 64 bit machine ? I tried `file` command but it just says it is a compiled java class. Is there any way to find it?


title: Why is pcmanfm such a headache when it comes to mounting filesystems?

text: If I would have known how much 'customization' it takes to get LXDE and its default file manager, `pcmanfm`, just working, I would probably have never chosen to try it. I've got a problem. Lots of people have it. All of these people report the same problem with `pcmanfm`. The people in the forums have about half a dozen magic recipes that get it to work finally. But I want to know what's actually causing `pcmanfm` not to work, because I want to increase my understanding of the way Linux works, not just follow someone's instructions. I am talking about the rather unhelpful "Not Authorized" window that pops up whenever I insert media. Lots of people have this problem. I managed to fix this before. I ended up doing some sort of magic with an xml file. (Was it udisks? Was it `polkit-gnome`? Dunno, but they're both on the list of magic recipes for solving this issue.) I changed every entry that said something to say something else. And finally, I could see my media. (I couldn't even mount it manually I should add.) I fixed it before and... What happened? I used `apt-get`, installed a new package (`udev`, because I was trying to fix _other mounting issues_ that it seems people stopped having when `hal` became deprecated), and bang, the problem's back. So, I must like torment, because it's certainly in the cards. This is not an easy answer question. If you didn't click any of the links above, you won't be able to tell what I'm talking about. My question is, _what's at the bottom of this?_ At a real, bare bones, _we built these systems on top of Unix and sometimes they don't work as well as the original Unix_ level?


title: How can I check which terminal definitions are available?

text: The bulk of the question is in title, but to elaborate a little: On most Linuxes I can `find /usr/share/terminfo -type f`. But on Solaris machine I have nearby - this directory doesn't even exist. I could iterate over a list of terminals, and do something like:               for TERM in xterm xtermc xterm-color xterm-256color screen rxvt     do         tput cols >/dev/null 2>/dev/null && echo "$TERM available"     done      But it's slow. Any options to discover path used by `tput` to terminal definitions, and run "find" myself?


title: How to find out what is wasting space on "/"?

text: I can find out what is wasting space with this:                du -sm * | sort +0nr | head -30      But what if "/" is filled 100%, and there are many mountpoints, ex.: /foo, /foo2, etc. How can I get a list of directory sizes in ex.: "/" that aren't mountpoints? (recursively not mountpoints?) UPDATE: This doesn't work:               cd /; du -sxm * 2>/dev/null | sort +0nr | head -30      since it lists directories that are mounted in ex.: "/FOO" (tried this under: AIX6.1 and SLES 9.4) UPDATE:               du -xm / | sort +0nr | head -30      this worked on AIX, now what? :D


title: Where is the log for ACPI events?

text: Running Mint 14. Sometimes I can suspend fine, but after my computer is on for a while, it no longer suspends. It wakes up after a second or so without any external inputs. My guess is that I'm monitoring something I don't need to monitor:               >cat /proc/acpi/wakeup     Device  S-state   Status   Sysfs node     LID       S4    *enabled        SLPB      S3    *enabled        IGBE      S4    *enabled   pci:0000:00:19.0     EXP3      S4    *disabled       XHCI      S3    *enabled   pci:0000:00:14.0     EHC1      S3    *enabled   pci:0000:00:1d.0     EHC2      S3    *enabled   pci:0000:00:1a.0     HDEF      S4    *disabled  pci:0000:00:1b.0      These devices are rather cryptic. Although it might be interesting to know what the devices are, all I really care about is the one that is causing my computer to wake up (so I can disable monitoring of that device). Is there a log file somewhere that keeps track of ACPI events that would tell me which device woke up my computer?


title: How to write out the next 3 or X days with a command?

text: I can give the day for today in a command:               TODAY=`date +%Y.%m.%d.`      but how can I give out the next 3 or X days in a command? (Ubuntu 12.04)


title: Linux VM's disk went read-only = no choice but reboot?

text: I have several Linux VMs on VMware + SAN. ## What happened A problem occured on the SAN (failed path) so that for some time, there were I/O errors on the Linux VMs drives. When the path failover had been done, it was too late: _every Linux machine considered most of its drives as not "trustworthy" anymore, setting them as read-only devices_. The root filesystem's drives were also impacted. ## What I tried   * `mount -o rw,remount /` without success,    * `echo running > /sys/block/sda/device/state` without success,   * dug into `/sys` to find a solution without success.  ## What I may have not tried   * `blockdev --setrw /dev/sda` ## Finally... I had to reboot all my Linux VMs. The Windows VMs were fine... ## Some more info from VMware... The problem is described here. VMware suggests to increase the Linux scsi timeout to **prevent** this problem to happen. ## The question! However, **when the problem _does_ eventually happen, is there a way to get the drives back to read-write mode?** (once the SAN is back to normal)


title: Which systems do not honor socket read/write permissions?

text: `man 7 unix` on Linux states: > In the Linux implementation, sockets which are visible in the file system > honor the permissions of the directory they are in. Their owner, group and > their permissions can be changed. Creation of a new socket will fail if the > process does not have write and search (execute) permission on the directory > the socket is created in. **Connecting to the socket object requires > read/write permission. This behavior differs from many BSD-derived systems > which ignore permissions for UNIX domain sockets.** Portable programs should > not rely on this feature for security. Which systems ignore permissions for UNIX domain sockets?


title: What's the syntax for selecting a range of lines in Vim?

text: What's the syntax for selecting a range of lines? I want to run a command over lines 1405 until 1700. And one from 1405 until the end of file, without wanting to look up that number. Update: Is it possible to select a range from the current line to Nth line?


title: How can I remotely run a Windows 7 application from host on a linux guest without showing up on host?

text: I have Ubuntu Linux guest running on a Windows 7 host using Virtualbox. I am wondering if I can remotely access the application from Windows 7 on my ubuntu install and not show up on the windows 7 host and only appear on Ubuntu. I know terminal services can do this but I am using Windows 7 ultimate and it does not include it. Would installing and x server on windows 7 like Mingw/Cygwin+CygwinX and SSH work like it does while in linux? Can anyone guide me in the right direction?


title: How do I force move something when sudo mv -f doesn't work?

text: I need to move a 16 GB folder to my external drive, but moving it manually gives me an in use error. I have tried to start in safe mode and moved it but it was still in use. I have run these commands               diskutil repairdisk /dev/disk0s2     diskutil repairdisk /dev/disk2      Where disk0 is my disk and disk2 is the one I want to move it to. I have no permission errors and I have even run `sudo mv -f` it gives me these:               mv: symlink: ../../../../../Preferences/com.apple.systemsound.plist: File exists`      I have also gotten the same error but without `symlink` For 200 files and the last error is this               mv: /bin/cp: terminated with 1 (non-zero) status      What can I do? I have also ran `sudo chmod 777` for both folders and used the "include for all files option (OS X). By request here is the exact command:               sudo mv -f ~/desktop/collections/jadd /Volumes/External\ 4


title: Running 64bit OS , Find all 32bit programs on a system

text: How should I locate all 32bit programs on my system ? I'm running a 64bit OS. (There might be some , but I forget)


title: Applying changes to xorg.conf without restarting

text: I'm using Ubuntu 12.04 and making some changes to `/etc/X11/xorg.conf`. I now need to restart X server to apply the changes, but I don't want to restart my machine. I know restarting the display manager (eg. lightdm) will sometimes work, is this the best way to do it?


title: Why isn't sed greedy in this simple case?

text: $echo "foo 65 bar" | sed -n -e 's/.*\([0-9]\+\).*/\1/p'     5      Why is the output not `65`? Shouldn't sed greedily match the `[0-9]\+` part? How do I tell sed to match all of `65`?


title: How to fix possibly wiped MBR after centOS install?

text: I think I have messed this one up royally... I have done a clean install of centOS 5.6 (x86_64) on my system. I got through the installation process successfully and rebooted. Now I am greeted with a blinking cursor on a black screen. No grub, no menu, no nothing (the system does POST). I did wipe the hard drive completely before doing the install. I am wondering if I wiped the MBR too, but I thought the centOS install would fix that. I am able to use bootable media with no issues. I have a copy of RIP Linux on a bootable USB so I am able to access the CentOS install files. At this point Im not sure where to go from here. What should my next step be to troubleshoot this? How would I do a fix or even a check on the MBR?


title: How do I make a droplet/.app in platypus for my unix command?

text: This is my sample code from the platypus tutorial. I am trying to make it work with a command named `pymol`, and I want it to open .pdb files or open just `pymol`. I know nothing about perl, but I have basic sh knowledge and can do aliases and modify `.zshrc` files. According to CommonMediaInc, > Filling the gap is Platypus, a handy little utility which makes application > bundles out of Unix scripts. Notice I didn’t say “Perl” there. Platypus > plays nicely with shell scripts, Python, PHP, Ruby, and Tcl just as easily > as Perl. As the developer describes it, “this is done by wrapping the script > in an application bundle directory structure along with an executable binary > that runs the script.” So hopefully someone here can help with making a small, usable droplet (drag- and-drop icon) to open files dropped to this app (while switching to the path of the file).               #!/usr/bin/perl          use strict;     use File::Basename;          my $cmd = "/usr/bin/tar cvfz";          # Get enclosing folder of first file     my($fn, $directory) = fileparse($ARGV[0]);          # Change to that directory     chdir($directory);          # Archive is created there     my $dest_path = "Archive.tgz";          my $files;     foreach(@ARGV)     {         my($filename, $directory) = fileparse($_);         $files .= "'$filename' ";     }          print $cmd . "\n";     system("$cmd $dest_path $files");


title: debug php script and output result and errors to a text file

text: Can someone tell me how to to run a php script and output content and errors to a text file (using nohup) using csh?


title: Sed regex - include original matching

text: INPUT:               dsfgsdf8gfsd     2011.06.26. v     iudsfg98sdfg     sosdufgsdfg     2011.06.27. h     8xdofguiosdfg     jdasfhasd89fa     2011.06.28. k     ydsfgsdgsdg     dsfgdsfzfszgh     2011.06.29. sze     ds9fgisdfgsdfg     asdfasdfasddf     2011.06.30. cs     dsg789sdiofgsdg     dsfig89dsfgds     2011.07.01. p     sd9fg8sdgsdg     sdlfjgsd89öfgxcbv     dsglsd9gcxbv     dsflgjsdlfgfsdg     sdfsdfgdxfgxc     2011.07.02. szo     cvbdsgfsd     2011.07.03. v     dfgsdfgsd     2011.07.04. h     sdfgsdfgsdg      How can I get this OUTPUT with e.g.: sed? (or Perl?)               2011.06.26. v     iudsfg98sdfg     sosdufgsdfg     ----------     2011.06.27. h     8xdofguiosdfg     jdasfhasd89fa     ----------     2011.06.28. k     ydsfgsdgsdg     dsfgdsfzfszgh     ----------     2011.06.29. sze     ds9fgisdfgsdfg     asdfasdfasddf     ----------     2011.06.30. cs     dsg789sdiofgsdg     dsfig89dsfgds     ----------     2011.07.01. p     sd9fg8sdgsdg     sdlfjgsd89öfgxcbv     dsglsd9gcxbv     dsflgjsdlfgfsdg     sdfsdfgdxfgxc     ----------     2011.07.02. szo     cvbdsgfsd     ----------     2011.07.03. v     dfgsdfgsd     ----------     2011.07.04. h     sdfgsdfgsdg      So I want to swap the:               2011.06.26. v      AND               2011.06.27. h      etc. to this:               ----------     2011.06.26. v      AND               ----------     2011.06.27. h      I already tried (don't laugh :D ):               sed "s/[0-9]\{4\}\.[0-9]\{2\}\.[0-9]\{2\}\. /WTF/g"      But I don't know how to match "h, k, sze, cs, p, szo, v" in sed, and I don't know how can I put the matched things to the "WTF" (in .../WTF/g") Has anyone any idea? :\ Thank you!


title: Is there a Vim syntax file for ANSI-colored output of CLI apps?

text: I have quite a lot of Perl scripts which print colored output to the terminal, using `Term::ANSIColor`. This is the same as when a shell script does e.g.               echo -e '\e[1;31mError:\e[0m Your fault.'      Viewing log files of these commands works in `less` (with the `-R` switch), but in Vim, the color characters are displayed raw like this:               ^[[1;31mError:^[[0m Your fault.      I would do a syntax file to match these markers, conceal them, and color the resulting syntax regions accordingly, but first I wanted to check whether there is something like this already.


title: Debian Stable libgl1-nvidia-glx:i386 not found (trying to install Steam)

text: I just installed Debian and now I am trying to set up Steam. I did the first 2 steps in the 64 bit instructions and also installed `ia32-libs`. But when I run the following:               apt-get install libgl1-nvidia-glx:i386      It tells me this:               Reading package lists... Done     Building dependency tree           Reading state information... Done     E: Unable to locate package libgl1-nvidia-glx      How can I have `apt-get` locate and install `libgl1-nvidia-glx`?


title: How can I find my local mail spool?

text: I am a graduate student and a relative Linux novice. This question is a sort of spin-off of my earlier question. My institution has a Ubuntu Linux cluster. I am just a user; I do not have sysadmin permissions, and I certainly do not have the expertise to be a sysadmin! My question is, how do I find my local mail spool? As far as I know, I am not using a mail transfer agent. Answers to my previous question suggested that I look for a file `/var/spool/mail/$USER`, but unfortunately, I do not see a file corresponding to my user name. In `/var/spool/mail/`, using `ls` I only see two files: `nobody` and `www-data`, which are both extensionless files. Do you have any other ideas of where I can look for my mail spool (which is probably local, since I do not have a mail transfer agent configured, as far as I know)?


title: bash: regular expressions in if expression

text: In my script on my ubuntu machine I declare a string like this:               DEBUG_PACKAGE_LIST=$(apt-cache search dbg | awk '{ print $1 }' | grep -e "-dbg")      For you to help you understand my problem here is the output of               echo $DEBUG_PACKAGE_LIST >> debug      The following               if [[ ! $DEBUG_PACKAGE_LIST =~ "[^-a-z0-9]libmagick++5-dbg[a-z]*" ]]; then         echo "no contained";      fi      echos "not contained", despite `$DEBUG_PACKAGE_LIST` contains the string "libmagick++5-dbgsym". Could you help me understand why? Basically my intention is to match libmagick++5-dbg, wheras, libmagick should only be preceeded by a space character.


title: How to create command shortcut to .sh file?

text: I want to type `firefox` in terminal and run Mozilla browser. So I try to create sym-link: `ln -s /opt/firefox firefox` but after typing `firefox` in terminal I get an error: `bash: firefox: command not found` Where is problem?


title: Install OpenSUSE 12.3 on a Virtual Machine

text: I am trying to install OpenSUSE 12.3 onto a (VirtualBox, on Windows) virtual machine. I have tried both the Net Install (-NET) and LiveCD (Gnome) installs. The installations proceed almost to completion, but then fail for a variety of reasons. For the Net Install, it will install most of the way, then crash into the text mode fallback with the error message "an error occurred during the installation". For the LiveCD, it will freeze when it reaches the point of installing the bootloader. I have tried scanning my disk for bad sectors or errors that would affect VirtualBox itself. I have also tried using a VirtualBox "fixed disk" rather than the "dynamic allocation". What would cause this?


title: Unable to start the 'named' service

text: Whenever I try to run the `named` service, I get the following even though my permissions and folder ownership are all fine:               [root@f13 ~]# service named start     Starting named:     Error in named configuration:     zone localhost/IN: loading from master file /var/lib/named/localhost.zone failed: permission denied     zone localhost/IN: not loaded due to errors.     _default/localhost/IN: permission denied     zone 235.168.192.in-addr.arpa/IN: loading from master file /var/lib/named/mydb-for-192-168-235 failed: permission denied     zone 235.168.192.in-addr.arpa/IN: not loaded due to errors.     _default/235.168.192.in-addr.arpa/IN: permission denied     zone example.org/IN: loading from master file /var/lib/named/mydb-for-example-dot-org failed: permission denied     zone example.org/IN: not loaded due to errors.     _default/example.org/IN: permission denied                                                                [FAILED]     [root@f13 ~]# ls -lh /var/lib/named/     total 12K     -rwxrwxrwx. 1 named named 191 May 27 09:13 localhost.zone     -rwxrwxrwx. 1 named named 277 May 27 09:15 mydb-for-192-168-235     -rwxrwxrwx. 1 named named 269 May 27 09:14 mydb-for-example-dot-org


title: Make laptop to wake up by keyboard and mouse

text: The only way I can wake up my laptop (HP Elitebook 8460p) from suspend is by pressing the power button. Neither the built-in keyboard/mouse nor the external ones (connected via USB) wake the laptop up. Things I already tried:   * Enabling the USB devices in `/proc/acpi/wakeup`.   * Checking the bootlog to find out the /dev paths of the USB mouse/keyboard, then:              udevadm info -a -p $(udevadm info -q path -n /dev/input/mouse2)      I then checked for every device in the list using:              cat /sys/devices/.../power/wakeup      if it is possible to enable it, and if so, I do that.   * I have enabled wake on USB in the BIOS. Here some outputs you might need: **$ uname -a**               Linux oliarch 2.6.38-ARCH #1 SMP PREEMPT Tue May 10 08:05:04 CEST 2011 x86_64 Intel(R) Core(TM) i5-2540M CPU @ 2.60GHz GenuineIntel GNU/Linux      **# lsusb**               Bus 001 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub     Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub     Bus 003 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub     Bus 003 Device 003: ID 046d:c52b Logitech, Inc. Unifying Receiver     Bus 003 Device 004: ID 04f2:b230 Chicony Electronics Co., Ltd      Bus 003 Device 005: ID 03f0:231d Hewlett-Packard      **# lspci**               00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)     00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)     00:16.0 Communication controller: Intel Corporation 6 Series Chipset Family MEI Controller #1 (rev 04)     00:16.3 Serial controller: Intel Corporation 6 Series Chipset Family KT Controller (rev 04)     00:19.0 Ethernet controller: Intel Corporation 82579LM Gigabit Network Connection (rev 04)     00:1a.0 USB Controller: Intel Corporation 6 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)     00:1b.0 Audio device: Intel Corporation 6 Series Chipset Family High Definition Audio Controller (rev 04)     00:1c.0 PCI bridge: Intel Corporation 6 Series Chipset Family PCI Express Root Port 1 (rev b4)     00:1c.1 PCI bridge: Intel Corporation 6 Series Chipset Family PCI Express Root Port 2 (rev b4)     00:1c.2 PCI bridge: Intel Corporation 6 Series Chipset Family PCI Express Root Port 3 (rev b4)     00:1c.3 PCI bridge: Intel Corporation 6 Series Chipset Family PCI Express Root Port 4 (rev b4)     00:1c.7 PCI bridge: Intel Corporation 6 Series Chipset Family PCI Express Root Port 8 (rev b4)     00:1d.0 USB Controller: Intel Corporation 6 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)     00:1f.0 ISA bridge: Intel Corporation 6 Series Chipset Family LPC Controller (rev 04)     00:1f.2 SATA controller: Intel Corporation 6 Series Chipset Family 6 port SATA AHCI Controller (rev 04)     23:00.0 FireWire (IEEE 1394): JMicron Technology Corp. IEEE 1394 Host Controller (rev 30)     23:00.1 System peripheral: JMicron Technology Corp. SD/MMC Host Controller (rev 30)     23:00.2 SD Host controller: JMicron Technology Corp. Standard SD Host Controller (rev 30)     24:00.0 Network controller: Intel Corporation Centrino Advanced-N 6205 (rev 34)     25:00.0 USB Controller: NEC Corporation uPD720200 USB 3.0 Host Controller (rev 04)      **# cat /proc/acpi/wakeup**               Device  S-state   Status   Sysfs node     LANC      S0    *enabled   pci:0000:00:19.0     EHC1      S3    *enabled   pci:0000:00:1d.0     EHC2      S3    *enabled   pci:0000:00:1a.0     PCIB      S5    *disabled       RP02      S4    *disabled  pci:0000:00:1c.1     ECF0      S4    *disabled       RP03      S4    *disabled  pci:0000:00:1c.2     RP04      S5    *disabled  pci:0000:00:1c.3     WNIC      S5    *disabled  pci:0000:24:00.0     RP08      S4    *disabled  pci:0000:00:1c.7     HST1      S5    *disabled        Any ideas?


title: Esker ActiveX Plug-in for Firefox under Linux?

text: I have installed the windows version of Firefox with winetricks under Fedora, hurrah! I heard that there is an Esker ActiveX Plug-in for Firefox, but I can't find it. I need it for visiting a website that uses Active X and by default it's only working under IE6.. :D (but it works perfectly under windows if the Firefox has the IE TAB plug-in installed.) Where is the offical Esker ActiveX Plug-in for Firefox? It woud be a great help to have activex under Fedora... :\


title: How to asynchronously launch external program from cli and discard its output?

text: I'm writing a simple desktop initiation script which waits for disk idle, and then launches next external program (like Firefox, Skype or conky) using `&`, like:               ps cax | grep conky > /dev/null     if [ $? -eq 0 ]; then       echo "Conky is already running."     else       wait-for-disk-idle sda       conky &     fi      That's easy. The problem is that some programs spew a lot of debug output to the terminal, which gets mixed with the messages produced by my initialization script. **The question:** Is there any way to asynchronously launch an external program so that its standard output is discarded? What I already tried:   * `conky & >/dev/null 2>/dev/null`   * `bash -c conky &` * * * The correct answer:               bash -c "conky >/dev/null 2>/dev/null &"


title: Light-weight alternative to Apache

text: In my set-up, I run (as root) `ln -s ~/share /var/www`. By doing this, anyone on the local network will access the _~/share_ directory by pointing their browsers at http://hostname/share. I use `apache`, but I suspect that it's overkill (memory usage) for this simple use. What alternative light-weight web servers can I use for this? Will it also be tinker-free (in Debian, there's no extra set-up for `apache`, beyond installation)?


title: Install yum packages on a mounted volume

text: I have a Raspberry Pi with Pidora installed. I need to install a LAMP server. This is the scheme of the filesystem, with a mounted USB flash drive.               Filesystem      Size  Used Avail Use% Mounted on     /dev/root       2.1G  2.0G     0 100% /     devtmpfs        218M     0  218M   0% /dev     tmpfs           218M     0  218M   0% /dev/shm     tmpfs           218M  376K  218M   1% /run     tmpfs           218M     0  218M   0% /sys/fs/cgroup     tmpfs           218M  160K  218M   1% /tmp     /dev/sdb1       7.5G  1.7G  5.8G  23% /mnt/ExternalDrive     /dev/mmcblk0p5   50M   23M   27M  46% /boot      The `/` partition has no space left, so I figured I could mount a USB flash drive in order to install `mysql`, `apache`, `php` and my website files there.   * Is that the best way to go in this situation?   * If so, how can yum packages be installed on a mounted volume? Consider that reinstalling the OS is not feasible.


title: 8086 emulator for unix-like OSs?

text: Is there any 8086 emulator (free or paid) for Fedora 17? I am learning assembly language using AT&T style.


title: Double line box_drawing characters in terminal

text: This piece of code in wikipedia:               $ char=( 6a 6b 6c 6d 6e 71 74 75 76 77 78 )     $ for i in ${char[*]}; do printf "0x$i \x$i \e(0\x$i\e(B\n"; done      includes one-line box-drawing characters. Are there double-line box-drawing characters in terminal? For example how can I print the character "╢". I'll use them in a C++ program like this:               #include <stdio.h>          int main()     {         printf("\e(0\x6a\e(B "); // 188         printf("\e(0\x6b\e(B "); // 187         printf("\e(0\x6c\e(B "); // 201         printf("\e(0\x6d\e(B "); // 200         printf("\e(0\x6e\e(B "); // 206         printf("\e(0\x71\e(B "); // 205         printf("\e(0\x74\e(B "); // 204         printf("\e(0\x75\e(B "); // 185         printf("\e(0\x76\e(B "); // 202         printf("\e(0\x77\e(B "); // 203         printf("\e(0\x78\e(B "); // 186     }


title: ubuntu winboot wubildr.mbr missing

text: I have installed Ubuntu 12.04 (64 bit) operating system, It supports uefi so I installed it like a normal dual booting Now(not like wubi), when I try to load Windows8 it works fine. But when I try to run ubuntu, I got the following error               ubuntu winboot wubildr.mbr missing      How to i fix the ubuntu boot-loading issue ? UPDATE: I have tried bootinfoscript in my lap this is the pastebin url http://paste.ubuntu.com/6073509/


title: System heating up since recent installations

text: Recently, after some operations on my machine, its temperature began to raise. Let's begin with some information. ### Machine caracteristics   * Sony VAIO SVE1511C5E laptop   * Intel Core i7   * 8Go RAM   * AMD Radeon graphics   * 500Gb hard drive ### Current system caracteristics   * Latest Arch Linux (3.10.10-1-ARCH)   * Working with Intel Integrated Graphics (supposedly, I'm not sure I did this configuration correctly). ### What I did until now... A few days ago, I decided it was be time to abandon the classic "Ubuntu/Windows 7" dual-boot, and switched to Arch Linux, which I've used for quite a long time on other machines.   * I started by shreding the hard drive, to make it "clean". One pass random, one pass with zeros (from sector 2048 to the end).   * I installed Arch Linux, everything went fine. But the problem occured after this. Back when I was under the Ubuntu/Windows 7 dual-boot, my computer's temperatures were reasonnable. I had sent the machine to Sony for repairs once (the fan was apparently broken), and since then, everything ran around 40/50°C (idle), and rarely reached 60/65°C during big tasks. Now that W7/Ubuntu disappeared, these temperatures are nothing but old memories.   * When doing nothing (idle), the machine stays around 60°C.   * When working harder, it reaches 75°C/80°C very quickly.   * I did not try the heaviest tasks such as running IDE's, compiling big programs, and so on. Right now, as I'm asking this question, `sensors` outputs :               acpitz-virtual-0     Adapter: Virtual device     temp1:        +58.0°C  (crit = +102.0°C)          coretemp-isa-0000     Adapter: ISA adapter     Physical id 0:  +61.0°C  (high = +87.0°C, crit = +105.0°C)     Core 0:         +61.0°C  (high = +87.0°C, crit = +105.0°C)     Core 1:         +58.0°C  (high = +87.0°C, crit = +105.0°C)     Core 2:         +57.0°C  (high = +87.0°C, crit = +105.0°C)     Core 3:         +55.0°C  (high = +87.0°C, crit = +105.0°C)          radeon-pci-0100     Adapter: PCI adapter          temp1:        +52.5°C      In order to "fix" this problem, I tried/did the following :   * I installed and configured `laptop-mode-tools` as suggested by the Arch community.   * I installed `cpupower` and set it to work under the `powersave` governor (CPU Frequency Scaling).   * I checked my BIOS for fan-related parameters, but there's none I can see.   * I _tried_ to work with Intel's graphics instead of using my AMD card, but I'm not even sure this worked (any way I could check it?)   * I _tried_ to use `fancontrol` and `pwmconfig` but apparently, there's not pwm-capable modules loaded. I couldn't succesfully load `it87`.   * I've set the ATI power profile to `low`.   * I've set the ATI power method to `profile`. After that, I decided to try other distributions, in case there would be a problem specific to Arch.   * OpenSUSE shows the same behaviour.   * Back to Ubuntu, same, even if I used it when dual-booting with W7 ! Having tried most of the things I know when it comes to high temperatures, I have to admit I've now run out of ideas... Is there anything I've missed, something I should try on my machine ? Something I've lost when I shreded my hard drive ? ## PowerTop results ### Overview Summary: 290.5 wakeups/second, 0.0 GPU ops/seconds, 0.0 VFS ops/sec and 6.8% CPU use                           Usage       Events/s    Category       Description             100.0%                      Device         Audio codec hwC0D0: Realtek              23.6 ms/s      50.7        Process        /usr/lib32/skype/skype               6.8 ms/s      51.2        Process        /usr/lib/chromium/chromium             413.2 µs/s      25.3        Process        [rcu_preempt]               7.6 ms/s      21.2        Process        /usr/lib/chromium/chromium --typ               0.9 ms/s      17.5        Timer          tick_sched_timer               7.0 ms/s      14.9        Process        /usr/bin/X -nolisten tcp :0 -aut             432.5 µs/s      15.2        Process        tint2             687.9 µs/s      15.4        Process        urxvt               1.8 ms/s      15.2        Interrupt      [6] tasklet(softirq)               4.3 ms/s       9.9        kWork          ath_hw_pll_work             323.9 µs/s       9.7        kWork          ieee80211_iface_work             321.6 µs/s       8.0        Process        /usr/bin/openbox --startup /usr/               1.0 ms/s       6.8        Timer          hrtimer_wakeup               3.1 µs/s       3.8        kWork          ieee80211_dynamic_ps_enable_wor               1.2 ms/s       2.1        Process        sensors               1.5 ms/s       1.9        Process        watch      ### Idle stats                           Package |             Core    |            CPU 0       CPU 1                         |                     | Actual    1.6 GHz     1.7 GHz     Idle        96.8%   | Idle        99.6%   | Idle        99.6%      100.0%     2.40 GHz     2.7%   | 2.60 GHz     0.0%   | 2.60 GHz     0.0%        0.0%     2.60 GHz     0.0%   | 2.50 GHz     0.0%   | 2.50 GHz     0.0%     2.50 GHz     0.0%   | 2.40 GHz     0.0%   | 1.60 GHz     0.1%     1.60 GHz     0.1%   | 1.60 GHz     0.1%   | 2.21 GHz     0.0%     2.21 GHz     0.1%   | 2.21 GHz     0.0%   | 2.40 GHz     0.0%     2.31 GHz     0.0%   | 2.31 GHz     0.0%   | 2.31 GHz     0.0%     1500 MHz     0.0%   | 1500 MHz     0.0%   | 1500 MHz     0.0%     1300 MHz     0.0%   | 1.80 GHz     0.3%   | 1.80 GHz     0.3%     1400 MHz     0.0%   |                     |                              |             Core    |            CPU 2       CPU 3                         |                     | Actual    1.8 GHz     1.7 GHz                         | Idle        99.9%   | Idle       100.0%      100.0%                         | 2.60 GHz     0.0%   | 2.60 GHz     0.0%        0.0%                         | 2.40 GHz     0.0%   | 2.40 GHz     0.0%        0.0%                         | 2.31 GHz     0.0%   | 1.60 GHz     0.0%        0.0%                         | 1500 MHz     0.0%   | 1.80 GHz     0.0%        0.0%                         | 1300 MHz     0.0%   |                          0.0%                         | 1400 MHz     0.0%   |                          0.0%                         | 1.60 GHz     0.0%   |                         | 1.80 GHz     0.0%   |                         |                     |                              |             Core    |            CPU 4       CPU 5                         |                     | Actual    1.9 GHz     2.2 GHz                         | Idle        99.9%   | Idle        99.9%      100.0%                         | 2.21 GHz     0.1%   | 2.21 GHz     0.1%        0.0%                         | 2.40 GHz     0.0%   | 2.40 GHz     0.0%                         | 2.10 GHz     0.0%   | 2.10 GHz     0.0%                         | 1.80 GHz     0.0%   | 1.80 GHz     0.0%                         |                     |                         |                     |                         |                     |                         |                     |                         |                     |                              |             Core    |            CPU 6       CPU 7                         |                     | Actual    2.3 GHz     2.0 GHz                         | Idle        97.3%   | Idle        97.3%      100.0%                         | 2.40 GHz     2.7%   | 2.40 GHz     2.7%        0.0%                         | 2.60 GHz     0.0%   |                          0.0%                         | 1.60 GHz     0.0%   |                          0.0%                         | 2.31 GHz     0.0%   |                          0.0%                         | 1300 MHz     0.0%   |                          0.0%                         | 1500 MHz     0.0%   |                          0.0%                     | 1.71 GHz     0.4%   | 2.40 GHz     0.0%        0.0%                         | 2.40 GHz     0.0%   | 2.60 GHz     0.1%        0.1%                         | 2.60 GHz     0.1%   | 3.10 GHz     0.0%        0.0%                         | 2.71 GHz     0.0%   | 2.81 GHz     0.0%        0.0%                         | 2.81 GHz     0.0%   | 1400 MHz     0.0%                         | 1400 MHz     0.1%   | 1300 MHz     0.0%                         | 1300 MHz     0.0%   | 2.10 GHz     0.1%                         | 2.10 GHz     0.1%   |                         |                     |                              |             Core    |            CPU 4       CPU 5                         |                     | Actual    1.8 GHz     1.8 GHz                         | Idle        97.8%   | Idle        98.5%       99.3%                         | 3.10 GHz     0.0%   | 3.10 GHz     0.0%        0.0%                         | 3.00 GHz     0.0%   | 3.00 GHz     0.0%        0.0%                         | 2.21 GHz     0.0%   | 2.21 GHz     0.0%        0.0%                         | 2.31 GHz     0.0%   | 2.31 GHz     0.0%        0.3%                         | 1.60 GHz     0.1%   | 1.60 GHz     0.1%        0.0%                         | 1.91 GHz     0.4%   | 2.00 GHz     0.2%        0.0%                         | 2.00 GHz     0.2%   | 1300 MHz     0.0%        0.0%                         | 1300 MHz     0.0%   | 1400 MHz     0.0%        0.0%                         | 1400 MHz     0.0%   | 2.90 GHz     0.0%        0.2%                         | 2.90 GHz     0.0%   | 2.10 GHz     0.0%        0.0%                         | 2.10 GHz     0.1%   | 2.60 GHz     0.0%        0.1%                         | 2.60 GHz     0.0%   | 1.71 GHz     0.3%        0.1%                         | 1.71 GHz     0.5%   | 1.80 GHz     0.7%        0.0%                         | 1.80 GHz     0.8%   | 1.91 GHz     0.1%        0.0%                         | 1500 MHz     0.1%   | 2.40 GHz     0.0%        0.0%                         | 2.40 GHz     0.0%   | 2.50 GHz     0.0%        0.0%                         | 2.50 GHz     0.0%   | 2.71 GHz     0.0%        0.0%                         | 2.71 GHz     0.0%   | 2.81 GHz     0.0%        0.0%                         | 2.81 GHz     0.0%   | 1500 MHz     0.0%                         | 1200 MHz     0.0%   |                              |             Core    |            CPU 6       CPU 7                         |                     | Actual    1.8 GHz     1.8 GHz                         | Idle        99.0%   | Idle        99.1%       99.8%                         | 3.10 GHz     0.0%   | 3.10 GHz     0.0%        0.0%                         | 2.21 GHz     0.0%   | 2.00 GHz     0.1%        0.0%                         | 2.31 GHz     0.0%   | 2.90 GHz     0.0%        0.0%                         | 2.00 GHz     0.1%   | 2.10 GHz     0.0%        0.0%                         | 1.91 GHz     0.1%   | 2.60 GHz     0.0%        0.0%                         | 1.60 GHz     0.1%   | 2.50 GHz     0.0%        0.0%                         | 2.90 GHz     0.0%   | 1.60 GHz     0.1%        0.0%                         | 2.10 GHz     0.0%   | 1.71 GHz     0.1%        0.1%                         | 2.60 GHz     0.0%   | 1400 MHz     0.0%        0.0%                         | 2.50 GHz     0.0%   | 1500 MHz     0.1%        0.0%      ### Frequency stats                         Package   |             Core    |            CPU 0       CPU 1                         |                     | C0 active   0.4%        0.0%                         |                     | POLL        0.0%    0.0 ms  0.0%    0.0 ms                         |                     | C1E-IVB     0.0%    0.0 ms  2.6%    6.6 ms     C2 (pc2)    0.9%    |                     |     C3 (pc3)    0.1%    | C3 (cc3)    0.0%    | C3-IVB      0.1%    0.1 ms  0.0%    0.0 ms     C6 (pc6)    1.0%    | C6 (cc6)    0.0%    | C6-IVB      0.0%    0.0 ms  0.0%    0.0 ms     C7 (pc7)   91.5%    | C7 (cc7)   96.9%    | C7-IVB     98.7%   39.9 ms 97.4%  246.1 ms                              |             Core    |            CPU 2       CPU 3                         |                     | C0 active   0.1%        0.1%                         |                     | POLL        0.0%    0.0 ms  0.0%    0.0 ms                         |                     | C1E-IVB     0.1%    0.3 ms  0.9%    1.8 ms                         |                     |                         | C3 (cc3)    1.6%    | C3-IVB      1.6%    2.7 ms  0.0%    0.0 ms                         | C6 (cc6)    0.0%    | C6-IVB      0.0%    0.0 ms  0.0%    0.0 ms                         | C7 (cc7)   97.4%    | C7-IVB     97.4%   49.2 ms 99.1%   91.0 ms                              |             Core    |            CPU 4       CPU 5                         |                     | C0 active   0.1%        0.0%                         |                     | POLL        0.0%    0.0 ms  0.0%    0.0 ms                         |                     | C1E-IVB     0.1%    0.5 ms  0.0%    0.0 ms                         |                     |                         | C3 (cc3)    0.0%    | C3-IVB      0.0%    0.0 ms  0.0%    0.0 ms                         | C6 (cc6)    0.0%    | C6-IVB      0.0%    0.0 ms  0.0%    0.0 ms                         | C7 (cc7)   99.5%    | C7-IVB     99.4%   71.8 ms100.1%  144.5 ms                              |             Core    |            CPU 6       CPU 7                         |                     | C0 active   3.1%        0.1%                         |                     | POLL        0.0%    0.0 ms  0.0%    0.0 ms                         |                     | C1E-IVB     0.2%    0.2 ms  0.0%    0.0 ms                         |                     |                         | C3 (cc3)    0.1%    | C3-IVB      0.1%    0.2 ms  0.0%    0.0 ms                         | C6 (cc6)    0.0%    | C6-IVB      0.0%    0.0 ms  0.0%    0.0 ms                         | C7 (cc7)   96.7%    | C7-IVB     96.8%   22.2 ms 99.9%  144.2 ms      ### Device stats               Usage     Device name     6.9%        CPU misc     6.9%        CPU core     100.0%        Audio codec hwC0D0: Realtek     100.0%        Display backlight     99.6%        Display backlight     0.0 ops/s   GPU core     0.0 ops/s   GPU misc     100.0%        USB device: EHCI Host Controller     100.0%        USB device: EHCI Host Controller     100.0%        USB device: xHCI Host Controller     100.0%        USB device: xHCI Host Controller     100.0%        Radio device: btusb     100.0%        Radio device: ath9k     100.0%        Radio device: Sony Notebook Control Driver     100.0%        Radio device: Sony Notebook Control Driver     100.0%        USB device: USB2.0 Camera (LOEA11P2BF13827W01781)     100.0%        USB device: Bluetooth USB Host Controller (Atheros Communicat     100.0%        PCI Device: Intel Corporation 7 Series/C210 Series Chipset      (most tunable items are set to Good, except USB suspension. Changes don't go further than +/- 2°C)


title: How to get larger thumbnails in dolphin

text: How can I increase the maximal size (when enlarging them with `Ctrl` `+`) and resolution of thumbnails in dolphin? If not, is there any other file manager which supports larger thumbnails than dolphin to preview pdf's and djvu's?


title: Getting stdin from a named pipe

text: What I am trying to do is run python in a terminal window and redirect it's stdin from a named pipe. Then I write to the named pipe in another terminal and have that command execute on python. Terminal 1:               mkfifo p1     python < p1      Terminal 2:               echo -n "print \"Hello World\"" > p1      What happens is - python prints `Hello World` and exits. What I want to do is keep python running to take a next command. How do I do this in the shell?


title: Auto-restart an process when it crashes

text: I have an app that I need to autostart when the OS starts. I am running in a CentOS 6, so I am using a LSB init script placed in `/etc/init.d`. So far this is fine and working. Now....besides that, what I would like is that if my app crashes (exits with error), I want that it automatically starts again. Ideally, even defining a max number of tries. In Mac's Info.plist there are the keys `KeepAlive` Since I already have `chkconfig` working, I was wondering if there is something I could do with it. I know there is http://mmonit.com/monit/ but it may be too much for what I need.


title: How to get the hostname along with the domain name?

text: In unix (Solaris) is there any command that returns the hostname and domain name together? For instance:               hostname -> servername     domainname -> us.xyz.com      I need : `servername.us.xyz.com`


title: Launchy: Hot keys won't work in xmonad

text: OS:Arch Linux Tiling manager: xmonad with unagi I installed the package launchy and I managed to set the hot key to `CTRL`+`ALT`+`Z` (it's the only program that uses this hotkey). However nothing, happens if I press `CTRL`+`ALT`+`Z`. Also dmenu works without trouble. What is the problem?


title: how to setup virtual box guest additions (drivers) on systemd system (exherbo)

text: The trouble is when I run ./VBoxLinuxA... I'm getting: **Unable to determine your Linux distribution** so there is build in script :               check_system_type() {         if [ ! "$ro_SYS_TYPE" = "" ]; then             return 0         elif [ -f /etc/debian_version ]; then             ro_SYS_TYPE=debian             ro_INIT_TYPE=sysv         elif [ -f /etc/gentoo-release ]; then             ro_SYS_TYPE=gentoo             ro_INIT_TYPE=sysv         elif [ -x /sbin/chkconfig ]; then             ro_SYS_TYPE=redhat             ro_INIT_TYPE=sysv         elif [ -x /sbin/insserv ]; then             ro_SYS_TYPE=suse             ro_INIT_TYPE=sysv         elif [ -f /etc/lfs-release -a -d /etc/rc.d/init.d ]; then             ro_SYS_TYPE=lfs             ro_INIT_TYPE=lfs         elif [ -f /etc/pardus-release ]; then             ro_SYS_TYPE=pardus             ro_INIT_TYPE=pardus         elif [ -f /etc/rc.d/rc.local ]; then             ro_SYS_TYPE=unknown             ro_INIT_TYPE=bsd             ro_RC_LOCAL=/etc/rc.d/rc.local         elif [ -f /etc/rc.local ]; then             ro_SYS_TYPE=unknown             ro_INIT_TYPE=bsd             ro_RC_LOCAL=/etc/rc.local         elif [ -d /etc/init.d ]; then             ro_SYS_TYPE=unknown             ro_INIT_TYPE=sysv         else  # Perhaps we can determine what we need to know anyway though?             echo 1>&2 "Unable to determine your Linux distribution"             log "Unable to determine the Linux distribution"             return 1         fi         return 0     }      And I'm confused what can I chose here. I'm using systemd I've tried to create various files but it still being wrong for me :( How to install it for systemd? (fedora installs it somehow) Add: seems like fedora had sysv-compatibility enabled in systemd and vbox don't support systemd. So I just need this hacky way to get drivers.


title: Fedora 14 command line: assign folder permissions

text: How can I assign folder permissions in Fedora 14 using the command line? I'd like to give read/write/execute permissions to :   * 2 users (tom, jim) to the folder /Home/Share   * 1 group (employees) to the folder /Home/Share/Employees However, I'm not sure how to do this properly from a shell.


title: KSH styling text based menu  using STDERR

text: Is it possible to format the STDERR in order to have a better looking menu using the select command? I have a simple select                   select oChoice in $(<tempMenu.menu) ; do             case "$oChoice" in               *)                 break               ;;           esac        done      I've tried a trick like:                   exec 3>&1         select ...         ...         done 2>&1 1>&3 | sed 's/^/NICE OUTPUT    /'      But I cannot use escape sequences (i.e. colors), for example                  ...        done 22>&1 1>&3 | sed 's/^/\033[1;33m\033[44mNICE OUTPUT    /'        or        done 22>&1 1>&3 | sed 's/^/\\033[1;33m\\033[44mNICE OUTPUT    /'      The escape sequences are not escaped and also the STDOUT is altered because I have customized the PS3 as well.               PS3="$(print \\n\\r)# $(print "\\033[1;33m\\033[44m")"$QUESTION"$(print "\\033[0m\\033[1;1m\\033[44m") `tput sc` $(print "")     #$(print "")     # $(print "")     # Status: $status $(print "")     # $(print "")     #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  `tput rc` "      As far as I understand (Show only stderr on screen but write both stdout and stderr to file) I cannot separate the STDERR from the STDOUT, so, is there a smarter way to create dynamic text-based menus just using the STDOUT? (or an otherway to workaround my issue)


title: fetchmail to log complete messages AND pass to mda

text: I couldn't seem to tell from the `fetchmail` man page or http://www.catb.org/~esr/fetchmail/fetchmail-man.html#7 whether `--bsmtp <filename>.bsmtp.log`, applied from cli/cronjob, and `--mda <command>` applied from varying _fetchmailrc_ config files are mutually exclusive. I am hoping not as I am trying to keep a "filename.bsmtp.log" for failover purposes on dedicated machine-email accounts, among all other fetchmail parameters to limit which messages are retrieved and how/if they are left on the IMAP server. Most of the messages the mda simply tosses so it is hard to tell if they've been seen or not properly by the mda. It is custom built and designed to exit immediately with no reading** under certain conditions, for example in the presence of certain other processes on the appliance. If they are mutually exclusive, is there another way to log everything similar to --bsmtp, in fetchmail, without altering the custom built mda? **Deliberately putting the responsibility back on `fetchmail` to not dismiss that message as read. Experimentally confirmed when the mda's _stdin_ was not read until _EOF_ before exiting


title: How to capture images transferred via HTTP?

text: I have multiple browsers and I want save all images with size more than 30KB and save to specified address. What is best way?   * listen to `tcpdump` and read the content, and then save to a file, or   * use something like `squid` I think `tcpdump` is better but I don't know how to find out whether the content is an image and of what size (and other attributes) to save it in a file.


title: 'Open .bash_profile' conflict on Ubuntu

text: I want to edit `.bash_profile` on my Ubuntu system. When I try to run the command `open .bash_profile`, it gives this message:               Couldn't get a file descriptor referring to the console      Please help me get around this problem and edit the file.


title: Imagemagick -quality 85 doesn't work

text: I run `mogrify` to compress a JPEG image to 85% quality:               $ ls -lah Screenshot.jpg     -rw-rw-r--.  1 USER GROUP 440K May 24 12:10 Screenshot.jpg     $ mogrify -compress JPEG Screenshot.jpg -quality 85     $ ls -lah Screenshot.jpg     -rw-rw-r--.  1 USER GROUP 441K May 24 12:10 Screenshot.jpg      The size doesn't shrink. Yet if I open the image in Gimp and save at 85% quality, the size does shrink:               ls -lah Screenshot.jpg     -rw-rw-r--.  1 USER GROUP 135K May 24 12:11 Screenshot.jpg      Why doesn't ImageMagick compress the JPEG image to 85%? I'm using ImageMagick-6.6.4.1-15.fc14.i686 on Fedora.


title: How to turn off a USB drive when samba is not using it [Raspberry PI]

text: I have a backup server on a Raspberry Pi using samba with 2x 2TB drives for storage. To reduce noise and drive degradation I'd like to turn them off when I'm not transferring files. I tried to unmount it but the disck kept spinning. I also tried "echo suspend > /sys/bus/usb/devices/usb1/power/level - error "no such file or directory".


title: I don't have a /dev/dsa yet I have audio!

text: I was hacking around and hoping to direct some random data using pipes at /dev/dsa as follows                 cat random.file > /dev/dsa      ...to get some random noise, but I can't manage to find an audio device. I have looked all around the dev folder, there is nothing called /dev/mixer or /dev/audio. I am running Ubuntu 11.04 on an Eeepc 1001p.


title: Does the position of partition on disk affect speed?

text: If I put `/var` as first partition, then `/home` and `/`, will the partition for `/var` have better performance than if I put other partitions close to head of the disk? Will the disk sector position matter? I heard some people saying that I should put swap closer to the head of a partition to get higher performance.


title: Reverse control-code look up for terminals

text: My understanding is that terminals often use ANSI control-codes to represent non-alphanumeric character sequences. For example, when editing `.inputrc` for Bash in Linux, it's easy to find code sequences that look as follows:               "\e[A": history-search-backward     "\e[B": history-search-forward     "\e[C": forward-char     "\e[D": backward-char     "\e[1~": beginning-of-line     "\e[4~": end-of-line     "\e[3~": delete-char     "\e[2~": quoted-insert     "\e[5C": forward-word     "\e[5D": backward-word      The commands above define key bindings for the Bash commands `history-search- backward`, etc.. Now, in bash, I can use `read` to see how characters typed in my keyboard are mapped to ANSI control codes. E.g. For example, if I run `read`, and then enter `Ctrl-P`, I get: `^P`. Similarly, if I enter `Alt-W`, I get: `^[W`. My question is: Is there a program, tool or website that does the opposite? I.e. a tool that outputs or shows the sequence of keyboard keys that I need to type on my keyboard to obtain a given ANSI control-code sequence. For example, entering `^[W` should output: `Alt-W` Thanks!


title: How do I remove certain lines (using line numbers) in a file?

text: There are specific lines that I want to remove from a file. Let's say it's line 20-37 and then line 45. How would I do that without specifying the content of those lines?


title: e2fsck not working

text: I am using Linux slitaz on my machine. I am able to see drives on the left side of the screen but when I click the drives it is giving the error cannot open the drive. When I ran the `e2fsck` on that partition I am getting an error. I used the following command to run `e2fsck`:               e2fsck -y -f -V /dev/hda3      and this gives the following error:               error:     e2fsck: Attempt to read block from filesystem resulted in short read while trying to open /dev/hda3     Could this be a zero-length partition?      How can I resolve this? when i did fdisk -l, i got this               Disk /dev/hda: 80.0 GB, 80026361856 bytes     255 heads, 63 sectors/track, 9729 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes             Device Boot      Start         End      Blocks  Id System     /dev/hda1               1        2550    20482843+ 83 Linux     /dev/hda2            2551        2615      522112+ 82 Linux swap     /dev/hda3            2616        6439    30716280  83 Linux     /dev/hda4            6440        9729    26426925  83 Linux


title: Ubuntu vs Debian for server

text: What would be a better choice for a web server, Debian or Ubuntu? I mainly use Python & PostgreSQL with Nginx and sometimes PHP & MySQL. What are pros/cons of each?


title: Print folders names character count

text: I am trying to use `find . -type d -print | wc -m` where `-m` or `--chars` would print the character counts of the folder names. Take following screen shot as example, the character count for **tempFolder** \+ **tempFolder** \+ **dingdongFolder** is only **34** , and event counting the slashes and dots is still **40**. Why the command print out **43** characters? Where are the 3 extra characters come from? ![enter image description here](http://i.stack.imgur.com/dRgin.png)


title: Progress bar in updatedb

text: Is it possible to get a reliable progress bar (or just a reliable information how long it will take) when doing `updatedb`?


title: Using Ctrl+B in less within tmux

text: I use the `Ctrl+B` command prefix in `tmux`, however this clashes with `Ctrl+B` in `less`, which is used for scrolling up a file. How can I get this to work? Do I have to set a different command prefix in `tmux`? I really don't want to have to learn new key bindings if I can avoid it.


title: How do I get back to X?

text: I pressed some key combination and got a big full screen black terminal screen with a login prompt. After logging in, I tried startx to get the UI back, but got a message               Fatal server error:     Server is already active for display 0     If this server is no longer running, remove /tmp/.X0-lock and start again.      So - what did I do to get me the black prompt in the first place, and how do I get back to X?


title: Can htmldoc create multi-level pdf bookmarks?

text: I downloaded an online html book (http://www.cim.mcgill.ca/~franco/OpSys-304-427/lecture-notes/lecture- notes.html), by the following command               wget -r -np  -nH --cut-dirs=3 -p -k http://www.cim.mcgill.ca/~franco/OpSys-304-427/lecture-notes/lecture-notes.html       Then I tried to convert it to pdf using htmldoc. My command is:               htmldoc --webpage -f 1.pdf lecture-notes.html node1.html node2.html ... node69.html      The resulting PDF file has bookmarks for its table of content shown in `lecture-notes.html`, but the bookmarks are just one-level. The table of content shown in `lecture-notes.html` is multilevel however, indicated in HTML source code by `<UL>` and `</UL>` pairs. Another example is http://www.unknownroad.com/rtfm/gdbtut/, which uses a different way to represent multi-level table of content in its HTML source code. Can `htmldoc` create multilevel bookmarks for table of content?


title: keyboard and mouse not working in QEMU

text: I'm trying to run a Linaro Beagleboard image under Qemu and I have trouble with the keyboard and mouse. Basically neither the keyboard nor the mouse work once the boot process completes. I tried two types of images, one with a full Ubuntu desktop and the other with just a minimal filesystem. Both of them boot OK but then I cannot interact in any way with the virtualized system; for the minimal image I get to the login prompt, it auto-logins as root but then I cannot do anything(it's very, very frustrating). I've tried starting both from the command line and from Qemulator GUI but with the same outcome. What could be the problem? The Qemu command line follows:               qemu-system-arm -M beaglexm -m 256 -sd /home/mac/work/qemu_images/beagle-nano.img      -k en-us -append "console=ttyS0" -serial stdio -usb      -hda /home/mac/work/qemu_images/beagle-nano.img      -localtime -net nic,vlan=1 -net user,vlan=1,hostname=beagle_nano      -kernel /home/mac/work/qemu_images/vmlinuz-3.0.0-1002-linaro-omap      -initrd /home/mac/work/qemu_images/initrd.img-3.0.0-1002-linaro-omap      I also tried without the direct boot which uses the kernel and the initial ramdisk images, but still no luck.


title: How to kill a command started over SSH - the SSH connection lost

text: If I use               timeout 10 ssh -n -o BatchMode=yes 1.1.1.1 'sleep 20' > 1.1.1.1.txt 2>&1 &      To give out a remote command on a server, and I kill the SSH connection after 10 seconds, then I can see that the `sleep 20` is still running on the server, but there is no SSH connection. How can I kill the remote command after a timeout, say 10 seconds? The remote machine is AIX 6.1 (or SLES) and no package is available for "timeout". My client is Ubuntu 10.03.


title: POSIX compliant way to work with a list of filenames possibly with whitespace

text: I have seen Bash scripting guides suggesting the use of array for working with filenames containing whitespace. DashAsBinSh however suggests that arrays are not portable so I am looking for a POSIX compliant way of working with lists of filenames that may contain whitespace. I am looking to modify the below example script so that it would `echo`               foo/target/a.jar     foo/target/b.jar     bar/target/lol whitespace.jar      Here is the script               #!/usr/bin/env sh          INPUT="foo/target/a.jar     foo/target/b.jar     bar/target/b.jar     bar/target/lol whitespace.jar"     # this would be produced by a 'ls' command     # We can execute the ls within the script, if it helps          dostuffwith() { echo $1; };          F_LOCATIONS=$INPUT     ALL_FILES=$(for f in $F_LOCATIONS; do echo `basename $f`; done)     ALL_FILES=$(echo "$ALL_FILES" | sort | uniq)          for f in $ALL_FILES     do         fpath=$(echo "$F_LOCATIONS" | grep -m1 $f)         dostuffwith $fpath     done


title: Recommended live distro with persistent USB storage and Compiz

text: I need a distro that matches these specifications:   * runs from USB   * has persistence (saves sessions and data like a regular OS)   * controls on top (as in, the Mac toolbar - I'm still new to Linux, I don't know the difference between desktops yet)    * I'd like it to run Compiz - those effects look awesome   * Compatible with a lot of machines, right off the bat


title: fstrim and iostat

text: I have a new samsung ssd in my new notebook. I tuned up everything to avoid writings in the disk (firefox profiles and `/var/log` in memory), I'm using a `ext4` fs with `relatime` and I use `fstrim` once a day to TRIM my ssd. I monitor disk load with `iostat -dhm`. Before running `fstrim` the command `iostat` shown               Device:            tps    MB_read/s    MB_wrtn/s    MB_read    MB_wrtn     sda                   4.97         0.05         0.59       1856      20924      after trimming `/home`               # fstrim -v /home     /home: 100.2 GiB (107555401728 bytes) trimmed      `ìostat` shows               Device:            tps    MB_read/s    MB_wrtn/s    MB_read    MB_wrtn     sda                   5.91         0.05         3.51       1859     123498      `MB_wrtn` increased `102574 MB`. Does that mean `fstrim` is writing `102574 MB = 100.2 GB` to my disk ? Trim is supposed to "mark" the pages that do not contain valid data, not writing them. I guess `iostat` saw the operation made by `fstrim` as writing (even if _it is not_ a writing). What do you think? Is there a better way to monitor my disk? Note: Using `iotop` is not an answer, because it doesn't show the amount of data of processes that were killed. Thus, `iotop` measurement is inexact.


title: Adding to PS1 in bash_profile

text: In my `.bash_profile` currently, I have `PS1='\[\e[1;91m\][\u@\h \w]\$\[\e[0m\] '`. I am trying to follow these commands to show branch name on iTerm terminal. I changed my               PS1='\[\e[1;91m\][\u@\h \w]\[\e[0m\][\033[32m\]\$(parse_git_branch)\[\033[00m\]$'      and the method at the end of the file               parse_git_branch() {         git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'     }      which shows now as:               [ava@GM12673 ~/blog][$(parse_git_branch) $      How to correctly add something to `PS1`?


title: Lock all devices when adjusting pulseaudio volume in kmix

text: My problem is that kmix adjusts the volumes of not all devices locked together. Adjusting built-in analog stereo also adjusts application's equalized stream and ALSA plugin. But webcam and event sounds are not locked and have to be adjusted separately. Also, when I strart an aplications, master can be at the middle, but the app volume is at maximum, so lowering it by hotkey lowers master from it's relative position. For example "Built-In analog stereo" was at level 50% with "Unknown application" Now I dolphin calls system sound on "delete". It plays very loud and when I open the kmix window - "Built-In analog stereo" now at 100% but other apps are where they were. By lowering "Built-In analog stereo" apps are getting lowered by the same amount (for example, ALSA plugin was 50% and is lowered with Built-In analog to 10% when analog was lwered from 100% to 60%). I want kmix (or "built-in analog stereo" which is master right now) to to adjust one system-wide volume regardless whether are these pulseaudio devices or other. ![screenshot](http://i.stack.imgur.com/F1fz8.png)


title: Store output from one command and process it for another

text: I am working on Unix command line. I have two files. I want to `cat file1.txt` and `grep` the output in `file2.txt` File1.txt               123A     223A     143A     153A     183A     123J     123P File2.txt:               123A (TYU)     223A (RUT)     143A (EWRW) 4     153A (TGBW) 89 ()     183A (23) YHYT      123J ikik 780     123P haja 123     XRQE haja 123     XRQE haja 909 The last 2 lines of `file2.txt` are not present in `file1.txt` I am trying to do something like: `head file1.txt | **and ??**` `grep file2.txt` I tried with `xargs`, `$variable` to store it, but shell hangs or doesn't work. Expected Output: _Edited_ : `               123A (TYU)     223A (RUT)     143A (EWRW) 4     153A (TGBW) 89 ()     183A (23) YHYT      123J ikik 780     123P haja 123


title: Practical use for moving file descriptors

text: According to the bash man page: > The redirection operator >   >   >        [n]<&digit- >   > > moves the file descriptor `digit` to file descriptor `n`, or the standard > input (file descriptor 0) if `n` is not specified. `digit` is closed after > being dupli‐cated to `n`. What does it mean to "move" a file descriptor to another one? What are the typical situations for such practice?


title: Mass deinterlacing with FFmpeg on Debian

text: I have about 300 videos, on a Debian server, stored in the following manner:               /mediaroot/1/m32.mp4     /mediaroot/2/m421.mp4     /mediaroot/n/mx.mp4      They all need to be deinterlaced, and I want to do it with FFmpeg. With the assistance of another helpful sole, I have reached a somewhat tolerable result with the following steps:   1. extract audio   2. transcode video, example              ffmpeg -y -i m148.mp4 -pix_fmt yuv420p -an -pass 1 -passlogfile m148.x600.1351896878.log -an -vcodec libx264 -b:v 600k -preset medium -tune film -threads 0 m148.x600.1351896878.mp4     ffmpeg -y -i m148.mp4 -pix_fmt yuv420p -an -pass 2 -passlogfile m148.x600.1351896878.log -an -vcodec libx264 -b:v 600k -preset medium -tune film -threads 0 m148.x600.1351896878.video.mp4        3. mux new video with audio extracted in step 1.    4. use qt-faststart to move the atoms              ffmpeg/qt-faststart m148.x600.1351896878.mp4 m148.x600.1351896878.atom.mp4      My question is then: How do I make it automatically deinterlace and replace all the videos?


title: Merge folders and replace files using CLI

text: I want to update some forum software and I'd like to test the upgrade process using CLI as a learning possibility. How do I merge contents of a folder into another folder and replace files?


title: Rotating logs generated from tcpdump with logrotate

text: On one production linux box, I am capturing SIP packets using the following configuration: **logrotate.conf:**               # Opensips SIP traces      /var/log/sip.log     {             rotate 31             daily             missingok             notifempty             compress             delaycompress             sharedscripts             postrotate                     pkill tcpdump                     /home/ubuntu/log-sip-messages.sh &             endscript     }      **log-sip-messages.sh:**               #!/bin/sh     tcpdump host 159.63.X.X -s0 -v >> /var/log/sip-159.63.X.X.log      This works great on the Ubuntu 11.04 server, but on the Ubuntu 12.10 boxes, this just produces a file with a timestamp at the time the logs were rotated. It's as if the pkill doesn't complete before running tcpdump again to start writing to the new file. I've tried running this directly from the terminal as an experiment:               pkill tcpdump && tcpdump -s0 -v udp >> /var/log/sip.log      and then when I run `ps aux|grep tcpdump` there's no process running, confirming what I already know... the pkill command runs asynchronously on 12.10 (but either is synchronous on 11.04 or just beats the 2nd command) How can I make this work so I can capture network traffic in a nice, readable log file (I don't need pcaps) without risking filling up my hard drive space?


title: ssh daemon error: sshd must be own

text: Running `service sshd restart` and then `service sshd status` on my system as root prints the following error: > Redirecting to /bin/systemctl status sshd.service sshd.service - OpenSSH > server daemon Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled) > Active: failed (Result: exit-code) since Sat, 16 Feb 2013 21:38:38 +0330; 6s > ago   >  Process: 2207 ExecStart=/usr/sbin/sshd -D $OPTIONS (code=exited, > status=255) Process: 2204 ExecStartPre=/usr/sbin/sshd-keygen (code=exited, > status=0/SUCCESS) CGroup: name=systemd:/system/sshd.service > > Feb 16 21:38:38 localhost.localdomain sshd[2207]: /var/empty/sshd must be > own... How do I find the cause of the problem?


title: Why does the history command do nothing in a script file?

text: If I create a file containing                #!/bin/bash       history      and run it, I get no output. Running it manually in a terminal or `source`ing the script file _does_ produce output. Why does `history` not work from a file?


title: What is logcheck, and why is it consuming 100% CPU out of the blue?

text: I have a server that's hardly used, basically a fresh linode VPS with Ubuntu 12.04 LTS. It has been running for 14 months with hardly a blip in the CPU graphs (2% max, average over 2 hours). Suddenly, the past 2 hours have been at 100%. The culprit is an `egrep` running by the user `logcheck`. Most references I find to this question on google are from many years ago (2005, 2007, 2010). Any suggestions? Killing the process just spawns another one. I'm not sure what this is: all the docs I find point to gentoo where it appears to be a log filtering program for sending data to sysadmins. If this isn't something that is scheduled by default with `ubuntu`, I'm not sure why it's running at this particular moment. ![enter image description here](http://i.stack.imgur.com/aNoKd.png) ![enter image description here](http://i.stack.imgur.com/gb4KB.png)


title: `Error: no such device...` after installing Arch

text: I've seen many threads about this error but I couldn't find a solution. I've installed Arch Linux alongside Windows 8. (Dual Boot). I followed this video exactly but am getting the error below at 20:35. After a reboot I'm getting:               error: no such device: ad4103fa-...     Loading Linux core repo kernel...     error: file `/boot/vmlinuz-linux` not found     Loading initial ramdisk ...     error: you need to load the kernel first.      Any helps would be great.


title: How to enlarge the edit-box size of the login screen of fedora?

text: My macbook with retina display runs fedora-20 KDE spin. The annoying issue is: **On the default login screen, the edit-boxes for username and password look too small to input.** Is there a simple way to customize the size of these edit-boxes?


title: I think somebody tried to hack me

text: root@host [/var/log]# tail -f secure     Jan  3 20:16:10 host sshd[22670]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=61.142.131.120  user=root     Jan  3 20:16:12 host sshd[22670]: Failed password for root from 61.142.131.120 port 9303 ssh2     Jan  3 20:16:15 host sshd[22670]: Failed password for root from 61.142.131.120 port 9303 ssh2     Jan  3 20:16:18 host sshd[22670]: Failed password for root from 61.142.131.120 port 9303 ssh2     Jan  3 20:16:18 host sshd[22684]: Disconnecting: Too many authentication failures for root     Jan  3 20:16:18 host sshd[22670]: PAM 2 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=61.142.131.120  user=root     Jan  3 20:16:26 host sshd[23127]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=61.142.131.120  user=root     Jan  3 20:16:28 host sshd[23127]: Failed password for root from 61.142.131.120 port 33913 ssh2     Jan  3 20:16:29 host sshd[23127]: Failed password for root from 61.142.131.120 port 33913 ssh2     Jan  3 20:16:30 host sshd[23154]: Connection closed by 61.142.131.120      61.142.131.120 is NOT my IP. So I do not know who that guy is. Moreover I can't login as root. I was lucky that I managed to logged in once. Now, even after I passwd to change password I still can't login to either whm or root. Notice report of failed password in secure keeps coming even though I simply do not try to login anymore. Finally things work again but with strange log               Jan  3 20:21:51 host sshd[1252]: reverse mapping checking getaddrinfo for fm-dyn-139-193-157-62.fast.net.id [139.193.157.62] failed - POSSIBLE BREAK-IN ATTEMPT!     Jan  3 20:21:55 host sshd[1252]: Accepted password for root from 139.193.157.62 port 29144 ssh2     Jan  3 20:21:55 host sshd[1252]: pam_unix(sshd:session): session opened for user root by (uid=0)      What does it mean by getaddrinfo doesn't work?


title: /bin/ and /usr/bin Command Tutorials

text: Let me first start off by mentioning that I am not a Linux newbie. I have personally been using the GNU\Linux for nearly 5 years now. However, often times I run across the commands under `/bin/` and `/usr/bin` and wonder how many of those commands I have never used, let alone the number of commands I've never heard of. Is there a book or perhaps an online tutorial that will walk me through those commands? I do realize that the `man` pages are always there to help with whatever tool I am using, but `man` pages are pretty dry and can be very boring to read, especially when you're not trying to find a solution to a specific problem. My question may be strange considering it is coming from an experienced GNU\Linux user, but I have figured it won't hurt to learn more about one's favorite OSs.


title: What does the expression ${MYVAR:+-x} mean in bash?

text: In a bash script I cannot post here I see the following expression:               ${MYVAR:+-x}      I understand the meaning of expressions like `${MYVAR:+OTHERVAR}` and `${MYVAR:-OTHERVAR}`, but an expression with both a plus-sign and a minus- sign. What does it mean, if anything?


title: Critical messages from gsm and gtk

text: After upgrading to Fedora 18, I am seeing the following critical messages on `/var/log/messages` whenever I log on to the computer:               CRITICAL: gsm_manager_set_phase: assertion \`GSM_IS_MANAGER<br>     Gtk-CRITICAL: gtk_main_quit: assertion `main_loops != NULL' failed      Based on my limited knowledge, critical messages and above can affect the usage of my computer if I don't deal with these urgently. Not that they are affecting the current usage of my computer, but I would like to find out more about them (seems to deal with mobile technology and GIMP toolkit?) and how to turn them off if I do not need these services.


title: Install Gnome on Linux Server and Access it via Remote

text: I have a remote linux server. I want to access it remote desktop style from windows. I found this tutorial http://wiki.centos.org/HowTos/VNC-Server And a bunch of others All are so complicated. Are there easier tutorial? Something that can explain what is Gnome, what is VNC, what is tiger-vnc, etc?


title: I am the owner of a file and I have write access: why can't I save?

text: I am on OSX 10.9.2 I am locked out of postgres and trying to modify pg_hba.conf to get back in. http://stackoverflow.com/questions/11919275/can-not-enter-and-change- postgresql-pg-hba-conf-file I run these commands:               $sudo ls -l /Library/PostgreSQL/9.3/data/pg_hba.conf     -rwx--x--x  1 abramhandler  daemon  4222 Oct  9 20:42 /Library/PostgreSQL/9.3/data/pg_hba.conf     $ whoami     abramhandler     $ sudo subl /Library/PostgreSQL/9.3/data/pg_hba.conf      I make changes and click save and get an error from sublime text 2: Unable to save ~/data/pg_hba.conf The ls -l command shows that I own the file and have write access. Why can't I save? Note: I think I am saving to /Library/PostgreSQL/9.3/data/pg_hba.conf even if I get that error message. Data has a little red circle on it -- which probably indicates a problem. ![enter image description here](http://i.stack.imgur.com/E30Qh.png)


title: Replace missing fonts in OpenOffice

text: I have a Word document that uses fonts not available on my system. How can I globally replace these fonts? I've tried both Find/Replace (with formatting) and Tools / Options / OpenOffice / Fonts, but both of these only seem to support replacing one installed font with another -- typing the name of the missing font in manually doesn't work.


title: What is the equivalent to yum-versionlock for ubuntu?

text: I need to install `r-base` 3.0.2 because a needed library isn't compatible with 3.0.3 yet (the latest). I can install the older version of R like so:               sudo apt-get install r-base=3.0.2-1precise0      However all the dependencies of r-base try and install with 3.0.3               root@foo:~# apt-get install r-base=3.0.2-1precise0     Reading package lists... Done     Building dependency tree     Reading state information... Done     Some packages could not be installed. This may mean that you have     requested an impossible situation or if you are using the unstable     distribution that some required packages have not yet been created     or been moved out of Incoming.     The following information may help to resolve the situation:          The following packages have unmet dependencies:      r-base : Depends: r-recommended (= 3.0.2-1precise0) but 3.0.3-1precise0 is to be installed     E: Unable to correct problems, you have held broken packages.      I guess I could install every dependency first, however there are a lot of them.                 r-cran-boot r-cran-class r-cran-cluster r-cran-codetools r-cran-foreign r-cran-kernsmooth r-cran-lattice       r-cran-mass r-cran-matrix r-cran-mgcv r-cran-nlme r-cran-nnet r-cran-rpart r-cran-spatial r-cran-survival       r-recommended      I'm mostly familiar with Centos and Yum. Is there a way to 'version lock' r and all it's dependencies to 3.0.2 instead of 3.0.3 ?               root@foo:~# apt-cache policy r-base     r-base:       Installed: (none)       Candidate: 3.0.3-1precise0       Version table:          3.0.3-1precise0 0             500 http://cran.cnr.berkeley.edu/bin/linux/ubuntu/ precise/ Packages          3.0.2-1precise0 0             500 http://cran.cnr.berkeley.edu/bin/linux/ubuntu/ precise/ Packages          3.0.1-6precise0 0             500 http://cran.cnr.berkeley.edu/bin/linux/ubuntu/ precise/ Packages          3.0.1-5precise0 0             500 http://cran.cnr.berkeley.edu/bin/linux/ubuntu/ precise/ Packages          3.0.1-3precise 0             500 http://cran.cnr.berkeley.edu/bin/linux/ubuntu/ precise/ Packages


title: Mapping Super Keys to Control without Xmodmap

text: I've been attempting to switch my super and control keys in X on a macbook and have been half successful. I'd like to avoid creating a custom .Xmodmap if possible, as there is a temporary 100% cpu bug that pops up every time the custom map is loaded (not to mention various warnings against using xmodmap generally which I've come across). After some diging, I ended up putting Option "XkbOptions" "altwin:ctrl_win" in my 01-keyboard-layout.conf file which has gotten me halfway there: for eg, left command now maps to 133 Control_L. However, the control keys remain the same. Left control, for eg still maps to 37 Control_L. Looking through evdev.lst (and a bunch of googling) turned up no relevant XkbOption for turning control keys into supers, and now i'm pretty stuck. I'm now looking through the insanity that is Doug Palmer's An Unreliable Guide to XKB Configuration but it is, as he describes, a descent into hell. anyone who's attempted this switchover before and knows the exact rules/symbols/keymaps to get it done, your assistance would be great. Thanks!


title: Screen command keypress Ctrl+r?

text: This is example of the command:                screen -S dua -X stuff $'commandhere'      I've searched lots of resources but still not found the command for keypress `Ctrl`+`R`.


title: Root password keep changing

text: This is frustrating. I am often able to login with a root password. Then I cannot login again. However, I am still logged in. Hence my password must be correct. I changed the root password with `passwd`. It works again. Then sometimes latter this happens again. It's as if the root password changes all the time automatically. Did someone hack my server?


title: newsyslog.conf logrotate when file is older than 6 month

text: I would like to delete following files with newsyslog.conf when the files are older than 6 month:               # logfile    [owner:group]    mode    count    size    when    flags    [/pid_file]     /mnt/usb/access_*.log      Which other options do I have to set?


title: Data loss prevention ( or recovery) in a MySql db in embedded systems

text: I have a little ( big ) problem with a MySql application that write on a SD card or a Compact Flash. After a data loss ( a power failure , for example) , if I try to retrieve the data of my db , it fails and the error code is : incorrect format table. If i try to see the files of my DB in filesystem mounted, I obtain: can't stat file or directory (I/O error). Someone have suggestion to overcome this? to prevent or recovery the contents of my db? the scenario is                 a) a filesystem with ext2 filesystem ( to prevent SD card multiple writings)       b) SD cards or DOM or Compact Flash as physical support       c) the OS ( TinyCore Linux Embedded ) it's loaded in RAM       d) the is MySql MyIsam db


title: Put text in the bash command line buffer

text: I would like to programmatically put a certain piece of text in the command line buffer of bash, read to be edited and used as a command. What I am looking forward to is something similar to `read -i` but for commands. > `-i text` If readline is being used to read the line, text is placed into > the editing buffer before editing begins. **Edit** : With _programmatically_ I mean that want to **write this in a script** , launch the script and have the command buffer prepared or the command history modified (as some questions have suggested).


title: Tmux ranger integration: opening text files in new panes

text: Here we have some amazing tools: tmux, ranger, vim... Would be amazing to configure ranger to open the files (when text editable) in a tmux newpane? Is that easy and how it is done?


title: How to check umask for all users under Linux?

text: Under AIX I can check the `umask` for all users with:               cut -d : -f 1 /etc/passwd | while read ONELINE; do lsuser -a umask "$ONELINE"; done      But how can I check the `umask` setting for all users under Linux? (`su` to every user and then `umask` command? Are there any better ways for it?) **UPDATE1:** It's not the best to `su` to all users, because on some RHEL servers the default shell for a few user is halt/shutdown..:               shutdown:x:6:0:shutdown;asdf;asdf;F:/sbin:/sbin/shutdown      so if I `su` to the user... then the server shuts down? **UPDATE2:** I created a bounty for a non-su based answer.


title: Speed optimize hostapd / wireless backports

text: I have an ARM9 CPU at 300MHz board with embedded Linux 2.6.32 running hostapd with dnsmasq. For wifi I use the linux-backports with an ath9k_htc usb wifi- dongle. I have tested the wifi-speed from between my embedded system and a client using iperf. My problem is that the speed is maximum 17mbps, and I don't know if this is what to expect. I have tried to set the CPU speed to maximum 434MHz (45% increase), which gave wifi-speed of 24.5mbps (45% increase). So it seems to be CPU dependent. I have tried to set optimization O3, with no luck. Is there any way to get more speed? Or at least analyze where the bottleneck is?


title: forwarding not working in iptables from 8006 to 443

text: My dedicated server was bridged to vmbr0 and it has 2 Ethernet cards eth0 and eth1 its bridged. I have enabled forwarding with `net.ipv4.ip_forward=1`. I want to redirect the Port 8006 to 443. Now I'm accessing one of the web applications on port 8006, it want to redirect towards 443 using `iptables`. Currently I'm using this rule to forward and its not working:               iptables -t nat -I PREROUTING -d 192.168.1.100 -p tcp --dport 443 -j DNAT --to-destination 192.168.1.100:8006      If I apply these `iptables` rules, the page cannot be accessed on 192.168.1.100:8006:               # Default filter          iptables -P INPUT DROP     iptables -P OUTPUT ACCEPT     iptables -P FORWARD DROP          # Loopback allows all.          iptables -I INPUT -i lo -j ACCEPT     iptables -I FORWARD -i lo -j ACCEPT          # Null packets are, simply said, recon packets. see how we configured the VPS and find out weaknesses.          iptables -A INPUT -p tcp --tcp-flags ALL NONE -j DROP          # Reject is a syn-flood attack          iptables -A INPUT -p tcp ! --syn -m state --state NEW -j DROP          # XMAS packets, also a recon packet          iptables -A INPUT -p tcp --tcp-flags ALL ALL -j DROP          # Allow all Outgoing connection          iptables -A OUTPUT -j ACCEPT     # Ethernet allows established/related Except invalid.          iptables -A INPUT -i vmbr0 -m state --state ESTABLISHE,RELATED -j ACCEPT     iptables -A INPUT -i vmbr0 -m state --state INVALID -j DROP          # Allow TCP on Port 22 SSH with rate limiting          iptables -A INPUT -i vmbr0 -p tcp --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT     iptables -I INPUT -i vmbr0 -p tcp -m state --state NEW -m tcp --dport 22 -m recent --set     iptables -I INPUT -i vmbr0 -p tcp -m state --state NEW -m tcp --dport 22 -m recent --update --seconds 10 --hitcount 5 -j DROP          # Allow Ping ICMP echo With Limiting          iptables -A INPUT -i vmbr0 -p icmp -m state --state NEW -m icmp --icmp-type echo-request -j ACCEPT     iptables -I INPUT -i vmbr0 -p icmp -m icmp --icmp-type echo-request -m recent --set     iptables -I INPUT -i vmbr0 -p icmp -m icmp --icmp-type echo-request -m recent --update --seconds 10 --hitcount 10 -j DROP          # Allow HTTP Requests for NON-secured 80          iptables -A INPUT -i vmbr0 -p tcp --dport 80 -m state --state NEW -m tcp -j ACCEPT     iptables -I INPUT -i vmbr0 -p tcp --dport 80 -m state --state NEW -m recent --set     iptables -I INPUT -i vmbr0 -p tcp --dport 80 -m state --state NEW -m recent --update --seconds 5 --hitcount 20 -j DROP          # Allow HTTP Requests for SLL 443          iptables -A INPUT -i vmbr0 -p tcp --dport 443 -m state --state NEW -m tcp -j ACCEPT     iptables -I INPUT -i vmbr0 -p tcp --dport 443 -m state --state NEW -m recent --set     iptables -I INPUT -i vmbr0 -p tcp --dport 443 -m state --state NEW -m recent --update --seconds 5 --hitcount 20 -j DROP          # Enabling Logging          iptables -N LOGGING     iptables -A INPUT -j LOGGING     iptables -A OUTPUT -j LOGGING     iptables -A LOGGING -m limit --limit 10/min -j LOG --log-prefix "IPTables-log:" --log-level 4     iptables -A LOGGING -j DROP          # DROP ALL Except Above Rules          iptables -A INPUT -j DROP


title: ZSH: Globbing the first N files under a path in lexicographic order

text: I was wondering if there is a way to specify the first N files under a given a directory in zsh. I am interested in solutions for recursive enumeration (i.e. any file recursively below a path is considered for the enumeration) and non-recursive (only those files strictly under a given folder are considered). Thanks!


title: Getting PHP fatal errors in vTiger while logging from a normal users

text: I am getting the error below and notices in Apache logs when I am trying to login with any normal user on vTiger although admin user is working fine and able to see everything as expected. Below are the errors:               [Mon Aug 29 13:49:54 2011] [error] [client 52.165.191.160] PHP Notice:  Undefined index:  search in /var/www/html/crm/include/utils/utils.php on line 996, referer: website://crm.abc.com/crm/index.php?module=Settings&action;=OrgSharingDetailView&parenttab;=Settings     [Mon Aug 29 13:49:54 2011] [error] [client 52.165.191.160] PHP Notice:  Undefined index:  file in /var/www/html/crm/include/utils/utils.php on line 1000, referer: website://crm.abc.com/crm/index.php?module=Settings&action;=OrgSharingDetailView&parenttab;=Settings     [Mon Aug 29 13:49:54 2011] [error] [client 52.165.191.160] PHP Notice:  Undefined index:  search in /var/www/html/crm/include/utils/utils.php on line 996, referer: website://crm.abc.com/crm/index.php?module=Settings&action;=OrgSharingDetailView&parenttab;=Settings     [Mon Aug 29 13:49:54 2011] [error] [client 52.165.191.160] PHP Notice:  Undefined index:  file in /var/www/html/crm/include/utils/utils.php on line 1000, referer: website://crm.abc.com/crm/index.php?module=Settings&action;=OrgSharingDetailView&parenttab;=Settings     [Mon Aug 29 13:49:54 2011] [error] [client 52.165.191.160] PHP Warning:  require(user_privileges/user_privileges_81.php) [function.require]: failed to open stream: No such file or directory in /var/www/html/crm/modules/Users/CreateUserPrivilegeFile.php on line 114, referer: website://crm.abc.com/crm/index.php?module=Settings&action;=OrgSharingDetailView&parenttab;=Settings     [Mon Aug 29 13:49:54 2011] [error] [client 52.165.191.160] PHP Fatal error:  require() [function.require]: Failed opening required 'user_privileges/user_privileges_81.php' (include_path='/var/www/html/crm/include/htmlpurifier/library:.:/usr/share/pear:/usr/share/php') in /var/www/html/crm/modules/Users/CreateUserPrivilegeFile.php on line 114, referer: website://crm.abc.com/crm/index.php?module=Settings&action;=OrgSharingDetailView&parenttab;=Settings     [Mon Aug 29 13:49:54 2011] [error] [client 52.165.191.160] File does not exist: /var/www/html/favicon.ico


title: Safest HardDrive Format for Archiving/Media Storage Data?

text: What is the safest hard drive format (NTFS, HFS+, XFS, ZFS, ...) for archiving or/and storing media (data)? I'd prefer to have the data not corrupt and be relatively safe (From corruption, ...) and would like to have the format to be accessible by Windows (Vista) as well. Thanks in advance.


title: Install over / preserving /home

text: I currently have Ubuntu 13.04 installed on my Desktop PC. It is 32-bit. I have 3 partitions: one for /, one for /home and another one for swap. Say I want to install another operating system (another distro) over / but **not formatting my /home partition**. Will it be compatible? More specifically: if I install a non Ubuntu-based distro over /, like Arch or Fedora or openSUSE, will my system break or my programs stop working after the installation?


title: How to make an infinitely executing command kill itself when certain conditions are met?

text: I'm running a command on command line which infinitely generates a certain data and I'm looking for a particular bit of data, so I used `grep` to find it. As soon as I get the data, I want the command to kill itself. How do I achieve this? **NOTE1:** AND'ing `kill $$` with `grep` is not terminating the command. **NOTE2:** I saw this question, which does not seem to work in my case.