Perfect_Printers

I wrote this a loong time ago, it amuses me to see that it still seems to work.
The comments in this one make it pretty self-explanatory;

#!/bin/sh
# This gives a list of only the perfectly supported printers under Linux
# It makes a nice list to take with you when you're going to the store.
# 
# The current list of printers include these manufacterers;
# Alps Anitech Apollo Apple Avery Brother CalComp Canon Casio Citizen 
# CItoh Compaq DEC Dell Dym Epson Fuj Fujifilm Fujitsu Generic Genicom
# Gestetner Heidelberg Hitachi HP IBM Imagen Imagistics InfoPrint 
# Infotec Kodak KONIC Kyocera Lanier LaserMaster Lexmark Minolta 
# Mitsubishi NEC NFCP NRG Oce Oki Olivetti Olympus Panasonic PCPI 
# Pentax Pixma Printrex QMS Raven Ricoh Samsung Savin Seiko Sharp 
# SiPix Sony Star Tally TallyGenicom Tektronix Toshiba Tysso Xante 
# Xerox
# 
# Edit the line below to include the printer manufacturers that you have
# an interest in, then run this script.
 
Manufacturers="Brother Epson HP"
 
for Each in $Manufacturers 
 do
  echo "=-=-=-=- $Each -=-=-=-="
  elinks -no-numbering -dump 1 http://www.openprinting.org/printers/manufacturer/$Each \
  | sed -e '1,/Perfect/d' -e '/Mostly/,$d' -e '/^$/d'
 done

Bash_Boggle

I wrote this little script one evening a long time ago, for someone who wanted to take pre-printed sheets to work, as it was more stimulating than the work…

#!/bin/bash
# Print out a Boggle board to stdout.
# The 16 dice and their 6 sides each, this creates Dice[n]=
Dice=\
(QBAJOM EFIEYH ODENWS HPSEIN GKYLUE ILUWRG CITAOA BYLTIA \
 DZNVEA ODUNKT RHASOM PAECMD GVZTEI OFIRXB REALSC PELUTS)
#
AllDice="  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15"

# Cut the string that represents the order of the dice in 
# the tray 99 time at some random point, then swap the parts
# around. Repeat as needed.
for ((a=1; a <= 100 ; a++))
do
   LeftCut=$(($(($(($RANDOM%15))*3))+3))
   RightCut=$((LeftCut+3))
   LeftEnd=${AllDice:0:LeftCut} 
   RightEnd=${AllDice:RightCut}
   Middle=${AllDice:LeftCut:3}
   AllDice="$Middle$LeftEnd$RightEnd"
done
# Roll the Dice to get what side is up.
Count=0
for Each in $AllDice
    do
    Side=$(($RANDOM%6))
    Die=${Dice[Each]:Side:1}
    [ $Die == Q ] && echo -n $Die"u " || echo -n $Die"  "
    [ $((Count%4)) -eq 3 ] && echo
    (( Count++ ))
    done

Pad

This generates a list of passwords, as a pad, I carry a subset of one of these with me in case I need a truly random password while I’m out.

#!/bin/bash
#      SRJ 2016-09-20 Create reasonable passwords
#      0        1         2         3         4         5         6         7
#      1234567890123456789012345678901234567890123456789012345678901234567890123456789
Chars="ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890.!@#$%&-_=+abcdefghijklmnopqrstuvwxyz"
# The column labels are taken from the beginning of the $Chars string
Count=${#Chars}   # Length of $Chars
R="60"   # Number of rows in output, 60 works well
C="6"   # Number of columns in output, 6 is the way
L="12"  # Length of string, 12 is ideal
# Shouldn't need to change anything below here
 
if [ ! -z ${1} ] ; then R="${1}" ; fi
if [ ! -z ${2} ] ; then C="${2}" ; fi
if [ ! -z ${3} ] ; then L="${3}" ; fi
 
d=$((L/2)) ; ((d++)) # Half of L plus 1
Sep="-"   # The Seperator at the top of each column
Blanks="" # This line and next generate the empty space at the beginning of each line
for z in $(seq 1 ${#R}) ; do Blanks+=" " ; done
 
Ran()
{
Offset=$(($(head -c4 /dev/urandom | od -N2 -tu2 | sed -ne '1s/.* //p')%$Count))
echo "${Chars:${Offset}:1}"
};
 
# Generate the top two lines of the report, labeling the columns and adding
# a seperator line
for Row in $(seq -w 0 1)
do echo -n "${Blanks}| "
  for Column in $(seq -w 1 ${C})
  do for Place in $(seq -w 1 ${L})
    do if [ ${Row} = "1" ] ; then
      echo -n "${Sep}"
      else if [ ${Place} -eq ${d} ] ; then
        echo -n ${Chars:$((Column-1)):1}
        else echo -n " " ; fi ; fi
    done ; if [ ! ${Column} -eq ${C} ] ; then echo -n " " ; fi
  done ; echo ""
done
 
# Send out the rows and columns of random characters
for Row in $(seq -w 1 ${R})
do echo -n "${Row}| "
  for Column in $(seq -w 1 ${C})
  do for Place in $(seq -w 1 ${L})
    do echo -n "$(Ran)"
    done ; if [ ! ${Column} -eq ${C} ] ; then echo -n " " ; fi
  done ; echo ""
done