Skip to content

Instantly share code, notes, and snippets.

Lorenz Lo Sauer lsauer

Block or report user

Report or block lsauer

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
dweldon /
Last active Jan 19, 2020
Install docker CE on Linux Mint 18.3
#!/usr/bin/env bash
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] xenial stable"
sudo apt-get update
sudo apt-get install docker-ce
kekru / 1-Enable Docker Remote API with TLS client
Last active Feb 11, 2020
Docker Remote API with client verification via daemon.json
View 1-Enable Docker Remote API with TLS client

Enable Docker Remote API with TLS client verification

Docker's Remote API can be secured via TLS and client certificate verification.
First of all you need a few certificates and keys:

  • CA certificate
  • Server certificate
  • Server key
  • Client certificate
  • Client key

Create certificate files

soheilhy /
Last active Feb 13, 2020
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for,, and on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

goldhand / recursiveness
Created Aug 15, 2013
Things I learned dealing with JSON trees in django
View recursiveness
# Things I learned dealing with recursive JSON objects
This is a summary of my findings while dealing with a django model, TaskCategory.
## Two ways for manipulating a set of trees
I found two different ways for manipulating objects with an uncertain amount
of ascendants / descendants. The first involves manipulating an object within
a tree and the second involves taking apart the tree, manipulating the branches
and building a new tree
edw /
Last active May 31, 2019
Dump a schema from a Heroku app's database.
db_url=`heroku config -s --app ${app} | grep ${env_var}`
lsauer / InChi.js
Created Oct 25, 2011
Regular Expressions for validating SMILES, InChi, InChiKey
View InChi.js
// International Chemical Identifier Regex, by lo sauer -
// Morphine InchI:
var x="InChI=1S/C17H19NO3/c1-18-7-6-17-10-3-5-13(20)16(17)21-15-12(19)4-2-9(14(15)17)8-11(10)18/h2-5,10-11,13,16,19-20H,6-8H2,1H3/t10-,11+,13-,16-,17-/m0/s1"
// applying an organic character-subset
// we could check for the length property, but in case of 0 matches 'null' is returned -> hence !!.. \ generally equal to Boolean(..)
timbroder / gist:1209944
Created Sep 11, 2011
insert update url rewrite
View gist:1209944
#INSERT INTO `core_url_rewrite` (`store_id`, `category_id`, `product_id`, `id_path`, `request_path`, `target_path`, `is_system`)
SELECT 1 AS `store_id`,
`sub`.`entity_id` AS `product_id`,
CONCAT('product', '/', `entity_id`, '/', `category_id`) AS `id_path`,
`value` AS `request_path`,
CONCAT('catalog/product/view/id/', `entity_id`, '/category/', `category_id`) AS `target_path`,
1 AS `is_system`
kzk / evhttp-multh-thread-httpd.cpp
Created Nov 6, 2010
Multi-Threaded HTTPServer using evhttp
View evhttp-multh-thread-httpd.cpp
#include <event.h>
#include <evhttp.h>
#include <pthread.h>
#include <errno.h>
#include <string.h>
#include <fcntl.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <iostream>
leandrosilva / Client.cs
Created Oct 31, 2010
Asynchronous Client/Server Socket Example with C# (from MSDN library)
View Client.cs
// Asynchronous Client Socket Example
using System;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using System.Text;
// State object for receiving data from remote device.
You can’t perform that action at this time.