Tips & Tricks for *nix

These are various fun/funny things I've found out about *nix.
- Userland wall (write all) replacement:
So, you want to write to everyone on your Unix (or Unix like operating system)
but only root can execute the program wall (write all). Well try injecting
a custom message into syslog. Here's an example:
$logger -p emerg "Hello world"
This works because syslog is usually set to send emergency messages to every
terminal being used (virtual terminals as well). Lot's o' fun, and even more
uses... but I'll let you think about that :-)
- Tcpdump (writing to file and displaying the packet headers):
tcpdump is great for capturing data. Sometimes you want to store the data
in a pcap file but also see the headers of what your capturing.
tcpdump -w - -s0 -i eth0 host 192.168.2.1|tee data.dmp
|tcpdump -ln -r -
I/O redirection in *nix rocks!
- Using strings:
Strings is a utility to display printable characters in a file. By changing
options we can look for ACSII, Unicode, 16/32 bit strings in big/little endian.
$strings file.txt
returns nothing
However,:
$strings -e l file.txt
returns
This program is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License version
2, 1991 as published by the Free Software Foundation.
Copyright © 2004