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 / 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
## 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 / 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
#!/bin/bash
mkdir /media/configdrive
mount /dev/xvdh1 /media/configdrive
coreos-cloudinit -from-configdrive /media/configdrive
@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 / install-heat.sh
Created August 31, 2015 14:36
Bash script to install single node OpenStack Heat with mariadb and rabbitmq
#!/bin/bash
################################################################################
# install-heat.sh
# ©Copyright IBM Corporation 2015.
#
# Bash script to install single node OpenStack Heat with mariadb and rabbitmq
# LICENSE: MIT (http://opensource.org/licenses/MIT)
################################################################################
echo "Script loosely based on https://github.com/sushilkm/heat-standalone/blob/master/install-heat"
heat_template_version: 2013-05-23
description: Create a VM with Floating IP and security group to allow all ssh
parameters:
key_name:
type: string
# default: hk_key
label: Keypair Name
description: Name of a KeyPair to enable SSH access to the instance.