Skip to content

Instantly share code, notes, and snippets.

@josch
josch / retrieve_avatars.py
Created June 24, 2012 18:06
download all avatars of xmpp contacts
import xmpp
import base64
import sys
# this script retrieves the avatars of all your xmpp contacts and saves them
# in the current directory
if len(sys.argv) != 4:
print "usage: "+sys.argv[0]+" user pass server"
exit(1)
@josch
josch / debconf-selections.txt
Created November 11, 2011 09:49
debconf installer preseed
# Services to use:
# Choices: security updates (from security.debian.org), volatile updates (from volatile.debian.org)
apt-setup-udeb apt-setup/services-select multiselect
# Non-existing physical volume
partman-auto-lvm partman-auto-lvm/no_such_pv error
# Check the integrity of another CD-ROM?
d-i cdrom-checker/nextcd boolean false
# Install GRUB?
grub-installer grub-installer/grub_not_mature_on_this_platform boolean false
@josch
josch / robot_sim.py
Created November 5, 2011 15:02
robot simulator
from math import sin, cos, pi, sqrt, atan2
from time import sleep
from random import uniform
import sys
# coords and transform are three-tuples of x, y, phi
# coords specifies the coordinates to be transformed
# transform specifies the transformation properties to be applied (what translation/rotation)
def transform_robot_to_sim(coords, transform):
coords_x = coords[0]
@josch
josch / latex.py
Created June 4, 2011 05:08 — forked from EnigmaCurry/latex.py
A LaTeX filter for blogofile
"""
Render TeX blocks to png
This is a Blogofile filter. Place it in your _filters directory.
"""
import tempfile
import subprocess
import shutil
import shlex
import os
@josch
josch / notes.tex
Created May 22, 2011 09:53
jacobs university esm4a quiz and exam questions and solutions
\documentclass[11pt,a4paper]{article}
\usepackage{amsmath}
\usepackage{listings}
\usepackage[utf8]{inputenc}
\begin{document}
\renewcommand{\theenumi}{(\alph{enumi})}
\renewcommand{\labelenumi}{\theenumi}
\section{Introduction}
@josch
josch / n900-rootfs.sh
Created December 29, 2010 23:47
generates a rootfs for nokia n900
#!/bin/sh -e
ROOTDIR="n900-chroot"
PACKAGES="ifupdown,openssh-server,udev,procps,netbase,vim,console-setup-mini,man-db,iproute"
PACKAGES="$PACKAGES,module-init-tools,wget,openssh-client,locales,sysklogd,klogd,input-utils,dnsutils"
PACKAGES="$PACKAGES,alsa-base,ntpdate,debconf-english,screen,less,console-tools,iputils-ping,vpnc,rsync"
PACKAGES="$PACKAGES,i2c-tools,watchdog"
cdebootstrap --flavour=minimal --include=$PACKAGES sid "$ROOTDIR"
/*
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
@josch
josch / file_1
Created February 23, 2010 05:24 — forked from anonymous/file_1
#!/usr/bin/env python
import sys
class VM:
max_space = 32
def __init__(self, program, initial_data):
self.program_store = list()
self.data_store = self.max_space*[0]
From f8b4a752dc41e81bca114e92838a41915fd87cb4 Mon Sep 17 00:00:00 2001
From: josch <josch@pyneo.org>
Date: Mon, 7 Dec 2009 08:29:45 +0000
Subject: [PATCH] added libts-bin, input-utils
---
pyneo-rootfs.sh | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/pyneo-rootfs.sh b/pyneo-rootfs.sh
#!/usr/bin/env python
import pygst
pygst.require('0.10')
import os
import gst
from gobject import timeout_add, MainLoop
mainloop = MainLoop()
pipeline = gst.element_factory_make('playbin')