Skip to content

Instantly share code, notes, and snippets.

View dysinger's full-sized avatar
😅
16 hour days is OK. Right?

Dysinger dysinger

😅
16 hour days is OK. Right?
  • Independent
  • Nearby
View GitHub Profile
@dysinger
dysinger / ubuntu-13.10-docker-0.6.5.sh
Created October 31, 2013 22:40
ok the steps for ubuntu 13.10 w/ docker are a tiny bit debian-tricky but easy enough. You have to add saucy-proposed to your repos & pin * at 400 from that repo. then you install lxc from that repo. So the install goes like this:
cat >/etc/apt/preferences.d/saucy-proposed <\EOF
Package: *
Pin: release a=saucy-proposed
Pin-Priority: 400
EOF
cat >/etc/apt/sources.d/saucy-proposed.list <\EOF
deb http://us.archive.ubuntu.com/ubuntu/ saucy-proposed main restricted universe
deb-src http://us.archive.ubuntu.com/ubuntu/ saucy-proposed main restricted universe
@dysinger
dysinger / Git.hs
Created September 19, 2013 23:10
{-# LANGUAGE OverloadedStrings #-}
module Git where
import Data.Text.Lazy (Text)
import qualified Data.Text.Lazy as T
import Prelude hiding (FilePath)
import Shelly
git :: [Text] -> Sh Text
{-# LANGUAGE OverloadedStrings #-}
module Git where
import Data.Text.Lazy (Text)
import qualified Data.Text.Lazy as T
import Prelude hiding (FilePath)
import Shelly
git :: [Text] -> Sh Text
@dysinger
dysinger / gist:6613786
Last active December 23, 2015 09:19 — forked from mwilliams/gist:6613649
cabal update
cabal install Cabal
cabal install cabal-install
export PATH=./.cabal-sandbox/bin:~/.cabal/bin:$PATH
cd ~/path/to/my/project
cabal sandbox init
cabal install elm
cabal install elm-server
main :: IO ()
main = putStrLn $ show $ solution 3 5 999
where allNums max' = [1..(max' :: Int)]
divisible x y = y `mod` x == 0
divisible2 x y = (\n -> (divisible x n) || (divisible y n))
solution x y max' = sum $ filter (divisible2 x y) (allNums max')
@dysinger
dysinger / easy-ubuntu-openvpn.sh
Created August 28, 2013 18:22
Create a VPN on EC2 in 30 seconds
#!/bin/sh
# linux firewall/forwarding
modprobe iptable_nat
echo 1 | tee /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -s 10.10.10.1/2 -o eth0 -j MASQUERADE
# install openvpn
apt-get update && apt-get install -y openvpn
cd /etc/openvpn/
INSTANCE=$(curl http://169.254.169.254/latest/meta-data/public-hostname)
openvpn --genkey --secret ${INSTANCE}.key
UBUNTU_NAME='precise'
UBUNTU_VERSION='12.04'
CHEF_VERSION='10.26.0'
ARCH='amd64'
sudo debootstrap --arch=${ARCH} --variant=minbase ${UBUNTU_NAME} ${UBUNTU_NAME}-${BUILD_NUMBER}
snapshot0=$(sudo tar -C ${UBUNTU_NAME}-${BUILD_NUMBER} -c .|docker import -)
sudo rm -rf ${UBUNTU_NAME}-${BUILD_NUMBER}
cat > Dockerfile <<EOF
FROM ${snapshot0}
im@Tims-MacBook-Air:~/src/k/kommand% ghc -V
The Glorious Glasgow Haskell Compilation System, version 7.6.3
tim@Tims-MacBook-Air:~/src/k/kommand% du -csh ./cabal-dev/bin/k
2.5M ./cabal-dev/bin/k
2.5M total
tim@Tims-MacBook-Air:~/src/k/kommand% otool -L ./cabal-dev/bin/k
./cabal-dev/bin/k:
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)
/usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
# -*- mode: ruby -*-
# vi: set ft=ruby :
# GITHUB
gem 'test-kitchen', github: 'Knewton/test-kitchen'
gem 'veewee', github: 'Knewton/veewee', ref: '4e5d50de4866472bd3e7060157ac573457196760'
# RUBYGEMS