Skip to content

Instantly share code, notes, and snippets.

View afresh1's full-sized avatar

Andrew Hewus Fresh afresh1

View GitHub Profile
@afresh1
afresh1 / admin.cgi.patch
Created October 12, 2017 02:29
blogsum as a Plack app
--- admin.cgi.orig Wed Oct 11 18:32:23 2017
+++ admin.cgi Wed Oct 11 18:32:52 2017
@@ -8,19 +8,19 @@
###########################
use strict;
use Blogsum::Config;
-my $database = $Blogsum::Config::database;
-my $blog_theme = $Blogsum::Config::blog_theme;
-my $blog_title = $Blogsum::Config::blog_title;
+our $database = $Blogsum::Config::database;
@afresh1
afresh1 / plenv-install-latest.sh
Last active September 19, 2019 19:12
Installs or upgrades to the latest perl5 version for each major release, as well as the latest development version.
https://github.com/afresh1/dotfiles/blob/master/plenv/libexec/plenv-install-latest
@afresh1
afresh1 / queue-status.pl
Last active July 22, 2017 22:12 — forked from dlangille/queue-status.pl
Would someone convert this to use File::Find for me please? I wrote this a loooong time ago. Thank you.
#!/usr/bin/perl
#
# $Id: queue-status.pl,v 1.3 2012/10/17 18:10:22 dan Exp $
#
# Copyright (c) 2001-2006 DVL Software
#
use strict;
use warnings;
@afresh1
afresh1 / !README.md
Last active January 3, 2024 21:52
CenturyLink PPPoE and 6rd on an OpenBSD router

Replacing the CenturyLink provided ethernet router with OpenBSD

Unfortunately CenturyLink provisions their fiber to the home with a PPPoE authentication over vlan 201, this makes replacing the router more difficult than it should be. I also had to call CenturyLink support to get the password for the PPPoE connection.

cnmac0 is the egress interface on my EdgeRouter Lite.

You also need to add match on pppoe0 scrub (max-mss 1452)

use v5.24.0;
use warnings;
use feature 'signatures';
no warnings 'experimental::signatures';
# https://aphyr.com/posts/340-acing-the-technical-interview
sub true() { 1 }
sub false() { 0 }
@afresh1
afresh1 / plenv-install-latest.sh
Last active September 19, 2019 19:13
Installs the latest available of each release version of perl plus the latest development version with https://github.com/tokuhirom/plenv
https://github.com/afresh1/dotfiles/blob/master/plenv/libexec/plenv-install-latest
@afresh1
afresh1 / start_inet6.sh
Last active May 8, 2020 17:24
Find the default IPv6 gateway and start forwarding traffic on OpenBSD and Comcast (XFinity)
#!/bin/sh
egress=$1
internal=$2
# 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
afresh1 / sysutils-rclone-Makefile
Created March 10, 2017 17:53
OpenBSD port Makefile for rclone
# $OpenBSD$
COMMENT = rsync for cloud storage
GH_ACCOUNT = ncw
GH_PROJECT = rclone
GH_TAGNAME = v1.35
CATEGORIES = sysutils
@afresh1
afresh1 / get_dns_blacklists.sh
Last active June 12, 2018 19:55 — forked from tvlooy/get_dns_blacklists.sh
Block ads by DNS
#!/bin/sh
# "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- https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts | grep ^0.0.0.0 | awk '{ print $2 }'
@afresh1
afresh1 / tssh.sh
Last active December 22, 2021 22:14
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.
#!/bin/sh
# tssh -- Andrew Fresh <andrew AT AFresh1.com>
set -e
if [ -z "$*" ]; then
echo "usage: tssh server1 [[[server2] server3] ...]"
exit 2
fi
new=""