Skip to content

Instantly share code, notes, and snippets.

View jonseymour's full-sized avatar

Jon Seymour jonseymour

View GitHub Profile
@jonseymour
jonseymour / gist:908ea09f7d1ab6dbb9fd
Last active October 24, 2016 17:23
Factory reset message codes
ERR301: The specified '$file' does not exist.
ERR302: The specified '$file' does not have the specified checksum ('$checksum'). Actual checksum: ('$filesum').
ERR310: Failed to download '${imageurl}' to '${imagetar}'.
ERR320: The clock has a date in the past: $(date "+%Y-%m-%d %H:%M:%S").
ERR330: The download of the recovery script from '$(url url .sh)' to '$shname' has failed.
ERR331: Partition table checksum mismatch. Expected '${PARTITION_TABLE_SHA1SUM}' found '$check'.
ERR341: The required recovery archive '$tar' does not exist.
ERR401: usage: generate-env {image-name} [ {url-prefix} ]
ERR405: usage: format-partitions {confrmation-code} {block-device} p{partition#}
ERR406: The specified partition device '${partition_device}' does not exist.
@jonseymour
jonseymour / gist:03598f052376095713a3
Last active October 24, 2016 17:24
diff between 03_0813 and images 04_0214
M ubuntu_armhf_trusty_norelease_sphere-unstable/etc/ninja-release
M ubuntu_armhf_trusty_norelease_sphere-unstable/etc/popularity-contest.conf
M ubuntu_armhf_trusty_norelease_sphere-unstable/etc/shadow
M ubuntu_armhf_trusty_norelease_sphere-unstable/etc/shadow-
M ubuntu_armhf_trusty_norelease_sphere-unstable/opt/ninjablocks/bin/sphere-setup-assistant
M ubuntu_armhf_trusty_norelease_sphere-unstable/opt/ninjablocks/drivers/sphere-go-led-controller/sphere-go-led-controller
A ubuntu_armhf_trusty_norelease_sphere-unstable/opt/ninjablocks/factory-reset/bin/recovery.sh
M ubuntu_armhf_trusty_norelease_sphere-unstable/opt/ninjablocks/factory-reset/bin/reset-helper.sh
M ubuntu_armhf_trusty_norelease_sphere-unstable/opt/ninjablocks/factory-reset/bin/sphere-io
A ubuntu_armhf_trusty_norelease_sphere-unstable/opt/ninjablocks/factory-reset/bin/sphere-serial
@jonseymour
jonseymour / reload-vbox.sh
Last active January 28, 2016 03:41
Reload the Mac OSX Kernel Extensions for Official VirtualBox Distribution
#!/usr/bin/env bash
# based on https://gist.github.com/rtgibbons/2024307 with updates from comments of that gist for OSX 10.9
EXTDIR="/Library/Application Support/VirtualBox"
unload() {
kextstat | grep "org.virtualbox.kext.VBoxUSB" > /dev/null 2>&1 && sudo kextunload -b org.virtualbox.kext.VBoxUSB
kextstat | grep "org.virtualbox.kext.VBoxNetFlt" > /dev/null 2>&1 && sudo kextunload -b org.virtualbox.kext.VBoxNetFlt
kextstat | grep "org.virtualbox.kext.VBoxNetAdp" > /dev/null 2>&1 && sudo kextunload -b org.virtualbox.kext.VBoxNetAdp
kextstat | grep "org.virtualbox.kext.VBoxDrv" > /dev/null 2>&1 && sudo kextunload -b org.virtualbox.kext.VBoxDrv
@jonseymour
jonseymour / extract-xcode41.sh
Created June 19, 2014 14:14
Script to extract components of Xcode 4.1 required to build VirtualBox on a OSX 10.9 system.
#!/usr/bin/env bash
#
# NAME
# extract-xcode41.sh
#
# DESCRIPTION
# 1. Copy this file into the same directory that contains installxcode_41_lion.dmg downloaded from Apple
# 2. Change into that directory
# 3. Run the file
# ./extract-xcode41.sh
package org.jonseymour.v1.option;
import java.util.NoSuchElementException;
import org.jonseymour.v1.functional.Unary;
import org.junit.Test.None;
/**
* Defines an {@link Option} type.
* <p>
@jonseymour
jonseymour / type-and-null-safe-meta-data.txt
Created March 6, 2012 06:33
Null and type safe meta data for Java
given:
public class Foo {
private String name;
private Bar bar;
public Foo(String name)
{
this.name = name;
this.bar = new Bar(name+":bar");
@jonseymour
jonseymour / Option.java
Created February 14, 2012 21:54
Option<T>
import java.util.Iterator;
import java.util.NoSuchElementException;
/**
* Implements support for an option type.
* <pre>
* // assuming Option<T> foo()
*
* for (T t : foo()) {
@jonseymour
jonseymour / NameSpaceWalker.java
Created February 2, 2012 11:19
NameSpaceWalker - utility for dumping a web application's JNDI context to the servlet context log
package org.jonseymour.servlet;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NameClassPair;
import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
@jonseymour
jonseymour / clean_ws.sh
Created April 25, 2011 04:00
clean trailing whitespace
clean_ws()
{
[ "$1" ] || exit 1;
sed "s/ *\$//" < $1 > $$.tmp && mv $$.tmp $1
}