Skip to content

Instantly share code, notes, and snippets.

View binarytemple's full-sized avatar

Bryan Hunt binarytemple

  • The mountains of mourne
View GitHub Profile
@binarytemple
binarytemple / README.md
Created July 1, 2016 23:13 — forked from rbishop/README.md
A super simple Elixir server for sending Server Sent Events to the browser.

Generate a new Elixir project using mix and add cowboy and plug as dependencies in mix.exs:

  defp deps do
    [
      {:cowboy, "~> 1.0.0"},
      {:plug, "~> 0.8.1"}
    ]
  end

docker volume ls

docker volume create --name mysql-data 
mysql-data

Create a file inside a volume, the container is terminated. The container is restarted, and the file is still there

@binarytemple
binarytemple / gist:0e05a8e2575b144e5c2d
Created February 5, 2016 09:58 — forked from tnolet/gist:7361441
Install collectd 5.4 on Centos 6.x and make it spit out cool metrics. Copied from http://linuxdrops.com/install-collectd-statistics-collecter-on-centos-rhel-ubuntu-debian/ and tweaked for your and my pleasure. For all other cool options, check the provided link.
#!/bin/bash
# Perform installation as root
# Install prereqs
yum -y install libcurl libcurl-devel rrdtool rrdtool-devel rrdtool-prel libgcrypt-devel gcc make gcc-c++
# Get Collectd, untar it, make it and install
wget http://collectd.org/files/collectd-5.4.0.tar.gz
tar zxvf collectd-5.4.0.tar.gz
@binarytemple
binarytemple / wip.py
Created February 1, 2016 10:23 — forked from phips/wip.py
VMware Fusion Ansible dynamic inventory
#!/usr/bin/env python
import sys
import subprocess
import re
import string
try:
import json
except:
import simplejson as json
@binarytemple
binarytemple / png-to-ico.sh
Created January 25, 2016 15:00 — forked from espeed/png-to-ico.sh
ImageMagick command to convert PNG file to transparent favicon.ico
convert app-icon.png
\( -clone 0 -resize 16x16 \)
\( -clone 0 -resize 32x32 \)
\( -clone 0 -resize 48x48 \)
\( -clone 0 -resize 64x64 \)
-delete 0 -alpha on -background transparent favicon.ico
@binarytemple
binarytemple / nginx.conf
Created January 5, 2016 14:59 — forked from dctrwatson/nginx.conf
Caching NPM proxy using Nginx
user www-data;
worker_processes 4;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
@binarytemple
binarytemple / cnxsoft.md
Created December 24, 2015 14:24 — forked from stefanozanella/cnxsoft.md
Emulate a Raspberry Pi with Qemu+ KVM

Booting with CNXSoft image

Reference: http://www.cnx-software.com/2012/07/31/84-mb-minimal-raspbian-armhf-image-for-raspberry-pi/

wget -r https://dl.dropbox.com/u/45842273/2012-07-15-wheezy-raspian-minimal.img.7z

yum install p7zip
7za e 2012-07-15-wheezy-raspian-minimal.img.7z

qemu-system-arm -kernel kernel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1" -hda 2012-07-15-wheezy-raspian-minimal.img -net nic -net user -vnc :0 -net tap,ifname=vnet0,script=no,downscript=no
@binarytemple
binarytemple / hipchat_bot.js
Created November 28, 2015 23:58 — forked from powdahound/hipchat_bot.js
Basic XMPP bot example for HipChat using node.js
// Basic XMPP bot example for HipChat using node.js
// To use:
// 1. Set config variables
// 2. Run `node hipchat_bot.js`
// 3. Send a message like "!weather 94085" in the room with the bot
var request = require('request'); // github.com/mikeal/request
var sys = require('sys');
var util = require('util');
@binarytemple
binarytemple / tanodb-preflist.markdown
Last active January 23, 2018 12:33 — forked from angrycub/preflist.erl
Testing tanodb preflist generation

tanodb is a distributed in memory key value store built on top of riak_core.

It is used as the example code for the Little Riak Core Book.

(kudos to @cv for the original version)

I found the following piece of code in a gist, but when I tried to execute it under taminodb, it returned an empty array.

@binarytemple
binarytemple / dns_proxy_srv.erl
Created October 4, 2015 22:32 — forked from andelf/dns_proxy_srv.erl
erlang dns proxy, with long ttl and persistant etc table cache.
%%%-------------------------------------------------------------------
%%% @author <andelf@gmail.com>
%%% @copyright (C) 2013,
%%% @doc
%%%
%%% @end
%%% Created : 18 Apr 2013 by <andelf@gmail.com>
%%%-------------------------------------------------------------------
-module(dns_proxy_srv).