User Tools

Site Tools


howtos:random_generator

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
howtos:random_generator [12/01/2007 23:46] domingohowtos:random_generator [02/12/2018 21:34] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +====== 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.
  
 +<file>
 +#!/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
 +</file>