Nerdier

Adjective: Comparative form of nerdy: more nerdy.

Makepasswd

I discovered this handy program while investigating generating password hashes and have written a little script that installs it and xclip and then puts a script in /usr/bin that allows you to type a command to generate a pass and copy it to your clipboard.


The current script is for Debian/Ubuntu.

#!/bin/bash

RED='\033[01;31m'
RESET='\033[0m'

if [ $EUID -ne 0 ] ; then

	echo -e $RED"This script must be run as root!"$RESET
	exit 1

fi 

if [ ! -f /usr/bin/makepasswd ] ; then

	sudo apt-get -y install makepasswd;

fi

if [ ! -f /usr/bin/xclip ] ; then

	sudo apt-get -y install xclip;

fi

touch /usr/bin/pw;

chmod +x /usr/bin/pw;

echo -e '#!/bin/bash\n\nmakepasswd --chars=15 | xclip -selection clipboard;\n\necho "Password copied to clipboard!"' > /usr/bin/pw;

echo -e $RED"Make password script installed, to use type pw into terminal.\nIt will generate a password and copy it to your clipboard. :)"$RESET

You can install it by doing as root;

wget http://imadinosaur.net/scripts/makepasswd && sh makepasswd

Example usage;

craig@marvin:~$ pw
Password copied to clipboard!
craig@marvin:~$

Leave a Reply

Your email address will not be published. Required fields are marked *