Virtual machine hangs when trying to login after beeing idle for som time

I'm using _Microsoft Virtual PC 2007_ to run a linux virtual machine, but after some time I can't login to it -- not from the instance on the localmachine or ssh in to the machine. Both give the same response. The login process doesn't finshf, the image shows where it stops: ![enter image description here](http://i.stack.imgur.com/VtNMU.png) This only happens when the vm has been running for some days, if I reboot it works fine again for some time before it locks up like this again. Does anyone have an idea of why this is happening? **Edit:** Here are the files. `ls -l /var/pam.d/`:               -rw-r--r--  1 root root 1208 2011-01-20 09:17 common-account     -rw-r--r--  1 root root 1260 2011-01-20 09:17 common-auth     -rw-r--r--  1 root root 1509 2011-01-20 09:17 common-password     -rw-r--r--  1 root root 1201 2011-01-20 09:17 common-session     -rw-r--r--  1 root root  182 2009-04-17 09:53 atd     -rw-r--r--  1 root root  384 2009-04-04 07:42 chfn     -rw-r--r--  1 root root  581 2009-04-04 07:42 chsh     -rw-r--r--  1 root root 3592 2009-04-04 07:42 login     -rw-r--r--  1 root root   92 2009-04-04 07:42 passwd     -rw-r--r--  1 root root 2305 2009-04-04 07:42 su     -rw-r--r--  1 root root   69 2009-03-27 17:18 samba     -rw-r--r--  1 root root  520 2009-03-21 10:28 other     -rw-r--r--  1 root root  168 2009-02-20 18:24 ppp     -rw-r--r--  1 root root  119 2009-02-17 04:22 sudo     -rw-r--r--  1 root root 1272 2009-01-28 21:58 sshd     -rw-r--r--  1 root root  289 2008-11-12 16:47 cron      `/etc/pam-.d/login`: (comments removed)               auth       optional   pam_faildelay.so  delay=3000000     auth       [success=ok ignore=ignore user_unknown=ignore default=die]  pam_securetty.so     auth       requisite  pam_nologin.so     session    required   pam_selinux.so close     session       required   pam_env.so readenv=1     session       required   pam_env.so readenv=1 envfile=/etc/default/locale          @include common-auth          auth       optional   pam_group.so     session    required   pam_limits.so     session    optional   pam_lastlog.so     session    optional   pam_motd.so     session    optional   pam_mail.so standard          @include common-account     @include common-session     @include common-password          session required pam_selinux.so open      `/etc/pam.d/common-account`:               account[success=1 new_authtok_reqd=done default=ignore]pam_unix.so      accountrequisitepam_deny.so     accountrequiredpam_permit.so      `/etc/pam.d/common-account`: common-auth               auth[success=1 default=ignore]pam_unix.so nullok_secure     authrequisitepam_deny.so     authrequiredpam_permit.so     authoptionalpam_smbpass.so migrate      `/etc/pam.d/common-auth session`: session               session[default=1]pam_permit.so     sessionrequisitepam_deny.so     sessionrequiredpam_permit.so     sessionrequiredpam_unix.so      sessionoptionalpam_ck_connector.so nox11      `auth.log`: (15:36 is problably when I tryed to ssh to the vm, and I got the fault and did a reboot.)               Jun 30 14:17:01 us CRON[1435]: pam_unix(cron:session): session opened for user root by (uid=0)     Jun 30 14:17:01 us CRON[1435]: pam_unix(cron:session): session closed for user root     Jun 30 14:20:01 us CRON[1458]: pam_unix(cron:session): session opened for user root by (uid=0)     Jun 30 14:20:01 us CRON[1458]: pam_unix(cron:session): session closed for user root     Jul  4 15:36:35 us sshd[1945]: Server listening on 0.0.0.0 port 22.     Jul  4 15:36:35 us sshd[1945]: Server listening on :: port 22.     Jul  4 15:36:37 us sshd[1945]: Received signal 15; terminating.     Jul  4 15:36:37 us sshd[2052]: Server listening on 0.0.0.0 port 22.     Jul  4 15:36:37 us sshd[2052]: Server listening on :: port 22.     Jul  4 15:39:01 us CRON[2478]: pam_unix(cron:session): session opened for user root by (uid=0)     Jul  4 15:39:01 us CRON[2478]: pam_unix(cron:session): session closed for user root     Jul  4 15:40:02 us CRON[2565]: pam_unix(cron:session): session opened for user root by (uid=0)     Jul  4 15:40:08 us CRON[2565]: pam_unix(cron:session): session closed for user root     Jul  4 15:42:29 us login[2451]: pam_unix(login:session): session opened for user glennwiz by LOGIN(uid=0)     Jul  4 15:50:01 us CRON[2677]: pam_unix(cron:session): session opened for user root by (uid=0)     Jul  4 15:50:02 us CRON[2677]: pam_unix(cron:session): session closed for user root     Jul  4 16:00:01 us CRON[2754]: pam_unix(cron:session): session opened for user root by (uid=0)     Jul  4 16:00:01 us CRON[2756]: pam_unix(cron:session): session opened for user root by (uid=0)     Jul  4 16:00:02 us CRON[2756]: pam_unix(cron:session): session closed for user root     Jul  4 16:00:02 us CRON[2754]: pam_unix(cron:session): session closed for user root     Jul  4 16:03:37 us sshd[2799]: Accepted password for glennwiz from 148.140.26.150 port 51330 ssh2     Jul  4 16:03:37 us sshd[2799]: pam_unix(sshd:session): session opened for user glennwiz by (uid=0)


Emacs temp dot hash file don't exist

I use `find | xargs grep` a lot when working on large source code and when I didn't save a file in Emacs it creates `.#SomeFile` and grep give error that there's not such file (I'm not including because it's localized) The same when I run:               ls -A dir/ | grep '^\.#' | xargs file      I've got:               .#SomeFile: ERROR: cannot open `.#SomeFile' (No such file or directory)      Why is that?


Weird control-d behavior

I can use `cat` as a very simple text editor by doing `cat > foo.txt`.   If I then type:               bar     baz      and then press `ctrl`+`D`, it now looks like this:               $ cat > foo.txt     bar     baz^D      with the cursor at the `^`. If I then press it once more the file will get saved. However if I press anything (okay maybe not anything, but mostly anything) else, I just continue to edit the file. Is this normal behavior?


Automatically rename files when they are placed in a specific directory

Is it possible to automatically rename a file when it's placed in a specific directory? For example I have a directory named "dir0".I move or copy a file named "file1" to "dir0".then "file1" should rename to "file1_{current timestamp}"


How to create a permanent alias without resourcing the .bashrc-like file?

I really like bash aliases, it annoys me that every time I want to add a new alias I have type two commands:               echo "alias \"short-cmd\"='long-command'" >> ~/.bash_aliases     source ~/.bash_aliases      Any way I can create an alias permanently with a single command?


How to set CST timezone w/o daylight period?

I want to configure linux box to use CST w/o daylight. My first idea was using the `UTC-06` zone file, but for some weird reason it provides UTC+6, not UTC-6 time! After that I read the List of tz database timezones article on Wikipedia, and copied the `America/Costa_Rica` zonefile to `/etc/localtime`. Now the timezone seems OK, but what if sometime Costa Rika goverment will decide to to to daylight? What is the correct way to set UTC-6 for Linux?


What commands in virsh corresponds to "Force Off" button in virt-manager?

I'm trying to find the corresponding command to the buttons in virt-manager, I read about `virsh help domain` and I found start, shutdown and reset etc. But the one for `Force Off` is missing. Anyone know what that is?


How to choose which bittorrent client is called when clicking downloaded torrent file in chromium?

When I was using squeeze, Qbittorrent was the only bittorrent client installed (I think). Once I had downloaded a torrent file using Chromium it would download to a bar at the bottom of the window, and on clicking it would bring up Qbittorrent. Now I am using wheezy. I have other bittorrent clients installed, including Transmission and Deluge. Now, when I click a torrent file at the bottom of the Chromium window, it brings up Transmission. How can I configure Chromium to bring up whatever bittorrent client I wish? I assume Debian has some internal preference system for which bittorrent client is chosen, but I have not found any documentation about this. NOTE: The question Set Transmission as default program when opening magnet links is very similar.


heuristically find how different a set of files are

