Skip to content

Instantly share code, notes, and snippets.


Andreas Stenius kaos

View GitHub Profile
kaos /
Created Apr 28, 2018
pip list available package versions
#!/usr/bin/env python
# When you want a easy way to get at all (or the latest) version of a certain python package from a PyPi index.
import sys
import logging
from pip._internal import cmdoptions, main
from pip._internal.commands import commands_dict
from pip._internal.basecommand import RequirementCommand
View app_docker-compose.yml
image: busybox
- sleep
- 3600
- global/
kaos / mq.capnp
Last active May 3, 2017
MQTT transport for capnp RPC
View mq.capnp
# Disclaimer, I'm no pubsub expert, so there may be inconsitencies and
# other errors in concept or layout with regard to how the queues and
# topics work.
interface Broker {
publish (message :Message, topic :Topic) -> (result :Result);
subscribe (subscriber :Subscriber, topic :Topic) -> (result: Result);
kaos /
Last active Jul 28, 2016
Proof of identity for keybase.

Keybase proof

I hereby claim:

  • I am kaos on github.
  • I am kaos ( on keybase.
  • I have a public key ASDjrQ4z8zESmWU718ZrzB-1NY_QmPKt4_T7qwuZ3dwFrAo

To claim this, I am signing this object:

kaos / bench
Created Sep 13, 2013
erlydtl scanner benchmark
View bench
#!/usr/bin/env escript
%% -*- mode: erlang -*-
%% Usage: ./bench <run time in seconds> <template file to scan>
%% Defaults to 2 seconds on 'bench.dtl'.
main([]) ->
run_benchmark(2, "bench.dtl");
main([Time]) ->
run_benchmark(list_to_integer(Time), "bench.dtl");
kaos / Vagrantfile
Created May 30, 2013
Vagrant setup for zotonic
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at
# Every Vagrant virtual environment requires a box to build off of. = "precise32"
kaos / _admin_edit_content.device.tpl
Created Dec 28, 2012
Adding custom properties to the zotonic admin backend.
View _admin_edit_content.device.tpl
{% extends "admin_edit_widget_std.tpl" %}
{% block widget_title %}{_ Device Details _}{% endblock %}
{% block widget_show_minimized %}false{% endblock %}
{% block widget_content %}
<fieldset class="admin-form">
{# Attention flag #}
<div class="form-item clearfix">
kaos / transcript
Last active Dec 10, 2015
2012/12/21 Alain O'Dea <>: > Brace yourselves for a brain dump :) > Here is a fairly literal transcript of how I did this for my blog. Some scripts will need path changes, etc. to work on your setup.
View transcript
Create an SSH key:
Create a repository named in Github:
Go to Settings
Click on Deploy Keys
Click on Add Deploy Key
Set Title to "zotonic-sync"
Set Key to the content of /home/zotonic/.ssh/