Check These Out
shell function which allows you to tag files by creating symbolic links directories in a 'tags' folder.
The tag function takes a tag name as its first argument, then a list of files which take that tag. The directory $HOME/tags/tagname will then hold symbolic links to each of the tagged files. This function was modified from bartonski's (http://www.commandlinefu.com/commands/view/10216) inspired by tmsu (found at https://bitbucket.org/oniony/tmsu/wiki/Home) with readlink function by flxndn (http://www.commandlinefu.com/commands/view/10222).
Example:
$ tag dog airedale.txt .shizturc weimeraner.pl
This will create $HOME/tags/dog which contains symbolic links to airedale.txt .shizturc and weimeraner.pl
NOTE: When opening the files you might need to strip the very top line with notepad++ as its a mistake header
This is useful when the local machine where you need to do the packet capture with tcpdump doesn?t have enough room to save the file, where as your remote host does
tcpdump -i eth0 -w - | ssh forge.remotehost.com -c arcfour,blowfish-cbc -C -p 50005 "cat - | gzip > /tmp/eth0.pcap.gz"
Your @ PC1 doing a tcpdump of PC1s eth0 interface and its going to save the output @ PC2 who is called save.location.com to a file /tmp/eth0-to-me.pcap.gz again on PC2
More info @: http://www.kossboss.com/linuxtcpdump1
Ever logged into a *nix box and needed to know which webserver is running and where all the current access_log files are? Run this one liner to find out. Works for Apache or Lighttpd as long as CustomLog name is somewhat standard. HINT: works great as input into for loop, like this:
$ for i in `lsof -p $(netstat -ltpn|awk '$4 ~ /:80$/ {print substr($7,1,index($7,"/")-1)}')| awk '$9 ~ /access.log$/ {print $9| "sort -u"}'` ; do echo $i; done
Very useful for triage on unfamiliar servers!
Good for summing the numbers embedded in text - a food journal entry for example with calories listed per food where you want the total calories. Use this to monitor and keep a total on anything that ouputs numbers.
Shows all block devices in a tree with descruptions of what they are.
I was using some twitter bots and twitter bloks my IP. Now im using some proxys and i use these command to validate the tweet was published.
You need to be root to do this. So check the command before running it.
You enter the same password for
Enter LUKS passphrase:
Verify passphrase:
Enter passphrase for /dev/loopn:
___
You can then copy the .img file to somewhere else.
Loop it it with losetup -f IMAGENAME.img and then mount it with a file manager (eg nemo) or run mount /dev/loopn /media/mountfolder
Acts similar to a mounted flash drive
Parallel does not suffer from the risk of mixing of output that xargs suffers from. -j+0 will run as many jobs in parallel as you have cores.
With parallel you only need -0 (and -print0) if your filenames contain a '\n'.
Parallel is from https://savannah.nongnu.org/projects/parallel/
Shows all block devices in a tree with descruptions of what they are.