Skip to content

Instantly share code, notes, and snippets.

View Annath's full-sized avatar

Nathan Miller Annath

View GitHub Profile
@Annath
Annath / metric-to-sae.svg
Last active August 11, 2022 05:51
Quick and dirty metric-to-SAE conversion chart
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Annath
Annath / dd-wrt-router-backup.sh
Created January 10, 2022 01:49
Quick and dirty backup script for a DD-WRT router with Twilio SMS notifications if it fails
#!/bin/bash
# Config variables supplied by the user
TWILIO_ACCOUNT_SID=""
TWILIO_AUTH_TOKEN=""
TWILIO_NUMBER=""
TO_NUMBER=""
LOCAL_BACKUP_PATH="/path/to/router-backups"
ROUTER_HOSTNAME="192.168.1.1"
-- initiate the mqtt client and set keepalive timer to 120sec
mqtt2 = mqtt.Client("huzzah", 120, "user", "pass")
mqtt2:on("connect", function(con) print ("connected") end)
mqtt2:on("offline", function(con) print ("offline") end)
-- on receive message
mqtt2:on("message", function(conn, topic, data)
print(topic .. ":" )
if data ~= nil then
@Annath
Annath / .bashrc
Last active April 16, 2017 03:52
Typical additions to my bashrc
export PS1="\[\e[00;37m\]\u@\h:\w \$? \\$ \[\e[0m\]"
alias pcp="time rsync --progress -ah"
alias ll="ls -lhF"
alias dfs="du -hx -d 1 . | sort -hr"
#include <Adafruit_NeoPixel.h>
#define NEOPIXEL_PIN 6
#define NEOPIXEL_NUM_PIXELS 30
typedef enum
{
UP,
DOWN,
} AnimationDirection;
@Annath
Annath / servo.py
Last active September 25, 2015 08:46
Quick servo code for the Beaglebone Black using the Adafruit BBIO python library and a Parallax Standard servo
import Adafruit_BBIO.PWM as PWM
servo_pin = "P8_13"
duty_min = 2.5
duty_max = 13.1
duty_span = duty_max - duty_min
PWM.start(servo_pin, duty_span * 0.5, 60.0)
while True: