Skip to content

Instantly share code, notes, and snippets.

View djvdorp's full-sized avatar

Daniel van Dorp djvdorp

View GitHub Profile
@djvdorp
djvdorp / golang-tls.md
Created September 6, 2016 14:42 — forked from denji/golang-tls.md
Simple Golang HTTPS/TLS Examples
Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048
    
# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
openssl ecparam -genkey -name secp384r1 -out server.key
@djvdorp
djvdorp / i3-cheat-sheet.md
Created September 2, 2016 12:34 — forked from miguelmota/i3-cheat-sheet.md
i3 Window Manager Cheat Sheet

i3 Window Manager Cheat Sheet

$mod refers to the modifier key (window/command or alt by default depending on config)

General

  • startx i3 start i3 from command line
  • $mod+<Enter> open a terminal
  • $mod+d open dmenu (text based program launcher)
  • $mod+r resize mode ( or to leave resize mode)
  • $mod+shift+e exit i3
@djvdorp
djvdorp / README.md
Created August 30, 2016 08:03 — forked from actionjack/README.md
How to Review Changes between Cloud Foundry Releases

How to Review Changes between Cloud Foundry Releases

This gist decribes a recommended way to review the differences between Cloud Foundry releases so they can be applied to our environments.

There are multiple ways listed to check the differences but typically you want to

  • Use git diff to see what has changed between release branches
  • Check the spec files to see the default options of the items that have been introduced or changed
  • Generate two Cloud Foundry manifests from each release and compare the two using spiff diff

Keybase proof

I hereby claim:

  • I am djvdorp on github.
  • I am djvdorp (https://keybase.io/djvdorp) on keybase.
  • I have a public key whose fingerprint is C435 A515 1C46 8FA5 07EC A395 96C2 3C75 87BE 3410

To claim this, I am signing this object:

@djvdorp
djvdorp / .golang-example-gitlab-ci.yml
Created April 12, 2016 09:29 — forked from mikeatlas/.golang-example-gitlab-ci.yml
Example Go GitLab CI setup (no root/sudo required)
# See docs/examples
# http://doc.gitlab.com/ce/ci/quick_start/README.html
# http://doc.gitlab.com/ce/ci/yaml/README.html
# GitLab CI template for Go tests. Note this installs
# a new working copy of Go in a non-standard path such
# that sudo/root is not needed for the install stage.
# note that this particular install-environment stage
# is overly verbose in order to debug anything tricky
@djvdorp
djvdorp / nginx-custom-build.sh
Created March 25, 2016 12:50
Build Ubuntu or Debian packages for nginx with custom patches, configs, and name suffixes in one command
#!/bin/bash
# Author: Alexander Rodin <[email protected]>
# License: MIT
BUILD_DIR=build
while getopts "hp:s:r:b:o:c:n" opt; do
case $opt in
h)
echo "Usage: $0 [options]"
@djvdorp
djvdorp / htpasswd.py
Created March 1, 2016 09:27 — forked from guerrerocarlos/htpasswd.py
Python script for generating htaccess passwords
#!/usr/bin/python
"""Replacement for htpasswd"""
# Original author: Eli Carter
import os
import sys
import random
from optparse import OptionParser
# We need a crypt module, but Windows doesn't have one by default. Try to find
@djvdorp
djvdorp / 95-lolcat
Created February 18, 2016 12:34 — forked from dorentus/95-lolcat
dynamically generated /etc/motd using fortune, cowsay & lolcat,save it as /etc/update-motd.d/95-lolcat.Google `pam_motd` or `update-motd` for more details of dynamically generated message-of-the-day.
#!/bin/bash
# see: http://blog.tomtung.com/2009/11/cowsay-fortune
# http://www.commandlinefu.com/commands/view/3584/remove-color-codes-special-characters-with-sed
# https://github.com/busyloop/lolcat
# https://github.com/dorentus/mruby-lolcat-bin
#
# requires `fortune`, `cowsay`,
# and ruby gem `lolcat` or its mruby version equivalent
export LANG="en_US.UTF-8"
@djvdorp
djvdorp / Vagrantfile
Created February 12, 2016 13:17 — forked from halcyonCorsair/Vagrantfile
A json file for chef-solo, and the equivalent Vagrantfile to setup koha
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "precise64"
@djvdorp
djvdorp / php-fpm-cli
Last active August 29, 2015 14:26 — forked from muhqu/php-fpm-cli
#!/bin/bash
#
# The MIT License (MIT)
#
# Copyright (c) 2014 Mathias Leppich <[email protected]>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell