Skip to content

Instantly share code, notes, and snippets.


David Burke bufke

View GitHub Profile
bufke / Dockerfile
Created Oct 1, 2015
GeoDjango with docker-compose
View Dockerfile
FROM python:3.4
RUN apt-get update ; apt-get --assume-yes install binutils libproj-dev gdal-bin
RUN wget
RUN tar -xjf geos-3.4.2.tar.bz2
RUN cd geos-3.4.2; ./configure; make; make install
RUN wget
RUN tar -xzf gdal-1.11.0.tar.gz
bufke /
Last active Jun 3, 2021
Convert odt, doc, docx, pdf to text with python and some linux programs. Doesn't require Libreoffice.
from subprocess import Popen, PIPE
from docx import opendocx, getdocumenttext
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter
from pdfminer.converter import TextConverter
from pdfminer.layout import LAParams
from pdfminer.pdfpage import PDFPage
from cStringIO import StringIO
bufke /
Last active Dec 10, 2015
For migrating zentyal 2.2 to 3.0 user ldap attributues
import base64
import binascii
import subprocess
import sys
# Set these please!
sam_file = "/var/lib/samba/private/sam.ldb.d/DC\=ZENTYAL\,DC\=EXAMPLE\,DC\=ORG.ldb"
user_dn = "ou=Users,dc=zentyal,dc=example,dc=org"
samba_dn = 'CN=Users,DC=zentyal,DC=example,DC=org'
base_dn = "dc=zentyal,dc=example,dc=org"