Skip to content

Instantly share code, notes, and snippets.

View dirkk0's full-sized avatar

Dirk Krause dirkk0

View GitHub Profile
@dirkk0
dirkk0 / install-web2py-pythonanywhere.sh
Created September 6, 2012 09:30 — forked from goldenboy/install-web2py-pythonanywhere.sh
Bash script to install web2py on pythonanywhere.com (web2py.pythonanywhere.com)
cd ~
wget -O web2py_src.zip http://web2py.com/examples/static/web2py_src.zip
unzip web2py_src.zip
echo "
PATH = '/home/"`whoami`"/web2py'
import os
import sys
sys.stdout = sys.stderr
os.chdir(PATH)
if not './' in sys.path[:1]: sys.path.insert(0,'./')
@dirkk0
dirkk0 / start_from_backup.sh
Created October 17, 2012 06:21
Start minecraft from an existing backup
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get -y install htop unzip
sudo apt-get -y install openjdk-7-jre
# either get it from a public dropbox:
# wget https://dl.dropbox.com/u/123456/myBackup.tar.gz
# or curl it from your FTP server
# curl --user user:pass ftp://myFtpServer.com/mc/myBackup.tar.gz -o bkp.tar.gz
@dirkk0
dirkk0 / backup.sh
Created October 17, 2012 06:24
tar and upload whole installation
tar czvf "bkp-$(date +%Y%m%d_%H%M%S).tar.gz" minecraft
curl --user user:pass -T bkp* ftp://myFtpServer.com
mv bkp* bkp-latest.tar.gz
curl --user user:pass -T bkp* ftp://myFtpServer.com
@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 / doit.sh
Created November 7, 2012 07:25
deploy dillinger.io to heroku
# Thanks to Joe McCann for Dillinger!!!!!
# https://github.com/joemccann/dillinger
# this script doesn't work just by itself, you need to
# insert uris and keys that get created by heroku, dropbox and github
####### heroku ######
# install heroku toolbelt
wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh
@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 / 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,