Skip to content

Instantly share code, notes, and snippets.

View lambdafu's full-sized avatar

Marcus Brinkmann lambdafu

View GitHub Profile
FROM ubuntu
RUN apt-get update && apt-get install -y build-essential git wget \
libldap2-dev zlib1g-dev libbz2-dev libsqlite3-dev libreadline-dev \
pcscd file ca-certificates bzip2 texinfo bison xfig imagemagick \
autogen autoconf gettext pinentry-tty && apt-get clean
RUN git clone git://git.gnupg.org/gnupg.git
RUN git clone git://git.gnupg.org/libgpg-error.git
RUN git clone git://git.gnupg.org/libgcrypt.git
RUN git clone git://git.gnupg.org/libksba.git
RUN git clone git://git.gnupg.org/npth.git
FROM ubuntu
RUN apt-get update && apt-get install -y build-essential git wget \
libldap2-dev zlib1g-dev libbz2-dev libsqlite3-dev libreadline-dev \
pcscd file ca-certificates bzip2 texinfo bison xfig imagemagick \
autogen autoconf gettext pinentry-tty && apt-get clean
RUN git clone git://git.gnupg.org/gnupg.git
RUN git clone git://git.gnupg.org/libgpg-error.git
RUN git clone git://git.gnupg.org/libgcrypt.git
RUN git clone git://git.gnupg.org/libksba.git
RUN git clone git://git.gnupg.org/npth.git
08ce563f89a0ed9414f5aa28ad0d96d6795f9c60
08ce563f89a0ed9414f5aa28ad0d96d6795f9c61
08ce563f89a0ed9414f5aa28ad0d96d6795f9c62
08ce563f89a0ed9414f5aa28ad0d96d6795f9c63
08ce563f89a0ed9414f5aa28ad0d96d6795f9c64
08ce563f89a0ed9414f5aa28ad0d96d6795f9c65
08ce563f89a0ed9414f5aa28ad0d96d6795f9c66
08ce563f89a0ed9414f5aa28ad0d96d6795f9c67
08ce563f89a0ed9414f5aa28ad0d96d6795f9c68
08ce563f89a0ed9414f5aa28ad0d96d6795f9c69
@lambdafu
lambdafu / mrm_decode.py
Created February 5, 2018 21:18
modified rabin mueller decoder for NFC
#! /usr/bin/env python2
import sys
class mrm_decoder():
def __init__(self):
self.last = "0"
# Take one symbol and decode it.
# Symbol can be: 1 (kurz = short), 2 (mittel = medium), 3 (lang = long)
@lambdafu
lambdafu / img2unicode.py
Created December 9, 2017 19:06
Convert an image to Unicode block graphic
# -*- coding: utf-8 -*-
from __future__ import print_function
import numpy as np
from PIL import Image
import matplotlib.pyplot as plt
import sys
THRESHOLD_VALUE = 128
WIDTH = 120

Keybase proof

I hereby claim:

  • I am lambdafu on github.
  • I am lambdafu (https://keybase.io/lambdafu) on keybase.
  • I have a public key whose fingerprint is 3CB0 E844 16AD 52F7 E186 5418 88B0 8D5A 57B6 2140

To claim this, I am signing this object:

from PIL import Image, TiffImagePlugin
import shutil
import os
from base64 import decodestring
TEST_TIF = "test-delete.tif"
test_tif = decodestring(
"""SUkqAAgAAAAMAAABBAABAAAACgAAAAEBBAABAAAACgAAAAIBAwABAAAACAAAAAMBAwABAAAAAQAA
AAYBAwABAAAAAwAAABEBBAABAAAArgYAABYBBAABAAAACgAAABcBBAABAAAAZAAAABoBBQABAAAA
ngAAABsBBQABAAAApgAAABwBAwABAAAAAQAAAEABAwAAAwAArgAAAAAAAAAAAAAAAQAAAAAAAAAB
import io
import os
import struct
class AppendingTiffWriter:
fieldSizes = [
0, # None
1, # byte
1, # ascii
2, # short
# AppendingTiffWriter
# -*- coding: utf-8 -*-
#
# "file object wrapper class" that is able to append a TIF to an existing one
#
# Code by @vashek (https://github.com/vashek) published at
# https://github.com/python-pillow/Pillow/issues/733#issuecomment-249380397
#
# Fixed PEP8 and clean by Jesús Leganés-Combarro 'piranna' <[email protected]>