Skip to content

Instantly share code, notes, and snippets.

View barnybug's full-sized avatar
🏠
Working from home

Barnaby Gray barnybug

🏠
Working from home
View GitHub Profile
~ % mosquitto_sub -h iot.eclipse.org -t 'cheerlightsRGB'
#000000
^C⏎ ~ % mosquitto_sub -h iot.eclipse.org -t 'cheerlights'
oldlace
^C⏎
~ % mosquitto_sub -h iot.eclipse.org -t 'cheerlightsRGB'
#000000
~ % mosquitto_sub -h iot.eclipse.org -t 'cheerlights'
oldlace
import macros
import strutils
proc compile(input: string, setup: string): NimNode {.compiletime.} =
var caseBody = newNimNode(nnkCaseStmt)
caseBody.add parseExpr("pc")
var pc = 0
template addCase(text): typed =
var branch = newNimNode(nnkOfBranch)
{
_index: "events_201701160824",
_type: "event",
_id: "AV6VlZ-AHWGhPQNyr0dK",
_score: 6.8922844,
_source: {
event: "portal.impressions",
sid: "dc7e7cec-800a-4454-b89e-2d42dfe0097a",
pid: "a03f0281-c9e3-4ba2-b5d0-92af0554af54",
total_count: 1,
@barnybug
barnybug / docker-compose.yml
Created November 21, 2017 11:14
Docker compose for a Docker-in-docker gitlab runners setup
# Docker-in-Docker Gitlab runners setup taken from:
# https://medium.com/@tonywooster/docker-in-docker-in-gitlab-runners-220caeb708ca
dind:
restart: always
privileged: true
volumes:
- /var/lib/docker
image: docker:17.09.0-ce-dind
command:
- --storage-driver=overlay2
@barnybug
barnybug / k8s-tips.md
Created July 17, 2018 09:43
kubernetes tips

List pods ordered by node:

kubectl get po -o=wide --sort-by=.spec.nodeName

List nodes by instance type / zone:

kubectl get no -Lbeta.kubernetes.io/instance-type -Lfailure-domain.beta.kubernetes.io/zone
<?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.virtualbox.vboxautostart</string>
<key>ProgramArguments</key>
<array>
<string>/Applications/VirtualBox.app/Contents/MacOS/VBoxAutostart</string>
<string>--start</string>