Exporting info from AD as CSV
If you want to export AD info as CSV then csvde is the cmd for you, for example:
csvde -s clyde -f users.csv -r objectClass=user -l givenName, sn, name, sAMAccountName
Copy Files from Linux to Windows using pscp Over SSH
Use the following program that comes with putty to copy files from nix machine to a windows machine.
pscp -r -C User@Machine:/var/log/httpd/ c:\weblog\ -C Enables compression, which sounds like a good shout accross slow links.
Burn ISO from Command Line
Get hold of 2003 cdburn.exe from the Windows 2003 Support Tools.
cdburn.exe e: c:\path\iso_file.iso Where e: is the CD writer.
Using Grep to Scan Log Files on Windows
Use the following to find Forbidden errors from web server logs:
grep 403 \machine\i$\LogFiles\W3SVC1\ex0* You can get GNU utilities for Windows which includes grep. Microsoft has its own version of grep called QGREP which is part of the 2003 resource kit.
Using tcpdump to Capture Traffic for Analysis in Wireshark
Use the following:
tcpdump -i <interface> -s 1500 -w <some-file> tcpdump will only cature the first 68 bytes so you need to change the value to your packet size.
Backing up partions under *nix
dd is your man here. Replace /dev/disk for the disk you are interested in i.e. sda, sdb :
dd if=/dev/disk of=/path/backup This will create a full backup of your partition i.e. /dev/sda1:
dd if=/dev/disk_partition of=/dev/backup You can compress the backup using gzip:
dd if=/dev/disk | gzip -c9 < /path/backup.gz And to restore it:
gunzip -c /path/backup.gz | dd of=/dev/disk