Skip to content

Instantly share code, notes, and snippets.

Avatar

Andrew Fresh afresh1

View GitHub Profile
View soekris_net4511_pin2gpio.txt
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 Jul 23, 2013
Scripts to setup OpenBSD flashrd images and start qemu instances for each of them.
View setup_images.sh
#!/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 Dec 24, 2015
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/
View calagatorEvents.js
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 Oct 3, 2013
Translation of Bing Quadkeys helper functions to perl. Original code at http://msdn.microsoft.com/en-us/library/bb259689.aspx
View BingQuadkeys.pm
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 Jul 16, 2018
A script to find and connect to known wifi networks on OpenBSD. Works for me on my iwn card in my laptop
View find_networks.sh
#!/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 Dec 28, 2015
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.
View make_updated_ports.pl
#!/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 Apr 8, 2014
Verify who I am on Keybase.
View keybase.md

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
~/bin/firefox for OpenBSD. Raises the ulimits needed to keep Firefox from crashing regularly. (~/bin is in my path before /usr/local/bin)
View firefox
#!/bin/sh
ulimit -n $(ulimit -Hn)
ulimit -d $(ulimit -Hd)
exec /usr/local/bin/firefox "$@"
@afresh1
afresh1 / lock_screen
Last active Aug 29, 2015
A set of scripts to lock my screen and turn off the laptop screen
View lock_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 Nov 24, 2014
A script that checks for changed files and re-runs prove if they have changed.
View reprove.pl
#!/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 );