expect script for ssh password prompt
16.07.2010 17:15 Below is a sample expect script to handle ssh password prompt should you not get the ssh keys to be working between hosts: #!/usr/bin/expect -fset host XXXset user XXXset password XXXset remote_path XXXset local_path XXX# disables the timeout, so script waits as long as it takes for the transferset timeout -1# call rsyncspawn rsync -av -e ssh $user@$host:$remote_path $local_path# avoids that if the output is to large, the earlier bytes won't be fotgottenmatch_max 100000# we're expecting the password prompt, we use a pattern so it can be anything that contains password: or Passwordexpect "*?assword:" # send a newline to make sure we get back to the command linesend -- "\r"# wait for the end-of-file in the outputexpect eof
expect script for ssh password prompt
16.07.2010 17:15 Below is a sample expect script to handle ssh password prompt should you not get the ssh keys to be working between hosts: #!/usr/bin/expect -fset host XXXset user XXXset password XXXset remote_path XXXset local_path XXX# disables the timeout, so script waits as long as it takes for the transferset timeout -1# call rsyncspawn rsync -av -e ssh $user@$host:$remote_path $local_path# avoids that if the output is to large, the earlier bytes won't be fotgottenmatch_max 100000# we're expecting the password prompt, we use a pattern so it can be anything that contains password: or Passwordexpect "*?assword:" # send a newline to make sure we get back to the command linesend -- "\r"# wait for the end-of-file in the outputexpect eof
15.07.2010 18:43 blkid can be used to display the swap label: # blkid /dev/md2/dev/md2: TYPE="swap" LABEL="SWAP-md2"
15.07.2010 18:43 blkid can be used to display the swap label: # blkid /dev/md2/dev/md2: TYPE="swap" LABEL="SWAP-md2"
15.07.2010 17:25 Below is a list of smartctl commands I frequently use to quickly verify disk health and status, specially when you have smartd logging errors to messages log file. Print all SMART information for drive /dev/sda . smartctl -a /dev/sda Enable SMART on device. smartctl --smart=on /dev/sda Get info about the device: smartctl -i /dev/sda Show the capabilities of drive. Also provides status when tests are being carried out. smartctl -c /dev/sda Basic health status: smartctl -H /dev/sda Display attributes. The attributes to look out for failing disk is Reallocated_Sector_Ct, Reallocated_Event_Count, Current_Pending_Sector and Offline_Uncorrectable. Their RAW_VALUE should normally be "0". smartctl -A /dev/sda Immediate offline test which updates attributes value. Good to run after a badblocks fsck check before checking on the attributes values. smartctl -t offline /dev/sda Run a thorough long test if you see suspect attributes with -A option as mentioned above. smartctl -t offline /dev/sda Examine self-test log. Shows if tests failed or passed. smartctl -l selftest /dev/sda Display most recent error log. smartctl -l error /dev/sda There are more examples in man smartctl.
15.07.2010 17:25 Below is a list of smartctl commands I frequently use to quickly verify disk health and status, specially when you have smartd logging errors to messages log file. Print all SMART information for drive /dev/sda . smartctl -a /dev/sda Enable SMART on device. smartctl --smart=on /dev/sda Get info about the device: smartctl -i /dev/sda Show the capabilities of drive. Also provides status when tests are being carried out. smartctl -c /dev/sda Basic health status: smartctl -H /dev/sda Display attributes. The attributes to look out for failing disk is Reallocated_Sector_Ct, Reallocated_Event_Count, Current_Pending_Sector and Offline_Uncorrectable. Their RAW_VALUE should normally be "0". smartctl -A /dev/sda Immediate offline test which updates attributes value. Good to run after a badblocks fsck check before checking on the attributes values. smartctl -t offline /dev/sda Run a thorough long test if you see suspect attributes with -A option as mentioned above. smartctl -t offline /dev/sda Examine self-test log. Shows if tests failed or passed. smartctl -l selftest /dev/sda Display most recent error log. smartctl -l error /dev/sda There are more examples in man smartctl.
Non-desctructive read-write badblocks disk check
15.07.2010 00:14 Below command can be run on unmounted partitions to do a disk check of badblocks. Use -p if you need to automatically fix issues. Single "c" will only do a badblock read test. e2fsck -vfcc -C 0 /dev/sdb4 "-C 0" -- displays progress "v" -- verbose output "f" -- force check "cc" -- read-write test
Non-desctructive read-write badblocks disk check
15.07.2010 00:14 Below command can be run on unmounted partitions to do a disk check of badblocks. Use -p if you need to automatically fix issues. Single "c" will only do a badblock read test. e2fsck -vfcc -C 0 /dev/sdb4 "-C 0" -- displays progress "v" -- verbose output "f" -- force check "cc" -- read-write test
13.07.2010 14:58 This is a OS I have been working on since Ubuntu 10.04 Beta 2. I thought it’s about time I released it and get some criticism on it.There isn’t any 32-bit version as most people should have a 64-bit processors as they have been around for for a few years now.
13.07.2010 14:58 This is a OS I have been working on since Ubuntu 10.04 Beta 2. I thought it’s about time I released it and get some criticism on it.There isn’t any 32-bit version as most people should have a 64-bit processors as they have been around for for a few years now.
resend all mails in sendmail queue
12.07.2010 06:31 As root you can redeliver all mail in the mail server queue via: sendmail -v -q
resend all mails in sendmail queue
12.07.2010 06:31 As root you can redeliver all mail in the mail server queue via: sendmail -v -q
lighttpd redirect to external url if file not found
11.07.2010 10:45 Below is a rewrite/redirect rule using similar to Apaches' "!-f" RewriteRule. # Redirect to external url if image file not foundurl.rewrite-if-not-file = url.redirect = $" => "http://other.domain.tld/$1" )
11.07.2010 10:45 To change the server timezone, just create a link to the respective zone you're on. ln -sf /usr/share/zoneinfo/US/Eastern /etc/localtime Check with the `date` command.
Tutorial on Software Programming
11.07.2010 10:45 A collection of 30 free tutorial books by Herong Yang on latest programming technologies. Tutorials in all books are based on Herong's personal experience and ideal for developers to learn new programming technologies.
Reklama
Hledaná slova
Nejčtenější články
Root.cz - 17.07.2010 00:00 - čteno(5)
LinuxSecurit... - 20.07.2010 13:07 - čteno(4)
openSUSE 11.3 Netbook Benchmarks
openSUSE... - 17.07.2010 10:49 - čteno(3)
Dolaďujeme a zpříjemňujeme si...
Root.cz - 28.07.2010 00:00 - čteno(2)
Abclinuxu -... - 27.07.2010 08:30 - čteno(2)
OpenGL není mrtvé, jak se snaží...
Linuxsoft.cz... - 27.07.2010 06:30 - čteno(2)
Root.cz - 24.07.2010 00:00 - čteno(2)
Ubuntu: 957-1: Firefox and Xulrunner...
LinuxSecurit... - 23.07.2010 07:34 - čteno(2)
LinuxSoft.cz - 22.07.2010 19:00 - čteno(2)
DSA-2073 mlmmj - insufficient input...
Debian.org -... - 21.07.2010 14:30 - čteno(2)
Copyright © 2009 LINUXPORTAL.cz








