Uninstall perl modules
perl -MExtUtils::Install -e "uninstall('/usr/lib/perl5/5.8.8/i486-linux/auto/Gaim/.packlist', 1, 1 );"
uninstall($packlist_file, $verbose, $dont_execute);
Removes the files listed in a $packlist_file.
If $verbose is true, will print out each file removed. Default is false.
If $dont_execute is true it will only print what it was going to do without actually doing it. Default is false.
Convert a Unix timestamp to a readable format
date -d '1970-01-01 1045126013 sec' +"%Y-%m-%d %T %z" perl -e 'print scalar localtime 1045126013\n'
HEX edit in vi
vi ~/binfile now editing in vi [esc] :%!xxd now editing mycat in hex [esc] :%!xxd -r [esc] :wq!
You can also 'pre' xxd transform the file, then edit it, then transform it back when finished.
Extract the contents of a .rpm file
rpm2cpio rpmpackage.rpm | cpio -dmiv
Extract the contents of a .deb file
ar -x debianpackage.deb
Create an SSL key for a web-server
Make the key openssl req -config openssl.cnf -new -out server.csr
To remove the passwd openssl rsa -in privkey.pem -out server.key To set the duration openssl x509 -in server.csr -out server.crt -req -signkey server.key -days 999