Skip to content

Instantly share code, notes, and snippets.

View gelim's full-sized avatar

Mathieu Geli gelim

View GitHub Profile
@gelim
gelim / lxml-tests.py
Created October 21, 2010 17:25
lxml.etree and StrinIO strangeness
import StringIO, lxml.etree
xmldata="<root>data</root>"
buffer=StringIO.StringIO(xmldata)
for event, element in lxml.etree.iterparse(buffer):
print "%s %s %s" % (event, element.tag, element.text)
buffer=StringIO.StringIO()
buffer.write(xmldata)
for event, element in lxml.etree.iterparse(buffer):
@gelim
gelim / lxml-tests.py
Created October 21, 2010 17:26
lxml.etree & StringIO strangeness
import StringIO, lxml.etree
xmldata="<root>data</root>"
buffer=StringIO.StringIO(xmldata)
for event, element in lxml.etree.iterparse(buffer):
print "%s %s %s" % (event, element.tag, element.text)
buffer.close()
buffer=StringIO.StringIO()
buffer.write(xmldata)
@gelim
gelim / test-nginx-date-parsing
Last active May 26, 2016 21:38
logstash date filter (nginx)
$ logstash -f test.conf
$ echo '{"ts": "03/Sep/2014:16:11:58 +0200", "foo": "bar"}' | nc localhost 2222
@gelim
gelim / sharelatex-install-ubuntu-16.04.md
Last active August 10, 2022 13:57
sharelatex (non-docker) installation on a ubuntu 16.04 server

Installing ShareLaTex on Ubuntu 16.04

Use this as-is without any warranty, and don't bug ShareLatex project members if there are problems with my instructions. They officialy support docker installation only.

This gist summarize the actions I did to setup a pure ShareLaTex community edition on a bare linux ubuntu 16.04 server (no docker). I intentionnaly tried to stick to distribution practice for running daemons (via runit, and not via a custom my_init + setuser wrapper).

I basically took ShareLaTeX receipt to build their docker and adapted it.

@gelim
gelim / jar_serial_patch.py
Created November 11, 2017 09:37
JAR serialVersionUID patched
#!/usr/bin/env python [54/1801]
#
# serialVersionUID Java class modifier
# -- gelim @ ERPScan
#
from pprint import pprint
import argparse
import zipfile
import struct