Skip to content

Instantly share code, notes, and snippets.

View KAllan357's full-sized avatar

Kyle Allan KAllan357

  • Singularity 6
  • Philadelphia, PA
View GitHub Profile
@aaronfeng
aaronfeng / mount_socket_to_host.sh
Created April 3, 2015 13:10
Mount unix socket from boot2docker to host
# Requires socat on host and boot2docker
# OSX - brew install socat
# boot2docker - tce-load -wi socat
# change your ssh key path
sudo socat "UNIX-LISTEN:/var/run/docker.sock,reuseaddr,fork" EXEC:'ssh -i /Users/aaron.feng/.ssh/id_boot2docker docker@192.168.59.103 socat STDIO UNIX-CONNECT\:/var/run/docker.sock'
# own the unix socket on host
sudo chown aaron.feng /var/run/docker.sock
@KAllan357
KAllan357 / FindMissingNumber.groovy
Created April 28, 2011 22:02
Accepts an array of integers from 1-N in which one number is missing. N is equal to the length of the array minus 1.
#!/usr/local/bin/groovy
def findMissingNumber(def a) {
lowerSum = a.inject(0, {
sum, it -> sum += it
})
upperSum = (1..(a.size + 1)).inject(0, {
sum, it -> sum += it
})
anonymous
anonymous / lolbase_extract2.py
Created April 11, 2011 01:24
Extract data from lolbase.net into a sqlite file.
#! /usr/bin/env python2.6
#
# Copyright 2011 James Aguilar
# Released under the new BSD license.
#
# Dependencies:
# - gflags
# - Beautiful Soup
from BeautifulSoup import BeautifulSoup
def ask_password(message)
HighLine.new.ask(message) do |q|
q.echo = false
end
end