Skip to content

Instantly share code, notes, and snippets.

View hassenius's full-sized avatar

Hans Kristian Moen hassenius

  • ServiceNow
  • Dublin, Ireland
View GitHub Profile
@hassenius
hassenius / private-network-gateway-floatingip.yaml
Created December 10, 2015 20:58
OpenVPN Server to access private openstack networks network
heat_template_version: 2013-05-23
description: Create an OpenVPN server to create connectivity to private networks
parameters:
key_name:
type: string
label: Keypair Name
description: Name of a KeyPair to enable SSH access to the instance.
constraints:
@hassenius
hassenius / get_openshift_clients.sh
Created September 8, 2020 12:34
Script to get latest openshift clients
#!/usr/bin/env bash
# Figure out platform
if [[ "$(uname -s)" == "Darwin" ]]; then
# We're on a mac
PLATFORM="mac"
else
# Assume linux
PLATFORM="linux"
fi
#!/usr/bin/env bash
function show_help() {
echo "Usage: "
echo $0
echo "-u <username>"
echo "-p <password>"
echo "-r <list of registries>"
echo "-d <dockerconfig.json>"
echo ""
@hassenius
hassenius / backporter.py
Last active March 23, 2020 17:19
Backporter experiments
#!/usr/bin/env python
##
## A good service here would be a robot that instead of picking up labels goes out and
## checks if the PR _could_ be merged to defined supported release branches _if_ the PR
## is labelled as bug. If it is automatically mergable this would indicate that the bug
## is also applicable to the supported releases.
##
from github import Github
import os, re
import subprocess
@hassenius
hassenius / managecluster.sh
Last active January 14, 2020 17:13
Simple script to manage kubectl when working with many IBM Cloud Private (ICP) clusters
#!/usr/local/bin/bash
#########################################################################################
##
## Simple script to simplify my workflow when managing kubernetes clusters
## Written and performed by Hans Kristian Moen
##
################ My defaults
# Where to stick certs and keys
kubecerts=~/.kube/certs
# Default namespace
## Starting deploy pkg operation
Deploying /tmp/vmware-root/6b7f3c42/imcf-DpjnKj
Initializing deployment module.
Cleaning old state file from tmp directory.
EXIT STATE INPROGRESS
Setting deploy error: Error removing lock /tmp/.vmware-deploy.INPROGRESS (No such file or directory)
#!/bin/bash
while getopts ":p:r:c:" arg; do
case "${arg}" in
p)
package_location=${OPTARG}
;;
r)
registry=${OPTARG}
;;
@hassenius
hassenius / get_package_options.rb
Last active September 2, 2016 20:52
Package Options
################################################################################
# get_package_options.rb
# ©Copyright IBM Corporation 2014.
#
# LICENSE: MIT (http://opensource.org/licenses/MIT)
################################################################################
require 'rubygems'
require 'softlayer_api'
require 'optparse'
require 'pp'
#!/bin/bash
mkdir /media/configdrive
mount /dev/xvdh1 /media/configdrive
coreos-cloudinit -from-configdrive /media/configdrive
@hassenius
hassenius / janitor.sh
Last active November 17, 2015 21:55
OpenStack Project Janitor
#!/bin/bash
#################################################################################
## janitor.sh
## ©Copyright IBM Corporation 2014.
## Brought to life by hans.moen@ie.ibm.com
## LICENSE: MIT (http://opensource.org/licenses/MIT)
#################################################################################
################################################################################
##
## janitor.sh -- employed to clean up other peoples mess