Skip to content

Instantly share code, notes, and snippets.

View ianatha's full-sized avatar

Ian Atha ianatha

View GitHub Profile
@ianatha
ianatha / install_hadoop.sh
Created June 28, 2014 02:21
Install Hadoop 1.0.3 using Homebrew
#!/bin/bash
HADOOP_VERSION=1.0.3
HADOOP_URL=http://archive.apache.org/dist/hadoop/core/hadoop-$HADOOP_VERSION/hadoop-$HADOOP_VERSION.tar.gz
pushd `brew --prefix`
CHECKOUT_CMD=`brew versions hadoop 2> /dev/null | grep $HADOOP_VERSION | awk -F " " '{ print $2 }'`
echo $CHECKOUT_CMD...
$CHECKOUT_CMD
@ianatha
ianatha / gist:efdf44005537fde1fb40
Created December 4, 2014 23:47
Backup Secret Keys to QR Codes
gpg --export-secret-keys --armor | split -b 1792
for i in x*; do echo $i; cat $i | qrencode -o $i.png; done
#!/usr/bin/ruby
require "uri"
require "net/http"
require "readline"
$cache = {}
def cached_exec(cmd)
if not $cache.include?(cmd)
$cache[cmd] = `#{cmd}`.split("\n")
end
#!/bin/bash -e
if [ "$(id -u)" != "0" ]; then
# Elevate privileges to root.
sudo $0 $*
exit $?
fi
#lang mzscheme
(require srfi/1/list
srfi/14/char-set
srfi/13/string)
(define ip-to-long
(lambda (ip-as-string)
(apply +
(map *
@ianatha
ianatha / ks.cfg
Last active December 30, 2015 16:09
install
url --url http://us.archive.ubuntu.com/ubuntu/
lang en_US.UTF-8
keyboard us
timezone America/Los_Angeles
network --bootproto=dhcp
rootpw "changeme"
user thatha --fullname "Ian Atha" --password "changeme"
@ianatha
ianatha / puppet-init.sh
Last active January 1, 2016 19:59
puppet-init.sh
#!/bin/bash
source /etc/lsb-release
wget http://apt.puppetlabs.com/puppetlabs-release-${DISTRIB_CODENAME}.deb
dpkg -i puppetlabs-release-${DISTRIB_CODENAME}.deb
apt-get update
apt-get install puppet -y
echo -e "START=yes\nDAEMON_OPTS=\"\"" > /etc/default/puppet
service puppet start
package main
import (
"hash/crc32"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"sync"
)

Keybase proof

I hereby claim:

  • I am ianatha on github.
  • I am ianatha (https://keybase.io/ianatha) on keybase.
  • I have a public key whose fingerprint is 00FD 9E6A 4AD7 70E8 3595 FCC9 292C B8B9 3CEF 4A43

To claim this, I am signing this object:

@ianatha
ianatha / make_me_pxeboot_server.sh
Last active November 28, 2017 00:36
Makes an Ubuntu box a PXEBoot server that serves CoreOS.
#!/bin/bash
COREOS_VERSION=147.0.1
apt-get install inetutils-inetd tftpd-hpa dhcp3-server -y
echo "RUN_DAEMON=\"yes\"" >> /etc/default/tftpd-hpa
echo "subnet 10.0.1.0 netmask 255.255.255.0 {
range 10.0.1.200 10.0.1.250;
option routers 10.0.1.1;