Skip to content

Instantly share code, notes, and snippets.

Avatar

Robert Jacob xperimental

View GitHub Profile
@xperimental
xperimental / demo-stack.yml
Created Dec 8, 2016
Simple docker cloud demo stack
View demo-stack.yml
lb:
image: 'dockercloud/haproxy:latest'
links:
- web
ports:
- '80:80'
roles:
- global
web:
image: 'xperimental/goecho:v1.5'
@xperimental
xperimental / weather-config.json
Last active Jun 19, 2016
Script to show NetAtmo weather on Onion Omega OLED Display
View weather-config.json
{
"clientId": "",
"clientSecret": "",
"username": "",
"password": ""
}
@xperimental
xperimental / fix-ipv6.sh
Last active Feb 9, 2016
Fix IPv6 prefix in running router (ffbsee-v0.0.2)
View fix-ipv6.sh
# Login to router using SSH
# Check if you have an invalid IPv6 address
# Should yield something with a mask /64 "in the middle"
uci get network.freifunk.ip6addr
# Set new prefix and remove invalid address
uci set network.globals.ula_prefix='fdef:1701:b5ee:42::/64'
uci delete network.freifunk.ip6addr
@xperimental
xperimental / counter-led.sh
Created Feb 8, 2016
Script to show client state on router led (for TP-Link WDR4300)
View counter-led.sh
#!/bin/sh
readonly _on=default-on # can also be "timer" when you want it to blink
readonly _led=/sys/devices/platform/leds-gpio/leds/tp-link:blue:qss/trigger
readonly _counter=$(cat /sys/kernel/debug/batman_adv/bat0/transtable_local 2> /dev/null | grep -c 'W')
if [ "${_counter}" = "0" ]; then
echo "none" > ${_led}
else
echo "${_on}" > ${_led}
@xperimental
xperimental / screeps.json
Last active Aug 29, 2015
Simple code from screeps.com
View screeps.json
[
{
"_id": 0,
"modules": {
"main": "var _ = require('lodash');\nvar spawn = require('spawn');\nvar harvester = require('harvester');\nvar builder = require('builder');\nvar guard = require('guard');\n\nGame.s = spawn;\nGame.r = {\n h: harvester,\n b: builder,\n g: guard\n};\n\n_.forEach(_.values(Game.creeps), function (c) {\n _.forEach(_.values(Game.r), function(r) {\n if (c.memory.role == r.role) {\n r.brain(c);\n }\n });\n});\n",
"harvester": "/*\n * Module code goes here. Use 'module.exports' to export things:\n * module.exports = 'a thing';\n *\n * You can import it from another modules like this:\n * var mod = require('harvester'); // -> 'a thing'\n */\nmodule.exports = {\n role: 'harvester',\n body: [Game.WORK, Game.CARRY, Game.MOVE, Game.MOVE],\n brain: function (c) {\n if (c.energy < c.energyCapacity) {\n var sources = c.room.find(Game.SOURCES_ACTIVE);\n if (sources.length) {\n c.moveTo(sources[0]);\n c.harvest(sources[0]);\n }\n } else {\n var s = Game.spawns.Spawn1;\n c.moveTo(
@xperimental
xperimental / keybase.md
Created Jun 1, 2014
Proof for keybase.io
View keybase.md

Keybase proof

I hereby claim:

  • I am xperimental on github.
  • I am xperimental (https://keybase.io/xperimental) on keybase.
  • I have a public key whose fingerprint is 6774 0203 4C2D 1311 0D9B 1749 2FA2 8F9B 0AB2 4687

To claim this, I am signing this object:

@xperimental
xperimental / add-serials.txt
Created May 17, 2014
Android Developer Days 2014 Prize Serials
View add-serials.txt
ADD 2014 Prize Serials
----------------------
Decompilation of ADD app by: goddchen, mauimauer and xperimental
4527
1137
1300
3584
3130
@xperimental
xperimental / elo.go
Created Jan 16, 2014
ELO scoring in Go
View elo.go
package main
import (
"fmt"
"math"
)
const (
ScoreFactor = 10
)
@xperimental
xperimental / remove_lock.sh
Last active Dec 29, 2015
Remove lock screen from adb
View remove_lock.sh
#!/bin/bash
adb shell am start --ez confirm_credentials false --ei "lockscreen.password_type" 0 com.android.settings/.ChooseLockGeneric
View pairing_tool.c
/*
* Copyright 2011 Benjamin Tissoires <benjamin....@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of