User Tools

Site Tools


howtos:random_generator

Random Generator

Simple little script, based on Zenity, that delivers a random string through a GUI. As Zenity is GTK+ based it works best in Gnome.

#!/bin/sh

$(zenity --title="Random Generator" --question --text="Extra Cryptic?")
if [ $? -eq 0 ]
then
	LENGTH=`zenity --title="Random" --entry-text="12" --entry --text="Lenght of Password (max 60):"`
	RANDOM=`head -c 45 /dev/random | uuencode - | head -n 2 | tail -n 1 | cut -c -$LENGTH`
	zenity --title="Random Cryptic"  --entry-text=$RANDOM --entry --text="Random output:"
	exit 0
 else
	LENGTH=`zenity --title="Random" --entry-text="12" --entry --text="Lenght of Password (max 60):"`
	RANDOM=`head -c 45 /dev/random | uuencode -m - | tail -n 2 | head -n 1 | cut -c -$LENGTH`
	zenity --title="Random Base64"  --entry-text=$RANDOM --entry --text="Random output:"   
	exit 0
 fi
fi
howtos/random_generator.txt · Last modified: d/m/Y H:i by domingo