Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View stfp's full-sized avatar

Stefan Praszalowicz stfp

View GitHub Profile
@stfp
stfp / install-image-in-lvm.py
Created January 8, 2011 11:27
installs an open nebula image from the repository to a new lvm volume in each host
#!/usr/bin/python
import os, sys
import logging
import hashlib
from xmlrpclib import ServerProxy
import xml2obj
ONE_SERVER="http://localhost:2633/RPC2"
ONE_USER="oneadmin"
### Keybase proof
I hereby claim:
* I am stfp on github.
* I am stfp (https://keybase.io/stfp) on keybase.
* I have a public key whose fingerprint is 99A9 D78D 7C95 D0B4 CDEC 9D9B B403 3B0F AD98 2B4A
To claim this, I am signing this object:
@stfp
stfp / SelfKiller.java
Created May 19, 2011 03:21
Java class to kill the current process using JNA
/* Requires JNA
* Get jna.jar here: http://java.net/projects/jna/sources/svn/show/trunk/jnalib/dist
*/
import com.sun.jna.Library;
import com.sun.jna.Native;
public class SelfKiller
{
private interface CLibrary extends Library
{
@stfp
stfp / veww.sh
Created January 27, 2011 18:26
virtualenvwrapperwrapper is like lazy initialization for virtualenvwrapper
#!/bin/sh
_veww () { source virtualenvwrapper.sh }
workon () { _veww; workon $@ }
mkvirtualenv () { _veww; mkvirtualenv $@ }
complete -o default -o nospace -F _veww workon