Monthly Archives: December 2012

Screenshot with date and Countdown

Install: save code to /usr/bin/screenshot
Usage: $ screenshot 5
five us for 5sec countdown

#!/bin/sh
if [ $1 ]
then
	scrot -cd $1 "%Y-%m-%d_`echo $(date +%H-%m-%S)`.png" -e 'mv $f /home/modinfo/shots/'
        echo "Screenshot save in: /home/modinfo/shots/`echo $(date +%Y-%m-%d_%H-%m-%S)`.png"
else
	scrot "%Y-%m-%d_`echo $(date +%H-%m-%S)`.png" -e 'mv $f /home/modinfo/shots/'
        echo "Screenshot save in: /home/modinfo/shots/`echo $(date +%Y-%m-%d_%H-%m-%S)`.png"
fi

Create md5 from string im Linux

How to install?
Create new file

nano /usr/bin/md5

copy&paste code to /usr/bin/md5

chmod:

chmod +x /usr/bin/md5

Code:

#!/bin/sh
if [ $1 ]
then
        hash="$(echo -n "$1" | md5sum )"
        echo "$hash"
else
        echo "Example usage: md5 <you-string>"
fi

Usage and Output:
root@host:~# md5 sebastian
c2d628ba98ed491776c9335e988e2e3b  –