Skip to content

Instantly share code, notes, and snippets.

View afresh1's full-sized avatar

Andrew Hewus Fresh afresh1

View GitHub Profile
@afresh1
afresh1 / soekris_net4511_pin2gpio.txt
Created July 14, 2013 04:00
A map of the Soekris net4511 physical pin to GPIO. http://soekris.com/products/net4511.html
http://soekris.com/products/net4511.html
jp3 on the Soekris net4511
pin -> gpio
3 -> 5
4 -> 6
5 -> 7
6 -> 8
7 -> 21
8 -> 22
@afresh1
afresh1 / setup_images.sh
Created July 23, 2013 02:30
Scripts to setup OpenBSD flashrd images and start qemu instances for each of them.
#!/bin/sh
# Andrew Fresh <andrew AT afresh1.com> - https://gist.github.com/afresh1
# This uses qemu, so pkg_add qemu
# Download and extract flashrd, either from github or here:
# http://www.nmedia.net/flashrd/
# Grab a flashrd image from here:
# http://www.nmedia.net/flashrd/images/
@afresh1
afresh1 / calagatorEvents.js
Last active December 24, 2015 11:19
A Google Script to copy Calagator Events I'm interested in to my calendar so I can get alarms. http://calagator.org https://script.google.com https://developers.google.com/apps-script/reference/calendar/
function calagatorFactory() {
var calagator = CalendarApp.getCalendarsByName('calagator')[0];
var start = new Date();
var end = new Date( start.getTime() + 7 * 24 * 60 * 60 * 1000 );
var findCopiedEvent = function(cal, event) {
var copy;
var events = cal.getEventsForDay( event.getStartTime() );
for (i in events) {
@afresh1
afresh1 / BingQuadkeys.pm
Created October 3, 2013 04:25
Translation of Bing Quadkeys helper functions to perl. Original code at http://msdn.microsoft.com/en-us/library/bb259689.aspx
package BingQuadkeys;
use Exporter qw(import);
use strict;
use warnings;
our @EXPORT_OK = qw(
clip
map_size
ground_resolution
map_scale
@afresh1
afresh1 / find_networks.sh
Last active July 16, 2018 14:30
A script to find and connect to known wifi networks on OpenBSD. Works for me on my iwn card in my laptop
#!/bin/sh
# find_network.sh - An OpenBSD Wireless Network configurator
# Looks for available networks listed at the end of the script
# Use this by adding "!/path/to/find_network.sh \$if" to your wlan hostname.if
if=$1
if [ -z "$if" ]; then
echo "Usage: $0 interface" >&2
exit 2;
fi
@afresh1
afresh1 / make_updated_ports.pl
Last active December 28, 2015 14:49
A script that will create updated "starter" Makefiles for OpenBSD perl ports available on the CPAN. Should only require things in the base system, but does like an up-to-date /usr/ports path.
#!/usr/bin/perl
use strict;
use warnings;
# Copyright (c) 2013 Andrew 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.
#
@afresh1
afresh1 / keybase.md
Created April 8, 2014 15:01
Verify who I am on Keybase.

Keybase proof

I hereby claim:

  • I am afresh1 on github.
  • I am afresh1 (https://keybase.io/afresh1) on keybase.
  • I have a public key whose fingerprint is 5B9A 7176 B30A 8D42 37D6 B9B3 4811 F661 BF7B CEAD

To claim this, I am signing this object:

@afresh1
afresh1 / firefox
Last active May 12, 2016 18:40
~/bin/firefox for OpenBSD. Raises the ulimits needed to keep Firefox from crashing regularly. (~/bin is in my path before /usr/local/bin)
#!/bin/sh
ulimit -n $(ulimit -Hn)
ulimit -d $(ulimit -Hd)
exec /usr/local/bin/firefox "$@"
@afresh1
afresh1 / lock_screen
Last active August 29, 2015 14:07
A set of scripts to lock my screen and turn off the laptop screen
#!/bin/sh
if ! pgrep xlock >/dev/null 2>&1; then
xlock -lockdelay 0 -endCmd ssh-add &
sleep 1
fi
sudo -k
ssh-add -D
@afresh1
afresh1 / reprove.pl
Created November 24, 2014 23:30
A script that checks for changed files and re-runs prove if they have changed.
#!/usr/bin/perl
use strict;
use warnings;
use 5.010;
use File::Find;
my %options_that_take_arguments = map { $_ => 1 }
qw( I P M e exec harness formatter source a archive j jobs state rc );