Skip to content

Instantly share code, notes, and snippets.

Tolleiv Nietsch tolleiv

Block or report user

Report or block tolleiv

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
View CustomPageViewController.swift
import UIKit
class CustomPageViewController: UIPageViewController,UIPageViewControllerDataSource,UIPageViewControllerDelegate {
fileprivate lazy var pages: [UIViewController] = {
return [
self.getViewController(withIdentifier: "firstVc"),
self.getViewController(withIdentifier: "secondVc")
tolleiv /
Last active Apr 15, 2018
Fixed syntax and added documentation for the timelapse script from
#!/usr/bin/env python
import numpy as np
import cv2
from skimage.measure import compare_ssim as ssim
import time
# Pick a source - either a file or a (exiting) device
cap = cv2.VideoCapture('/dev/video0')
tolleiv / ssh_config
Created Jan 12, 2018
SSH Config so "ssh" uses the right key with the right settings
View ssh_config
Host *.aws
IdentityFile ~/.ssh/super-secret-key.pem
User ubuntu
StrictHostKeyChecking no
ProxyCommand nc $(sed -e "s/.aws$//" <<< "%h") %p
openssl s_client -connect $SITE:443 > /tmp/cert (edited)
sudo keytool -storepass changeit -import -alias $SITE -keystore $(/usr/libexec/java_home)/jre/lib/security/cacerts -file /tmp/cert
tolleiv /
Last active Nov 3, 2017 — forked from cecilemuller/
How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

There are two main modes to run the Let's Encrypt client (called Certbot):

  • Standalone: replaces the webserver to respond to ACME challenges
  • Webroot: needs your webserver to serve challenges from a known folder.

Webroot is better because it doesn't need to replace Nginx (to bind to port 80).

In the following, we're setting up HTML is served from /var/www/mydomain, and challenges are served from /var/www/letsencrypt.

tolleiv / abort-jenkins-job.groovy
Created Jul 25, 2017
Groovy snippet to abort a build without removing it....
View abort-jenkins-job.groovy
Jenkins.instance.getItemByFullName("JobName").getBuildByNumber(JobNumber).finish(hudson.model.Result.ABORTED, new"Aborting build"));
set -e # Fail fast
aws s3 sync --acl "public-read" --sse "AES256" public/ s3://$BUCKET_NAME --exclude 'post'
aws cloudfront create-invalidation --distribution-id $DISTRIBUTION_ID --paths /index.html / /page/*
tolleiv /
Created Jul 15, 2017
Have a service account for helm/tiller only
kubectl create serviceaccount --namespace kube-system tiller
kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'
helm init --service-account tiller --upgrade
helm list
tolleiv /
Created Jun 28, 2017
Minimal script to transform a list of files into the full tree with all parent folders (used to generate rsync-filters)
while read -r line ; do
DIR=$(dirname $line)
for i in $DIR; do
echo "$subpath"
tolleiv /
Last active Apr 18, 2017
Small project which sends measurements from an DHT22 sensor via MQTT into my home automation void.
You can’t perform that action at this time.