Skip to content

Instantly share code, notes, and snippets.

@TheCase
TheCase / gist:a1bbf8bf54b643c17b7d
Last active August 29, 2015 14:11
Mac OS X - AppleScript to auto-align Terminal windows
# 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
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
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);
#!/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"

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:

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)
@TheCase
TheCase / check_pfsense_dpinger
Last active May 6, 2017 16:50
gateway check for pfSense
#!/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=''
@TheCase
TheCase / _commands
Last active November 28, 2018 15:18
nomad sample
yum -y install python-setuptools unzip wget
easy_install pip
pip install supervisor
wget https://releases.hashicorp.com/consul/0.8.0/consul_0.8.0_linux_amd64.zip
unzip consul*.zip
mkdir -p /opt/consul/data
mv consul /opt/consul
@TheCase
TheCase / commands.cfg
Created May 4, 2017 03:39
slack notifier for nagios/shinken in bash
define command {
command_name notify_host_by_slack
command_line $NAGIOSPLUGINSDIR$/post_to_slack.sh host $HOSTSTATE$ $NOTIFICATIONTYPE$ $HOSTNAME$ nil "$HOSTOUTPUT$" $CONTACT_PAGER$
}
define command {
command_name notify_service_by_slack
command_line $NAGIOSPLUGINSDIR$/post_to_slack.sh service $SERVICESTATE$ $NOTIFICATIONTYPE$ $HOSTNAME$ "$SERVICEDESC$" "$SERVICEOUTPUT$" $CONTACTPAGER$
}
# Config Section
# columns, rows per window
set cols to 80
set rows to 50
# first window, pixels down from top of screen
set top_margin to 0
# pixels per terminal column - this might vary by screen - use screencap to show pixel count