Skip to content

Instantly share code, notes, and snippets.

View Ramblurr's full-sized avatar

Casey Link Ramblurr

View GitHub Profile
@Ramblurr
Ramblurr / gist:0a3c2ed3cf596fb9ffe7
Created May 15, 2015 16:13
Using Docker data containers
For smaller defaults, like sane config files, I put them into the application container, and then create a data volume container using the same image as the container that runs the application.
for example, When I make an apache image, the /etc/apache dir will contain working defaults. When I want to deploy a customised Apache container, I will
`docker run --name apache-cfg -v /etc/apache apache true`
then edit the cfg in that volume container - lets be primitve
`docker run --rm -it --volumes-from apache-cfg my-dev-tools bash`
#-- vim:sw=2:et
#++
# :title: the fucking weather plugin for rbot
#
# Author:: Casey Link <unnamedrambler@gmail.com>
# Copyright:: (C) 2009 Casey Link
#
# License:: GPL 2+
require 'cgi'
class FUWeather < Plugin
@Ramblurr
Ramblurr / qt-poppler-pdf2txt.cpp
Created October 15, 2009 17:17
Qt4 Poppler bindings to convert a pdf file into text
#include <poppler-qt4.h>
#include <QRectF>
#include <QDebug>
#include <QFile>
#include <QTextStream>
void pdftotext( const QString &filename )
{
Poppler::Document *doc = Poppler::Document::load(filename);
int count = doc->numPages();
@Ramblurr
Ramblurr / ChildrenFilteringProxyModel.cpp
Created August 9, 2010 16:41
Proxy model for filtering only the 1st level children in a treemodel. Assumes 1 column, 2 level tree.
/**
Proxy model for filtering only the 1st level children in a treemodel. Assumes 1 column, 2 level tree.
If the source model is:
Parent 1
- child 1
- child 2
Parent 2
- child 4
- child 5
@Ramblurr
Ramblurr / scorer.py
Created April 29, 2011 23:28
Iterated Prisoner's Dilemma Scorer
#! /usr/bin/python
#
# Iterated prisoner's dilemma King of Hill Script Argument is a
# directory. We find all the executables therein, and run all possible
# binary combinations (including self-plays (which only count once!)).
import subprocess
import os
import sys
RESULTS = {"cc":(2,"K"), "ct":(-1,"R"), "tc":(4,"S"), "tt":(1,"E")}
@Ramblurr
Ramblurr / key32to16.py
Created December 7, 2011 21:51
Converts a base32 encoded string to a base 16 string
#!/usr/bin/env python2
# Converts a base32 encoded string to a base 16 string
# requires numconv package
import numconv
import re
google_key = raw_input("Google key: ")
@Ramblurr
Ramblurr / owncloud.sh
Created August 13, 2012 16:18 — forked from dirkk0/owncloud.sh
owncloud installation on Amazon EC2
#!/bin/bash
VERSION=4.0.6 # desired owncloud version
if [[ $EUID -ne 0 ]]; then
echo "You must be a root user" 2>&1
exit 1
fi
@Ramblurr
Ramblurr / go_go_tor_relay.sh
Created November 14, 2012 14:58
Setup tor relay on debian squeeze
#!/bin/bash
####
# Simple tor relay (non-exit) setup for Debian squeeze
####
# begin user config
EXTERNAL_IP= # your external ip
MAX_MONTHLY_BW= # maximum GB per month you can spare for a tor relay
NICKNAME=atorrelay # custom nickname (will show in tor directory)
RELAY_PORT=443 # port to accept incoming connections on (open in your firewall!)
UnBundle 'mattn/webapi-vim'
UnBundle 'spf13/vim-autoclose'
UnBundle 'amirh/HTML-AutoCloseTag'
UnBundle 'matchit'
UnBundle 'Puppet-Syntax-Highlighting'
UnBundle 'groenewege/vim-less'
UnBundle 'tpope/vim-cucumber'
UnBundle 'tpope/vim-rails'
UnBundle 'derekwyatt/vim-sbt'
UnBundle 'derekwyatt/vim-scala'
@Ramblurr
Ramblurr / gist:5840573
Last active December 18, 2015 20:29
Travel Logistics

Maps

Android

Offline maps

  • Openandromaps - free vector maps covering the whole world for outdoor sport use, work best with Locus or Oruxmaps. OSM data with tags tweaked for outdoor sports.

Trains