Skip to content

Instantly share code, notes, and snippets.

View pklaus's full-sized avatar

Philipp Klaus pklaus

  • Frankfurt, Germany
View GitHub Profile
#!/usr/bin/python
import sys
import xmlrpclib
# declare some variables for later use:
VERSION = "1.0"
NAME = "sipgateAPI-phonebook.py"
VENDOR = "someone nice"
@pklaus
pklaus / print_contacts_from_address-book.py
Created June 16, 2011 18:24
How to access the Mac OS X Address Book from Python: <http://www.programmish.com/?p=26>
import objc
import AddressBook as ab
import pprint as pp
def pythonize(objc_obj):
if isinstance(objc_obj, objc.pyobjc_unicode):
return unicode(objc_obj)
elif isinstance(objc_obj, ab.NSDate):
return objc_obj.description()
@pklaus
pklaus / sms.conf
Created June 17, 2011 08:50
Command Line Tool to send an SMS via the Sipgate API found on <http://irq0.org/Code?action=AttachFile&do=view&target=sms.py> on 2008-03-16
[account]
user: spam
passwd: eggs
@pklaus
pklaus / print_deepbit_status.py
Created June 24, 2011 19:18
Print the current status of of you account for the deepbit.net miner pool using Python.
#!/usr/bin/env python
import json, urllib
API_KEY='4e088145797261e10a000000_DA858CAE16'
API_BASE = 'http://deepbit.net/api/'
class Deepbit(object):
@staticmethod
def get_stats(api_key):
@pklaus
pklaus / gist:1050883
Created June 28, 2011 10:37
Create_thumbs – save in ~/.gnome2/nautilus-scripts/ as Create_thumbs
#!/bin/bash
# This is the modified version from http://ubuntuforums.org/showthread.php?p=5777836#post5777836
# And further modified by Philipp Klaus <http://blog.philippklaus.de>
# must have imagemagick installed
CURRENTLOCATION=`pwd`
SIZE=`zenity --list --title="Choose the thumbnail's size" --radiolist --column="Check" --column="Size" "" "320x240" "" "640x480" "" "800x600" "" "1024x768"`
@pklaus
pklaus / AMD.ovdr
Created July 14, 2011 05:17
AMDOverdriveCtrl on Command Line / Terminal (Overclocking to 820MHz)
<?xml version="1.0" encoding="utf-8"?>
<OVERDRIVE_PROFILE>
<PERFORMANCE_LEVEL level="2" gpu="82000" mem="125000" voltage="1100"/>
<PERFORMANCE_LEVEL level="1" gpu="50000" mem="125000" voltage="1000"/>
<PERFORMANCE_LEVEL level="0" gpu="25000" mem="15000" voltage="900"/>
<FAN_SETTING percentage="AUTO"/>
<FAN_CTRL enabled="yes"/>
<FAN_CTRL_CURVE type="2"/>
<FAN_CTRL_POINT nr="0" temperature="2000" percentage="0"/>
<FAN_CTRL_POINT nr="1" temperature="7500" percentage="500"/>
@pklaus
pklaus / PfeifferVacuum.py
Created November 19, 2011 10:23
Python Code to communicate with the 6 channel Pfeiffer Vacuum TPG256A MaxiGauge pressure gauge controller via a serial connection
#!/usr/bin/env python
# -*- encoding: UTF8 -*-
# Author: Philipp Klaus, philipp.l.klaus AT web.de
# This file is part of PfeifferVacuum.py.
#
# PfeifferVacuum.py 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
@pklaus
pklaus / ING-DiBa_cleanupCSV.py
Created December 11, 2011 02:45
Extrahieren der Transaktionen von der ING-DiBa Online-Banking Website mit __ALLEN__ Details (Kontonummern, BLZs). Dies ist ein Firefox-Makro geschrieben mit der Firefox-Erweiterung iMacros. Genaue Beschreibung unter http://goo.gl/nYdGO
#!/usr/bin/env python
# -*- encoding: UTF8 -*-
import sys
import re
def main(*args):
if len(args)<2:
usage_and_exit(args)
@pklaus
pklaus / opensc-tool.terminal-log.txt
Created December 21, 2011 12:50
First usage and test of the REINER SCT komfort RFID smart card reader on Mac OS X 10.7.2 using several terminal commands. See http://blog.philippklaus.de/2011/12/reiner-sct-cyberjack-rfid-komfort/ for more information.
philipp@lion:~$ opensc-tool --list-readers
# Detected readers (pcsc)
Nr. Card Features Name
0 No PIN pad REINER SCT cyberJack RFID komfort 00 00
@pklaus
pklaus / MacOSX-configure
Created January 4, 2012 09:13
Installing newer libccid 1.4.4 on Mac OS X Lion 10.7.2
philipp@lion:~/Downloads/ccid-1.4.4$ ./MacOSX/configure
+ ./configure 'CFLAGS= -DRESPONSECODE_DEFINED_IN_WINTYPES_H -isysroot /Developer/SDKs/MacOSX10.6.sdk -arch x86_64' PCSC_CFLAGS=-I/Users/philipp/Downloads/ccid-1.4.4/MacOSX 'PCSC_LIBS=-framework PCSC' LIBUSB_CFLAGS=-I/usr/local/include/libusb-1.0 'LIBUSB_LIBS=/usr/local/lib/libusb-1.0.a -Wl,-framework -Wl,IOKit -Wl,-framework -Wl,CoreFoundation' LDFLAGS= --enable-usbdropdir=/usr/libexec/SmartCardServices/drivers --disable-dependency-tracking --disable-static --disable-pcsclite --enable-composite-as-multislot
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes