Skip to content

Instantly share code, notes, and snippets.

View talos_upgrade.sh
#!/bin/bash
set -uo pipefail
version=""
CEPH_HEALTH_TIMEOUT="15m"
NODE_HEALTH_TIMEOUT="15m"
NODE_UPGRADE_TIMEOUT="15m"
View keybase.md

Keybase proof

I hereby claim:

  • I am smarthall on github.
  • I am smarthall (https://keybase.io/smarthall) on keybase.
  • I have a public key ASBwv-LmwQhwYFEcoZU7EJus8dpu7abfW1kyRzD3lq2j4Ao

To claim this, I am signing this object:

@smarthall
smarthall / lifx.c
Created Aug 12, 2015
LIFX Packet Sending Example
View lifx.c
#include "lifx.h"
#include <arpa/inet.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
View gist:39d9db9392de8dbff1f8
### Keybase proof
I hereby claim:
* I am smarthall on github.
* I am smarthall (https://keybase.io/smarthall) on keybase.
* I have a public key whose fingerprint is A7FC 317E A9D0 5A34 45E7 2BCD 8AD9 D99E 2E0A 44E2
To claim this, I am signing this object:
@smarthall
smarthall / fetchlistfromdict.py
Last active Feb 16, 2018
Getting lists from dictionaries in Ansible
View fetchlistfromdict.py
# In Ansible lots of things take lists (or comma seperated
# strings), however lots of things return dicts. One
# example of this is the hostvars and groups variable.
#
# groups returns a list of machines in a group, and
# hostvars is a dict containing all the hosts. So if you
# need a list of ip addresses of those hosts for the
# route53 module you cant. This filter makes this possible.
def fetchlistfromdict(d, l):
@smarthall
smarthall / 0_reuse_code.js
Created Jun 21, 2014
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View gist:7900976
http://filamentgroup.com/lab/responsive_design_approach_for_complex_multicolumn_data_tables/
@smarthall
smarthall / gist:7867898
Created Dec 9, 2013
Easy function for switching/making Python Virtualenvs. Put in your ~/.bashrc
View gist:7867898
function pve {
VENVFILE="$HOME/usr/venv/$1/bin/activate"
if [ -f $VENVFILE ]; then
source $VENVFILE
else
virtualenv $HOME/usr/venv/$1
source $VENVFILE
fi
}
@smarthall
smarthall / display.sh
Last active Dec 18, 2015
Beaglebone to OpenSegment code for REA Hack Day 2013
View display.sh
#!/bin/bash
# To use:
# Plug the left display into pin 24 on connector P9
# Plug the right display into pin 21 on connector P9
if [ -f /sys/devices/bone_capemgr*/slots ]; then
# Create and setup the UART devices if needed
if [ -f /dev/ttyO1 ]; then
echo BB-UART1 >/sys/devices/bone_capemgr*/slots
@smarthall
smarthall / gist:4095271
Created Nov 17, 2012
Fridge Data logger
View gist:4095271
// This file has moved into the glassfridge project.
// Find it here: https://github.com/smarthall/glassfridge
#include <SoftwareSerial.h>
// software serial #1: TX = digital pin 2, RX = digital pin 3
SoftwareSerial xbee(2, 3);
unsigned long nextreport;
#define REPORTINT 10000UL