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 / 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
case "$1" in
"up" )
amixer set Master 1%+
;;
"down" )
amixer set Master 1%-
;;
"toggle" )
@abenson
abenson / etc.dnsmasq.conf
Last active January 29, 2024 04:12
adblock setup
...
# adblock
addn-hosts=/etc/hosts.adblock
...
@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.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 / 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 / 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 / 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 / expand_net
Created March 15, 2019 01:13
"expand_net" wrapper for nmap
#!/bin/sh
SORT="cat"
if [ "$1" = "-r" ]; then
shift
SORT="sort -R"
fi
if [ -z "$1" ] || [ "$1" = "-h" ]; then
@abenson
abenson / git.sh
Last active June 29, 2020 01:00
getting lazier and lazier
alias co='git checkout'
alias ci='git commit'
alias ga='git add'
alias addp='git add -p'
alias status='git status'
alias gdiff='git diff'
alias gpatch='git diff --no-prefix'
alias show='git show'
alias wdiff='git wdiff'
alias br='git branch'