Skip to content

Instantly share code, notes, and snippets.

View jesperhj's full-sized avatar

Jesper Hjertstedt jesperhj

  • Tink
  • Stockholm, Sweden
View GitHub Profile
require 'rubygems'
require 'json'
require 'pp'
############################################################
# mapper code
############################################################
def put_line line, action
l = JSON.parse line
puts "#{l['uid']}\t#{action}:#{l['ip']}" if !l['uid'].nil?
@jesperhj
jesperhj / git howto
Last active December 1, 2015 16:39
Git
List remote and local branches
git branch -a
List only remote branches
git branch -r
Create new branch
git checkout -b newbranch
Create a local test branch which is tracking the remote test branch.
@jesperhj
jesperhj / osx_setup.sh
Created September 24, 2012 09:04
Mac OSX setup
# go tool
git clone https://github.com/srid/go-tool
cd go-tool
sudo python setup.py install
go-setup # (or python -m go) to setup the shell driver:
@jesperhj
jesperhj / hubotnode_modules
Created December 4, 2012 13:28
npm packages installed for hubot
{
"name": "hosted-hubot",
"version": "2.3.2",
"dependencies": {
"hubot-hipchat": {
"version": "1.1.3",
"dependencies": {
"node-expat": {
"version": "1.6.1"
},
@jesperhj
jesperhj / scala.rb
Created August 28, 2013 13:28 — forked from cstrahan/scala.rb
# to install the latest stable version:
brew install scala --with-docs
# to install scala-2.10.0-RC1:
brew install https://raw.github.com/gist/3939012/scala.rb --with-docs
# to switch versions (from https://github.com/mxcl/homebrew/wiki/External-Commands):
brew switch scala 2.9.2
brew switch scala 2.10.0-RC1
zone "example.com" {
type master;
file "/etc/bind/zones/example.com.db";
};
$TTL 604800
@ IN SOA ns.example.com. root.example.com. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS ns.example.com.
ns IN A 54.217.192.242
@jesperhj
jesperhj / gist:fd29729fe4fb9f289d657d2aa288cc71
Last active September 11, 2016 18:35
Pokemon Go Map installation on Raspberry Pi 3
# usb drive
sudo fdisk -l
sudo mkfs.ext4 /dev/sda1
sudo mkdir /var/lib/mysql
sudo mount /dev/sda1 /var/lib/mysql
chmod 700 /var/lib/mysql
chown mysql:mysql /var/lib/mysql
# https://www.reddit.com/r/pokemongodev/comments/4wtiso/any_pokemon_go_map_programs_able_to_run_on/d6h75a4
@jesperhj
jesperhj / day1.rb
Created December 7, 2016 15:13
Advent of Code December 1
#!/bin/ruby
# moves = ["R5", "L5", "R5", "R3"] # ok
# moves = ["R2", "R2", "R2"] # ok
# moves = ["R2", "L3"] # ok
moves = ["L2", "L5", "L5", "R5", "L2", "L4", "R1", "R1", "L4", "R2", "R1", "L1", "L4", "R1", "L4", "L4", "R5", "R3", "R1", "L1", "R1", "L5", "L1", "R5", "L4", "R2", "L5", "L3", "L3", "R3", "L3", "R4", "R4", "L2", "L5", "R1", "R2", "L2", "L1", "R3", "R4", "L193", "R3", "L5", "R45", "L1", "R4", "R79", "L5", "L5", "R5", "R1", "L4", "R3", "R3", "L4", "R1""85", "L5", "L3", "L1", "R5", "L2", "R1", "R3", "R2", "L3", "L4", "L2", "R2", "L3", "L2", "L2", "L3", "L5", "R3", "R4", "L5", "R1", "R2", "L2", "R4", "R3", "L4", "L3", "L1", "R3", "R2", "R1", "R1", "L3", "R4", "L5", "R2", "R1", "R3", "L3", "L2", "L2", "R2", "R1", "R2", "R3", "L3", "L3", "R4", "L4", "R4", "R4", "R4", "L3", "L1", "L2", "R5", "R2", "R2", "R2", "L4", "L3", "L4", "R4", "L5", "L4", "R2", "L4", "L4", "R4", "R1", "R5", "L2", "L4", "L5", "L3", "L2", "L4", "L4", "R3", "L3", "L4", "R1", "L2", "R3", "L2", "R1", "R2", "R5", "L4", "L2", "L1", "L3
@jesperhj
jesperhj / keybase.md
Created October 31, 2017 12:11
keybase.md

Keybase proof

I hereby claim:

  • I am jesperhj on github.
  • I am klorin (https://keybase.io/klorin) on keybase.
  • I have a public key ASC2Tc8irRchuQ-Xm5RA2HP8JeUqEpgaHgGSIhPB3_VZRQo

To claim this, I am signing this object: