The following is a list of useful commands that I've learned for Linux, but that I use so rarely, I tend to forget until I need them again.
To rip an entire normal data-cd (ISO filesystem) from a CD-ROM:
dd if=/dev/cdrom of=my_cd_image.iso
To create an iso using files in Linux:
mksisofs -o image.iso path/
wodim dev=/dev/cdrw -v -data cd_image.iso
wodim dev=/dev/cdrw -v -audio [wav files...]
To burn a DVD from the filesystem:
growisofs -dvd-compat -input-charset=ISO-8859-1 -Z /dev/cdrom -R -J -pad "/path/to/source/dir/structure"
To create a blank floppy disk image:
mkfs.msdos -C image.flp 1440
To mount a floppy image:
mount -o loop image.flp /media/floppy1/
To take a video file to a format usable by an iPod or an iPhone:
ffmpeg -vcodec xvid -b 300 -qmin 3 -qmax 5 -bufsize 4096 -g 300 -acodec aac -ab 96 \
-i source_file.avi -s 320x240 -aspect 4:3 target_file.mp4
Take target_file.mp4 and import into iTunes, then sync with your device.
To mount a Windows or Samba SMB fileshare:
mount -t cifs //ntserver/download -o username=user,password=myPassword /mnt/ntserver
Passing *both* stdout and stderr to the pipe.
<command> 2>&1 | <command2>
Passing only stderr to the pipe:
exec 3>&1 <command> 2>&1 >&3 3>&- | <command2> 3>&- exec 3>&-
Use the following command to dump a directory structure to a remote tape drive:
tar cv --rmt-command=/sbin/rmt --rsh-command /usr/bin/ssh -f <remote_host>:/dev/st0 --directory /path/to/source/dir --label "Label for backup" <directory_name>
Use the following command to recover a directory structure from a remote tape drive:
tar xv --rmt-command=/sbin/rmt --rsh-command /usr/bin/ssh -f <remote_host>:/dev/st0
Of course, as always with the tar command, one can specify the files/sub-directories to be recovered if one wishes.
Add the following to /etc/sysctl.conf:
net.ipv4.ip_forward = 1
Run the following command:
# sysctl -p /etc/sysctl.conf
Verify with:
# cat /proc/sys/net/ipv4/ip_forward 1