Skip to content

Instantly share code, notes, and snippets.

View yarbelk's full-sized avatar

James Rivett-Carnac yarbelk

View GitHub Profile
@yarbelk
yarbelk / launchconfig.tf
Last active June 17, 2017 08:11
Create, partiton and format EBS volume in a script for AWS EBS
resource "aws_launch_configuration" "test" {
name_prefix = "lc-test-"
image_id = "${data.aws_ami.ubuntu.image_id}"
instance_type = "t2.small"
security_groups = ["${aws_security_group.test.id}"]
associate_public_ip_address = false
key_name = "${var.bastion_keypair_name}" /* bastion == bounce host since there is no public ip */
user_data = "${data.template_file.user_data.rendered}"
iam_instance_profile = "${aws_iam_instance_profile.test.arn}"
@yarbelk
yarbelk / create_services.powershell
Created June 14, 2017 07:30
Nomad Server on windows 2016
Sc create "Consul" binPath="C:\consul\consul.exe -config-dir=C:\consul\etc\" DisplayName="Consul" start="auto"
Sc create "Nomad" binPath="C:\nomad\nomad.exe agent -config=C:\nomad\etc\" DisplayName="Nomad" start="auto" depend="Consul"
@yarbelk
yarbelk / zfs_pools.rst
Created January 11, 2016 09:47
zsh hybrid pools
@yarbelk
yarbelk / mandy.rb
Last active August 29, 2015 14:17
Mandelbrot Set done with colors (and BEN!)
require 'complex'
XR = 0.01575 * 2
YR = 0.0125 * 2
ESCAPE_RADIUS = ARGV[0].to_f || 2.0
def mandelbrot(a)
x = a.real
y = a.imaginary
i = 0
@yarbelk
yarbelk / gist:b403f56a1fb8c661c12a
Created December 9, 2014 04:27
Python 2.7 in RHEL linux
#taken from http://www.lecloud.net/post/61401763496/install-update-to-python-2-7-and-latest-pip-on
#I keep struggling to find it, so made it a gist.
# install build tools
sudo yum install make automake gcc gcc-c++ kernel-devel git-core -y
# install python 2.7 and change default python symlink
sudo yum install python27-devel -y
sudo rm /usr/bin/python
sudo ln -s /usr/bin/python2.7 /usr/bin/python
@yarbelk
yarbelk / export_github_issues.py
Created December 28, 2012 10:38
a command line utility to export github issues. requires the `requests` library.
#!/usr/bin/env python
# export github issues to a csv file
import json
import requests
import csv
import getpass
from StringIO import StringIO
import argparse
import sys
@yarbelk
yarbelk / forms.py
Created May 26, 2012 07:58
Example to illustrate a problem I'm having with multi-table inheritance for user profiles in django and Userena
# This is the form to sign up a Spam Type Person
from django import forms
from userena.forms import SignupFormTos
from . models import CommonProfile, SpamProfile
class SpamSignupForm(SignupFormTos):
"""signup a Spam Person"""
common_field = forms.CharField(label='what is your quest')
spam_field = forms.CharField(label='what kind of spam are you')