Commands

Here I list useful commands and snippets of code.

Linux

Iptables NAT IRC DCC helper module.

# modprobe ip_nat_irc

To force USB to version 1.1 transfer mode.

# rmmod ehci_hcd

To list PCI devices.

$ lspci -k -v

To list USB devices.

$ lsusb -k -v

-k Show kernel drivers handling each device and also kernel modules capable of handling it.
-v Be verbose and display detailed information about all devices.

ffmpeg how to

Ffmpeg can convert many movie formats including .flv
to see what formats ffmpeg will support, use this command.

ffmpeg -formats

For example to convert a flv to a avi.

ffmpeg -i <FILE>.flv <FILE>.avi

You may want other options for quality etc. see the man page fore more details.

man ffmpeg

How to extract a chapter off a DVD.

$ mencoder -chapter <CHAPTER>-<END_CHAPTER> dvd://<TITLE> -ovc copy -oac copy -o <FILE>.avi

How to pause and resume a program.

$ killall -STOP <PROGRAM>

To resume you type this.

$ killall -CONT <PROGRAM>

How to cut a file to last number of lines.

Note do not use the same file for input and output. The shell creates and truncates the outfile, so if you try you will have a empty infile.

$ tail -n<NUMBER_OF_LINES> <IN_FILE> > <OUT_FILE>

Test 5.1 surround sound.

Using alsa utils.

$ speaker-test -t sine -f 440 -c 6 -D surround51