Skip to content

Instantly share code, notes, and snippets.

View sirhopcount's full-sized avatar

Adrian van Dongen sirhopcount

View GitHub Profile

Keybase proof

I hereby claim:

  • I am sirhopcount on github.
  • I am sirhopcount (https://keybase.io/sirhopcount) on keybase.
  • I have a public key whose fingerprint is E627 113D 9BA1 6C88 86FB 7AFC F688 D69D 8082 512C

To claim this, I am signing this object:

@sirhopcount
sirhopcount / README.md
Created August 14, 2017 09:57 — forked from wnoguchi/README.md
Preseed Recipe: Basic Configuration

Ubuntu Preseed Recipe: Basic

System Requirements

  • Ubuntu Server 12.04.3 LTS AMD64
  • HDD: 2TB Single
  • Mem: 16GB

References

#!/bin/bash
# configures bash prompt based on current kubernetes cluster context and namespace
# based on https://pracucci.com/display-the-current-kubelet-context-in-the-bash-prompt.html
__kube_ps1()
{
CONTEXT=$(kubectl config view | grep current-context | awk '{ print $NF }' | awk -F '.' '{ print $1 }')
NS=$(kubectl config view $(kubectl config current-context) | grep namespace | awk '{ print $2 }')
if [ -n "$CONTEXT" ]; then
echo "[${CONTEXT}][${NS}]"
@sirhopcount
sirhopcount / README.md
Created June 8, 2017 10:59 — forked from dbiesecke/README.md
Simple gist to show the aptly magic :)

Aptly Real-Live example

Install Repo

$ echo 'deb http://repo.aptly.info/ squeeze main' > /etc/apt/sources.list.d/aptly.list && wget -qO - https://www.aptly.info/pubkey.txt | sudo apt-key add -

$ apt-get update && apt-get install -y -f aptly

@sirhopcount
sirhopcount / var-lib-etcd2.mount
Created April 13, 2017 13:09 — forked from mgoodness/var-lib-etcd2.mount
Systemd unit file to mount EBS volume to /var/etc/data
[Unit]
Description=Mount EBS volume at /var/lib/etcd2
Requires=format-etcd-ebs.service
After=format-etcd-ebs.service
Before=etcd2.service
[Mount]
DirectoryMode=0777
Type=ext4
What=/dev/xvdb
@sirhopcount
sirhopcount / minio-distributed-statefulset.yaml
Created February 22, 2017 08:34 — forked from nitisht/minio-distributed-statefulset.yaml
Create a distributed Minio deployment based on StatefulSets
apiVersion: v1
kind: Service
metadata:
name: minio
labels:
app: minio
spec:
clusterIP: None
ports:
- port: 9000
@sirhopcount
sirhopcount / authentication.rb
Created October 21, 2016 05:08 — forked from theCrab/authentication.rb
A Hanami Framework authentication based on JSON Web Tokens.
# lib/authentications/authentication.rb
# @api auth
# Authentication base class
#
module Authentication
def self.included(base)
base.class_eval do
before :authenticate!
expose :current_user
@sirhopcount
sirhopcount / README.md
Created October 18, 2016 07:47 — forked from lusis/README.md
terraform template to generate serverspec properties

This uses terraform's template_file resource to generate a yaml properties file for serverspec to use.

  • create the Rakefile in your terraform project root
  • create a spec directory and put spec_helper.rb in it
  • create the templates/properties.tmpl.yml file
  • create the serverspec.tf
  • terraform apply

tests

Tests will be matched based on roles defined for a given node.

@sirhopcount
sirhopcount / cloud-config.yml
Created September 26, 2016 06:25 — forked from cbsmith/cloud-config.yml
modifying fleet metadata (from aws meta-data service) before fleet.service start; this is a proof of concept (but it works!)
#cloud-config
---
coreos:
units:
- name: update-fleet-metadata.service
command: start
content: |-
[Unit]
Description=Update Fleet metadata tag
Before=fleet.service
#!/bin/bash
APP='flannel-conf'
[[ "$DEBUG" == 'true' ]] && set -x
K8S_CLUSTER_ID=${K8S_CLUSTER_ID:?"${APP}: \$K8S_CLUSTER_ID is not set"}
K8S_S3_BUCKET=${K8S_S3_BUCKET:?"${APP}:\$K8S_S3_BUCKET is not set"}
SERVER_CERTIFICATES="flannel.pem flannel-key.pem"
CERTIFICATES="ca.pem"