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 / ubuntu-14.04.1.json
Created November 25, 2014 20:58
Packer template for Ubuntu Server 14.04.1
{
"variables": {
"template": "unknown"
},
"builders": [
{
"type": "qemu",
"iso_url": "http://mirror.utexas.edu/ubuntu-iso/CDs-Ubuntu/14.04.1/ubuntu-14.04.1-server-amd64.iso",
"iso_checksum": "946a6077af6f5f95a51f82fdc44051c7aa19f9cfc5f737954845a6050543d7c2",
@briancline
briancline / hackjob.diff
Created November 17, 2014 16:49
Force Swift 1.12.0 to behave with self-signed SSL and Other™ SSL issues
diff --git a/test/functional/swift_testing.py b/test/functional/swift_testing.py
index 50abc8e..6903b56 100644
--- a/test/functional/swift_testing.py
+++ b/test/functional/swift_testing.py
@@ -141,7 +141,8 @@ def retry(func, *args, **kwargs):
snet=False,
tenant_name=swift_test_tenant[use_account],
auth_version=swift_test_auth_version,
- os_options={})
+ os_options={},
@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.
*/
/*********************************************************************************