Skip to content

Instantly share code, notes, and snippets.

View xvronny's full-sized avatar

Ronny Hendrawan xvronny

View GitHub Profile
@xvronny
xvronny / rune_literals.py
Last active September 21, 2020 12:48
Translating Go Rune literals into python binary format.
#!/usr/bin/env python
# Go byte slice format is printed using rune literals https://golang.org/ref/spec#Rune_literals
# If you need to translate this format (e.g. from Google cbt client) into python byte array the following would be useful
import struct, re
ESCAPE_CHARACTERS = {"a": 7, "b": 8, "f": 12, "v": 11, "n": 10, "r": 13, "t": 9, "\\": 92, "'": 39, "\"": 34}
GO_RUNE_LITERALS = re.compile(r"((?P<hex>\\x[0-9a-fA-F]{2})|"
@xvronny
xvronny / postgres.md
Last active January 16, 2019 23:18
Installing PostgreSQL 11 with PostGIS 2.4 on Amazon Linux 2018.03

Published note for installation instructions to make it easier for future installers.

PostgreSQL 11.0 Installation

Installation of PostgreSQL on Amazon Linux generally follows the same path as discussed in StackOverflow Question

  1. Copy the link from PostgreSQL repository list after selecting the appropriate options. For Amazon Linux 2018.xx we should select RedHat Enterprise Linux 6 as target OS.
  2. Add the repository link and replace versions placeholders in /etc/yum.repos.d/pgdg-11-redhat.repo using the following commands