Skip to content

Instantly share code, notes, and snippets.

View dirkk0's full-sized avatar

Dirk Krause dirkk0

View GitHub Profile
@dirkk0
dirkk0 / test.py
Created February 5, 2014 08:57
python script to send mail including docopt
#!/usr/bin/env python
"""Mail.
Usage:
mail.py (-h | --help)
mail.py --version
mail.py [--to <to>] [--from <from>] [--cc <cc>] [--subject <subject>] [--message <message>]
Options:
@dirkk0
dirkk0 / test.html
Created February 13, 2014 06:57
timbre.js drag&drop mp3
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Decode</title>
</head>
<body>
drag & drop an audio file.
<ul style="list-style:none">
#!/bin/sh
export XKL_XMODMAP_DISABLE=1
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
gnome-panel &
gnome-settings-daemon &
metacity &
nautilus &
@dirkk0
dirkk0 / new_xample.py
Last active August 29, 2015 14:06
edited
import new_code
@dirkk0
dirkk0 / gist:655c5a27e718597a8913
Last active August 29, 2015 14:07
Install Minetest Server with Carbone on Ubuntu 12.04 in Amazon EC2
sudo apt-get update
sudo apt-get install --yes htop unzip
sudo apt-get install --yes python-software-properties
sudo add-apt-repository --yes ppa:minetestdevs/stable
sudo apt-get update
sudo apt-get install --yes minetestc55
wget https://gitorious.org/calinou/carbone/archive/master.zip -O carbone.zip
unzip carbone.zip
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script>
<script>
var vegetables = [{
"name": "Carrot"
}, {
"name": "Potato"
}, {
"name": "Broccoli"
}];
<html>
<head>
<title>Redirecting...</title>
<meta http-equiv="refresh" content="0;url=http://google.de">
</head>
<body>
Attempting to redirect to <a href="http://google.de">http://google.de</a>.
</body>
</html>
@dirkk0
dirkk0 / doit.sh
Last active August 29, 2015 14:16
Installing ppnet/ppnet-proxy on EC2/Ubuntu14
sudo apt-get update
sudo apt-get -y install couchdb
# curl http://localhost:5984
sudo apt-get install -y python-software-properties
sudo apt-get install software-properties-common
sudo add-apt-repository -y ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install -y nodejs
@dirkk0
dirkk0 / 1.py
Created March 11, 2015 17:52
Read Trello API by board, list, card
# 1.py
# pip2 install trello
# https://pythonhosted.org/trello/trello.html
import pprint
pp = pprint.PrettyPrinter(indent=4)
import credentials
key = credentials.key
@dirkk0
dirkk0 / test_app.py
Last active August 29, 2015 14:16
Using the jsontemplate engine (or, the beauty of python)
# via http://json-template.googlecode.com/svn/trunk/doc/Introducing-JSON-Template.html
import jsontemplate
import json
# load template
template = open('test_template.html', 'r').read()
# load data
data = json.loads(open('test_data.json', 'r').read())