Skip to content

Instantly share code, notes, and snippets.

View kynan's full-sized avatar
💭
I may be slow to respond and only triage notifications irregularly

Florian Rathgeber kynan

💭
I may be slow to respond and only triage notifications irregularly
View GitHub Profile
@kynan
kynan / gist:1101739
Created July 23, 2011 18:48
Mount script for truecrypt volumes mounted from /etc/fstab
We couldn’t find that file to show.
@kynan
kynan / helmholtz_demo.py
Created September 20, 2011 18:59
DOLFIN demo to solve the Helmholtz equation on a unit square
"""This demo program solves Helmholtz's equation
- div grad u(x, y) + u(x,y) = f(x, y)
on the unit square with source f given by
f(x, y) = (1.0 + 8.0*pi**2)*cos(x[0]*2*pi)*cos(x[1]*2*pi)
and the analytical solution
@kynan
kynan / mailman-subscribers.py
Created September 27, 2011 11:20
List the email addresses subscribed to a MailMan mailing list, fetched from web
#!/usr/bin/env python
# vi: set et sw=4 st=4:
#
# 2004-08-27 Jim Tittsler <jwt@starship.python.net>
# 2004-10-03 jwt change authentication
# 2004-10-04 jwt remove dependency on ClientCookie
# 2004-10-07 jwt use getopt to retrieve host, list, password from command
# 2004-10-10 jwt return to using ClientCookie
# 2004-10-13 jwt add --fullnames option
# 2005-02-15 jwt switch on RFC2965 cookie support when newer version
@kynan
kynan / fluidity_mcfc_buildbot.sh
Created January 16, 2012 19:04
MCFC utilities
#!/bin/bash
# Run Fluidity UFL tests the same way buildbot does
(cd spatialindex-1.5; ./autogen.sh)
./configure --enable-2d-adaptivity --enable-mba3d --enable-algencan --enable-shared
make clean
make
make -C femtools clean-elements
make -C femtools get_element
@kynan
kynan / solarize-terminator.sh
Created February 19, 2012 16:59
shell script for setting terminator color palette to use Solarized theme
#!/bin/bash
#
# Shell script that configures terminator to use solarized theme
# colors. Assumes a single terminator profile. Tested on Ubuntu 11.10.
#
# Solarized theme: http://ethanschoonover.com/solarized
#
# Original from 79CetiB:
# http://www.reddit.com/r/emacs/comments/npfmv/i_need_some_help_with_the_solarized_theme_in_a/c3b4mds
#
@kynan
kynan / cx1.platform
Created May 5, 2012 19:06
Dorsal platfrom files
# Load modules
module unload intel-suite/10.1
module load armadillo/1.1.90 cgal/3.5 mpfr/2.4.1 intel-suite/11.1 mumps/4.9.2-parmetis parmetis/3.1 petsc/3.1-p6 scipy/2009-08-25 swig/2.0.2
# Platform specific variables
default UMFPACK_DIR=/usr
default PETSC_ARCH=linux-gnu-cxx-op
default GMP_DIR=/usr
default SCOTCH_ARCH=pc_linux2
@kynan
kynan / irssi_log_merge.py
Created May 16, 2012 00:13
Irssi Log Merger is a small Python script that takes a set of Irssi irclogs/ directories and merges them chronologically into a single set of files.
#!/usr/bin/python
# .- coding: utf-8 -.
#
# irssi_log_merge.py.
# Written by Lasse Karstensen <lasse.karstensen@gmail.com>, 2008.
# Released under GPLv2.
#
# Newest version available on http://hyse.org/irssi-log-merge/ .
#
# Modified by Florian Rathgeber <florian.rathgeber@gmail.com>
@kynan
kynan / shoot.sh
Created June 16, 2012 15:40
Take a screenshot and upload to imgur
#!/bin/bash
#
# By Sirupsen @ http://sirupsen.dk
# Original version: http://sirupsen.com/a-simple-imgur-bash-screenshot-utility
# Modifications by Florian Rathgeber @frathgeber (https://github.com/kynan)
#
# Description: Very simple script to make you
# select a region of your screen, which will be captured, and
# then uploaded. The URL will then be injected into your clipboard.
#
@kynan
kynan / pre-commit
Created June 23, 2012 17:22
OP2 git client hooks
#!/bin/sh
#
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-commit".
if git rev-parse --verify HEAD >/dev/null 2>&1
@kynan
kynan / test-automata.spec.coffee
Created October 15, 2012 20:56
Game of Life with rule 24 in Coffee
DEAD = 0
ALIVE = 1
evolve_cell = (left, middle, right) ->
register = left*4+middle*2+right
#console.log left, middle, right, register
switch register
when 4 then ALIVE # from [ALIVE,DEAD,DEAD]
when 3 then ALIVE # from [DEAD,ALIVE,ALIVE]
else