Skip to content

Instantly share code, notes, and snippets.

View briancline's full-sized avatar

Brian Cline briancline

  • SoftLayer / IBM Cloud
  • Dallas, Texas
View GitHub Profile
@briancline
briancline / holler.sh
Last active August 29, 2015 14:07
stuff to add to dotfiles
# git-retag
# courtesy gist:gumob/7064287
grt() {
if [ -n "$1" ]; then
git tag -d $1
git push origin :refs/tags/$1
git tag $1
git push --tags origin
else
echo "Please specify a name of tag."
discovery.dfw1:~% gitignore
zsh: do you wish to see all 112 possibilities (28 lines)? y
Actionscript Erlang Mercury Scrivener
Ada ExpressionEngine MetaProgrammingSystem Sdcc
Agda ExtJS-MVC Meteor SeamGen
Android Fancy Node SketchUp
AppceleratorTitanium Finale OCaml SugarCRM
ArchLinuxPackages ForceDotCom Objective-C Swift
Autotools Fortran Opa Symfony
Bancha FuelPHP OpenCart Symfony2
@briancline
briancline / 00-readme.md
Last active February 22, 2017 05:37
Test Swift installation (multi-node)

These are based on updated instructions for the Swift multi-node setup guide.

Steps to install on Ubuntu 14.04, assuming at least two machines:

  1. Copy the below 3 scripts to each of your VMs (make sure to chmod +x each of them as well).
  2. Run 01-install-proxy-node.sh only on your proxy.
  3. Run 02-install-storage-node.sh only on each of your storage nodes, prefixing the command with NODE=1, where 1 is the number for that storage node (must start at 1 and increment). For instance: NODE=1 ./02-install-storage-node.sh on your first storage node, NODE=2 ./02-install-storage-node.sh on your second storage node, etc.
  4. For each of the exports provided to you by the storage node install script (STORAGE_N_IP and STORAGE_N_DISKS), copy and paste them into your shell on the proxy. Then, running set | grep -a '^STORAGE_' from your proxy should show you all the storage nodes' exports.
  5. On the proxy, run 03-build-rings.sh. It will show you all the nodes and disks it discovered from your environment, build the
@briancline
briancline / stuff.md
Last active August 29, 2015 14:02
Useful random junk

Python Stuff

pip install https://github.com/briancline/repo/archive/7aa7cea9cb2d425362cda6bc0e8ac94924436752.zip

Linux Containers (LXC) Stuff

@briancline
briancline / gist:e9b019c778a97027fce3
Last active August 29, 2015 14:01
Finding default mutables in Python via Sublime Text

Matches all defs, including multi-line defs:

def\s+\w+\(((?!\):).|\n)+\):

Matches all instances of ={ and =[:

=(\[|\{)
@briancline
briancline / goodnight.py
Created April 8, 2014 04:12
Example Philips Hue dim script
#!/usr/bin/env python
from __future__ import print_function
from heliotron import Bridge
# ...and by heliotron I mean https://github.com/briancline/heliotron
bridge = Bridge(ip='10.0.0.42', app_name='testscript')
lights = bridge.get_lights()
print('Good night!')
@briancline
briancline / cashmoney.c
Last active August 29, 2015 13:57
Cashmoney Indentation Standard (C$'14)
#include <stdio.h>
#define $$$ /**/
int main(int argc, char* argv[]) {
$$$ $$$ $$$ $$$ printf("cashmoney indentation or bust\n");
$$$ $$$ $$$ $$$ return 0;
}
@briancline
briancline / gotemp-read-osx.cpp
Last active August 29, 2015 13:57
OSX C++ version of the Python script I normally use under Linux to gather temperature from Go!Temp temperature sensors. Thanks for making everything about USB HID difficult, Apple.
/*
* Ugh. This code is pretty bad. But, it's the only basis I've been able
* to use successfully on OSX, since Apple stupidly auto-claims every single
* HID device on the system, making it unwritable via libusb, etc. unless you
* write an actual driver for it.
*
* So this will have to do.
*/
/*********************************************************************************
@briancline
briancline / version-sort.py
Created March 5, 2014 19:47
Safe-ish version number list parsing from stdin
#!/usr/bin/env python
from __future__ import print_function
import sys
def _leloo_multiparse(v):
parse_fn = None
try:
import pkg_resources
@briancline
briancline / ifcfg-he-ipv6
Created March 5, 2014 03:45
HE.net IPv6 Tunnel Broker - CentOS/RHEL/Fedora NIC config
DEVICE="he-ipv6"
DEVICETYPE=sit
BOOTPROTO=none
ONBOOT=yes
IPV6INIT=yes
IPV6TUNNELIPV4=184.105.253.10
IPV6TUNNELIPV4LOCAL=XXX.XXX.XXX.XXX
IPV6ADDR=2001:470:YYYY:YYYY::2/64
IPV6_DEFAULTGW=2001:470:YYYY:YYYY::1