Skip to content

Instantly share code, notes, and snippets.

Andrew Fresh afresh1

Block or report user

Report or block afresh1

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
afresh1 /
Last active Sep 19, 2019
Installs the latest available of each release version of perl plus the latest development version with
afresh1 /
Last active Dec 11, 2018
Find the default IPv6 gateway and start forwarding traffic on OpenBSD and Comcast (XFinity)
# This should set up ipv6 on XFinity or Comcast on OpenBSD 6.1
# Stop everything
/usr/bin/pkill dhcp6c
route -qn delete -inet6 default
ifconfig $egress -inet6
afresh1 / sysutils-rclone-Makefile
Created Mar 10, 2017
OpenBSD port Makefile for rclone
View sysutils-rclone-Makefile
# $OpenBSD$
COMMENT = rsync for cloud storage
GH_PROJECT = rclone
GH_TAGNAME = v1.35
CATEGORIES = sysutils
# "include: /var/unbound/etc/ad-blacklist.conf" in /var/unbound/etc/unbound.conf
# run script as daily cron
TMPFILE=$( mktemp get_dns_blacklists-XXXXXXXXX )
trap 'rm -f $TMPFILE; exit 1' EXIT KILL INT QUIT TERM
ftp -VM -o- | grep ^ | awk '{ print $2 }'
afresh1 /
Last active Apr 24, 2018
A simple clusterssh clone to ssh into many machines at once in a single tmux session. Use `set synchronize-panes` to send commands to all panes at once.
# tssh -- Andrew Fresh <andrew AT>
set -e
if [ -z "$*" ]; then
echo "usage: tssh server1 [[[server2] server3] ...]"
exit 2
afresh1 /
Last active Sep 22, 2016
This script replaces the c_rehash perl script from openssl, at least the main functionality of it. From
# replaces the c_rehash perl script from openssl.
# by afresh1
rm -f *.[0-9]* *.r[0-9]*
for c in *.pem; do
[ "$c" = "*.pem" ] && continue
hash=$(openssl x509 -noout -hash -in "$c")
if egrep -q -- '-BEGIN( X509 | TRUSTED | )CERTIFICATE-' "$c"; then
afresh1 / create_github_labels.js
Created Jun 4, 2016
Creates "Sane GitHub Labels", paste into the javascript console on the issue page for your project.
View create_github_labels.js
labels = [
{ "name": "Priority: Low", "color": "#009800" },
{ "name": "Priority: Medium", "color": "#fbca04" },
{ "name": "Priority: High", "color": "#eb6420" },
{ "name": "Priority: Critical", "color": "#e11d21" },
{ "name": "Status: Abandoned", "color": "#000000" },
{ "name": "Status: Accepted", "color": "#009800" },
{ "name": "Status: Available", "color": "#bfe5bf" },
{ "name": "Status: Blocked", "color": "#e11d21" },
{ "name": "Status: Completed", "color": "#006b75" },
afresh1 / lock_screen
Created May 15, 2016
Lock screen and dpms off monitor. I have `command lock "lock_screen"` in ~/.cwmrc and `*/5 * * * * $HOME/bin/monitors_off` in my crontab.
View lock_screen
if ! pgrep xlock >/dev/null 2>&1; then
xlock -lockdelay 0 &
sleep 1
sudo -k
ssh-add -D
afresh1 / wtf.cgi
Created Jan 20, 2016
This simple program displays an issue with either slowcgi or httpd. It appears that the headers end after the first read instead of after the first blank line.
View wtf.cgi
use strict;
use warnings;
$| = 1;
print "foo: bar\r\n" for 1 .. 15;
print "\r\n";
print "quux\r\n";
afresh1 /
Last active Jul 10, 2017
A Mojolicious One Liner to serve static files from the current directory
exec perl -Mojo -E '$m=a("/");$m->static->paths(["."]);$m->start' daemon
You can’t perform that action at this time.