I am having a large number of output files produced by repeated runs of a test suite and would like to see, approximately, how different they are. Ideally they should all be identical (indicating a fully reproducible test) or nearly identical (e.g. if timestamps are present). So I am looking for a script like:               show-greatest-diff /path/to/files/*.out      So, if 100 *.out files are present the script should `diff` them all against each other and perhaps produce the maximum number of lines / characters that any pair amongst them differ (and maybe identify the most different pair) or just print the `diff` output of the pair that differs the most or produce some other heuristically helpful output. The solution suggested here is not appropriate for my use case due to the large number of files.


What are the implications of setting LC_ALL on Solaris

To support an application we just installed, I've been asked to add this command to the `/etc/profile` file on our Solaris 10 UNIX server:               LC_ALL=en_US.UTF-8; export LC_ALL      The effect of this changes the "locale" on the server, which is currently not defined (defaulting to "C"). My question: is there any reason I should not make this change? As an alternative, I can imagine writing a script that exports that variable, runs the application and then "unsets" it again. I don't mind doing that but I really don't know very much about the impact of making a change like this. I also understand that the same change can be made to the `/etc/default/init` file. Would that be a better solution?


Hibernate not working in Linux Mint 14 KDE after nvidia driver update

I've had some problems with the X server ramping up CPU usage, so I wanted to check if it goes away to a new Nvidia driver. I was at 304.xx and jumped to 319.49. Now, every time I try to hibernate, I just get thrown back to the login screen (identical to a X restart). After examining `/var/log/pm-suspend.log` from today and the days before i've noticed that the the **before** logs ended with something like:               Running hook /usr/lib/pm-utils/sleep.d/99video hibernate hibernate:     /usr/lib/pm-utils/sleep.d/99video hibernate hibernate: success.     Running hook /etc/pm/sleep.d/novatel_3g_suspend hibernate hibernate:     /etc/pm/sleep.d/novatel_3g_suspend hibernate hibernate: success.     Mon Aug 26 23:56:43 CEST 2013: performing hibernate      And the new ones end with just the first line of that:               Running hook /usr/lib/pm-utils/sleep.d/99video hibernate hibernate:      Things to keep in mind:   * Before I could get things going I had to cleanup on old versions of the driver because it complained of incopatibilities between these driver and kernel modules. I did a `apt-get remove --purge nvidia*' and then blacklisted nouveau in grub.   * I tried `sudo apt-get update;sudo apt-get upgrade` and there is nothing new. Any ideas?


How to boot Linux Mint Debian with nomodeset?

On almost all the distros that I use I have to use `nomodeset`, but there's something I don't understand about Linux Mint Debian Cinnamon 64 bit. I edit boot menu, to look like so `...nosplash nomodeset...` it doesn't work. I edit it to look like so `quite splash nomodeset` doesn't work. I tried to boot without editing anything, doesn't work My Xubuntu grub file. Note that Xubuntu and Manjaro are probably the only two distros that boot on my PC without `nomodeset` option, so it's not the same as Linux Mint


Parsing complex text file using Unix commands

I have the following text structure which I would like to parse:               >Cluster 423     0   56aa, >HWI-ST1448:257:C3V2HACXX:1:1106:19087:2550.1... at 92.86%     1   64aa, >HWI-ST1448:257:C3V2HACXX:1:1106:15943:81371.1... *     2   41aa, >HWI-ST1448:257:C3V2HACXX:1:1106:12438:91360.3... at 90.24%     3   45aa, >HWI-ST1448:257:C3V2HACXX:1:1108:13046:13861.1... at 91.11%     4   52aa, >HWI-ST1448:257:C3V2HACXX:1:1110:12260:2424.2... at 90.38%     >Cluster 434     0   64aa, >HWI-ST1448:257:C3V2HACXX:1:1106:15723:89894.1... *     1   46aa, >HWI-ST1448:257:C3V2HACXX:2:1312:1967:40935.2... at 97.83%      Basically, the identifier is marked with a `*` at the end and the group size is the last group number +1. The output I want to produce would be (please note the group size at the end):               HWI-ST1448:257:C3V2HACXX:1:1106:15943:81371.1      5     HWI-ST1448:257:C3V2HACXX:1:1106:15723:89894.1      2      Any ideas?


What Causes Mutt To Fail In This Way

When sending an email, the authentication and uploading stages exit successfully. After a long period with the message `Connecting to gmail.com`, the error message `Could not connect to gmail.com (No route to host).` occurs and the email is not sent. What causes this error and how might I fix it? I do have my `smtp_url` set to port `587` of my stmp account URI.


Unable to generate ssh public key when installing Redmine

I am trying to set up a Redmine on my server, and I am following THIS setup guide. I have used this guide before on my VPS and it worked perfectly however on this server I get following error when I try to generate public key.               aristotle:~# sudo su - redmine     No directory, logging in with HOME=/     redmine@aristotle:/$ ssh-keygen -t rsa -N '' -f ~/.ssh/gitolite_admin_id_rsa     Generating public/private rsa key pair.     open //.ssh/gitolite_admin_id_rsa failed: No such file or directory.     Saving the key failed: //.ssh/gitolite_admin_id_rsa.     redmine@aristotle:/$


how many password generators are there in debian and how to know which are good

I know of two password generators in Debian. The first one which I have used is apg and it seems to generate some good passwords.               $ apg -m 15 -M SNCL     RefGav:quedTut7     {Shtetmigdybig1     vojkewth3OdTuv<     2quacyodoobEst+     pedBoyggyu2guv/     suj?Quonvewv7Om      I also tried pwgen similarly               $ pwgen -1csy 15     q#n?PPWEWp8+])'      OR               $ pwgen -1sy 15     rE'AmK8=n;s9Bv3      Now I have two questions instead of one, are there any shell/command-line based password generators known either in Debian or in the more wider GNU/Linux world (perhaps not packaged.)? The other query is has there been any sort of comparisons made on the two password generators either on basis of their algorithm or the password- generating speed or something else entirely? Looking forward to know.


Get KERN_DEBUG messages into syslog on rhel7/centos7?

I've been trying to get KERN_DEBUG messages logged to a file in centos7, but have had no luck. I can get them just fine from "dmesg," but not /var/log/messages or /var/log/dmesg Here's a MWE kernel module that I can use to test:               #include <linux/module.h>     #include <linux/kernel.h>          int init_module(void) {         printk(KERN_DEBUG "Hello world!\n");         return 0;     }          void cleanup_module(void) {     }      And corresponding Makefile:               obj-m += hello.o     all:         make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules     clean:         make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean      I tried adding another log file by modifying the rsyslog configuration:               [root@centos7 ]# cat /etc/rsyslog.d/kern.conf      kern.*      /var/log/kern.log      But even after restarting rsyslogd, it wouldn't populate. I have SELinux set to enforcing, so just for kicks I touched that file and copied the context from /var/log/messages:               [root@centos7 mwe]# ls -lZ /var/log/kern.log      -rw-r--r--. root root system_u:object_r:var_log_t:s0   /var/log/kern.log      Of course I never had any SELinux errors, that's just more of a knee-jerk reaction from running in enforcing Has anyone configured this successfully?


Prompt when copying multiple files?

When copying multiple files from one directory to another is there a way to get bash to run through each file and ask for y/n? I vaguely remember adding something to the end of my command like 'ok?' to make it do this, but I can't find it anywhere!


bash: /etc/bash.bashrc: Permission denied whenever I open a terminal

On Ubuntu 13.10, when I open a new terminal, I sometimes get the following output on the terminal:               bash: /etc/bash.bashrc: Permission denied      However, the permissions should be fine:               >ls -l /etc/bash.bashrc     -rwxr-xr-x 1 root root 2177 Mär 30  2013 /etc/bash.bashrc*      What is the problem? How can I fix it? What is the purpose of the file `/etc/bash.bashrc` and where exactly does it gets called? Content of this file:               # System-wide .bashrc file for interactive bash(1) shells.          # To enable the settings / commands in this file for login shells as well,     # this file has to be sourced in /etc/profile.          # If not running interactively, don't do anything     [ -z "$PS1" ] && return          # check the window size after each command and, if necessary,     # update the values of LINES and COLUMNS.     shopt -s checkwinsize          # set variable identifying the chroot you work in (used in the prompt below)     if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then         debian_chroot=$(cat /etc/debian_chroot)     fi          # set a fancy prompt (non-color, overwrite the one in /etc/profile)     PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '          # Commented out, don't overwrite xterm -T "title" -n "icontitle" by default.     # If this is an xterm set the title to user@host:dir     #case "$TERM" in     #xterm*|rxvt*)     #    PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'     #    ;;     #*)     #    ;;     #esac          # enable bash completion in interactive shells     #if ! shopt -oq posix; then     #  if [ -f /usr/share/bash-completion/bash_completion ]; then     #    . /usr/share/bash-completion/bash_completion     #  elif [ -f /etc/bash_completion ]; then     #    . /etc/bash_completion     #  fi     #fi          # sudo hint     if [ ! -e "$HOME/.sudo_as_admin_successful" ] && [ ! -e "$HOME/.hushlogin" ] ; then         case " $(groups) " in *\ admin\ *)         if [ -x /usr/bin/sudo ]; then         cat <<-EOF         To run a command as administrator (user "root"), use "sudo <command>".         See "man sudo_root" for details.              EOF         fi         esac     fi          # if the command-not-found package is installed, use it     if [ -x /usr/lib/command-not-found -o -x /usr/share/command-not-found/command-not-found ]; then         function command_not_found_handle {                 # check because c-n-f could've been removed in the meantime                     if [ -x /usr/lib/command-not-found ]; then                /usr/lib/command-not-found -- "$1"                        return $?                     elif [ -x /usr/share/command-not-found/command-not-found ]; then                /usr/share/command-not-found/command-not-found -- "$1"                        return $?             else                printf "%s: command not found\n" "$1" >&2                return 127             fi         }     fi


scp between two servers with different pem files

I'm following the answer on How to scp from server to server with different public keys? but I'm getting a connection error:               # start the agent and capture its environment in the current shell     eval `ssh-agent`          # add keys needed to connect to the different accounts     ssh-add /path/to/first/ssh/key     ssh-add /path/to/second/ssh/key          # do the copying          $ scp -r user@server1:/images user@server2:/images     ssh: connect to host server2 port 22: Connection timed out     lost connection      It works if I use my machine as an explicit intermediary:               $ scp -r user@server1:/images /images     $ scp -r /images user@server2:/images      Any clues on why it's failing to do the copy in one step?


Global IP on DomU in XEN, using Ubuntu

Can a DomU have a global IP in Xen? I see that DomU's are connected to Dom0 and then physical ethernet using xenbridges, so is it technically possible in Xen to assign global IPs to DomU so it can be pinged/accessed by the outside world? Is there any config changes in Xen that I need to do? Can `network-route` be of some help if used in place of `network-bridge`?


Getting the line count and storing in a result set

Need to calculate the number of lines in a file and store it in a resultset. I'm sure Im wrong in this line -num_of_lines=wc -l "$file" but how can I get the executed result set?               for file in *.csv     do       num_of_lines=wc -l "$file"       split -n 5 -d -a 2  "$file" "$file"     done


Software for image files analysis

I'd like to ask if there is some program to analyze files, especially image files, for linux, with functionality similar to hex editors, which will show what bytes changed after I paint some area of the image and etc.


Change some ASP code to PHP code in all files

I'm migrating a directory of files containing fairly simple ASP code over to a PHP server and I need to modify the contents of all the files with a find and replace mechanism. I'm not great with regular expressions, but I've used this to change a few things already:               find . -name "*.php" -print0 | xargs -0 -n 1 sed -i -e 's/oldstring/newstring/g'      I have some complex strings I need to replace though. See the following: FROM:               <% if request("page") = "" then %>      TO:               <?php if(!isset($_GET['page']) || !$_GET['page']){ ?>      This one, the * can be any number, then keep that number where the * is on the "TO". FROM:               <% elseif request("page") = "*" then %>      TO:               <?php } elseif($_GET['page'] == '*'){ ?>      And the last one is pretty simple. FROM:               <% end if %>      TO:               <?php } ?>      If I can run this in bulk, recursively in a directory, this will fix 98% of all the ASP code in these files. I've tried to escape these strings in several ways, but cannot figure out how to get it to run. Any help is appreciated!


Is there a way in vim to know I am in the left most split?

I want to detect whether or not I am in the right most (or left, top, bottommost) split. In other words, when `ctrl-w h` would do nothing. Is there a way to do that?


H.264 support in Firefox (Iceweasel) 24

I am using `Firefox (Iceweasel) 24` in `Debian Wheezy`. When I go to https://www.youtube.com/html5 it shows me that my browser does not support `H.264` When I go to the same URL with `Chrome`, it shows `H.264` is supported After googling, I found few debian bug reports about this. Seems that `H.264` is disabled deliberately. Indeed when I go to `about:buildconfig` in Firefox, I see it has been compiled with `--disable-gstreamer` I am confused why this is disabled. Is this a technical reason, or a "license/free software" issue Is there any simple way to enable `H.264` in my browser (short of recompiling my own iceweasel package) ? Can somebody please explain the situation and why it arose ? # EDIT: I have all necessary packages installed:               gstreamer0.10-ffmpeg     libx264-123     libavutil51     libavformat53     libavcodec53     gstreamer0.10-plugins-good     chromium-browser


grep: Find all lines that contain Japanese kanjis

In a huge UTF-8 text file, I want to show all lines that contains Japanese kanjis.   What `grep` (or other) expression does this? If I am not mistaken, kanjis are the characters between `\u4e00` and `\u4dbf`. I don't need to show kanas, but showing them too would not be a big problem.


Possible to download these webpages as a book?

I would like to download a SQL tutorial here http://www.w3schools.com/sql/default.asp, as a book with all linked SQL related sections. Here is my command               wget -r -np -nH  -p -k  http://www.w3schools.com/sql/default.asp      Under the downloaded `sql` directory, I get some asp files, which I don't know how to open in Chrome. Did I download the webpages correctly? How shall I do? Thanks!


kill xterm process in a bash

I would like to kill the xterm process I started this way in a script:               #!/bin/bash          echo "#!/bin/bash" > /tmp/test0     grep file | awk '{print "xterm -hold -e echo",$1,"sleep 10" && pid=$!}' >> /tmp/test0     echo "exit" >> /tmp/test0     chmod 700 /tmp/test0     bash /tmp/test0&     sleep 5     kill $pid  ---> does not work     exit      now let's say, I have got several xterm launched this way in the same bash (test0), is there a way to store their corresponding pid in an array and call them back when it's time to kill them? Furthermore, when storing these values, is there a way to associate them with another value (in this example with $1) to make it easier to call back. nb: $1 = text thank you very much !


redirect and log script output

I am trying to tidy up the following snippets, design goals are to log all output from a script, and should not be a wrapper. Less lines are better. I don't care about user inputs (at this stage), target scripts are run non- interactively. The snippet needs to   * output stdout to log, and always echo to console   * output stderr to log, and echo to console iff debugging is enabled   * stderr messages should be prefixed with time stamps and other usefulness At the moment I have the following which only tests out under recent versions of bash (4.2+?) like in Ubuntu precise, but misbehaves on CentOS6.               DEBUG_LOG="${0##*/}.log"          # copy stdout to log always and echo to console     exec >  >(tee -a ${DEBUG_LOG})                     # copy stderr to log only, unless debugging is enabled     [ $DEBUG_TEST = "true" ] \       && exec 2> >(tee -a ${DEBUG_LOG} >&2) \       || exec 2>> ${DEBUG_LOG}      Then this...               # Expand escaped characters, wrap at 70 chars on spaces,      # and indent wrapped lines     msg_log() {        echo -e "$(date +%T) ${0##*/}: $1" \         | fold -w70 -s | sed '2~1s/^/  /' >&2;      }     msg_con() {        if [ "${DEBUG_TEST}" = "true" ]; then          msg_log "$1"       else         echo -e "$1" | fold -w70 -s | sed '2~1s/^/  /';        fi     }      Instead of `echo` I can call one of those msg procedures, e.g., `msg_con "hello world"`.   Also script output will then go to stderr by setting as an environment variable at call time, e.g., `DEBUG_TEST=true myscript`. I have read that exec may not work in some shells such as busybox. There is a mkfifo and fork combination at http://stackoverflow.com/a/5200754 that does something similar but I'd rather not use fork unless absolutely needful. Prefer bash examples please, but something that works under sh or is more portable would be nice. Any ideas?


Equivalent command line call for airplane mode

Can someone suggest how to turn on airplane mode from command line instead of using the GUI? Also can someone list what all are turned off by enabling airplane mode or how to turn off all radios including bluetooth and wifi? Is there a difference between hardware shutdown and device driver shutdown?


How far can you go with rm -rf / as root

If you are root, and you issue               rm -rf /       Then how far can the command go? Can you recover data from this kind of an action? Even after the binaries are gone, would the running processes still be active? What would it take to make the same physical machine boot again? What files would you need to restore to make this happen? I could try this on a VM and see, but I want to know the rationale behind what to expect if I do this.


How to "mute" ls command?

Suppose I do a recursive `ls`               $ ls -R       on the root directory. I get a lot of messages like these -               ls: cannot open directory ./var/lib/sendmail: Permission denied     ls: cannot open directory ./var/lib/sudo: Permission denied     ...      Is there a way to avoid displaying the above "`cannot open directory`" messages?


harddisk not recognized / filesystem too large to mount safely on this system / hdparm shows garbage

I have a 4 TB Verbatim external hard disk with ext4. It can be successfully mounted at my Raspberry Pi. I am trying to plug it at my WD Mybook Live Duo device where I have SSH root access. When I plug in the device, I get following `dmesg` messages:               usb 1-1: new high speed USB device using dwc_otg and address 2     usb 1-1: New USB device found, idVendor=18a5, idProduct=0400     usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3     usb 1-1: Product: USB 3.0 Desktop HD     usb 1-1: Manufacturer: Verbatim     usb 1-1: SerialNumber: 306239230569     usb 1-1: configuration #1 chosen from 1 choice     usbcore: registered new interface driver libusual     Initializing USB Mass Storage driver...     scsi2 : SCSI emulation for USB Mass Storage devices     usbcore: registered new interface driver usb-storage     USB Mass Storage support registered.     usb-storage: device found at 2     usb-storage: waiting for device to settle before scanning     scsi 2:0:0:0: Direct-Access     ST4000DM 000-1F2168       CC52 PQ: 0 ANSI: 6     sd 2:0:0:0: Attached scsi generic sg2 type 0     sd 2:0:0:0: [sdc] Very big device. Trying to use READ CAPACITY(16).     usb-storage: device scan complete     sd 2:0:0:0: [sdc] 7814037168 512-byte logical blocks: (4.00 TB/3.63 TiB)     sd 2:0:0:0: [sdc] Write Protect is off     sd 2:0:0:0: [sdc] Mode Sense: 1f 00 00 08     sd 2:0:0:0: [sdc] Assuming drive cache: write through     sd 2:0:0:0: [sdc] Very big device. Trying to use READ CAPACITY(16).     sd 2:0:0:0: [sdc] Assuming drive cache: write through      sdc: sdc1     sd 2:0:0:0: [sdc] Very big device. Trying to use READ CAPACITY(16).     sd 2:0:0:0: [sdc] Assuming drive cache: write through     sd 2:0:0:0: [sdc] Attached SCSI disk      The size of 4 TB seems to be recognized correctly. Note that the message `Very big device. Trying to use READ CAPACITY(16).` does not seem to be an error, since it happens at my Raspberry too, but there everything works fine. The devices `/dev/sdc` and `/dev/sdc1` appear. So, at least it recognizes the partition table, I guess. (I cannot run `fdisk -l` since it is not installed at the device and I don't want to mess around too much on that device) When I run `mount /dev/sdc1 ./mymountpoint/` I get following error in `dmesg`: `EXT4-fs (sdc1): filesystem too large to mount safely on this system` `hdparm -I /dev/sdc` shows absolute garbage:               NAS:/DataVolume# hdparm -I /dev/sdc          /dev/sdc:     SG_IO: bad/missing sense data, sb[]:  70 00 05 00 00 00 00 0a 00 00 00 00 24 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00          ATA device, with removable media             Serial Number:      abhs¦UU             Media Serial Num:   ¦U¦¦yYT¦UU                  Media Manufacturer:  H                  Transport:          Parallel, ATA8-APT     Standards:             Used: unknown (minor revision code 0x5555)             Supported: 9 7 6 5             Likely used: 9     Configuration:             Logical         max     current             cylinders       21845   0             heads           4352    0             sectors/track   61711   0             --             Logical  Sector size:                   512 bytes             Physical Sector size:                  4096 bytes             Logical Sector-0 offset:            2796032 bytes             device size with M = 1024*1024:  2864663189 MBytes             device size with M = 1000*1000:  3003817068 MBytes (3003817 GB)             cache/buffer size  = unknown             Nominal Media Rotation Rate: 11884     Capabilities:             IORDY(may be)(can be disabled)             Standby timer values: spec'd by Vendor             R/W multiple sector transfer: Max = 0   Current = ?             Recommended acoustic management value: 18, current value: 0             DMA: sdma15             PIO: unknown                *    READ BUFFER DMA command                *    Long physical sector diagnostics                *    CFast specification support     Security:             Master password revision code = 112                     supported                     enabled                     locked             not     frozen                     expired: security count                     supported: enhanced erase             Security level high     Logical Unit WWN Device Identifier: 776f000000000013             NAA             : 7             IEEE OUI        : 76f000             Unique ID       : 000000013     Integrity word not set (found 0x1400, expected 0xbaa5)      `NAS:/DataVolume# lsusb` shows:               Bus 001 Device 003: ID 18a5:0400 Verbatim, Ltd     Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub      What can I do to have the hard disk running at this system? (I want to use it to create backups with `rsync` since my network is really slow) Linux at the Raspberry:               uname --all     Linux raspberrypi 3.12.22+ #691 PREEMPT Wed Jun 18 18:29:58 BST 2014 armv6l GNU/Linux      Linux at the NAS:               uname --all     Linux NAS 2.6.32.11-svn70860 #1 Thu May 17 13:32:51 PDT 2012 ppc GNU/Linux      * * * **UPDATE** Here are the correct `hdparm` which I get from a Raspberry Pi or a Ubuntu Live CD:               desinfect@desinfect:/dev$ sudo hdparm -I /dev/sdb          /dev/sdb:          ATA device, with non-removable media         Model Number:       ST4000DM000-1F2168                               Serial Number:      Z300ZT7T         Firmware Revision:  CC52             Transport:          Serial, SATA 1.0a, SATA II Extensions, SATA Rev 2.5, SATA Rev 2.6, SATA Rev 3.0     Standards:         Used: unknown (minor revision code 0x0029)          Supported: 8 7 6 5          Likely used: 8     Configuration:         Logical     max current         cylinders   16383   16383         heads       16  16         sectors/track   63  63         --         CHS current addressable sectors:   16514064         LBA    user addressable sectors:  268435455         LBA48  user addressable sectors: 7814037168         Logical  Sector size:                   512 bytes         Physical Sector size:                  4096 bytes         Logical Sector-0 offset:                  0 bytes         device size with M = 1024*1024:     3815447 MBytes         device size with M = 1000*1000:     4000787 MBytes (4000 GB)         cache/buffer size  = unknown         Form Factor: 3.5 inch         Nominal Media Rotation Rate: 5900     Capabilities:         LBA, IORDY(can be disabled)         Queue depth: 32         Standby timer values: spec'd by Standard, no device specific minimum         R/W multiple sector transfer: Max = 16  Current = ?         Advanced power management level: 128         Recommended acoustic management value: 208, current value: 0         DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 udma5 *udma6               Cycle time: min=120ns recommended=120ns         PIO: pio0 pio1 pio2 pio3 pio4               Cycle time: no flow control=120ns  IORDY flow control=120ns     Commands/features:         Enabled Supported:            *    SMART feature set                 Security Mode feature set            *    Power Management feature set            *    Write cache            *    Look-ahead            *    Host Protected Area feature set            *    WRITE_BUFFER command            *    READ_BUFFER command            *    DOWNLOAD_MICROCODE            *    Advanced Power Management feature set                 Power-Up In Standby feature set            *    SET_FEATURES required to spinup after power up                 SET_MAX security extension            *    48-bit Address feature set            *    Device Configuration Overlay feature set            *    Mandatory FLUSH_CACHE            *    FLUSH_CACHE_EXT            *    SMART error logging            *    SMART self-test            *    General Purpose Logging feature set            *    WRITE_{DMA|MULTIPLE}_FUA_EXT            *    64-bit World wide name                 Write-Read-Verify feature set            *    WRITE_UNCORRECTABLE_EXT command            *    {READ,WRITE}_DMA_EXT_GPL commands            *    Segmented DOWNLOAD_MICROCODE            *    Gen1 signaling speed (1.5Gb/s)            *    Gen2 signaling speed (3.0Gb/s)            *    Gen3 signaling speed (6.0Gb/s)            *    Native Command Queueing (NCQ)            *    Phy event counters            *    unknown 76[15]                 DMA Setup Auto-Activate optimization                 Device-initiated interface power management            *    Software settings preservation            *    SMART Command Transport (SCT) feature set            *    SCT LBA Segment Access (AC2)                 unknown 206[7]                 unknown 206[12] (vendor specific)     Security:          Master password revision code = 65534             supported         not enabled         not locked         not frozen         not expired: security count             supported: enhanced erase         508min for SECURITY ERASE UNIT. 508min for ENHANCED SECURITY ERASE UNIT.     Logical Unit WWN Device Identifier: 5000c500651cc162         NAA     : 5         IEEE OUI    : 000c50         Unique ID   : 0651cc162     Checksum: correct               desinfect@desinfect:/dev$ sudo fdisk -l /dev/sdb          Warnung: GPT (GUID-Partitionstabelle) auf '/dev/sdb' erkannt! Das Hilfsprogramm Fdisk unterstützt GPT nicht. Verwenden Sie GNU Parted.               Disk /dev/sdb: 4000.8 GB, 4000787030016 bytes     255 Köpfe, 63 Sektoren/Spur, 486401 Zylinder, zusammen 7814037168 Sektoren     Einheiten = Sektoren von 1 × 512 = 512 Bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Festplattenidentifikation: 0x7453181c             Gerät  boot.     Anfang        Ende     Blöcke   Id  System     /dev/sdb1               1  4294967295  2147483647+  ee  GPT      The hard disk has GPT. gparted shows a 4 MB unpartitioned area and the rest of 3.6 TB are used for an ext4 partition. `parted` does show it as:               $ parted --list          Modell: ST4000DM 000-1F2168 (scsi)     Festplatte  /dev/sdb:  4001GB     Sektorgröße (logisch/physisch): 512B/512B     Partitionstabelle: gpt          Nummer  Anfang  Ende    Größe   Dateisystem  Name   Flags      1      4194kB  4001GB  4001GB  ext4         linux      The NAS does use 2x 4 TB hard disks which are mirrored using mdraid . I wonder why the NAS has no problem using them...


How do I stop thunar trying auto-mount a partition

When I plug in **SIPOD** , _my pet ipod_ , thunar tries to auto-mount **two** partitions instead of **one**. This annoying pop-up is starting to kill me: ![alt text](http://i.stack.imgur.com/yKf4N.png) This is what `/dev/sde` looks like:               $ sudo file -s /dev/sde*     /dev/sde:  x86 boot sector, code offset 0x58, OEM-ID "MSDOS5.0", Bytes/sector 2048, sectors/cluster 8, reserved sectors 512, Media descriptor 0xf8, heads 255, sectors 39075371 (volumes > 32 MB) , FAT (32 bit), sectors/FAT 0, infoSector 0, Backup boot sector 0, reserved3 0x50000, physical drive 0x5, serial number 0xa88b3652, label: "       iPod"     /dev/sde1: data     /dev/sde2: x86 boot sector, code offset 0x3c, OEM-ID "*UOKJIHC" cached by Windows 9M, Bytes/sector 2048, sectors/cluster 8, Media descriptor 0xf8, heads 255, hidden sectors 64260, sectors 39011108 (volumes > 32 MB) , FAT (32 bit), sectors/FAT 9522, reserved3 0x1000000, reserved 0x1, serial number 0x58dd9832, label: "SIPOD      "      Is there a way to tell thunar to completely ignore `/dev/sde1`?


mutt responsive way to refresh inbox

Using `mutt` with Gmail I "check for e-mail updates" sometimes through the `$` binding (sync-mailbox), sometimes just by using `c` (change folder) and just supplying `=` (defaults to MAILBOX) as the IMAP folder path to change to. Is there a better (in particular: faster) way of doing the same? A solution would be something that is more direct than "pretending to switch folders", as I do, for example. Also something that does not "miss" some updates, as `$` seems to do at times (perhaps `$` is not meant to check for e-mails at all but just to expunge messages marked as deleted, etc?)


Reseting USB for scanner

This is a question on:superuser, since one reply suggested I ask here... My distro does not yet have a backend for my scanner, but the last release of SANE does. So I downloaded the source and installed. Scanning goes fairly well except that for some reason at the end of a scan I get an error message: "reset high speed USB device using ehci_hcd and address xx" After that I can't scan anything until I unplug and replug the ( USB ) scanner. Since I expect my distro to pick up the latest sane version within a few months, for now all I would like to do is reset the scanner so it can do the next page. Any suggestions on how to do this? PS: The kernel version is: 2.6.31-22


Unitary testing: emulating hardware connection or disconnection

I'm writing a program using libudev. And I want to write some tests. But, one of the functionalities of the program has to do with an usb drive being connected or disconnected. I've read plenty of documentation about `qemu` and its many many applications. But I'm still without find the way for correctly write unitary tests that have to do with connection or disconnection of hardware to the pc. Which the best (or easiest) way of accomplish this?


Delay in playing(recording?) real time raw audio. [OpenWrt, Debian]

I'm developing OpenWrt device which sends audio data to network but I have issues in the early beginning. I'm trying to find which cause delay in playing (or maybe recording, but more probably playing) real time record from microphone. For example I run `arecord | aplay` on my Debian machine and the delay in playing is somewhere between **500-1000 ms.** When I run the same command on my OpenWrt box (TP LINK wr703n) I get almost the same delay (Same to `cat /dev/dsp > /dev/dsp`) When I stream sound using netcat(with UDP) from OpenWrt box to Debian PC (on LAN) I get almost the same delay. I think It does not depend on sound card - on OpenWrt I use usb sound card connected via hub and on Debian machine I use integrated notebook sound card. > _Which could cause this delay? Or do you know possible solutions?_ Thank you and sorry my english :)


Assigning a value with echo piped together with the bc command and using a variable as an argument

Basically i'd like to assign to variable $finalbyte a value (which consists of a binary representation of a byte e.g 11100000). So trying to do that i put the following as part of some script:               field4=224     ##224 for example, it could be any number.                    ##Depends on the script          finalbyte=$(echo 'obase=2; ibase=10; ${field4}' | bc)   ##<-------error here      I get the following error which is kinda like obvious to interpret but my problem is that i don't know or imagine the way that $field4 could nestle down there in between the other arguments . The error is:               (standard_in) 1: illegal character: $


Need to trim the names of file names

![enter image description here](http://i.stack.imgur.com/2K4Ys.jpg)I have files in UNIX directory which have a unique number starting with, i have to remove the unique id followed by '-' from the file name and need to have regular file. Any help is appreciated. Example: 32456113-report.pdf Required File name in the database: report.pdf I have file names of all kind of extensions .pdf, .doc, .xls, .txt but have the same number in the front. I am using winscp to test or view the data and i am running a shell script by registering it as a host concurrent program in oracle apps.


How costly is case insensitive search as compared to case sensitive search?

I dont think grep -i is exponentially (wrt to the number of characters to be grepped) more costly (time wise) than a normal grep because the run times are not too different. But theoretically it should be. For example               egrep -i abc *      is equivalent to               egrep "abc|abC|aBc|aBC|Abc|AbC|ABc|ABC" *      How do utilities like grep avoid the exponential time in case insensitive queries? Is there a case insensitive comparison operator that Unix inherently supports that such utilities can use?


Copying man pages from tmux copy mode

I am in `xterm` on Pangolin, inside a `tmux` session, in `copy mode`. I am trying to copy the text of a `man` page but what I yank into the clipboard by using the simple `vi` bindings of spacebar/enter is text full full of whitespace which I can't just paste into `vim`.   * How can I view a `man` page as "plain text", perhaps even outside of the `man` program?    * Alternatively, how can I use the `tmux` copy mode to properly copy the text as it appears on the screen so that `CTRL+]` pasting it elsewhere will be faithful to the formatting I intended to reproduce? EDIT: I should mention that the command `capture-pane`, followed by `save- buffer`, _works_ to save an _entire_ buffer to a file. I am looking for something less of an overkill: simple copy mode, select and yank, paste somewhere else; for example: inside `vim`.


How can I find the cause of clock drift on a custom embedded system?

We have custom hardware running 3.2 Angstrom on a SAM9G45 processor. Everything works fine. Recently we designed similar hardware that uses the SAM9G25 processor. We found the 2.6 kernel works fine on the SAM9G25, but we needed to port the 3.2 kernel to the platform to take advatage of some wireless drivers. We completed the port, but we have just discovered the time of day clock is not reliable. It runs fine for about 20 minutes - then the time (reported by "date") will jump ahead a few hours or days. The 2.6 kernel still works fine, so we think it's something we did not port correctly. We have looked over everything, but no luck so far. I'm not sure where to look next. **Final Answer** : Atmel supplies a patch for the 2.6 kernel, to the file tcb_clksrc.c. We missed that in our port to the 3.2 kernel. Thanks for the insight!


Why is yum's tab completion slow?

Why is yum's tab completion slow? Is it because it needs to connect to the internet? If yes, how can I disable that?


Change a driver's source code and compile

I have made some little change to `if_igb` in `/usr/src/sys/dev/e1000/if_igb.c`. How can I compile only this file and load it to kernel dynamically? I'm using FreeBSD 8.2 Release.


Enable ACL on ArchLinux

Hi i'm trying to enable ACL on my filesystem. this are the steps   * install acl with `# pacman -S acl`   * edit `/home` entry on `/etc/fstab` * * *               /dev/sdb4    /home       ext4        defaults,acl,noatime        0 2      * * *   * remount partition `# mount -o remount /home` even after reboot the acl is not displayed for the `mount` command               /dev/sda4 on /home type ext4 (rw,noatime,data=ordered)


How to find human-readable information about file types recognized by `file`?

Searching, googling, I could not find any information about file types recognized by `file`. For example, an *.mp4 file is identified as "ISO Media" (while being able to play with VLC normally). This is not 100% clear, it somehow leaves me to wonder whether it's a correct detection or the file is confused for ISO image. (Either because e.g. the sample is somehow corrupted, or, just that the algorithm is not 100% accurate for all types.) My problem is that I need to set up some rules for switching based on file type. I have set created a sample file set, but I cannot collect enough samples of all types which I need to be recognized by my code. And the real set will probably be really huge. It would be enough for me if I could read some comments to use as a reference to those types which are not so obvious. But to my surprise, I could not find any useful information. Most of my searches ended on magic file format specification, which is not really helpful to me. I'm interested in _the_ magic file which is distributed with, say, Debian.


How can I split a text file into multiple text files?

I have a text file called `entry.txt` that contains the following:               [ entry1 ]     1239 1240 1242 1391 1392 1394 1486 1487 1489 1600     1601 1603 1657 1658 1660 2075 2076 2078 2322 2323     2325 2740 2741 2743 3082 3083 3085 3291 3292 3294     3481 3482 3484 3633 3634 3636 3690 3691 3693 3766     3767 3769 4526 4527 4529 4583 4584 4586 4773 4774     4776 5153 5154 5156 5628 5629 5631     [ entry2 ]     1239 1240 1242 1391 1392 1394 1486 1487 1489 1600     1601 1603 1657 1658 1660 2075 2076 2078 2322 2323     2325 2740 2741 2743 3082 3083 3085 3291 3292 3294     3481 3482 3484 3690 3691 3693 3766 3767 3769 4526     4527 4529 4583 4584 4586 4773 4774 4776 5153 5154     5156 5628 5629 5631     [ entry3 ]     1239 1240 1242 1391 1392 1394 1486 1487 1489 1600     1601 1603 1657 1658 1660 2075 2076 2078 2322 2323     2325 2740 2741 2743 3082 3083 3085 3291 3292 3294     3481 3482 3484 3690 3691 3693 3766 3767 3769 4241     4242 4244 4526 4527 4529 4583 4584 4586 4773 4774     4776 5153 5154 5156 5495 5496 5498 5628 5629 5631      I would like to split it into three text files: `entry1.txt`, `entry2.txt`, `entry3.txt`. Their contents are as follows. **entry1.txt** :               [ entry1 ]     1239 1240 1242 1391 1392 1394 1486 1487 1489 1600     1601 1603 1657 1658 1660 2075 2076 2078 2322 2323     2325 2740 2741 2743 3082 3083 3085 3291 3292 3294     3481 3482 3484 3633 3634 3636 3690 3691 3693 3766     3767 3769 4526 4527 4529 4583 4584 4586 4773 4774     4776 5153 5154 5156 5628 5629 5631      **entry2.txt** :               [ entry2 ]     1239 1240 1242 1391 1392 1394 1486 1487 1489 1600     1601 1603 1657 1658 1660 2075 2076 2078 2322 2323     2325 2740 2741 2743 3082 3083 3085 3291 3292 3294     3481 3482 3484 3690 3691 3693 3766 3767 3769 4526     4527 4529 4583 4584 4586 4773 4774 4776 5153 5154     5156 5628 5629 5631      **entry3.txt** :               [ entry3 ]     1239 1240 1242 1391 1392 1394 1486 1487 1489 1600     1601 1603 1657 1658 1660 2075 2076 2078 2322 2323     2325 2740 2741 2743 3082 3083 3085 3291 3292 3294     3481 3482 3484 3690 3691 3693 3766 3767 3769 4241     4242 4244 4526 4527 4529 4583 4584 4586 4773 4774     4776 5153 5154 5156 5495 5496 5498 5628 5629 5631      In other words, the `[` character indicates a new file should begin. The entries (`[ entry*]`, where `*` is an integer) are always in numerical order and are consecutive integers starting from 1 to N (in my actual input file, N = 200001). Is there any way I can accomplish automatic text file splitting in bash? My actual input `entry.txt` actually contains 200,001 entries.


How to escape < or > in a parameter in shell?

I'd like to use `grep` with a PCRE expression that contains the `<` character. Bash thinks I want to redirect, but I don't want to. How can I escape `<`?


Linux Mint 15 Olivia source list

I am facing a problem downloading anything using apt-get tool. I have played with my source list and I think something went wrong. Synaptic also doesn't work. I've searched for the original source list online and I found this:               deb http://packages.linuxmint.com/ olivia main upstream import     deb http://archive.ubuntu.com/ubuntu/ raring main restricted universe multiverse     deb http://archive.ubuntu.com/ubuntu/ raring-updates main restricted universe multiverse     deb http://security.ubuntu.com/ubuntu/ raring-security main restricted universe multiverse     deb http://archive.canonical.com/ubuntu/ raring partner          # deb http://archive.getdeb.net/ubuntu raring-getdeb apps     # deb http://archive.getdeb.net/ubuntu raring-getdeb games      So I have changed my /etc/apt/source.list and typed `sudo apt-get update` This is the output of the update                   Ign http://archive.ubuntu.com raring Release.gpg                                    Ign http://security.ubuntu.com raring-security Release.gpg                          Get:1 http://archive.canonical.com raring Release.gpg [933 B]                       Ign http://archive.ubuntu.com raring-updates Release.gpg                            Ign http://archive.ubuntu.com raring Release                                        Ign http://archive.ubuntu.com raring-updates Release                                Get:2 http://ppa.launchpad.net raring Release.gpg [316 B]                           Ign http://archive.ubuntu.com raring/main amd64 Packages/DiffIndex                  Get:3 http://packages.linuxmint.com olivia Release.gpg [198 B]                      Get:4 http://ppa.launchpad.net raring Release.gpg [316 B]                           Ign http://archive.ubuntu.com raring/restricted amd64 Packages/DiffIndex            Get:5 http://packages.linuxmint.com olivia Release [18.5 kB]                        Ign http://security.ubuntu.com raring-security Release                              Ign http://security.ubuntu.com raring-security/main amd64 Packages/DiffIndex        Ign http://security.ubuntu.com raring-security/restricted amd64 Packages/DiffIndex     Get:6 http://packages.linuxmint.com olivia/main amd64 Packages [23.5 kB]            Ign http://security.ubuntu.com raring-security/universe amd64 Packages/DiffIndex     Hit http://archive.canonical.com raring Release                                     Ign http://archive.canonical.com raring Release                                     Ign http://security.ubuntu.com raring-security/multiverse amd64 Packages/DiffIndex     Ign http://archive.ubuntu.com raring/universe amd64 Packages/DiffIndex              Get:7 http://packages.linuxmint.com olivia/upstream amd64 Packages [9,249 B]        Ign http://archive.canonical.com raring/partner amd64 Packages/DiffIndex            Ign http://security.ubuntu.com raring-security/main i386 Packages/DiffIndex         Ign http://archive.ubuntu.com raring/multiverse amd64 Packages/DiffIndex            Ign http://archive.canonical.com raring/partner i386 Packages/DiffIndex             Ign http://security.ubuntu.com raring-security/restricted i386 Packages/DiffIndex     Ign http://archive.ubuntu.com raring/main i386 Packages/DiffIndex                   Get:8 http://packages.linuxmint.com olivia/import amd64 Packages [39.2 kB]          Hit http://ppa.launchpad.net raring Release                                         Ign http://ppa.launchpad.net raring Release                                         Ign http://security.ubuntu.com raring-security/universe i386 Packages/DiffIndex     Ign http://archive.ubuntu.com raring/restricted i386 Packages/DiffIndex             Hit http://ppa.launchpad.net raring Release                                         Ign http://security.ubuntu.com raring-security/multiverse i386 Packages/DiffIndex     Ign http://ppa.launchpad.net raring Release                                         Ign http://archive.ubuntu.com raring/universe i386 Packages/DiffIndex               Hit http://archive.canonical.com raring/partner amd64 Packages                      Ign http://ppa.launchpad.net raring/main Sources/DiffIndex                          Ign http://archive.ubuntu.com raring/multiverse i386 Packages/DiffIndex             Hit http://archive.canonical.com raring/partner i386 Packages                       Ign http://ppa.launchpad.net raring/main amd64 Packages/DiffIndex                   Get:9 http://packages.linuxmint.com olivia/main i386 Packages [23.5 kB]             Ign http://ppa.launchpad.net raring/main i386 Packages/DiffIndex                    Ign http://ppa.launchpad.net raring/main Sources/DiffIndex                          Get:10 http://packages.linuxmint.com olivia/upstream i386 Packages [9,237 B]        Ign http://ppa.launchpad.net raring/main amd64 Packages/DiffIndex                   Ign http://ppa.launchpad.net raring/main i386 Packages/DiffIndex                    Get:11 http://packages.linuxmint.com olivia/import i386 Packages [40.1 kB]          Ign http://archive.canonical.com raring/partner Translation-en_US                   Ign http://archive.canonical.com raring/partner Translation-en                      Ign http://archive.ubuntu.com raring-updates/main amd64 Packages/DiffIndex          Hit http://ppa.launchpad.net raring/main Sources                                    Ign http://archive.ubuntu.com raring-updates/restricted amd64 Packages/DiffIndex     Hit http://ppa.launchpad.net raring/main amd64 Packages                             Ign http://archive.ubuntu.com raring-updates/universe amd64 Packages/DiffIndex      Hit http://ppa.launchpad.net raring/main i386 Packages                              Ign http://archive.ubuntu.com raring-updates/multiverse amd64 Packages/DiffIndex     Ign http://archive.ubuntu.com raring-updates/main i386 Packages/DiffIndex     Ign http://archive.ubuntu.com raring-updates/restricted i386 Packages/DiffIndex     Ign http://archive.ubuntu.com raring-updates/universe i386 Packages/DiffIndex     Hit http://ppa.launchpad.net raring/main Sources                           Ign http://archive.ubuntu.com raring-updates/multiverse i386 Packages/DiffIndex     Hit http://ppa.launchpad.net raring/main amd64 Packages                    Hit http://ppa.launchpad.net raring/main i386 Packages                     Ign http://ppa.launchpad.net raring/main Translation-en_US                          Ign http://ppa.launchpad.net raring/main Translation-en                             Ign http://ppa.launchpad.net raring/main Translation-en_US                 Ign http://ppa.launchpad.net raring/main Translation-en                    Ign http://security.ubuntu.com raring-security/main Translation-en_US               Ign http://security.ubuntu.com raring-security/main Translation-en         Ign http://security.ubuntu.com raring-security/multiverse Translation-en_US     Ign http://security.ubuntu.com raring-security/multiverse Translation-en     Ign http://packages.linuxmint.com olivia/import Translation-en_US     Ign http://security.ubuntu.com raring-security/restricted Translation-en_US     Ign http://security.ubuntu.com raring-security/restricted Translation-en     Ign http://packages.linuxmint.com olivia/import Translation-en     Ign http://security.ubuntu.com raring-security/universe Translation-en_US     Ign http://security.ubuntu.com raring-security/universe Translation-en     Ign http://packages.linuxmint.com olivia/main Translation-en_US     Err http://security.ubuntu.com raring-security/main amd64 Packages       404  Not Found [IP: 91.189.92.200 80]     Ign http://packages.linuxmint.com olivia/main Translation-en     Err http://security.ubuntu.com raring-security/restricted amd64 Packages       404  Not Found [IP: 91.189.92.200 80]     Err http://security.ubuntu.com raring-security/universe amd64 Packages                404  Not Found [IP: 91.189.92.200 80]     Ign http://packages.linuxmint.com olivia/upstream Translation-en_US        Err http://security.ubuntu.com raring-security/multiverse amd64 Packages       404  Not Found [IP: 91.189.92.200 80]     Err http://security.ubuntu.com raring-security/main i386 Packages       404  Not Found [IP: 91.189.92.200 80]     Err http://security.ubuntu.com raring-security/restricted i386 Packages       404  Not Found [IP: 91.189.92.200 80]     Ign http://packages.linuxmint.com olivia/upstream Translation-en     Err http://security.ubuntu.com raring-security/universe i386 Packages       404  Not Found [IP: 91.189.92.200 80]     Err http://security.ubuntu.com raring-security/multiverse i386 Packages       404  Not Found [IP: 91.189.92.200 80]     Ign http://archive.ubuntu.com raring/main Translation-en_US     Ign http://archive.ubuntu.com raring/main Translation-en     Ign http://archive.ubuntu.com raring/multiverse Translation-en_US     Ign http://archive.ubuntu.com raring/multiverse Translation-en     Ign http://archive.ubuntu.com raring/restricted Translation-en_US     Ign http://archive.ubuntu.com raring/restricted Translation-en     Ign http://archive.ubuntu.com raring/universe Translation-en_US     Ign http://archive.ubuntu.com raring/universe Translation-en     Ign http://archive.ubuntu.com raring-updates/main Translation-en_US     Ign http://archive.ubuntu.com raring-updates/main Translation-en     Ign http://archive.ubuntu.com raring-updates/multiverse Translation-en_US     Ign http://archive.ubuntu.com raring-updates/multiverse Translation-en     Ign http://archive.ubuntu.com raring-updates/restricted Translation-en_US     Ign http://archive.ubuntu.com raring-updates/restricted Translation-en     Ign http://archive.ubuntu.com raring-updates/universe Translation-en_US     Ign http://archive.ubuntu.com raring-updates/universe Translation-en     Err http://archive.ubuntu.com raring/main amd64 Packages       404  Not Found [IP: 91.189.88.149 80]     Err http://archive.ubuntu.com raring/restricted amd64 Packages       404  Not Found [IP: 91.189.88.149 80]     Err http://archive.ubuntu.com raring/universe amd64 Packages       404  Not Found [IP: 91.189.88.149 80]     Err http://archive.ubuntu.com raring/multiverse amd64 Packages       404  Not Found [IP: 91.189.88.149 80]     Err http://archive.ubuntu.com raring/main i386 Packages       404  Not Found [IP: 91.189.88.149 80]     Err http://archive.ubuntu.com raring/restricted i386 Packages       404  Not Found [IP: 91.189.88.149 80]     Err http://archive.ubuntu.com raring/universe i386 Packages       404  Not Found [IP: 91.189.88.149 80]     Err http://archive.ubuntu.com raring/multiverse i386 Packages       404  Not Found [IP: 91.189.88.149 80]     Err http://archive.ubuntu.com raring-updates/main amd64 Packages       404  Not Found [IP: 91.189.88.149 80]     Err http://archive.ubuntu.com raring-updates/restricted amd64 Packages       404  Not Found [IP: 91.189.88.149 80]     Err http://archive.ubuntu.com raring-updates/universe amd64 Packages       404  Not Found [IP: 91.189.88.149 80]     Err http://archive.ubuntu.com raring-updates/multiverse amd64 Packages       404  Not Found [IP: 91.189.88.149 80]     Err http://archive.ubuntu.com raring-updates/main i386 Packages       404  Not Found [IP: 91.189.88.149 80]     Err http://archive.ubuntu.com raring-updates/restricted i386 Packages       404  Not Found [IP: 91.189.88.149 80]     Err http://archive.ubuntu.com raring-updates/universe i386 Packages       404  Not Found [IP: 91.189.88.149 80]     Err http://archive.ubuntu.com raring-updates/multiverse i386 Packages       404  Not Found [IP: 91.189.88.149 80]     Fetched 165 kB in 35s (4,642 B/s)     W: GPG error: http://archive.canonical.com raring Release: The following signatures were invalid: BADSIG 40976EAF437D05B5 Ubuntu Archive Automatic Signing Key <ftpmaster@ubuntu.com>     W: GPG error: http://ppa.launchpad.net raring Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY D45DF2E8FC91AE7E     W: GPG error: http://ppa.launchpad.net raring Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4DF9B28CA252A784     W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/raring/main/binary-amd64/Packages  404  Not Found [IP: 91.189.88.149 80]          W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/raring/restricted/binary-amd64/Packages  404  Not Found [IP: 91.189.88.149 80]          W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/raring-security/main/binary-amd64/Packages  404  Not Found [IP: 91.189.92.200 80]          W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/raring-security/restricted/binary-amd64/Packages  404  Not Found [IP: 91.189.92.200 80]          W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/raring-security/universe/binary-amd64/Packages  404  Not Found [IP: 91.189.92.200 80]          W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/raring-security/multiverse/binary-amd64/Packages  404  Not Found [IP: 91.189.92.200 80]          W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/raring/universe/binary-amd64/Packages  404  Not Found [IP: 91.189.88.149 80]          W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/raring-security/main/binary-i386/Packages  404  Not Found [IP: 91.189.92.200 80]          W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/raring/multiverse/binary-amd64/Packages  404  Not Found [IP: 91.189.88.149 80]          W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/raring-security/restricted/binary-i386/Packages  404  Not Found [IP: 91.189.92.200 80]          W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/raring/main/binary-i386/Packages  404  Not Found [IP: 91.189.88.149 80]          W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/raring-security/universe/binary-i386/Packages  404  Not Found [IP: 91.189.92.200 80]          W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/raring/restricted/binary-i386/Packages  404  Not Found [IP: 91.189.88.149 80]          W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/raring-security/multiverse/binary-i386/Packages  404  Not Found [IP: 91.189.92.200 80]          W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/raring/universe/binary-i386/Packages  404  Not Found [IP: 91.189.88.149 80]          W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/raring/multiverse/binary-i386/Packages  404  Not Found [IP: 91.189.88.149 80]          W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/raring-updates/main/binary-amd64/Packages  404  Not Found [IP: 91.189.88.149 80]          W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/raring-updates/restricted/binary-amd64/Packages  404  Not Found [IP: 91.189.88.149 80]          W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/raring-updates/universe/binary-amd64/Packages  404  Not Found [IP: 91.189.88.149 80]          W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/raring-updates/multiverse/binary-amd64/Packages  404  Not Found [IP: 91.189.88.149 80]          W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/raring-updates/main/binary-i386/Packages  404  Not Found [IP: 91.189.88.149 80]          W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/raring-updates/restricted/binary-i386/Packages  404  Not Found [IP: 91.189.88.149 80]          W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/raring-updates/universe/binary-i386/Packages  404  Not Found [IP: 91.189.88.149 80]          W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/raring-updates/multiverse/binary-i386/Packages  404  Not Found [IP: 91.189.88.149 80]          E: Some index files failed to download. They have been ignored, or old ones used instead.      I've tried to upgrade after that, I've got this with many other lines:               Reading package lists... Error!      For `sudo apt-get check` , this is the output               Reading package lists... Error!     W: Duplicate sources.list entry http://packages.linuxmint.com/ olivia/main amd64 Packages (/var/lib/apt/lists/packages.linuxmint.com_dists_olivia_main_binary-amd64_Packages)     W: Duplicate sources.list entry http://packages.linuxmint.com/ olivia/upstream amd64 Packages (/var/lib/apt/lists/packages.linuxmint.com_dists_olivia_upstream_binary-amd64_Packages)     W: Duplicate sources.list entry http://packages.linuxmint.com/ olivia/import amd64 Packages (/var/lib/apt/lists/packages.linuxmint.com_dists_olivia_import_binary-amd64_Packages)     W: Duplicate sources.list entry http://packages.linuxmint.com/ olivia/main i386 Packages (/var/lib/apt/lists/packages.linuxmint.com_dists_olivia_main_binary-i386_Packages)     W: Duplicate sources.list entry http://packages.linuxmint.com/ olivia/upstream i386 Packages (/var/lib/apt/lists/packages.linuxmint.com_dists_olivia_upstream_binary-i386_Packages)     W: Duplicate sources.list entry http://packages.linuxmint.com/ olivia/import i386 Packages (/var/lib/apt/lists/packages.linuxmint.com_dists_olivia_import_binary-i386_Packages)     W: Duplicate sources.list entry http://archive.ubuntu.com/ubuntu/ raring/main amd64 Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_raring_main_binary-amd64_Packages)     W: Duplicate sources.list entry http://archive.ubuntu.com/ubuntu/ raring/restricted amd64 Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_raring_restricted_binary-amd64_Packages)     W: Duplicate sources.list entry http://archive.ubuntu.com/ubuntu/ raring/universe amd64 Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_raring_universe_binary-amd64_Packages)     W: Duplicate sources.list entry http://archive.ubuntu.com/ubuntu/ raring/multiverse amd64 Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_raring_multiverse_binary-amd64_Packages)     W: Duplicate sources.list entry http://archive.ubuntu.com/ubuntu/ raring/main i386 Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_raring_main_binary-i386_Packages)     W: Duplicate sources.list entry http://archive.ubuntu.com/ubuntu/ raring/restricted i386 Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_raring_restricted_binary-i386_Packages)     W: Duplicate sources.list entry http://archive.ubuntu.com/ubuntu/ raring/universe i386 Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_raring_universe_binary-i386_Packages)     W: Duplicate sources.list entry http://archive.ubuntu.com/ubuntu/ raring/multiverse i386 Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_raring_multiverse_binary-i386_Packages)     W: Duplicate sources.list entry http://archive.ubuntu.com/ubuntu/ raring-updates/main amd64 Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_raring-updates_main_binary-amd64_Packages)     W: Duplicate sources.list entry http://archive.ubuntu.com/ubuntu/ raring-updates/restricted amd64 Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_raring-updates_restricted_binary-amd64_Packages)     W: Duplicate sources.list entry http://archive.ubuntu.com/ubuntu/ raring-updates/universe amd64 Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_raring-updates_universe_binary-amd64_Packages)     W: Duplicate sources.list entry http://archive.ubuntu.com/ubuntu/ raring-updates/multiverse amd64 Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_raring-updates_multiverse_binary-amd64_Packages)     W: Duplicate sources.list entry http://archive.ubuntu.com/ubuntu/ raring-updates/main i386 Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_raring-updates_main_binary-i386_Packages)     W: Duplicate sources.list entry http://archive.ubuntu.com/ubuntu/ raring-updates/restricted i386 Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_raring-updates_restricted_binary-i386_Packages)     W: Duplicate sources.list entry http://archive.ubuntu.com/ubuntu/ raring-updates/universe i386 Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_raring-updates_universe_binary-i386_Packages)     W: Duplicate sources.list entry http://archive.ubuntu.com/ubuntu/ raring-updates/multiverse i386 Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_raring-updates_multiverse_binary-i386_Packages)     W: Duplicate sources.list entry http://security.ubuntu.com/ubuntu/ raring-security/main amd64 Packages (/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_raring-security_main_binary-amd64_Packages)     W: Duplicate sources.list entry http://security.ubuntu.com/ubuntu/ raring-security/restricted amd64 Packages (/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_raring-security_restricted_binary-amd64_Packages)     W: Duplicate sources.list entry http://security.ubuntu.com/ubuntu/ raring-security/universe amd64 Packages (/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_raring-security_universe_binary-amd64_Packages)     W: Duplicate sources.list entry http://security.ubuntu.com/ubuntu/ raring-security/multiverse amd64 Packages (/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_raring-security_multiverse_binary-amd64_Packages)     W: Duplicate sources.list entry http://security.ubuntu.com/ubuntu/ raring-security/main i386 Packages (/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_raring-security_main_binary-i386_Packages)     W: Duplicate sources.list entry http://security.ubuntu.com/ubuntu/ raring-security/restricted i386 Packages (/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_raring-security_restricted_binary-i386_Packages)     W: Duplicate sources.list entry http://security.ubuntu.com/ubuntu/ raring-security/universe i386 Packages (/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_raring-security_universe_binary-i386_Packages)     W: Duplicate sources.list entry http://security.ubuntu.com/ubuntu/ raring-security/multiverse i386 Packages (/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_raring-security_multiverse_binary-i386_Packages)     E: Encountered a section with no Package: header     E: Problem with MergeList /var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_raring-security_main_i18n_Translation-en     E: The package lists or status file could not be parsed or opened.      This is the output of `cat /etc/apt/sources.list{,.d/*}`               deb http://packages.linuxmint.com/ olivia main upstream import     deb http://archive.ubuntu.com/ubuntu/ raring main restricted universe multiverse     deb http://archive.ubuntu.com/ubuntu/ raring-updates main restricted universe multiverse     deb http://security.ubuntu.com/ubuntu/ raring-security main restricted universe multiverse     deb http://archive.canonical.com/ubuntu/ raring partner          # deb http://archive.getdeb.net/ubuntu raring-getdeb apps     # deb http://archive.getdeb.net/ubuntu raring-getdeb games               deb http://ppa.launchpad.net/gezakovacs/ppa/ubuntu raring main     deb-src http://ppa.launchpad.net/gezakovacs/ppa/ubuntu raring main     #deb file:///usr/share/local-repository binary/          # Do not edit this file manually, use Software Sources instead.          deb http://packages.linuxmint.com olivia main upstream import  #id:linuxmint_main          deb http://archive.ubuntu.com/ubuntu raring main restricted universe multiverse     deb http://archive.ubuntu.com/ubuntu raring-updates main restricted universe multiverse          deb http://security.ubuntu.com/ubuntu/ raring-security main restricted universe multiverse     deb http://archive.canonical.com/ubuntu/ raring partner     deb http://ppa.launchpad.net/relan/exfat/ubuntu raring main     deb-src http://ppa.launchpad.net/relan/exfat/ubuntu raring main      Any idea how can this be solved? I am sorry if this seems to be silly but I am not an expert.


Program to test CPU load and process priority

I am running some test on Amazon EC2 instances and we want to make the CPU always busy at above 80%. What I have is a program `main` that needs to run in high priority and I want to launch another program, preferably some math C code or a bash script that loads the CPU to over 80%. What programs are there to use for such a task, and how to make my program run with the highest priority. PS: Running Fedora.


Is there a way to automatically run a script after grub-install?

I would like to automatically run a script after `grub-install` (using Grub2) if it's possible? Some context. The script will simply run `grub-install /dev/sda1`, `grub- install /dev/sdb1`, `grub-install /dev/sdc1` as I want all three EFI boot partitions in sync.


Console port problems on Fedora 15

I've looked under every search term on google I can think of and can't seem to find anything that works. I just switched from Windows 7 to Fedora 15 on my PC. I need use of the console port to interact with Cisco switches and other devices. However, I cannot seem to get it to work. I've tried putty, and it says : > Unable to open connection to:   >  Unable to open serial port I've tried minicom as well. Both putty and minicom I set up to `/dev/ttyS0`. I did have it working, once, connected with `cat /dev/ttyS0`, and it outputted the info from the switch, but when it got to the point where the switch expected input, it looped the input request message dozens of times a second. I thought it might be a driver issue, but I cannot find any info for getting drivers for serial ports. I'm thinking I probably need to know the adapter model # or something. The port is built into the motherboard though, so I don't know if it has one. I also tried `setserial /dev/ttyS0`, but it gives the message: > /dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4 Is there a command to get info about the serial port/adapter? Is there something that I am doing wrong that I am not seeing?


Install winetricks application to ~/.wine prefix

How can I tell winetricks to install an app to `~/.wine` instead of `~/.local/share/wineprefixes/<app-name>`? I have already tried `WINEPREFIX=~/.wine winetricks <app-name>` without any success.


A terminal emulator for CygWin?

I have:   * Windows 7   * CygWin   * A development board connected to COM1 port. I need:   * Connect to its serial port from CygWin. If I used Linux I would run a program like _picocom_ or _minicom_. Also in Windows 7 I could install _HyperTerminal_ and open COM1 port or use Putty for that. But I would like to do it from CygWin's mintty because I like its fonts and some other small joys. It seems mintty itself is not able to work with serial ports, so I wonder if there is a program like _picocom_ or _minicom_ in CygWin's repository.


Missing float function in awk on RHEL 5.8

Why is `float` missing in `awk` on my RHEL 5.8? Was it replaced by some other function? On Solaris:               echo "Foampile=123" | awk -F"=" '{ print float($2) "<->" $1 }'      returns               123<->Foampile      on RHEL 5.8               awk: (FILENAME=- FNR=1) fatal: function `float' not defined


FFMPEG Conversion Fails

Bad file? I'm very new to FFMPEG so how can I better debug and trace these issues?                ffmpeg -i /home/videospace/public_html/labo/lion.3gp new_video.flv     ffmpeg version N-57647-g1880294 Copyright (c) 2000-2013 the FFmpeg developers       built on Oct 30 2013 19:25:44 with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-3)       configuration: --prefix=/usr/local --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvpx --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libvo-aacenc --enable-libxvid --disable-ffplay --enable-shared --enable-gpl --enable-postproc --enable-nonfree --enable-avfilter --enable-pthreads --extra-cflags=-fPIC --arch=x86_64       libavutil      52. 48.100 / 52. 48.100       libavcodec     55. 39.100 / 55. 39.100       libavformat    55. 19.104 / 55. 19.104       libavdevice    55.  5.100 / 55.  5.100       libavfilter     3. 90.100 /  3. 90.100       libswscale      2.  5.101 /  2.  5.101       libswresample   0. 17.104 /  0. 17.104       libpostproc    52.  3.100 / 52.  3.100     Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/videospace/public_html/labo/lion.3gp':       Metadata:         major_brand     : 3gp6         minor_version   : 256         compatible_brands: isom3gp6         creation_time   : 2013-04-11 07:48:16       Duration: 00:02:43.98, start: 0.000000, bitrate: 206 kb/s         Stream #0:0(und): Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p, 320x240 [SAR 1:1 DAR 4:3], 194 kb/s, 30 fps, 30 tbr, 30 tbn, 30 tbc (default)         Metadata:           creation_time   : 2013-04-11 07:48:16           handler_name    : IsoMedia File Produced by Google, 5-11-2011         Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 22050 Hz, mono, fltp, 31 kb/s (default)         Metadata:           creation_time   : 2013-04-11 07:48:17           handler_name    : IsoMedia File Produced by Google, 5-11-2011     Output #0, flv, to 'new_video.flv':       Metadata:         major_brand     : 3gp6         minor_version   : 256         compatible_brands: isom3gp6         encoder         : Lavf55.19.104         Stream #0:0(und): Video: flv1 (flv) ([2][0][0][0] / 0x0002), yuv420p, 320x240 [SAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 1k tbn, 30 tbc (default)         Metadata:           creation_time   : 2013-04-11 07:48:16           handler_name    : IsoMedia File Produced by Google, 5-11-2011         Stream #0:1(und): Audio: mp3 (libmp3lame) ([2][0][0][0] / 0x0002), 22050 Hz, mono, fltp (default)         Metadata:           creation_time   : 2013-04-11 07:48:17           handler_name    : IsoMedia File Produced by Google, 5-11-2011     Stream mapping:       Stream #0:0 -> #0:0 (mpeg4 -> flv)       Stream #0:1 -> #0:1 (aac -> libmp3lame)     Press [q] to stop, [?] for help     [mpeg4 @ 0x2659cc0] Error at MB: 1864337kB time=00:02:18.83 bitrate= 255.9kbits/s     [mpeg4 @ 0x2659cc0] concealing 263 DC, 263 AC, 263 MV errors in P frame     [mov,mp4,m4a,3gp,3g2,mj2 @ 0x2563900] stream 0, offset 0x40b8fc: partial file     /home/videospace/public_html/labo/lion.3gp: Invalid data found when processing input     frame= 4345 fps=1045 q=4.2 Lsize=    4503kB time=00:02:24.83 bitrate= 254.7kbits/s     video:3783kB audio:565kB subtitle:0 global headers:0kB muxing overhead 3.558660%


What is BS"D in Mac OS X and iOS Internals?

I just received my copy of Mac OS X and iOS Internals, and there is something a little strange: `Chapter 13: BS"D: The BSD Layer` Is there an explanation for the extra quote ?


When was this vulnerability fixed in Debian? (CVE-2012-2088 affecting libtiff4)

I have Debian Squeeze installed on my one of my workstation. On my Ubuntu 10.04 workstation there have been two security updates to the libtiff4 package in the last couple of weeks, addressing the CVE-2012-2088 vulnerability, but none to libtiff4 on the Debian installation. Is the libtiff4 package installed on my Debian system [3.9.4-5+squeeze4] vulnerable? What update fixes it? More generally, how can I find out whether and when a vulnerability is fixed in Debian?


Get network under Network-Manager's management

Initially, when I had installed Debian 'Wheezy' on my old trusty laptop, it's network was managed by Network-Manager. However, at some point, I think I did something, which lead to the network connectivity, no longer being managed by Network-Manager, though the NM-applet continues to show-up on my GNOME classic desktop. Question is, how can I get the configuration back to a state where network is again managed by Network-Manager ?


Why is variable interpolation not working for variable assignment (for bash)?

I have this script:               ROOT=/tmp     LOG=$ROOT/blah.log     echo $LOG      The output is:               /blah.log      obviously the `ROOT` variable is not being interpolated which is very unexpected. If I echo `$ROOT`, it correctly shows `/tmp`. Hence something fishy is going on here.


How to manually install linux on a USB?

I have been using `unetbootin` to create bootable Linux USBs. I want to do this manually using command line. What is the procedure that unetbootin uses to prepare a bootable USB? **How would you go about manually converting an Ubuntu ISO to a USB?**


Directly convert Archbang live on a USB drive to one such with persistent file-system

I have installed Archbang 2012.12.03 from ISO image on my USB drive, now I have a USB drive with a live Linux installed on it but at end of every session and rebooting system I faced with a fresh Archbang installation and nothing will be saved. I'm looking for a solution to convert my live system to an Archbang installed on my USB drive with persistent file-system which save every changes during sessions. I have to mention I would not to install it to a new USB drive, just converting.


Blank Screen on Mint 15 LiveCD

I own a Lenovo Yoga 11s (i5 processor, Intel integrated graphics) and I'm trying to install Linux Mint on to it. However, after I boot from the live cd, the screen goes blank and stops responding. I've looked into the problem online, and I see that it might be an issue with the graphics card.   However, any fix I find online has been useless in alleviating the problem. What can I do next to solve this problem?


Why is a echo-request ping packet 84 bytes in the log of iptables?

When I log the length of a echo-request packet, `iptables -A OUTPUT -p icmp -m icmp --icmp-type 8 -j LOG` I saw the length was `LEN=84`, but in wireshark, the captured packet size was `0x60`, why does it differ?


Monitor servers

I want to monitor three server pages. These three pages contain a simple text (for example it says it's "working fine"). I want to be notified when anything other than this message is displayed, e.g. via email. I want shell scripting code for displaying the status of the three pages in an html file.


Recompile Kernel to Change Stack Size

I need to recompile my kernel on RHEL WS5 with only two changes.   1. Change stack size from 4k to 8k   2. Limit usable memory to 4096. How do I recompile the kernel without changing anything else but these two items?


Why email clients prepend `Re:` to subject line?

I wonder why most email clients prepend `Re:` to the subject if the mail is a response. When responding, the mail client generates an `In-Reply-To:` header which clearly states that this message is a response. This enables mail user agents to display the mails in the correct thread (together with the `References:` header). So technically the `Re:` does not add any information. The disadvantages are:   * The `Re:` string needs to be adjusted to the language (`Sv:`, `Odp:`, `Vs:`, etc.) which makes it very hard to configure the mail client properly.   * It adds visual clutter to the subject line.   * It can lead to subject lines like this: `Re: Re: Sv: Odp: Re: This is the subject` Why is this common practice and what are the advantages?


Pseudo files for temporary data

I often want to feed relatively short string data (could be several lines though) to commandline programs which accept only input from files (e.g. wdiff) in a repeated fashion. Sure I can create one or more temporary files, save the string there and run the command with the file name as parameter. But it looks to me as if this procedure would be highly inefficient if data is actually written to the disk and also it could harm the disk more than necessary if I repeat this procedure many times, e.g. if I want to feed single lines of long text files to wdiff. Is there a recommended way to circumvent this, say by using pseudo files such as pipes to store the data temporarily without actually writing it to the disk (or writing it only if it exceeds a critical length). Note that wdiff takes two arguments and, as far as I understand it will not be possible to feed the data doing something like `wdiff <"text"`.


python3 traceback error

Whenever I mistype any command in terminal instead of getting `Error:Command not found` I get this python message error                   Traceback (most recent call last):       File "/usr/lib/python3.3/site.py", line 631, in <module>         main()       File "/usr/lib/python3.3/site.py", line 616, in main         known_paths = addusersitepackages(known_paths)       File "/usr/lib/python3.3/site.py", line 284, in addusersitepackages         user_site = getusersitepackages()       File "/usr/lib/python3.3/site.py", line 260, in getusersitepackages         user_base = getuserbase() # this will also set USER_BASE       File "/usr/lib/python3.3/site.py", line 250, in getuserbase         USER_BASE = get_config_var('userbase')       File "/usr/lib/python3.3/sysconfig.py", line 580, in get_config_var         return get_config_vars().get(name)       File "/usr/lib/python3.3/sysconfig.py", line 530, in get_config_vars         _init_posix(_CONFIG_VARS)       File "/usr/lib/python3.3/sysconfig.py", line 403, in _init_posix         from _sysconfigdata import build_time_vars       File "/usr/lib/python3.3/_sysconfigdata.py", line 6, in <module>         from _sysconfigdata_m import *     ImportError: No module named '_sysconfigdata_m'      I know that after installing python3.x and trying to make it my default interpreter this error has gone this way.               $ lsb_release -rd     Description:    Linux Mint 14 Nadia     Release:    14      `/usr/lib/command-not-found` is working well also.   Can I get back to my default python version ? simply I did               sudo ln -sf /usr/bin/python2.7 /usr/local/bin/python      is it enough to get 2.7 as default interpreter ?   Any idea how to get rid off this hell message error ?


Apache boot without asking for passwd

So I'm maintaining a server which has a verified SSL certificate setup, however there is a password on the private key and so whenever apache is reboot, we get a message asking for the password. This isn't a major issue, but becomes one when you reboot the machine! When this happens, it will hang at apache startup (I can tell by viewing the syslog through AWS) and then the machine doesn't run sshd and so I cannot access the server any more! Is there a way to setup apache to use this key without asking for the password? I think one option would be to reissue the SSL certificate but this time not using a password, but then is that unsafe?


zsh and xfce4-terminal

I've changed my login shell to zsh from bash on an installation of Debian Squeeze with XFCE. When I launch xfce4-terminal, zsh starts but does not load my configuration. I have searched high and low, but have come to SO to extend beyond my regular limits and see if someone can assist in diagnosing this.


Can I create a software RAID 1 with one device

I have a single disk that I want to create a Mirror of, Lets call this disk `sda` I have just bought another identicle size disk, which we can call `sdb`. `sda` and `sdb` have one partition called `sda1` and `sdb1` respectively. When creating a raid I dont want to wipe my `sda` clean and start again, I just want it to start mirroring with `sdb`. My train of thought was to do:               mdadm --create --verbose /dev/md0 --level=mirror --raid-devices=1 /dev/sda1      ..to create the array without `sdb` disk, then run something like (Im thinking the following command out loud, because I am not sure how to achieve this step)               mdadm /dev/md0 --add /dev/sdb1      Note `sdb1` is assumed to be formated similar to `sda1` Is this posible?


Equivalent of newusers for groups

The newusers command is useful for adding or modifying users in bulk. Is there an equivalent command for managing groups?


Using for loop to brute-force a password

I just wanted to brute-force my old router but the for-loop was really amateur style. How to write a nice for-loop, if I only know the charaters included? Found already that page but it does not include my case. I though of something like the following, but obviously it does not work:               for word in $(cat charList)$(cat charlist); do echo ${word}; done


Is there any PF log parser for FreeBSD

I am runing FreeBSD 8 stable with PF as firewall, I am looking for any tool for parsing PF log's.


Repairing CentOS 6.5 permissions after file migration

I'm running CentOS 6.5 in a VirtualBox VM. Recently, I ran out of space for my virtual hard disk. To remedy this, I decided to create a second hard disk for the `/usr` directory. I mounted that and copied over files as root with `rsync -a /usr.bak /usr`. This seemed to have preserved all file ownership and permissions. However, now I'm getting weird permission issues. While I can boot the system just fine, various things don't work, like:   1. The network adapter doesn't work `sudo service network restart` fails while "Determining IP information for eth0."   2. Doing an ACPI shutdown no-longer pops up the same dialog in Gnome.   3. I see some "/usr/bin/logger: Permission denied" errors. I had disabled SELinux earlier, so I don't think this is interfering. I also tried to fix permissions by running this as root, but the problem persists:               for i in `rpm -qa`;do rpm --setperms $i;done      What could have been messed up in my copying files using `rsync` to this new mount point? Anything I can do to repair things? Note that this is a development sandbox, so I'm not super concerned if a fix would involve a non- ideal security setup.


How to set the resolution in text consoles (troubleshoot when any `vga=...` fails)

It is a common way to set the resolution of a text consoles (that are usually available by Ctrl-Alt-F1 thru Ctrl-Alt-F6) by using a `vga=...` kernel parameter. I'm using Ubuntu 10.04 Lucid, output of `uname -a` is: > Linux 2.6.32-33-generic #70-Ubuntu SMP Thu Jul 7 21:13:52 UTC 2011 x86_64 > GNU/Linux To identify modes available i use the `sudo hwinfo --framebuffer` which reports: > 02: None 00.0: 11001 VESA Framebuffer   >  [Created at bios.464]   >  Unique ID: rdCR.R1b4duaxSqA   >  Hardware Class: framebuffer   >  Model: "NVIDIA G73 Board - p456h1 "   >  Vendor: "NVIDIA Corporation"   >  Device: "G73 Board - p456h1 "   >  SubVendor: "NVIDIA"   >  SubDevice:   >  Revision: "Chip Rev"   >  Memory Size: 256 MB   >  Memory Range: 0xc0000000-0xcfffffff (rw)   >  Mode 0x0300: 640x400 (+640), 8 bits   >  Mode 0x0301: 640x480 (+640), 8 bits   >  Mode 0x0303: 800x600 (+800), 8 bits   >  Mode 0x0305: 1024x768 (+1024), 8 bits   >  Mode 0x0307: 1280x1024 (+1280), 8 bits   >  Mode 0x030e: 320x200 (+640), 16 bits   >  Mode 0x030f: 320x200 (+1280), 24 bits   >  Mode 0x0311: 640x480 (+1280), 16 bits   >  Mode 0x0312: 640x480 (+2560), 24 bits   >  Mode 0x0314: 800x600 (+1600), 16 bits   >  Mode 0x0315: 800x600 (+3200), 24 bits   >  Mode 0x0317: 1024x768 (+2048), 16 bits   >  Mode 0x0318: 1024x768 (+4096), 24 bits   >  Mode 0x031a: 1280x1024 (+2560), 16 bits   >  Mode 0x031b: 1280x1024 (+5120), 24 bits   >  Mode 0x0330: 320x200 (+320), 8 bits   >  Mode 0x0331: 320x400 (+320), 8 bits   >  Mode 0x0332: 320x400 (+640), 16 bits   >  Mode 0x0333: 320x400 (+1280), 24 bits   >  Mode 0x0334: 320x240 (+320), 8 bits   >  Mode 0x0335: 320x240 (+640), 16 bits   >  Mode 0x0336: 320x240 (+1280), 24 bits   >  Mode 0x033d: 640x400 (+1280), 16 bits   >  Mode 0x033e: 640x400 (+2560), 24 bits   >  Config Status: cfg=new, avail=yes, need=no, active=unknown It looks like many hi-res modes are available, like 0x305, 0x307, 0x317, 0x318, 0x31a, 0x31b (by the way, what does the plus-number means in the list of modes?). However, setting any of these modes in kernel option string, line `vga=0x305`, results in either pitch black text console, or screen filled by blinking color/bw dots. What is the 'modern', 'robust' way to set up high resolution in text consoles?


Grub dual boot without countdown

Is it possible to configure grub to have a dual boot setup behaving like described below?   * When turning on PC and doing nothing, the default system should start as soon as possible without waiting for a countdown.   * When wanting to boot another system, a key must be pressed to get to the normal grub menu to select a system. Furthermore, I recently switched from grub legacy to grub and discovered that it takes notably longer to load before the menu shows up... Is it possible to reduce this time and get a fast boot? My current `/boot/grub/grub.cfg`: grub.cfg


Standard and/or common directories on Unix/Linux OSes

Coming from the Windows world, I have found the majority of the ~~folder~~ directory names to be quite intuitive:   * `\Program Files` contains files used by programs (surprise!)   * `\Program Files (x86)` contains files used by 32-bit programs on 64-bit OSes   * `\Users` (formerly `Documents and Settings`) contains users' files, i.e. documents and settings     * `\Users\USER\Application Data` contains application-specific data     * `\Users\USER\Documents` contains documents belonging to the user   * `\Windows` contains files that belong to the operation of Windows itself     * `\Windows\Fonts` stores font files (surprise!)     * `\Windows\Temp` is a global temporary directory et cetera. Even if I had no idea what these folders did, I could guess with good accuracy from their names. Now I'm taking a good look at Linux, and getting quite confused about how to find my way around the file system. For example:   * `/bin` contains binaries. But so do `/sbin`, `/usr/bin`, `/usr/sbin`, and probably more that I don't know about. Which is which?? What is the difference between them? If I want to make a binary and put it somewhere system-wide, where do I put it?   * `/media` contains external media file systems. But so does `/mnt`. And neither of them contain anything on my system at the moment; everything seems to be in `/dev`. What's the difference? Where are the other partitions on my hard disk, like the `C:` and `D:` that were in Windows?   * `/home` contains the user files and settings. That much is intuitive, but then, what is supposed to go into `/usr`? And how come `/root` is still separate, even though it's a user with files and settings?   * `/lib` contains shared libraries, like DLLs. But so does `/usr/lib`. What's the difference?   * What **_is_** `/etc`? Does it really stand for "et cetera", or something else? What kinds of files should go in there -- global or local? Is it a catch-all for things no one knew where to put, or is there a particular use case for it?   * What are `/opt`, `/proc`, and `/var`? What do they stand for and what are they used for? I haven't seen anything like them in Windows*, and I just can't figure out what they might be for. If anyone can think of other standard places that might be good to know about, feel free to add it to the question; hopefully this can be a good reference for people like me, who are starting to get familiar with *nix systems. *OK, that's a lie. I've seen similar things in WinObj, but obviously not on a regular basis. I still don't know what these do on Linux, though.