Skip to content

Instantly share code, notes, and snippets.

View stigkj's full-sized avatar

Stig Kleppe-Jørgensen stigkj

View GitHub Profile
@stigkj
stigkj / fortelling.md
Last active February 26, 2019 21:28
norsk

Jeg satt i den store, grå bilen vår på den lange veien til den fine, brune hytta vår. Lydboken vi skulle høre på trodde jeg var kjedelig, men jeg innså at den var helt utrolig gøy. Derfor gikk den lange turen til hytta veldig fort. Dagen etter tok jeg et stort, mykt lammeskinn og la det på det kalde gulvet. Jeg tok fram den spennende boka mi og la meg på lammeskinnet og leste lenge. På fredag gikk vi en lang skitur rundt det store Otrøvannet. Det var strålende sol når vi satte oss ned for å spise halvveis i løypa. Vi spiste deilig mat og nydelig kvikklunsj til dessert. Dagen etter sto vi på slålom i de bratte bakkene ved siden av den brune hytta vår. Vi spiste lunsj på en fin cafe nede ved den minste slålombakken. Vi hadde en god hamburger med pommes frites og en stor, nydelig kakao med marshmallows.

@stigkj
stigkj / OkHttpBug.java
Last active September 8, 2017 21:13
HEAD request timing out
import okhttp3.*;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
public class OkHttpBug {
@Test
public void test() throws Exception {
Request request = new Request.Builder()
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.openzfsonosx.ilovezfs.zfs.zpool-import</string>
<key>ProgramArguments</key>
<array>
<string>/usr/sbin/zpool</string>
<string>import</string>

Keybase proof

I hereby claim:

  • I am stigkj on github.
  • I am stigkj (https://keybase.io/stigkj) on keybase.
  • I have a public key ASAF9Gyyn_lXDCnknfiFInAwotjWOBQAflBHzDnNJS5algo

To claim this, I am signing this object:

@stigkj
stigkj / camel-with-spock.groovy
Last active November 12, 2015 08:37
How to use Camel with Spock's PollingConditions
@Test
public void should_filter_out_messages_with_missing_durations() {
template.sendBodyAndHeaders("solr://<some solr server>", [someInputData(), someOtherInputData()], headers)
new PollingConditions(timeout: 10, initialDelay: 1.5, factor: 1.25).eventually {
assert solr.received.size() == 1
}
assert solr.received.first().body.contains(<some string>)
}
#!/bin/sh
#
# Creates a SmartOS VM in VirtualBox (assuming you alread have VirtualBox installed)
#
# This script will:
# * Download the latest live ISO image of SmartOS
# * Create a VirtualBox VM, or update an existing VM with the latest ISO
# * Configure the VM with a zones disk, and boot it!
#
#
@stigkj
stigkj / README.md
Last active August 29, 2015 14:08 — forked from jpetazzo/README.md

Rectifier

The diode bridge is the simplest rectifier I know.

Rectifier lets you share a directory with a docker container (just like $yourvm shared folders).

You don't have to install anything in your containers, and you only need to install diod in the host. diod is packaged on Ubuntu/Debian distros, and will automatically be apt-get install-ed if needed.

Since it uses diod to make a bridge, I called it rectifier. Yeah, that sucks, so if you have a better name, I'll steal it!

@stigkj
stigkj / Vagrantfile
Created July 23, 2014 08:16
Vagrantfile for installing nsinit in VM
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.define "boot2docker-nsinit"
config.vm.box = "yungsang/boot2docker"
@stigkj
stigkj / pid.js
Created December 27, 2013 13:34 — forked from FGRibreau/pid.js
//
// Usage: require('./pid')("myapp");
//
var fs = require('fs');
module.exports = function(appname){
process.title = appname;
var PID_FILE = "/usr/local/var/run/"+process.title+".pid";
#!/bin/sh
set -e
JAVA_VER=7
rm -f /tmp/oab-index.html /tmp/oab-download.html >/dev/null 2>&1 || true
trap "rm -f /tmp/oab-index.html /tmp/oab-download.html" EXIT ERR QUIT INT TERM
# Try and dynamic find the JDK downloads
echo " [x] Getting Java SE download page "