Skip to content

Instantly share code, notes, and snippets.

View elliottwilliams's full-sized avatar
🏳️‍🌈

Elliott Williams elliottwilliams

🏳️‍🌈
View GitHub Profile
@elliottwilliams
elliottwilliams / installing-openmrs-zamboni.md
Last active December 20, 2015 23:49
Installing openmrs/zamboni

(This document roughly follows [Mozilla's Zamboni install docs][1])

#Setting up openmrs/zamboni (Work in progress)

This guide was tested against Ubuntu 12.04 x64. YMMV.

##Install stuff:

Begin by installing dependencies.

#!/bin/sh
VERSION=0.10.16
PLATFORM=linux
ARCH=x64
PREFIX="/usr/local"
mkdir -p "$PREFIX" && \
curl http://nodejs.org/dist/v$VERSION/node-v$VERSION-$PLATFORM-$ARCH.tar.gz \
| tar xzvf - --exclude="ChangeLog" --exclude="LICENSE" --exclude="README.md" --strip-components=1 -C "$PREFIX"
@elliottwilliams
elliottwilliams / alarm.sh
Created October 9, 2013 09:23
For when your smartphone dies. Requires [sox](http://sox.sourceforge.net/) $ brew install sox
#!/usr/bin/env bash
WAKEUP=$1
MUSIC="/Users/herooftime/Music/iTunes/iTunes\ Music/Music/Arcade\ Fire/Funeral/07\ Wake\ Up.mp3"
while [ "$(date +%H:%M)" != "$WAKEUP" ]; do
sleep 20
done
echo "-=GOOD MORNING!=-"
@elliottwilliams
elliottwilliams / configuring-openldap.md
Last active August 29, 2015 13:57
Configuring OpenLDAP for OpenMRS ID

Configuring OpenLDAP for OpenMRS ID

Purpose of this document: To document how to configure [OpenLDAP][4] for a development environment of [OpenMRS ID][5]. OpenMRS ID requires other components (a mysql database, nodejs environment, a postfix server to connect to), but OpenLDAP is easily the most complicated to configure.

Installing

Install OpenLDAP. On Ubuntu, this is two packages:

#!/bin/sh
# Get a lightweight, simplified git log statement, ideal for grabbing commit
# ids. To run, place in your $PATH and execute:
#
# $ git l
#
# Enjoy!
git --no-pager log --pretty=oneline --abbrev-commit -n 10
dn: cn=bamboo-admin,ou=groups,dc=openmrs,dc=org
description: Bamboo system administrators
objectClass: groupOfNames
cn: bamboo-admin
member:
dn: cn=bamboo-maven,ou=groups,dc=openmrs,dc=org
description: Bamboo Maven test team
objectClass: groupOfNames
cn: bamboo-maven
@elliottwilliams
elliottwilliams / slapd.conf
Last active August 29, 2015 14:03
OpenMRS ID LDAP Config
#
# See slapd.conf(5) for details on configuration options.
# This file should NOT be world readable.
#
include /etc/ldap/schema/core.schema
include /etc/ldap/schema/cosine.schema
include /etc/ldap/schema/inetorgperson.schema
include /etc/ldap/schema/ppolicy.schema
pidfile /var/run/slapd/slapd.pid
@elliottwilliams
elliottwilliams / overflow.c
Created September 3, 2014 03:23
C overflow demonstration
λ ~/Desktop/ ./overflow
Before any reassignment:
i = 512 = 0x200
c = 127 = 0x7f
When i = c, then c = i:
i = 127 = 0x7f
c = 127 = 0x7f
When c = i, then i = c:
i = 0 = 0x0
c = 0 = 0x0
@elliottwilliams
elliottwilliams / README.md
Created September 9, 2014 02:45
Example constructive existence proof

Example Constructive Existence Proof

CS 180 • 9/8/14

Theorem: There exists some integer that is expressable as the sum of two cubes in two different ways.

This code implements a constructive existence proof of that theorem. It finds two sets of such cubes.

@elliottwilliams
elliottwilliams / gcd.c
Created September 23, 2014 20:56
Greatest Common Denominator — Euclidian algorithm and a crappy count-all-the-factors one
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
int gcd_euc(int a, int b) {
if (b > a) {
return gcd_euc(b, a);
} else if (b == 0) {
return a;
} else {