Skip to content

Instantly share code, notes, and snippets.

Avatar

Andreas Stenius kaos

View GitHub Profile
@kaos
kaos / list-pkg-versions.py
Created Apr 28, 2018
pip list available package versions
View list-pkg-versions.py
#!/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
try:
from pip._internal import cmdoptions, main
from pip._internal.commands import commands_dict
from pip._internal.basecommand import RequirementCommand
View app_docker-compose.yml
svcA:
image: busybox
command:
- sleep
- 3600
external_links:
- global/HAproxy:svcB.example.com
@kaos
kaos / mq.capnp
Last active May 3, 2017
MQTT transport for capnp RPC
View mq.capnp
@0xe425876d9fb9589c
# 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
kaos / keybase.md
Last active Jul 28, 2016
Proof of identity for keybase.
View keybase.md

Keybase proof

I hereby claim:

  • I am kaos on github.
  • I am kaos (https://keybase.io/kaos) on keybase.
  • I have a public key ASDjrQ4z8zESmWU718ZrzB-1NY_QmPKt4_T7qwuZ3dwFrAo

To claim this, I am signing this object:

@kaos
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
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 vagrantup.com.
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "precise32"
@kaos
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
kaos / transcript
Last active Dec 10, 2015
2012/12/21 Alain O'Dea <alain.odea@gmail.com>: > 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:
ssh-keygen
Create a repository named blog.alainodea.com 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/id_rsa.pub
You can’t perform that action at this time.