Skip to content

Instantly share code, notes, and snippets.

@isotopp
Created January 14, 2026 10:42
Show Gist options
  • Select an option

  • Save isotopp/02d95c383ebaa5b34662a4d32cba639b to your computer and use it in GitHub Desktop.

Select an option

Save isotopp/02d95c383ebaa5b34662a4d32cba639b to your computer and use it in GitHub Desktop.
bofhle-optimizer
acpid
alias
amidi
aplay
atobm
auchk
audit
auths
axfer
batch
bccmd
bdiff
beadm
blkid
bmtoa
brctl
btmon
btrfs
bwrap
byobu
bzcat
bzcmp
bzexe
capsh
chacl
chage
chcon
chcpu
chgrp
chmem
chmod
choom
chown
cjpeg
ckgid
ckint
ckstr
cksum
ckuid
clear
colrm
cryfs
ctags
ctail
ctrun
cupsd
cwebp
dbsql
dconf
dcopy
devnm
disks
djpeg
dladm
dmesg
dwebp
egrep
eject
elisa
emacs
encfs
error
fcadm
fdisk
fgrep
filan
fixnt
fixps
flock
fmadm
fruid
fsadm
fstyp
fuser
gchem
gcomm
gcore
gdate
gdbus
gdiff
gdisk
gecho
getty
gexpr
gfind
gfold
ggrep
ghead
gjoin
gkill
glink
gmake
gneqn
gnice
gperl
gpgsm
gprof
groff
grops
grpck
gsort
gstty
gsync
gtabs
gtail
gtest
gtput
gtrue
gtset
guniq
gzcat
gzcmp
gzexe
gznew
htdbm
ibadm
iconv
idmap
iftop
inetd
iotop
ipadm
ipcmk
ipcrm
iwspy
javac
javah
javap
jdeps
jexec
jinfo
jstat
kcalc
kinit
klist
kprop
kstat
lastb
lkbib
login
loweb
lsblk
lscpu
lshal
lsipc
lsmem
lsmod
lspci
lsusb
lzcat
lzcmp
mailq
mailx
mandb
mckey
mcomp
mcopy
minfo
mkdir
mknod
mmcli
mmove
mount
msgid
mtype
mvdir
mxtar
mysql
named
namei
ncftp
newfs
nginx
nmcli
nmtui
nohup
nping
nproc
nroff
nscfg
nstat
oscap
pacat
pacmd
pactl
padsp
pager
pamon
parec
pargs
partx
paste
patch
pbget
pbind
pbput
pcred
pdiff
pfcsh
pfctl
pfksh
pfzsh
pgrep
pgsql
phang
pidof
pinky
pkcon
pkgmk
pkgrm
pkill
pkmon
pldes
plget
plgrp
plser
ports
ppdpo
ppgsz
ppriv
prctl
preap
print
prove
proxy
psicc
pslog
psnup
psset
pstop
ptime
ptree
pwait
pwgen
pydoc
qdbus
qgltf
qlalr
qmake
qmljs
qperf
quota
rbash
rdate
rdmsr
refer
remsh
reset
rgrep
rmail
rmdir
rmmod
rnano
roles
route
rping
rsync
rtmon
runat
rview
rwall
rygel
saned
sdiff
share
shred
skill
sleep
snacc
snice
snmpd
snoop
socat
spell
split
spray
sprof
sshfs
strip
sxadm
tapes
tclsh
tcopy
timex
tkmib
tload
touch
troff
truss
trust
tsort
uflow
umask
uname
units
unrar
unzip
usbip
users
ustat
uuidd
vigpg
virsh
vwebp
watch
wdctl
which
whodo
whois
write
wrmsr
wsgen
xargs
xauth
xbiff
xcalc
xedit
xeyes
xhost
xinit
xkill
xload
xlogo
xmlwf
xmore
xprop
xzcat
xzcmp
xzdec
ypcat
ypset
zdiff
zdump
zgrep
zhack
zless
zmore
zpool
#! /usr/bin/env python3
from collections import Counter
from pprint import pprint
def score_word(w: str) -> int:
score = sum(letter_counts[ch] for ch in set(w)) # set(w) -> unique chars, sum(letter_counts[ch] = most common chars score highest
# print(f"{w=} {score=}")
return score
with open("bofhle.txt") as f:
lines = f.readlines() # all cmds
lines = map(str.strip, lines)
lines = map(str.lower, lines)
lines = list(lines) # no newlines, no upcase, no iterator (get a list)
letter_counts = Counter("".join(lines)) # use counter to get stats
for c, n in letter_counts.most_common(): # mosty common chars
print(c,n)
scored = [(score_word(w), w) for w in lines] # dict(score, word)
scored.sort(key=lambda x: (-x[0], x[1])) # sort by score
pprint(scored[0:9]) # 10 highest scores = best start words
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment