Skip to content

Instantly share code, notes, and snippets.

View abenson's full-sized avatar

Andrew Benson abenson

  • San Antonio, TX
View GitHub Profile
@abenson
abenson / lstwgdocs
Last active June 19, 2019 17:47
wordgrinder helpers
#!/bin/sh
if [ -z "$1" ]; then
echo "usage: $0 <file.wg>"
exit
fi
egrep '.documents.[0-9]+.name' "$1" | awk -F ': ' '{ print $2;}'
@abenson
abenson / sdclock.html
Last active July 30, 2018 21:58
us gov't shutdown clock
<html>
<head>
<style>
body {
background-color: black
}
</style>
<title>US Gov't Shutdown Clock</title>
</head>
<body>
@abenson
abenson / bin2chr.c
Created July 17, 2018 21:26
bin2chr
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
int main(int argc, const char *argv[])
{
uint8_t b = 0, c = 128;
int i;
@abenson
abenson / etc.sv.fstrim.dotrim
Last active May 9, 2023 22:12
Drive Trim Timer
#!/bin/sh
TIMEFILE=$(dirname $0)/fstrim.timer
LOGFILE=/var/log/fstrim.log
date -u >> $LOGFILE
/usr/bin/fstrim -a -v >> $LOGFILE 2>&1
touch $TIMEFILE
@abenson
abenson / nano
Last active March 3, 2022 03:09
nano
#!/bin/sh
echo "Starting a real editor"
sleep 1
exec vim "$@"
@abenson
abenson / etc.dnsmasq.conf
Last active January 29, 2024 04:12
adblock setup
...
# adblock
addn-hosts=/etc/hosts.adblock
...
#!/bin/sh
case "$1" in
"up" )
amixer set Master 1%+
;;
"down" )
amixer set Master 1%-
;;
"toggle" )
@abenson
abenson / msfvupdate
Last active November 4, 2021 13:31 — forked from misuchiru03/msfvupdate
Short script to install/update Metasploit on Void Linux
#!/bin/sh
# root check
if [ `id -u` != "0" ]; then
echo "This should be run as root."
exit
fi
# Dependency check for curl and rsync
missing=0
#!/bin/sh
# xupavail - see how many packages are available for upgrade
SUDO=
if command -v sudo >/dev/null &&
sudo -l | grep -q -e ' ALL$' -e xbps-install; then
SUDO=sudo
elif [ "$(whoami)" != root ]; then
SUDO='su root -c '\''"$@"'\'' -- -'
fi
@abenson
abenson / travis.sh
Last active March 7, 2018 23:45
you got any of them travises
#!/bin/sh
pkg="$1"
shift
if [ -z $pkg ]; then
echo "usage: $0 <pkg>"
exit
fi