Check These Out
ls -Q will show the filenames in quotes. xargs -p rm will print all the filenames piped from ls -Q and ask for confirmation before deleting the files.
without the -Q switch, if we have spaces in names, then the files won't be deleted.
Show external IP and geolocation information.
Primary feature is the use of tee to echo IP _and_ send to geoiplookup command...Use IP as input for as many commands as you want with more >( [command] )
Thanks to http://www.commandlinefu.com/commands/view/6334/
Requires MaxMind DB and geoiplookup tool.
Sample output has IP obfuscated on first line, lines 2-4 from having MaxMind Country && MaxMind City DBs installed
Useful for a cron job that runs nightly, gzipping or alternatively deleting files from a specific directory that are older than 10 days (in this case)
Get the IP of a hostname.
also search with aptitude search '~c'
populate the auth.hosts file with a list of IP addresses that are authorized to be in use and when you run this command it will return the addresses that are pingable and not in the authorized list.
Can be combined with the "Command line Twitter" command to tweet unauthorized access.
Brute force way to block all LSO cookies on a Linux system with the non-free Flash browser plugin. Works just fine for my needs. Enjoy.
##Dependancies: bash coreutils
Many executables in $PATH have the keyword somewhere other than the beginning in their file names. The command is useful for exploring the executables in $PATH like this.
$ find ${PATH//:/ } -executable -type f -printf "%f\n" |grep admin
lpadmin
time-admin
network-admin
svnadmin
users-admin
django-admin
shares-admin
services-admin
If you have used bash for any scripting, you've used the date command alot. It's perfect for using as a way to create filename's dynamically within aliases,functions, and commands like below.. This is actually an update to my first alias, since a few commenters (below) had good observations on what was wrong with my first command.
# creating a date-based ssh-key for askapache.github.com
$ ssh-keygen -f ~/.ssh/`date +git-$USER@$HOSTNAME-%m-%d-%g` -C 'webmaster@askapache.com'
$ # /home/gpl/.ssh/git-gplnet@askapache.github.com-04-22-10
# create a tar+gzip backup of the current directory
$ tar -czf $(date +$HOME/.backups/%m-%d-%g-%R-`sed -u 's/\//#/g'