Tue, 04 Oct 2005
find
find /etc -type f -print0 | xargs -0 grep 10.10.10.10 // finds all references to 10.10.10.10 in /etc
Posted at: 00:00 | category: /commands | Comments ()
tar
tar jvcpsf foo.tar.bz2 DirectoryWithDotFile/
// create a compressed archive called foo.tar.bz2 from
// the contents of DirectoryWithDotFile/
// j = compress thru bzip2
// v = verbose
// c = create
// p = preserve permissions
// s = same sort order on extract
// f = name of archive file follows this argument
// To Move An Entire Directory
(cd /src/dir; tar cf - .) | (cd /dst/dir; tar xvfp -)
or
cp -av /src/dir /dst/dir
// To backup a website using SSH and tar
ssh butakun@justhogs.org "tar cfzps - /home/butakun/www" > www.tar.gz
Posted at: 00:00 | category: /commands | Comments ()
To get php info from a server known to have php installed:
Method 1: create a php page of any name and in it use the function:
Method 2: in a browser, go to any php page on the server. Then paste the
following string to the URL after the .php ...
?=PHPB8B5F2A0-3C92-11d3-A3A9-4C7B08C10000
so you might have a URL like this:
http://domain.com/index.php?=PHPB8B5F2A0-3C92-11d3-A3A9-4C7B08C10000
To prevent this from showing up, edit your php.ini file as follows:
expose_php = Off
Posted at: 00:00 | category: /commands | Comments ()
enscript
enscript -2r filename // simple 2 column landscape enscript -G2rE -U2 filename // gaudy headers, 2 columns // code highlight, 2 up // very small text enscript --color --language=html --toc -p foo.html filename // prints file into html page foo.html enscript -G2rE filename // gaudy headers, 2 columns // good choice
Posted at: 00:00 | category: /commands | Comments ()
hping2
sudo hping2 -1 66.70.90.120 -1 is to send icmp packets instead of the default tcp packets. default is o.k., but my firewall drops the returning tcp packets, but not the icmp packets.
Posted at: 00:00 | category: /commands | Comments ()
Rustybear Blog