Skip to content

Instantly share code, notes, and snippets.

View dirkk0's full-sized avatar

Dirk Krause dirkk0

View GitHub Profile
@dirkk0
dirkk0 / minimal.py
Created October 17, 2012 06:44
minimal Amazon EC2 startup script in boto/python
import time
from boto import ec2
it = 't1.micro'
# it = 'm1.small'
ami = "ami-137bcf7a" # ubuntu 12.04
instance_name = "myInstance"
security_group = "quicklaunch-0"
# elastic_ip = "1.2.3.4"
@dirkk0
dirkk0 / doit.sh
Created October 21, 2012 09:44
upload youtube videos via CLI
# install the youtube-uploader. Get it here:
# http://code.google.com/p/youtube-upload/wiki/Readme
# - create a folder uploads
# - copy your wmv's to this folder
# - create a batch file or call this script like this
# ./doit.sh "The title as it appears on Youtube"
# The video will be private at first (see the --private flag).
# Also set the proper category tag.
@dirkk0
dirkk0 / translate.py
Created November 17, 2012 09:58
translate by scraping dict.cc
# found at http://blog.dispatched.ch/2009/03/15/webscraping-with-python-and-beautifulsoup/
import urllib
import urllib2
import string
import sys
from BeautifulSoup import BeautifulSoup
user_agent = 'Mozilla/5 (Solaris 10) Gecko'
headers = { 'User-Agent' : user_agent }
@dirkk0
dirkk0 / pgessays.py
Created November 18, 2012 14:38 — forked from olasitarska/pgessays.py
Builds epub book out of Paul Graham's essays.
# -*- coding: utf-8 -*-
"""
Builds epub book out of Paul Graham's essays: http://paulgraham.com/articles.html
Author: Ola Sitarska <ola@sitarska.com>
This script requires python-epub-library: http://code.google.com/p/python-epub-builder/
"""
import re, ez_epub, urllib2, genshi
@dirkk0
dirkk0 / add.py
Last active October 24, 2015 12:19
Erratic bevaviour in tinydb
from tinydb import TinyDB, where
db = TinyDB('stack.json')
print db.insert({'type': 'job', 'cmd': 'tweet', 'txt': 'Heya!', 'prio': 1})
@dirkk0
dirkk0 / test.md
Last active December 10, 2015 01:48
Links
@dirkk0
dirkk0 / temp.json
Created December 28, 2012 16:07
blender exporter output
{
"metadata" :
{
"formatVersion" : 3.2,
"type" : "scene",
"sourceFile" : "",
"generatedBy" : "Blender 2.65 Exporter",
"objects" : 3,
"geometries" : 1,
@dirkk0
dirkk0 / gist:4530915
Last active December 11, 2015 02:29
Installing Telescope ( https://github.com/SachaG/Telescope)
# https://github.com/SachaG/Telescope
########################
# it should be
sudo apt-get install git npm
curl https://install.meteor.com | /bin/sh
sudo npm install -g meteorite
""""Create "The Matrix" of binary numbers scrolling vertically in your terminal.
original code adapted from juancarlospaco:
- http://ubuntuforums.org/showpost.php?p=10306676
Inspired by the movie: The Matrix
- Corey Goldberg (2013)
Requires:
@dirkk0
dirkk0 / install.sh
Created January 22, 2013 08:02
Installation of BLK (https://github.com/benvanik/blk-game) on Amazon EC2(Ubuntu
# install newer node
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs npm
sudo apt-get install --yes build-essential;
sudo apt-get install curl screen