Skip to content

Instantly share code, notes, and snippets.

@azmeuk
azmeuk / SDL EGL test
Last active December 16, 2015 21:48
This code returns :EGL KOGLX OK
#include <EGL/egl.h>
#include <GL/glx.h>
#include <SDL/SDL.h>
int main(){
SDL_InitSubSystem(SDL_INIT_VIDEO);
SDL_SetVideoMode(200, 200, 0, SDL_OPENGL);
printf(eglGetCurrentContext() == EGL_NO_CONTEXT ? "EGL KO\n" : "EGL OK\n");
printf(glXGetCurrentContext() == NULL ? "GLX KO\n" : "GLX OK\n");
#
# Finds the closest virtualenv root directory, starting from $1, and going up to the root.
# If the target directory is not specified as an argument, current directory is used.
# Prints the virtualenv path found, or nothing otherwise.
#
function venv_find () {
# The cycle is just for the case with broken root folder detection -- never do more than N iterations.
venv_root=${1:-"."}
venv_found=""
@azmeuk
azmeuk / parser.py
Last active August 29, 2015 14:07
General output parser
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import multiprocessing, subprocess, sys
class Parser(multiprocessing.Process):
process = None
def __init__(self, daemon, output):
super(Parser, self).__init__()
@azmeuk
azmeuk / foobar.py
Created September 30, 2014 13:08
Python wait and print
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import time, sys
if __name__ == "__main__":
for i in range(0,4):
print i
time.sleep(1)
@azmeuk
azmeuk / conquest-pacs.sh.patch
Last active August 29, 2015 13:57
conquest-pacs.sh.patch Patch
--- conquest-pacs.sh 2013-10-13 22:34:39.000000000 +0200
+++ conquest-pacs.sh 2014-03-24 15:05:48.397034507 +0100
@@ -84,7 +84,7 @@
--exec $DAEMON -- $ARGS
sleep 1
start-stop-daemon --start --quiet --pidfile $PIDFILE \
- --chuid conquest --chdir $HOME --exec $DAEMON -- $ARGS
+ --chuid $PACSUSER --chdir $HOME --exec $DAEMON -- $ARGS
echo "$NAME."
;;
@azmeuk
azmeuk / gist:8859316
Created February 7, 2014 08:56
Docker issue logs
$ sudo lxc-checkconfig
--- Namespaces ---
Namespaces: enabled
Utsname namespace: enabled
Ipc namespace: enabled
Pid namespace: required
User namespace: missing
Network namespace: enabled
Multiple /dev/pts instances: missing