Skip to content

Instantly share code, notes, and snippets.

View lily-mara's full-sized avatar
💖

Lily Mara lily-mara

💖
View GitHub Profile
aptitude install -y git curl python-dev python-pip redis-server ruby1.9.1-full rubygems1.9.1
aptitude install -y mysql-server libmysqlclient-dev
adduser --system --shell /bin/sh --gecos 'git version control' --group --disabled-password --home /home/git git
adduser --disabled-login --gecos 'gitlab system' gitlab
usermod -a -G git gitlab
su - gitlab
ssh-keygen -q -N '' -t rsa -f /home/gitlab/.ssh/id_rsa
aptitude install gitolite
cp /home/gitlab/.ssh/id_rsa.pub /home/git/gitlab.pub
su - git
@lily-mara
lily-mara / protocol.md
Last active August 29, 2015 14:08
Hunt The Wumpus Protocol

Wumpus Protocol

Overview

The protocol should be text based and use TCP as the primary communication method: TCP communication streams are simpler to maintain and more reliable than UDP streams. A Java class can be used to hold String constants that correspond with each of the commands.

Setup

ArrayList<Sprite> sprites;
int current = 0;
void setup() {
size(400, 400);
sprites = new ArrayList<Sprite>();
sprites.add(new Sprite(width/2, height/2));
}
@lily-mara
lily-mara / pir.py
Last active August 29, 2015 14:10
example code for pir motion detector
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
PIR_PIN = 7
GPIO.setup(PIR_PIN, GPIO.IN)
def MOTION(PIR_PIN):
print 'Motion Detected!'
print 'PIR Module Test (CTRL+C to exit)”
@lily-mara
lily-mara / keybase.md
Last active August 29, 2015 14:13
keybase.md

Keybase proof

I hereby claim:

  • I am natemara on github.
  • I am natemara (https://keybase.io/natemara) on keybase.
  • I have a public key whose fingerprint is DDB6 2313 92BA E5BA D425 8D44 5A78 67ED E2BD 6900

To claim this, I am signing this object:

@lily-mara
lily-mara / high-cost.py
Created February 12, 2015 18:22
Zero-Cost Abstraction
class Sum(object):
def __init__(self):
self._sum = 0
def increment(self, val):
self._sum += val
def print_sum(self):
print self._sum
#!/usr/bin/env python3
from serial import Serial
import sys
import requests
def main():
serial_port = find_port()
while True:
@lily-mara
lily-mara / eu-cookie.json
Last active March 14, 2016 12:55
The cookie that is sent to your browser if you navigate to http://ec.europa.eu/justice/cookies/index_en.htm and click "I Refuse Cookies"
provider "docker" {
host = "unix:///var/run/docker.sock"
}
resource "docker_container" "foo" {
image = "${docker_image.alpine.latest}"
name = "foo"
command = ["/bin/cat", "/etc/issue"]
}
{
"builders": [
{
"type": "docker",
"image": "frolvlad/alpine-python3",
"export_path": "image.tar"
}
],
"provisioners": [
{