Skip to content

Instantly share code, notes, and snippets.

View jof's full-sized avatar
🐈‍⬛
Surviving

Jonathan Lassoff jof

🐈‍⬛
Surviving
View GitHub Profile
@jof
jof / README.md
Created May 11, 2026 19:04
CAMT.053 Max Balance Finder — because your bank won't just tell you

CAMT.053 Max Balance Finder

Why does this exist?

So you're an American living abroad. You have a bank account in another country because, you know, you live there. You buy groceries with it. You pay rent. Normal stuff.

But the US government would like you to know that they are very interested in your foreign bank account. Not necessarily to tax it, mind you — just to... know about it. Track it. Keep tabs. The IRS requires you to report the peak value of every foreign financial account you hold during the year via FBAR (FinCEN Form 114). And if your accounts cross certain thresholds, you get to fill out FATCA Form 8938 too. Fun!

So you think, okay, I'll just ask my bank what my maximum balance was this year. Simple question, right?

@jof
jof / show_aws_inside_addressing.rb
Last active August 29, 2015 14:11
AWS VPC VPN Tunnel Addressing
jof@thq-m-jlass01 ~/tmp % ruby show_aws_inside_addressing.rb
+---------+-----------+--------------+-----------------------------+-------------------------------+---------------------------------+---------------------------------+---------------------------------+
| Account | Region | VPN ID | VPN Name | Local TEPs | AWS TEPs | Tunnel 1 Inside IPs | Tunnel 2 Inside IPs |
+---------+-----------+--------------+-----------------------------+-------------------------------+---------------------------------+---------------------------------+---------------------------------+
| prod | us-west-1 | vpn-xxxx | aws-common-gateway0-testing | x.x.x.x / x.x.x.x | 204.246.160.78 / 204.246.163.62 | 169.254.253.18 / 169.254.253.17 | 169.254.253.22 / 169.254.253.21 |
| prod | us-west-1 | vpn-xxxx | aws-prod-gateway0 | x.x.x.x / x.x.x.x | 204.246.163.62 / 204.246.160.78 | 169.254.253.22 / 169.254.253.21 | 169.254.253.
@jof
jof / gist:8530994
Created January 20, 2014 22:51
Totally awesome/useless LCD number maker.
class LCDMaker
def initialize(size)
@size=size
end
def h_bar
a = []
a << ' '
a << ('-' * @size)
a << ' '
end
jof@cucumis ~/tmp % ruby greenspeak.rb 10
locally-sourced, hyperlocal photons
cage-free internet
grass-fed bits
hyperlocal, local web browsing
sustainable photons
locally-sourced, hyperlocal packets
cage-free, sustainable routes
local, locally-sourced photons
grass-fed, cage-free bits
@jof
jof / README.md
Last active September 23, 2019 20:23
GoPro Timelapse Creation Script

This script takes a directory of source images off of a GoPro camera (or something similar that takes time-lapse images), and creates a directory of images suitably-laid-out for ffmpeg, clustered by file creation time.

Example usage:

jof@cucumis ~/Desktop/timelapse/ffmpeg % gopro_timelapse ../ride_in .
Building destination symlink directories for 1 clusters.
You can now call ffmpeg like: ffmpeg -i /Users/jof/Desktop/timelapse/ffmpeg/sequence_0/image%04d.jpg sequence_0.mp4

Then, run ffmpeg as directed, and this will generate a time lapse movie into "sequence_0.mp4"

@jof
jof / netconf_nat_pool.rb
Created April 18, 2013 23:58
NETCONF-speaking script to poll a Juniper SRX NAT pool and stuff the metrics into Graphite
#!/usr/bin/env ruby
require 'rubygems'
require 'pry'
require 'socket'
$:.unshift '/home/jof/src/net-netconf/lib'
$:.unshift '/home/jof/src/net-ssh/lib'
require 'net/netconf'
require 'net/ssh'
@jof
jof / provision_debian_chroot.sh
Last active December 16, 2015 06:38
Userland Debian chroot
#!/bin/bash
debian_release=squeeze
rhel_major=6
epel_release_rpm="epel-release-6-8.noarch.rpm"
chroot=/debian
mkdir -p $chroot
_machine=`uname -m`
@jof
jof / bssid_hunter.rb
Created August 30, 2012 22:13
"Loudest APs" Kismet Client
#!/usr/bin/env ruby
load '/Users/jof/src/kismet/ruby/kismet.rb'
require 'time'
require 'rubygems'
require 'pry'
require 'awesome_print'
require 'yaml'
CLEAR_SCREEN = "\e[2J"
class File
def join_from_root(*args)
# Stringify objects.
args.map! { |a| a.to_s }
return self.join(SEPARATOR, *args)
end
end
@jof
jof / doorduino.c
Created November 28, 2011 01:21
Arduino Door Opener
#include <errno.h>
#include <stdio.h>
#include <string.h>
// Ardunio-specific headers
#include <Ethernet.h>
#include <Udp.h>
#include <SPI.h>
#include <stdarg.h>