commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
This must be typed before any other characters have been entered on the line. Use fg, as usual, to resume the ssh session.
This uses fetchmail to issue an etrn command that causes the MTA on the secondary mail server to process the queue for the specified domain.
You can also just use telnet or nc to connect to port 25 of the server and then:
250 2.0.0 Queuing for node yourdomain.example.org started
This is best run as root to avoid permission denials that can produce false positives.
Obviously you can specify a directory in the usual way:
find -L dirname -type l
I can't remember where I read about this or who deserves the credit for it. The find(1) manual page hints strongly toward it, however.
The password is stored in the password file, which obviously must be kept secure, encrypted later with gpg, deleted, or whatever you prefer.
openssl enc -d -aes-256-cbc -salt -in filename.enc -out filename -pass file:/path/to/password-file
Alternative ciphers can be used, of course.
This exports a directory to the world in read/write mode. It is useful for
quick, temporary NFS exports. Consider restricting the clients to a subnet or
to specific hosts for security reasons (the client can be specified
before the colon).
On the client:
mount -t nfs4 hostname:/ /mountpoint
To terminate all of the exports (after unmounting on the client):
exportfs -u -a
Leave out the fsid=0 option if you don't want NFSv4.
This works under recent versions of Linux.
The J option is a recent addition to GNU tar. The xz compression utility is required as well.
If two or more IPv6 addresses are assigned to an interface, apply this command to all but the address that you want to use as the source address of outbound packets.
This is Linux-specific and requires the iproute package, or equivalent for your distribution.
This requires wvWare, which under Debian is in the wv package. Alternative converters can be used, e.g., jodconverter, which uses OO.O instead (no X server need be running.)