bagneris.net


geek stuff > my cheatsheet

Commands I use from time to time, and the options and args of which I always forget.

Networking

The magical ssh forwarding:

$ ssh -NnL 2222:server.to.reach:2222 server.in.the.middle

Do this in a screen, open a new screen window and:

$ ssh -p 2222 me@localhost

Shell

Uncompress and untar a .tar.bz2 file:

$ bzcat file.tar.bz2 | tar xf -
$ tar --bzip2 -xf file.tar.bz2

Compress and tar a directory:

$ tar --bzip2 -cf outfile.tar.bz2 thedir

Latex

Spellcheck a latex source:

$ ispell -d francais-TeX8b source.tex

Here, the source is supposed to be in French, and with latin-1 encoding.

NetBSD

Find the current kernel config options when you do not have the sources:

# config -x <kernel-binary>

Get rid of "missing: ./etc/rc.d/xdm" and "missing: ./etc/rc.d/xfs" messages on an X-less server: simply add:

./etc/rc.d/xdm                  type=file mode=0555     optional
./etc/rc.d/xfs                  type=file mode=0555     optional

to /etc/mtree/special.local. As usual, man mtree for details.

Debian

Which package does this file belong to?

$ dpkg -S filename

Change timezone

$ sudo dpkg-reconfigure tzdata

Miscellaneous

Make a screenshot:

$ convert X: shot.png

Burn an iso with wodim:

$ wodim -v dev=/dev/scd0 speed=4 blank=fast foobar.iso

Rip a CD, flac encoding:

$ abcde -p -o flac:"-8" -d /dev/scd0

geek stuff

licence CC

Creative Commons License BY-NC-SA

A Django site.