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 / 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>
@jof
jof / parport_daemon.c
Created November 13, 2011 05:34
Parallel Port Daemon
#include <stdlib.h>
#include <errno.h>
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <strings.h>
#include <string.h>
#include <time.h>
#include <linux/ppdev.h>
#include <sys/ioctl.h>