Skip to content

Instantly share code, notes, and snippets.

View zacblazic's full-sized avatar

Zac Blazic zacblazic

  • Zappi
  • Cape Town, South Africa
View GitHub Profile
@zacblazic
zacblazic / http-sw-app.yaml
Last active February 6, 2024 12:01
Cilium Star Wars Demo
---
apiVersion: v1
kind: Service
metadata:
name: deathstar
labels:
app.kubernetes.io/name: deathstar
spec:
type: ClusterIP
ports:
192.168.70.3 google.com
192.168.70.3 absa.co.za
@zacblazic
zacblazic / Makefile
Last active January 22, 2019 15:24 — forked from itskingori/Makefile
Makefile for generating TLS certs for the Prometheus custom metrics API adapter
# modified from https://github.com/stefanprodan/k8s-prom-hpa/blob/617a98c5d921c3413599bbbb1438dfb125e3bd21/Makefile
SHELL=bash
UNAME := $(shell uname)
PURPOSE:=custom-metrics-adapter
SERVICE_NAME:=custom-metrics-adapter
ALT_NAMES:="custom-metrics-adapter.kube-system","custom-metrics-adapter.kube-system.svc"
SECRET_FILE:=custom-metrics-adapter-serving-certs.yml
certs: gensecret rmcerts
@zacblazic
zacblazic / nic.sh
Created July 26, 2017 23:35
Configures a secondary network interface (Debian Jessie)
#!/bin/bash
set -e
gateway_ip=$(ip route show default | awk '/default/ {print $3}')
eth1_ip=$(ip addr show eth1 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1)
echo "Configuring secondary IP (eth1) ..."
# Print stuff
@zacblazic
zacblazic / Steganography.cpp
Created March 26, 2011 16:36
Hides a text file within a BMP image
/*
* Author: Zac Blazic (210208880)
* Date: 24/03/2011
* File: Steganography.cpp
*/
#include "Steganography.h"
#include <fstream>
#include <string>
#include <iostream>
@zacblazic
zacblazic / SnakesAndLadders.cpp
Created March 20, 2011 18:48
Finds the maximum, minumum and average rolls to complete a snakes and ladders game
/*
* Author: Zac Blazic (210208880)
* Date: 19/03/2011
* File: SnakesAndLadders.cpp
* Description: Finds the maximum, minumum and average rolls to complete a snakes and ladders game.
*/
#include <iostream>
#include <ctime>