Check These Out
Find all .gz files and recompress them to bz2 on the fly. No temp files.
edit: forgot the double quotes! jeez!
Search for files and list the 20 largest.
$ find . -type f
gives us a list of file, recursively, starting from here (.)
$ -print0 | xargs -0 du -h
separate the names of files with NULL characters, so we're not confused by spaces
then xargs run the du command to find their size (in human-readable form -- 64M not 64123456)
$ | sort -hr
use sort to arrange the list in size order. sort -h knows that 1M is bigger than 9K
$ | head -20
finally only select the top twenty out of the list
Assume that you have a form , in the source look for something similar to :
input name="rid" type="TEXT"
input name="submit" value="SUBMIT" type="SUBMIT" align="center"
Then exec the command to get the response into html
More info : www.h3manth.com
Place this in your .bash_profile and you can use it two different ways. If you issue 'h' on its own, then it acts like the history command. If you issue:
$ h cd
Then it will display all the history with the word 'cd'
Takes IP from web logs and pipes to iptables, use grep to white list IPs.. use if a particular file is getting requested by many different addresses.
Sure, its already down pipe and you bandwidth may suffer but that isnt the concern. This one liner saved me from all the traffic hitting the server a second time, reconfigure your system so your system will work like blog-post-1.php or the similar so legitimate users can continue working while the botnet kills itself.
% cat ph-vmstat.awk
# Return human readable numbers
function hrnum(a) {
b = a ;
if (a > 1000000) { b = sprintf("%2.2fM", a/1000000) ; }
else if (a > 1000) { b = sprintf("%2.2fK", a/1000) ; }
return(b) ;
}
# Return human readable storage
function hrstorage(a) {
b = a ;
if (a > 1024000) { b = sprintf("%2.2fG", a/1024/1024) ; }
else if (a > 1024) { b = sprintf("%2.2fM", a/1024) ; }
return(b) ;
}
OFS=" " ;
$1 !~ /[0-9].*/ {print}
$1 ~ /[0-9].*/ {
$4 = hrstorage($4) ;
$5 = hrstorage($5) ;
$9 = hrnum($9) ;
$10 = hrnum($10) ;
$17 = hrnum($17) ;
$18 = hrnum($18) ;
$19 = hrnum($19) ;
print ;
}
This will enable the possibility to navigate in the history of the command you type with the arrow keys, example "na" and the arrow will give all command starting by na in the history.You can add these lines to your .bashrc (without &&) to use that in your default terminal.