scrot -s
– takes screenshots of an areaapg -a 1 -m 6 -x 6
pwgen
figlet foo
– creates an ASCII art formatted textMrxvt is a multitabbed terminal emulator based on RXVT. It doesn't require any heavy libraries like QT or GTK so it's ideal for a low powered laptop machine.
Place this into your ~/.Xdefaults
file for some nicer defaults.
mrxvt.font: 9x15 mrxvt.geometry: 100x30 mrxvt.reverseVideo: True mrxvt.loginShell: True mrxvt.scrollbarRight: True mrxvt.scrollbarStyle: rxvt mrxvt.bottomTabbar: True mrxvt.saveLines: 1500 mrxvt.visualBell: True Mrxvt.macro.Shift+Left: GotoTab -1 Mrxvt.macro.Shift+Right: GotoTab +1
Some tips:
Shift+Right
and Shift+Left
Shift+Ctrl+t
-tnum #
in command-line argsForward the webserver (port 127.0.0.1:80) at remote.host to your local machine (port 8080) and allow open this port (8080) on all local interfaces (-g):
$> ssh user@remote.host -L 8080:127.0.0.1:80 -N -g
Have you ever been logged into a machine (maybe even over multiple hosts) and then needed a file from you local host on that machine? Using a second connection with scp is a pain in the a** especially with multiple hops. The solution is zssh - a wrapper around SSH and the zmodem protocol.
On you local machine just install it (apt-get install zssh
is your friend) and probably add the following to your ~/.bashrc
alias ssh=zssh
When you are on the remote machine just press CTRL-Space
to go into interactive mode (very much like FTP). To send a file use this:
sz -e <file>
The -e
option works around non 8-Bit clean terminals. You only need the lrzsz
and ssh
packages installed on the remote machine.
Gives you some info about memory stats, IO and CPU states. Give sample rate in seconds as parameter.
#> vmstat 3
This is a powerful replacement for nslookup
Doing a zone transfer if allowed:
$> dig @nameserver domain.tld axfr
If a write failes the writer stays inaccessable sometimes - giving an error like this:
logical unit not ready, long write in progress
Resetting the SCSI or ATAPI bus doesn't help. The tool cdrdao has an option to reset the device properly:
#> cdrdao unlock
===== Copy an audio CD with cdrdao =====
Will use the recorder for reading and writing:
#> cdrdao copy --device 0,0,0 --driver generic-mmc --datafile /exchange/cd.img --eject
#> cdrecord -v dev=0,0,0 speed=16 driveropts=burnfree image.iso
You can embed Setup Commands for VIM in the source file. Here is an example for a Shell Script:
#Setup VIM: ex: et ts=2 nowrap syntax=sh :
From the manpage:
pgrep looks through the currently running processes and lists the process IDs which matches the selection criteria to stdout. All the criteria have to match. For example,pgrep -u root sshd
will only list the processes called sshd AND owned by root. On the other hand,pgrep -u root,daemon
will list the processes owned by root OR daemon.
pkill will send the specified signal (by default SIGTERM) to each process instead of listing them on stdout.
This is a nice replacement for constructions like kill `ps ax|grep 'foo'|grep -v 'grep'|awk '{print $1}'`
Sweet Network Analyzer (http://nast.berlios.de/) or just install the Debian Packages.
I like the -m
(map LAN via ARP requests) and the -g
(find a gateway host) switches most.
This command-line tool is within the sysstat
-package and provides information about the cpu load/usage and/or about basically any device in /dev/.
usage: iostat [device [device2..]] [refrehrate in sec] [repeats]
refrehsrate defaults to 0, means no repeats at all.
repeat defaults to infinite.
This command-line tool displays package information and Usage of several network interfaces. It has a console-graphical interface and serveral configuration options. See man-page.
To fetch a whole site use this command:
$> httrack -K0 -%q0 --keep-alive --urlhack -D http://www.example.com
This gives you the suggested crop parameters:
$> mplayer -vf cropdetect somemovie.avi
This concats two avi files
$> cat part1.avi part2.avi| mencoder -noidx -ovc copy -oac copy -o output.avi -
For rotating MJPEG movies as produced by the PowerShot S2 IS. This is not completely lossless but the best way I could find:
$> mencoder -vf rotate=2 -ovc lavc -lavcopts vcodec=mjpeg -oac copy -o output.avi input.avi