--Imaging:
Save on machine (not direct copy):
time ssh test1 "ntfsclone -o - -s /dev/hda2 | gzip -v | cat" > gx270.hda2.img.gz
time ssh lab1 cat gx270.hda2.img.gz | gunzip | ntfsclone -O /dev/hda2 -r -
Direct copy: *Remember "sshstart" on server computer
time ssh test1 dd if=/dev/sda1 bs=2048 | dd of=/dev/sda1 bs=2048
time ssh test1 ntfsclone -o - -s /dev/sda2 | ntfsclone -O /dev/sda2 -r -
--Partitioning for lab computers:
/dev/sda1
1
9
72292
de (Dell Utility Partition)
/dev/sda2
10
10208
81923467
7 (NTFS)
*Remember: In order to image, the partitions must start at the same place.
Partition sizes:
- 20,000
'/'
- 1500
swap
- remainder
'/extra'
--tar:
/usr/local/bin/tar czf (destination-filename) (file/dir) --> (to compress and tar)
/usr/local/bin/tar xvzf (file.tar) --> (extracts to current dir)
--tar (copy directory)
ssh www "cd /var/lib; tar cvf - mysql" | (cd /var/lib; tar xf -)
Regular expressions:
(Addressing mode) --> (Regular expression) (Same symbols can mean different things)
% = "any line" (short for '1,$')
.* = "any character repeated any number of times"
Examples:
:%s/:.*// --> "Delete all text after the first colon on every line"
:3,7s/$/@cse.unr.edu --> "Append '@cse.unr.edu' to the end of lines 3-7"
Awk example:
awk '{print $2 " " $1}' file1 > file2
(Print 2nd word, space, 1st word of every line in file1; write to file2)
awk '{print "./email_pwcrack " $1 " " $2}' inputFile | sh
EM01B WebSensor Probe status command:
http://134.197.40.11/index.htm?em