Skip to content

Instantly share code, notes, and snippets.

View sshimko's full-sized avatar

Spencer Shimko sshimko

View GitHub Profile
@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",
@sshimko
sshimko / gist:8467924
Created January 17, 2014 03:28
3 x PowerColor 7950, Sapphire 7950
{
"pools" : [
{
"url" : "stratum+tcp://us-east.multipool.us:7777",
"user" : "username.a",
"pass" : "a"
},
{
"url" : "stratum+tcp://us-west.multipool.us:7777",
"user" : "username.a",
@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 / 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 / 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 / authorization
Last active January 13, 2019 23:12
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 / otp.txt
Last active January 9, 2024 23:25
Yubikey + FreeIPA Manual Setup
In Yubikey tool:
1. Click OATH+HOTP tab
2. Click Advanced
3. Deselect token identifier.
4. Press Generate to create a new random seed.
#!/bin/sh
# this is a pre-connect script for Tunnelblick that displays a bnner prior to connect and bails if the user clicks "Decline".
# adjust the banner as needed for your compliance requirements.
# NOTE: after you add pre-connect.sh to your tblk config directory you must attempt to connect once and then in the subsequent dialog that appears
# you must alloiw tunnelblick to access the System UI Server.
#
banner="
You will be monitored.
If you are unauthorized or do not agree to the terms above, you are not permitted to use this system.
@sshimko
sshimko / extract-nssdb-to-pem.sh
Created January 11, 2019 16:19
Extracting keys + certs from nssdb
#!/bin/sh
pk12util -d . -r -n Server-Cert -o foo.p12
openssl pkcs12 -in foo.p12 -out foo-crt.pem -clcerts -nokeys
openssl pkcs12 -in foo.p12 -out foo-key.pem -nocerts -nodes
@sshimko
sshimko / ipset-ban.sh
Last active February 24, 2019 02:38
Add IPs to ipset amd use iptables to drop
#!/bin/sh
SETNAME=baddies
echo "Current stats of ipset ${SETNAME}"
iptables -LINPUT -n -v | head -n2
iptables -LINPUT -n -v | grep ${SETNAME}
echo -e "\nCreating or flushing the \"${SETNAME}\"."