Skip to content

Instantly share code, notes, and snippets.

View jhenkens's full-sized avatar

Johan Henkens jhenkens

View GitHub Profile
@jhenkens
jhenkens / gist:4084472
Created November 16, 2012 05:38
God damn Nachos
[jhenkens@homer test]$ ../userprog/nachos -x test4_1 -d m
Loaded Program: 432 code | 64 data | 256 bss
Starting thread "main" at time 290
At PC = 0x0: JAL 52
At PC = 0x4: SLL r0,r0,0
At PC = 0xd0: ADDIU r29,r29,-40
At PC = 0xd4: SW r31,36(r29)
At PC = 0xd8: SW r30,32(r29)
At PC = 0xdc: JAL 48
At PC = 0xe0: ADDU r30,r29,r0
Mac OS X 10.9.2, Vagrant 1.5.1, VMWare Fusion 6.0.2
I had some intense difficulties getting this all to work. The VMs would boot
fine with gui=true, but then would fail as soon as I turned that off. Yet when
they failed, they were actually running just fine! I could ssh in, but neither
vagrant nor vmrun could find the running VMs! You would think that it would
give better errors, but no.
First off, most boxes you find online will be using the VMWare configuration 9,
which will only boot if you have gui=true the first boot, so you can upgrade it
@jhenkens
jhenkens / rename
Created March 18, 2014 04:27
Rename command stripped from Debian Wheezy
#!/usr/bin/perl -w
#
# This script was developed by Robin Barker (Robin.Barker@npl.co.uk),
# from Larry Wall's original script eg/rename from the perl source.
#
# This script is free software; you can redistribute it and/or modify it
# under the same terms as Perl itself.
#
# Larry(?)'s RCS header:
# RCSfile: rename,v Revision: 4.1 Date: 92/08/07 17:20:30
@jhenkens
jhenkens / gist:9946624
Created April 3, 2014 01:16
Ruby on Rails Tutorial (RailsTutorial.org) Postgres Setup
Install Postgres.app
Open the psql console via:
$ psql
Create the 'blog' user with CREATEDB permission;
# CREATE USER blog CREATEDB;
# \q
Set postgres to default to using a TCP port rather than a unix socket, because the Postgres.app defaults to TCP ports.
cat "export PGHOST=localhost" >> ~/.bash_profile
@jhenkens
jhenkens / gist:9946928
Last active August 29, 2015 13:58
RubyMine Rubytutorials.org RVM setup
Working through the Rubytutorials.org tutorial, I wanted to use the Jetbrain's
RubyMine IDE, because I love all of their IDEs. One of the problems is that they
do not discuss specifically how to use RubyMine in the context of their
tutorial. Specifically, I followed all the steps to set up RVM, and it
appeared that RubyMine was not following my RVM gemset as configured through
the RubyTutorials.org guide. Eventually I found out that RubyMine does not
appear to support any RVM 'configuration files' except for the project level
'.rvmrc' shell-script. Following the tutorial, I added:
rvm use ruby-2.0.0-p451@railstutorial_rails_4_0
I spent some time messing around getting Time Lapse and HTTP Live streaming
working on my Raspberry Pi
I'm using a raspberry pi, Logitech C920 webcam and some powered 4 port hub from amazon
Had a lot of problems with firmware (Make sure you update to the, as of April
18th 2014, beta firmware and set the USB concurrency flags to 0x7 (or something
like that).)
I also had problems with shitty USB cables, but now its pretty stable.
@jhenkens
jhenkens / .My terminal configs
Last active February 18, 2020 11:41
My terminal config files
Some of these are copied from elsewhere, some of these are made by me.
Maybe I'll eventually add my ~/bin scripts to Gist as well, but I
figured I may as well put these up for versioning and as a reference
to the internet.

Install raspbian, set up your users however you would like, so long as you have sudo access on the user you are running this with. You probably want to resize the image so it fills the SD card as well.

  1. Copy this entire gist to your raspberry pi
  2. Do chmod +x step1.sh step2.sh iptables.sh in the gist folder (so that
  3. Run step1.sh a) This script does a few things - it first updates your raspberry pi, then it installs a few needed utilities, then it upgrades the firmware on your raspberry pi
@jhenkens
jhenkens / 01-autoreboot
Last active August 29, 2015 14:01
OpenElec Files
#!/bin/bash
# OpenElec Power Script to restart XBMC
# I didn't want to bind any special buttons to reboot xbmc, and I already had a button to sleep cycle the box.
# I wrote this script to kill xbmc within OpenElec if you sleep and then wake within 60 secodns
# Put it in /storage/.config/sleep.d/01-autoreboot
# Or whatever you want within sleep.d, autoreboot is a terrible name
LOCDIR=/storage/.config/.autoreboot
@jhenkens
jhenkens / transmissionSequentialPatch.diff
Last active August 29, 2015 14:01
Patch to transmission to enable sequential torrenting on a per-torrent basis in the web gui. This allows 'streaming' media as it is downloaded.
Index: daemon/remote.c
===================================================================
--- daemon/remote.c (revision 14252)
+++ daemon/remote.c (working copy)
@@ -718,6 +718,7 @@
TR_KEY_seedRatioMode,
TR_KEY_seedRatioLimit,
TR_KEY_sizeWhenDone,
+ TR_KEY_sequential,
TR_KEY_startDate,