Skip to content

Instantly share code, notes, and snippets.

View rooreynolds's full-sized avatar

Roo Reynolds rooreynolds

View GitHub Profile
@rooreynolds
rooreynolds / sysinfo.sh
Created July 3, 2012 17:53
Publish Raspberry Pi system stats to Cosm
loadAvg=`uptime | cut -f 6 -d,`
upDays=`uptime | cut -f 4 -d " "`
upHours=`uprecords -s | sed -n '3p' | cut -c 23-25`
upMinutes=`uprecords -s | sed -n '3p' | cut -c 27-28`
upD=`echo "scale=5;$upDays + ($upHours / 24) + ($upMinutes / 24 / 60)" | bc`
users=`w | head -1 | cut -f 3 -d, | awk '{print $1}'`
memFree=`free -m | grep Mem | awk '{print $4}'`
swapFree=`free -m | grep Swap | awk '{print $4}'`
processes=`ps aux | wc -l`
wget -O - --header="X-Http-Method-Override:put" \
@rooreynolds
rooreynolds / get_completed_and_created.sh
Created July 3, 2012 17:58
Things - publish number or items completed and created today to Cosm
# get simple CSV showing number of items completed and created today
sqlite3 -csv ~/Library/Application\ Support/Cultured\ Code/Things\ beta/ThingsLibrary.db "SELECT
'completed', case when count then count else '0' end from (SELECT date(ZSTOPPEDDATE, 'unixepoch', '+31 years', 'localtime') as date,
count(Z_PK) as count from ZTHING WHERE ZSTATUS = 3 and date = (SELECT date('now')));
SELECT 'created', case when count then count else '0' end from (SELECT date(ZCREATIONDATE, 'unixepoch', '+31 years', 'localtime') as date,
count(Z_PK) as count FROM ZTHING WHERE ZCREATIONDATE != '' and date = (SELECT date('now')));"
@rooreynolds
rooreynolds / BlinkyBike.ino
Created August 22, 2014 14:34
BlinkyTape bike indicators
#include <FastLED.h>
#include <avr/pgmspace.h>
#include <Animation.h>
#include "steady.h"
#include "left.h"
#include "right.h"
#include <Button.h> // https://github.com/virgildisgr4ce/Button
#define LED_COUNT 60
struct CRGB leds[LED_COUNT];