Skip to content

Instantly share code, notes, and snippets.

View simonvc's full-sized avatar
💭
Hiring Go Engineers

Simon Vans-Colina simonvc

💭
Hiring Go Engineers
View GitHub Profile
@simonvc
simonvc / gist:7104974
Created October 22, 2013 17:51
an ssh pub key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDo4mZedXR7FQH6SbsnP887D/FdU0hdnBr2jVl6+AbL5T3DKxDhjUX7OKQWbjJpw/rbaoCF8a5870fm3Lp6AFFC1XlakGtuWsabWdHl1qGyJHiXbCPt18HZBRx1a23KNtgmT5pEovntOMU/2/sMFw2oEJdsPjaNEy/TPTdAehhotWaQgY+KlNJoIQC4+kcpBP4dbIzzq96wWat2rGw6ijhqkWIeaFUeVbCqZsEJ6WQ/a7ylqOTwFFDdCriwCYgmcX3QRl8PiJs7pZjlGpa7Qe5TB39gAEJ88cLs+FUt5WtOlkXPTBq9d9wGMGxohIr4hMjup2d+pUcWKJUHzokoM/7V simonvc@aphid
@simonvc
simonvc / gist:7230732
Created October 30, 2013 10:57
python dictionary has a list or get an empty (but iterable) list
>>> for x in a.get('a list'):
... print x
...
1
2
3
4
5
6
>>> for x in a.get('b list'):
@simonvc
simonvc / Own_status_board.psp
Last active December 30, 2015 17:29
python server page hack to make a train display board. See it working here. http://imgur.com/tW9Bugl
<html>
<head>
<title>Python Server Pages (PSP)</title>
<meta http-equiv="refresh" content="60; url=http://192.168.1.2:8000/">
<body>
<%
import json
import time
import requests
from BeautifulSoup import BeautifulSoup
@simonvc
simonvc / docker.md
Last active August 29, 2015 13:58
Docker networking proposal

Seriously, the current state of connecting docker hosts together is poor. Most solutions seem to rely on stuffing ENVIRONMENT variables into docker hosts. I think we can do better..

I want to create a config file that looks like this:

# Host is a reserved name, MyWebContainer will look for a docker container called MyWebContainer
HOST:(*)80 --> MyWebContainer:8080
 
# any tcp connections on (*) any source port, with the dst port as 3306 will be routed to the mydatabase continer port 3306
MyWebContainer(*)3306 --&gt; MyDataBase:3306
@simonvc
simonvc / keybase.md
Created September 17, 2014 14:56
keybase

Keybase proof

I hereby claim:

  • I am simonvc on github.
  • I am simonvc (https://keybase.io/simonvc) on keybase.
  • I have a public key whose fingerprint is F251 3223 EBB4 6E00 F160 84A4 AEA8 9F35 D783 11AD

To claim this, I am signing this object:

@simonvc
simonvc / fix.sh
Created May 27, 2015 13:41
Script to fix files with the query string attached.
ls *\?* | while read fn; do nfn=$(echo $fn | tr '\?' ' ' | awk '{print $1}'); cp "$fn" $nfn;done
@simonvc
simonvc / gist:67c0c406d6ff4c146854
Last active August 29, 2015 14:26
thug180 cleanflight settings
# version
# Cleanflight/NAZE 1.10.0 Jul 31 2015 / 15:12:38 (96061b8)
# dump master
# mixer
mixer QUADX
mmix reset
smix reset
@simonvc
simonvc / gist:bbeb6e9c8a47d040ac6b
Created August 30, 2015 20:07
blackout cleanflight 1.9.0
# dump
# version
# Cleanflight/SPRACINGF3 1.9.0 May 31 2015 / 13:17:30 (98f7549)
# dump master
# mixer
mixer QUADX
0xF0bb9686Aa3bb1694695dfd36764b8e1d02F7E36 There once was a man named simon.
cd ~/Library/Containers/com.docker.docker/Data/database/
git reset --hard
cat com.docker.driver.amd64-linux/slirp/max-connections
echo 1500 > com.docker.driver.amd64-linux/slirp/max-connections
git add com.docker.driver.amd64-linux/slirp/max-connections
git commit -s -m 'Update the maximum number of connections'