Skip to content

Instantly share code, notes, and snippets.


Darren Wurf dwurf

  • Australia
View GitHub Profile
dwurf / hello.svg
Created Sep 6, 2020
Half a submission for the pycon 2020 Rube Codeberg challenge - unfinished
View hello.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
dwurf /
Created Dec 15, 2019
Using Python's built-in smtplib to send files
#!/usr/bin/env python
"""Script for sending an email (with an optional file attachment)."""
# Modified from the documentation at
# Tested against python 2.6, 2.7 and 3.6
# For help, run this script!
dwurf / Makefile
Last active Sep 13, 2019
Query Valve servers
View Makefile
.PHONY: run
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
pth := $(notdir $(patsubst %/,%,$(dir $(mkfile_path))))
run: $(pth)/venv
$(pth)/venv/bin/python3 $(pth)/
dwurf / go.mod
Last active Sep 1, 2019
Go web server - hello world!
View go.mod

Keybase proof

I hereby claim:

  • I am dwurf on github.
  • I am dwurf ( on keybase.
  • I have a public key ASDQJHM8GNRuzcosO3uRNIX6hvy5qDyjKLpms2GMATU8vAo

To claim this, I am signing this object:

dwurf /
Created Mar 20, 2017
TCP client/server code in Python (asyncore library)
#!/usr/bin/env python
# This script opens CONNECTIONS simultaneous connections to a remote socket,
# and sends a fixed string before closing the connection. The process is then
# repeated indefinitely
# Intended to unit test the script
import asyncore
import socket
dwurf /
Last active Feb 28, 2016
Practical Use of Docker
## Docker

Docker is a useful abstraction for processes

  • Web application server (django/rails/tomcat/...)
  • Database
  • Reverse HTTP proxy (nginx/apache)

... each in their own Docker container

dwurf / cyclobs.cpp
Created Jan 13, 2016
Program to solve cyclobs' weird problem
View cyclobs.cpp
#include <iostream>
#include <cstdlib>
using namespace std;
// Arbitrary precision c++ library
// compile with:
// gcc thisfile.c -lgmp -lgmpxx -o mybinary
#include <gmpxx.h>
int main(int argc, char **argv){
dwurf /
Last active Oct 26, 2015
Docker setup

These steps were run to set up the local network

Docker install

sudo apt-key adv --keyserver hkp:// --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
sudo bash -c "echo deb ubuntu-trusty main > /etc/apt/sources.list.d/docker.list"
sudo apt-get update
sudo apt-get -y install docker-engine
sudo docker run hello-world
sudo docker run -it ubuntu bash
# Script to install kf2 server under wine on ubuntu 14.04 (AWS micro instance)
# This script makes a mess, run it in a subdirectory to keep it contained
# Also run it on a server you don't care about or be sure you don't mind when it
# installs a bunch of random crap
# Install wine
if dpkg -l wine > /dev/null 2>/dev/null; then