Wednesday, 23 March 2011

steghide

Hey pervs,

quick notes :P

[root@hermes]#yum install steghide -y

[root@hermes]#steghide --embed --embedfile call-handling.pdf --passphrase salami \
--coverfile DSC02036.jpg --stegofile image.jpg --encryption rijndael-256
embedding "call-handling.pdf" in "DSC02036.jpg"... done%
writing stego file "image.jpg"... done

[root@hermes]#steghide --extract --stegofile image.jpg --passphrase <some_pass> \ 
--extractfile file.pdf
wrote extracted data to "file.pdf".

[root@hermes]# du -sk image.jpg DSC02036.jpg call-handling.pdf
2716    image.jpg
2724    DSC02036.jpg
108    call-handling.pdf


nough said :)

Thursday, 17 March 2011

simple mysql backup

A simple mysqldump script.. keep only 7 days of backups

#!/bin/bash
USER=root
PASS=your_password

mkdir -p /backup/mysqldump/
find /backup/mysqldump/ -mtime +7 -exec rm {} \;

for x in `mysql -Bse "show databases" -u $USER --password=$PASS` ; do
mysqldump -u $USER --password=$PASS $x | gzip -9 > /backup/mysqldump/$x.`date +%Y%m%d`.gz
done


Linux Server Hacks (v1)

:)

cool tricks with pv

Blog come... blogs go... Im just keeping some notes here...

1) Simulate typing
echo "You can simulate on-screen typing just like in the movies" | pv -qL 10

2) Monitor progress of a command
pv access.log | gzip > access.log.gz

3) copy working directory and compress it on-the-fly while showing progress

tar -cf - . | pv -s $(du -sb . | awk '{print $1}') | gzip > out.tgz

4) dd with progress bar and statistics

dd if=/dev/sdc bs=4096 | pv -s 2G | sudo dd bs=4096 of=~/USB_BLACK_BACKUP.IMG

5) [re]verify a disc with very friendly output

dd if=/dev/cdrom | pv -s 700m | md5sum | tee test.md5

6) time how fast the computer reads from /dev/zero

pv /dev/zero > /dev/null


Cheers to UrFix's Blog

:)