Skip to content

Instantly share code, notes, and snippets.

Avatar

Stefan Praszalowicz stfp

View GitHub Profile
View gist:ec6f17d02101d90b0c0f
### 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
Java class to kill the current process using JNA
View SelfKiller.java
/* 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 Jan 27, 2011
virtualenvwrapperwrapper is like lazy initialization for virtualenvwrapper
View veww.sh
#!/bin/sh
_veww () { source virtualenvwrapper.sh }
workon () { _veww; workon $@ }
mkvirtualenv () { _veww; mkvirtualenv $@ }
complete -o default -o nospace -F _veww workon
@stfp
stfp / install-image-in-lvm.py
Created Jan 8, 2011
installs an open nebula image from the repository to a new lvm volume in each host
View install-image-in-lvm.py
#!/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"