Skip to content

Instantly share code, notes, and snippets.

View HBBisenieks's full-sized avatar

Hilary B. Brenum (they/them) HBBisenieks

View GitHub Profile
@HBBisenieks
HBBisenieks / client-script.js
Created May 10, 2019 17:30
js for new employee info webapp
/**
* README
*
* All of the checkbox automation that happens on the main
* HiringPage area is controlled by needsXXXX(role) functions.
* These functions are, as much as possible, controlled by
* switch() statements that will return true, and check the
* associated box, if one of the affiliations listed with
*
* case "affiliation":
@HBBisenieks
HBBisenieks / nano-wc.sh
Last active November 5, 2015 19:17
Simple script suitable for firing from a cron job for updating NaNoWriMo wordcount via their API
#!/bin/bash
# If you're writing your NaNo work in chunks, this compiles your chunks first
cat /path/to/NaNoWriMo/chunks/chunk_* > /path/to/NaNoWriMo/compiled.txt
# Set wordcount variable
wc=`wc -w /path/to/NaNoWriMo/compiled.txt | tail -n 1 | awk '{print $1}'`
# Get current wordcount from NaNoWriMo
nanowc=`curl http://nanowrimo.org/wordcount_api/wc/hbbisenieks | grep -oPm1 "(?<=<user_wordcount>)[^<]+"`
@HBBisenieks
HBBisenieks / .xmobarrc
Created October 16, 2015 18:40
Xmonad for NaNoWriMo
Config { font = "-*-Fixed-Bold-R-Normal-*-13-*-*-*-*-*-*-*"
, bgColor = "#444444"
, fgColor = "#cdcdcd"
, position = Top
, lowerOnStart = True
, commands =
[ Run Weather "KOAK" ["-t","Oakland International: <tempF>F","-L","55","-H","80","--normal","green","--high","red","--low","lightblue"
] 36000
, Run Cpu [ "-L" , "3"
, "-H" , "50"
@HBBisenieks
HBBisenieks / uniques.sh
Created September 22, 2014 18:58
Get basic statistics on unique and repeated words from a plaintext file.
#!/bin/bash
echo "$1 is `wc -w $1 | awk '{print $1}'` words long."
echo "It contains `cat $1 | awk '{ for (i=1; i<=NF; i++) print $i }' | sed -e 's/[,.;-*?"]//g' | tr A-Z a-z | sort | uniq | wc -w` unique words."
echo "It contains `cat $1 | awk '{ for (i=1; i<=NF; i++) print $i }' | sed -e 's/[,.;-*?"]//g' | tr A-Z a-z | sort | uniq -d | wc -w` words that are repeated at least once."
@HBBisenieks
HBBisenieks / add-printers.sh
Created September 12, 2014 19:06
Printer Deployment Script
#!/bin/sh
# Takes a list of printers in the form
# System Name, Display Name, Model, Location, Address
# and adds them to the system, extrapolating required driver
# and installing drivers as needed
if [ ! "$1" ]; then
echo
echo " Usage: ${0##*\/} list-of-printers.csv"
title At the Mountains of Madness
author H B Bisenieks & H P Lovecraft
homepage www.puzzlescript.net
noundo
norestart
zoomscreen 20x15
========
OBJECTS
@HBBisenieks
HBBisenieks / minecraf-server-notifier.sh
Last active December 26, 2019 23:42
A simple Minecraft server notifier using lsof and ssmtp to check for active player conections and send an email if players have logged in to the server since the last check.
#!/bin/bash
email="user@domain.com"
message="Someone has logged in to the Minecraft server"
if [ -s .players ]; then
lsof -iTCP:25565 -sTCP:ESTABLISHED > .players
else
lsof -iTCP:25565 -sTCP:ESTABLISHED > .players && echo "$message" | /usr/sbin/ssmtp "$email"
fi