Skip to content

Instantly share code, notes, and snippets.

View marians's full-sized avatar

Marian Steinbach marians

View GitHub Profile
@marians
marians / import.py
Created March 16, 2017 13:09
Migrating a Ghost blog database to Jekyll
# coding: utf8
"""
This script helps to import content from a Ghost blog database to Jekyll.
The database is expected to be running on a reachalbe MySQL host.
See the very end for DB configuration.
Quick Usage:
pip install -r requirements
@marians
marians / Podcasts.md
Created January 31, 2017 21:21
Podcasts in English or German that could help you find out what's going on in the U.S. (politics)
@marians
marians / main.go
Created January 27, 2017 10:25
OAuth 2.0 authentication in a Golang CLI
package main
import (
"context"
"crypto/tls"
"fmt"
"log"
"net/http"
"net/url"
"time"
@marians
marians / Chromium Linux.md
Last active March 12, 2024 06:32
How to install CA certificates and PKCS12 key bundles on different platforms

We install certutil and pk12util if necessary:

sudo apt install libnss3-tools

On Linux, Chromium uses the NSS Shared DB. Check if you have the ~/.pki/nssdb directory:

ls $HOME/.pki/nssdb
@marians
marians / openapi-spec.yaml
Created November 14, 2016 15:45
How to avoid repeating a parameter definition in an Open API 2.0 spec?
swagger: "2.0"
host: api.example.com
schemes:
- https
info:
title: An Example API Spec
version: "1"
paths:
/users/{user_id}/:
@marians
marians / Ernests struggle.md
Last active August 25, 2016 11:53
Ernest Gagnon wants to ride with you

August 25, 2016

Some time ago the inspiring story of Ernest Gagnon (Blog, Facebook, Strava) captured my attention. Ernest (570 lbs/258 kg as of April 2010) is fighting to loose weight by riding his bike on a regular basis and even participating in Cyclocross races. I followed him from the distance on Strava ever since to support his fight idealistically by hitting the Kudos button for his efforts.

Photo of Ernest

Today, Ernest added an activity on Strava titled My last strava posting. In the comments, Ernest explains why he seems decided to quit cycling for good and end his fight.

been a really hard few months, lost lots of friends to new jobs moving and all that, been really hard to find people to ride with

@marians
marians / Dockerfile
Last active July 12, 2016 13:56
Synchronous encryption in Python+PyCrypto for decryption using OpenSSL
FROM python:2.7-alpine
ENV PYTHONUNBUFFERED True
RUN apk add --update openssl py-pip build-base python-dev \
&& pip install pycrypto \
&& apk del build-base python-dev \
&& rm -rf /var/cache/apk/*
ADD . /app/

Getting Started with a D1 mini (ESP-8266EX) and Arduino

These notes from June 2016 document how I got a successful start with a Wemos D1 mini on Arduino (Mac).

Installation

USB Serial Connection

I'm on Mac OS Sierra, so I need a driver for the USB serial bridge on the board, which is a CH340. The driver can be downloaded from this page:

@marians
marians / Dockerfile
Last active March 29, 2016 11:14
A Dockerfile for CouchDB
# Taking some inspiration from
# https://github.com/tutumcloud/tutum-docker-couchdb (licensed Apache 2.0)
FROM debian:wheezy
ENV DEBIAN_FRONTEND noninteractive
ENV COUCHDB_VERSION 1.6.1
# install base packages
RUN set -x && \
@marians
marians / map.js
Created March 16, 2016 13:16
CouchDB reduce_overflow_error problem
function(doc) {
if (doc.request_context.user_name
&& doc.timestamp
&& doc.day
&& doc.request_context.activity
&& typeof doc.request_context.activity !== "undefined") {
var is_error = 0;
if (typeof doc.response_status !== "undefined" && doc.response_status > 400) {
is_error = 1;
}