Skip to content

Instantly share code, notes, and snippets.

View jbfink's full-sized avatar
💭
we have statuses now? is this AOL?

John Fink jbfink

💭
we have statuses now? is this AOL?
View GitHub Profile
slice.rb:5:in `block in <main>': undefined method `[]' for nil:NilClass (NoMethodError)
from /home/jbfink/.rbenv/versions/2.1.2/gemsets/ruby-marc/gems/marc-0.8.1/lib/marc/reader.rb:248:in `each'
from slice.rb:3:in `<main>'
This is a persistent volume for CraftBukkit. It has at least one plugin which requires an external db: I have this working with a link to the main bukkit server. It probably has to be running before bukkit runs, so if you're doing this from scratch run the db like so:
docker run -d --name bukkit-mysql -v /mnt/huge/bukkit/mysql:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=impossiblepassword -e MYSQL_DATABASE=bukkit -e MYSQL_USER=bukkit -e MYSQL_PASSWORD=humnahumna docker-mysql
Aren't those environment variables cool? They come courtesy of orchardup's mysql container. Note that we're not exposing any ports on the db -- Docker's linking takes care of the port exposure. It's awesome!!!
The bukkit thing itself runs like this:
docker run -d -p 25565:25565 --name bukkit --link bukkit-mysql:db -v /mnt/huge/bukkit:/bukkit minecraft:bukkit /bukkit/stable/stable.sh
@jbfink
jbfink / caesar-decrypt.rb
Last active August 29, 2015 14:07
caesar decrypt function (yes I know it's ugly)
def decrypt(string)
letters = ("a".."z").to_a
letters2 = letters.join
rotated = letters.rotate(-1).join
puts string.downcase.tr(letters2, rotated)
end
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jbfink
jbfink / scds-academic-director-job-ad.txt
Created March 2, 2015 20:13
SCDS academic director job ad
McMaster University
Department of Communication Studies & Multimedia
Lewis & Ruth Sherman Centre for Digital Scholarship
ASSISTANT PROFESSOR, DIGITAL HUMANITIES
The Lewis & Ruth Sherman Centre for Digital Scholarship and the Department of Communication Studies and Multimedia invite applications for a three-year contractually limited appointment as Academic Director of the Sherman Centre, 1 July 2015 – 30 June 2018. Candidates must have a Ph.D. and have an established research agenda in the Digital Humanities. The successful candidate will hold an appointment as Assistant Professor and be expected to teach in the Department of Communication Studies & Multimedia.
As Academic Director of the Sherman Centre for Digital Scholarship, the successful candidate will assist the Centre in promoting and developing disciplinary and interdisciplinary digital scholarship at McMaster. The Academic Director recruits and works closely with our resident graduate student and postdoctoral researchers. Other priorities include

The Free Lunch; Fair Dealing and Creative Commons in Canadian Education

In 2011-2012 the rights of Canadians to use copyrighted works freely without needing to compensate creators -- known as Fair Dealing was expanded considerably by Bill C-21 and a series of court decisions known as the Copyright Pentalogy. In particular, education rights were greatly expanded; as such, it is generally considered fair dealing to use copyrighted images, portions of text, and video clips for university projects.

However, the Creative Commons -- a copyright scheme in which creators explictly allow a greater range of rights on works to users than traditional copyright -- remains a recommended method for acquiring media for projects, due in no small part to its flexibility in a greater range of uses than just education. Here are some links about C-21/the Pentalogy and Creative Common

#!/bin/bash
# to split on command line do:
# pdftk largepdfile.pdf burst
# and to combine:
# pdftk *.crop.pdf cat output onelargepdfile.pdf
for i in *.pdf; do convert $i -crop 612x730+62+0 $(basename $i .pdf).crop.pdf; done
@jbfink
jbfink / siegfried-error.txt
Created March 30, 2015 01:11
siegfried-error.txt
Need to get 2,166 kB of archives.
After this operation, 20.5 MB of additional disk space will be used.
E: Method https has died unexpectedly!
E: Sub-process https received a segmentation fault.
@jbfink
jbfink / punchcard.py
Last active August 29, 2015 14:19
punchcard.py
#!/usr/bin/env python
#
# punchcard.py
#
# Copyright (C) 2011: Michael Hamilton
# The code is GPL 3.0(GNU General Public License) ( http://www.gnu.org/copyleft/gpl.html )
#
import Image
import sys
from optparse import OptionParser
@jbfink
jbfink / punchcardgen.py
Created April 23, 2015 15:35
punchcardgen.py
#!/usr/bin/env python
#
# punchcardgen.py
#
# Copyright (C) 2011: Michael Hamilton
# The code is GPL 3.0(GNU General Public License) ( http://www.gnu.org/copyleft/gpl.html )
#
import Image
import sys