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
afresh1 / 6rd_config.sh
Last active Dec 6, 2019
This script takes an IPv4 address, with optional mask, the v4 destination IP, a 6rd prefix with length and calculates the v6 IP and default gateway for OpenBSD. See also this gist: https://gist.github.com/afresh1/791343380b4410687d51fdd94f20bd42
View 6rd_config.sh
#!/bin/ksh
set -e
# Copyright (c) 2019 Andrew Hewus Fresh <andrew@afresh1.com>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
@afresh1
afresh1 / HTTP-Tiny-nc.pm
Last active Jun 6, 2019
An monkey patch to let perl's HTTP::Tiny to use the OpenBSD netcat with TLS support to access https sites without installing IO::Socket::SSL and Net::SSLeay.
View HTTP-Tiny-nc.pm
package HTTP::Tiny::nc;
use strict;
use warnings;
use parent 'HTTP::Tiny';
# Copyright (c) 2019 Andrew Hewus Fresh <afresh1@openbsd.org>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
@afresh1
afresh1 / Installing_an_OpenBSD_VM_under_FreeNAS.md
Last active Dec 11, 2018
Installing OpenBSD in a bhyve VM under FreeNAS
View Installing_an_OpenBSD_VM_under_FreeNAS.md
@afresh1
afresh1 / force_hires_move.pl
Created Nov 3, 2017
Forces File::Copy to use HiRes times in move.
View force_hires_move.pl
#!/usr/bin/perl
use v5.20;;
use warnings;
BEGIN {
require Time::HiRes;
# Has to come before importing File::Copy
Time::HiRes->export( 'File::Copy', qw( stat utime ) );
}
use File::Copy;
View !blogsum-app.psgi
#!/usr/bin/env plackup
use strict;
use warnings;
use Plack::Builder;
use Plack::App::File;
use Plack::App::WrapCGI;
BEGIN {
chdir "/var/www/blogsum" or die "Unable to chdir: $!";
@afresh1
afresh1 / admin.cgi.patch
Created Oct 12, 2017
blogsum as a Plack app
View admin.cgi.patch
--- 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 Sep 19, 2019
Installs or upgrades to the latest perl5 version for each major release, as well as the latest development version.
View plenv-install-latest.sh
https://github.com/afresh1/dotfiles/blob/master/plenv/libexec/plenv-install-latest
@afresh1
afresh1 / queue-status.pl
Last active Jul 22, 2017 — 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.
View queue-status.pl
#!/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 Mar 26, 2019
CenturyLink PPPoE and 6rd on an OpenBSD router
View !README.md

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 1440)

View acing-the-technical-interview.pl
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 }
You can’t perform that action at this time.