Skip to content

Instantly share code, notes, and snippets.

View sshimko's full-sized avatar

Spencer Shimko sshimko

View GitHub Profile
@sshimko
sshimko / authorization
Last active February 3, 2025 06:22
MacOS/OS X google authenticator pam configs for screensaver, ssh, sudo, authotization (GUI login)
# authorization: auth account
# !!! DO NOT USE !!!
# !!! USING THIS BREAKS ANY LOGIN AFTER THE FIRST LOGIN !!!
# !!! IT IS LEFT HERE AS A WARNING !!!
# this change impacts the GUI login at boot
# if it breaks in someway, there may very
# well be no way to recover.
#
# NOTE: if you use filevault, you filevault
# password will not change. you will decrypt
@sshimko
sshimko / vera_ad2usb_disarm.lua
Created January 21, 2015 01:29
Vera luup code to conditionally disable Ademco alarm via ad2usb
-- Handle the alarm
local state = luup.variable_get("urn:micasaverde-com:serviceId:AlarmPartition2", "DetailedArmMode", 7)
luup.log("Found alarm panel in '" .. state .. "' state when running Deadbolt PIN Entered scene.")
if ((state ~= "Ready") and (state ~= "NotReady")) then
luup.log("Sending Disarm command.")
luup.call_action("urn:micasaverde-com:serviceId:AlarmPartition2", "RequestArmMode", { State="Disarmed", PINCode="1234"} , 7)
end
@sshimko
sshimko / bash-debug-shell.sh
Created December 28, 2014 17:17
A BASH debug shell for scripts
#!/bin/bash
HISTSIZE="10000"
set -o history
function debug() {
# Export arrays since BASH doesn't.
declare -a -p |grep -v BASH_ > ${tmpdir}/bash_arrays
history|sed -E 's/^[[:space:]]*[0-9]+[[:space:]]+//' > ${tmpdir}/debug.hist
PS1="DEBUG SHELL> " HISTFILE=$(ls ${tmpdir}/debug.hist) /bin/bash --rcfile ${tmpdir}/bash_arrays -o history|| true
@sshimko
sshimko / export-all.sh
Created December 4, 2014 16:45
BASH - export all variables and functions to subshells
export -a
for f in $(declare -F | awk '{ print $3; }'); do
eval declare -f -x $f
done
@sshimko
sshimko / cgminer.conf
Created January 13, 2014 03:01
1,880kh/s cgminer config for three PowerColor 7950s. All cards are undervolted from 1.25 1.081. GPU 0 and GPU 2 are stock cooling, but still differ in performance characteristics and thus require slightly different parameters for optimum utilization and efficiency. GPU 1 is the same card that I modified with a aftermarket cooler - Gelid Icy Visi…
{
"pools" : [
{
"url" : "stratum+tcp://<url>:<port>",
"user" : "username.worker",
"pass" : "a"
},
{
"url" : "stratum+tcp://<url>:<port>",
"user" : "username.worker2",