Skip to content

Instantly share code, notes, and snippets.

View spencerbutler's full-sized avatar

Spencer Butler spencerbutler

  • Twin Cities Open Systems, Incorporated
  • Minneapolis, MN
View GitHub Profile
@spencerbutler
spencerbutler / tos-finviz.sh
Created November 6, 2022 20:11
ThinkOrSwim - Grab symbols from FinViz that meet your float requirements.
#!/bin/sh
# Spencer Butler <github@tcos.us>
# ToS doesn't provide stock float infomation.
# Grab symbols from FinViz that meet your float requirements.
# In ToS Watchlist > Create watchlist > import > select the csv file
# You can then create a scanner and choose this watchlist to "Scan in:".
# Change this to the directory you want to save your watchlists.
outdir="$HOME"
########################################
# Fix this, it leaks RAM like crazytown.
# Freed 6G of RAM immediately after
# removing this card! --spencer
########################################
id: crooked_status
type: custom:config-template-card
variables:
- states['sensor.disk_use_percent'].state
@spencerbutler
spencerbutler / run-lnms-tests.sh
Created April 6, 2019 15:42
simple script to run tests for LibreNMS new OS definition
#!/bin/sh
dir='/home/spencer/build/librenms'
device="$lnms_host"
os='liebert'
run() {
cd $dir
rm cache/os_defs.cache
./discovery.php -h $device
#!/usr/bin/env bash
if [ ! $1 ]; then
echo "What VPN do you want to connect to?"
echo "Usage: $(basename $0) <changeme|anotherserver>"
exit
fi
if [ $(id -u) -ne 0 ]; then
echo 'use root'
exit
fi