Skip to content

Instantly share code, notes, and snippets.

@svanellewee
svanellewee / kubedf
Created November 20, 2019 07:43 — forked from redmcg/kubedf
Bash script to show k8s PVC usage
#!/usr/bin/env bash
KUBEAPI=127.0.0.1:8001/api/v1/nodes
function getNodes() {
curl -s $KUBEAPI | jq -r '.items[].metadata.name'
}
function getPVCs() {
jq -s '[flatten | .[].pods[].volume[]? | select(has("pvcRef")) | '\
@svanellewee
svanellewee / Vagrantfile
Last active January 16, 2020 13:09
Making etcd and kube-apiserver work together on a single virtualbox
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
cur_state=ENV["STATE"] || "startup"
Vagrant.configure("2") do |config|
@svanellewee
svanellewee / Vagrantfile
Created November 13, 2019 20:10
hardway kube vagrant
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
config.vm.provider "virtualbox" do |vb|
@svanellewee
svanellewee / Vagrantfile.actual.rb
Last active November 5, 2019 19:21
Vagrant files for the kubernetes course
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
config.vm.define :alpha do |alpha|
@svanellewee
svanellewee / PKGBUILD
Created July 9, 2019 10:42
usermode linux networking
# Maintainer: Haruue Icymoon <[email protected]>
# Contributor: Lucjan Lucjanov <[email protected]>
pkgname=linux-usermode
true && pkgname=(linux-usermode linux-usermode-modules)
pkgbase=linux-usermode
_kernelname=-usermodelinux
_srcname=linux-5.1.16
pkgver=5.1.16
pkgrel=1
@svanellewee
svanellewee / howto.sh
Created March 2, 2019 20:47
linux image tools
2274631 source image-tools
2274661 make-blank-image virtualdisk.img 1000
2274662 make-paritions virtualdisk.img
2274663 format-partitions virtualdisk.img
2274666 install-to-root virtualdisk.img ~/morty/arch/x86_64/boot/bzImage
# the next copies busybox/_install to /tmp/busybox/ and add init.
2274633 build-initramfs ~/busybox ~/morty # custom-initramfs.cpio.gz
XXXXXXX install-to-root virtualdisk.img custom-initramfs.cpio.gz
XXXXXXX cat <<EOF > startup.nsh
@svanellewee
svanellewee / index.html
Created November 9, 2018 07:04
WebGL example, Triangle, pulsing size+colour (from Shane)
<html>
<head>
</head>
<body>
<canvas id="app"> </canvas>
<script src="./index.tsx"></script>
</body>
</html>
@svanellewee
svanellewee / hack_tiller_download.md
Created July 26, 2017 13:05
Tiller image download fail

Having some trouble here again. seems adding this in minkube to the docker deamon helps:

Edit config:

minikube ssh
sudo vi /etc/systemd/system/docker.service.d/10-machine.conf

Add this to the calling script

@svanellewee
svanellewee / doc.xml
Last active June 12, 2017 21:36
C! Go! XML Xslt!
<?xml version="1.0" encoding="UTF-8"?>
<catalog>
<cd>
<title>Empire Burlesque</title>
<artist>Bob Dylan</artist>
<country>USA</country>
<company>Columbia</company>
<price>10.90</price>
<year>1985</year>
</cd>
@svanellewee
svanellewee / myfirstbot.go
Created May 19, 2017 12:04 — forked from IndianGuru/myfirstbot.go
My First Telegram Bot
package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
"strconv"
)