Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
peak awesomeness imminent

Bryan Casey TheCase

💭
peak awesomeness imminent
View GitHub Profile
@TheCase
TheCase / check_pfsense_dpinger
Last active May 6, 2017
gateway check for pfSense
View check_pfsense_dpinger
#!/bin/sh
# add this file as /usr/local/libexec/check_pfsense_dpinger
# apinger is gone. This is a new RTT check based on output available from the dpinger sockets
FILES=$(find /var/run | grep dpinger | grep sock)
stateid=0
message=''
View gist:ba86e6bd7a9587b3217bba41f4718ebf
root@raspberrypi:/opt# ./infinitive -httpport=80 -serial=/dev/ttyUSB0
INFO[0000] opening serial interface: /dev/ttyUSB0
[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.
- using env: export GIN_MODE=release
- using code: gin.SetMode(gin.ReleaseMode)
[GIN-debug] GET /api/zone/1/config --> main.webserver.func1 (3 handlers)
[GIN-debug] GET /api/zone/1/vacation --> main.webserver.func2 (3 handlers)
[GIN-debug] PUT /api/zone/1/vacation --> main.webserver.func3 (3 handlers)
[GIN-debug] PUT /api/zone/1/config --> main.webserver.func4 (3 handlers)
View keybase.md

Keybase proof

I hereby claim:

  • I am thecase on github.
  • I am thecase (https://keybase.io/thecase) on keybase.
  • I have a public key ASDFU2NtXS3GJMPwqPULkHzQr55UiS56StyToheWbz11rAo

To claim this, I am signing this object:

View gist:c441a3d138dfab70ec6c
#!/usr/bin/expect
set cmd [lindex $argv 0]
eval spawn ssh admin@ap
set prompt ":|#|\\\$"
interact -o -nobuffer -re $prompt return
send "the-actual-passsword\r"
interact -o -nobuffer -re $prompt return
send "system led $cmd\r"
View OpenSCAD module example
module group1(high){
cylinder(r1=2, r2=4, h=high, $fn=30, center=true);
cube([5,5,high], center=true);
}
group1(10);
translate([0,0,20]) group1(30);
View gist:71b577126f067c083131
cur = 1h;
translate([0,0,1h]) cylinder(d1=1d, d2=8.5, h=1Bh, $fn=40); //1B
cur = cur + 1Bh
translate([0,0,cur]) cylinder(d=2d, h=2h, $fn=30); //2
cur = cur + 2h;
translate([0,0,cur]) cylinder(d=3d, h=3h, $fn=15); //3
cur = cur + 3h
@TheCase
TheCase / gist:a1bbf8bf54b643c17b7d
Last active Aug 29, 2015
Mac OS X - AppleScript to auto-align Terminal windows
View gist:a1bbf8bf54b643c17b7d
# Config Section
# columns, rows per window
set cols to 80
set rows to 50
# first window, pixels right and down from top left of screen
set left_margin to 20
set top_margin to 100