Skip to content

Instantly share code, notes, and snippets.

View Darkflib's full-sized avatar
💭
Kubernetes: because you thought one moving part wasn't enough.

Mike Preston Darkflib

💭
Kubernetes: because you thought one moving part wasn't enough.
View GitHub Profile
Github Desktop
Chrome
FF
npm
java-sdk
android sdk
vlc
7zip
chromeremotedesktophost
cyberduck
<?php
class UUID {
public static function v3($namespace, $name) {
if(!self::is_valid($namespace)) return false;
// Get hexadecimal components of namespace
$nhex = str_replace(array('-','{','}'), '', $namespace);
// Binary Value
$nstr = '';
@Darkflib
Darkflib / install-kube.sh
Last active May 27, 2018 19:59
kube - ubuntu
#!/bin/sh
#########
#
# Note: this does not provide a production ready cluster. It will produce a dev cluster with a single etcd daemon.
#
##########
apt-get -y update
apt-get -y upgrade
apt-get -y install apt-transport-https ca-certificates curl software-properties-common tmux vim
@Darkflib
Darkflib / ringtones.txt
Created March 9, 2018 18:55
Creating iphone ringtones
To create ringtones for iphone
1. select up to 30 seconds of music...
2. convert that 30 seconds into AAC
3. change the extension to m4r
4. use itunes to upload it
@Darkflib
Darkflib / reset-mac.sh
Created April 25, 2018 14:55
Mac switch MAC
To switch mac, you will need to be admin and disconnected from the wifi.
Before you begin, get your existing mac address and replace the placeholder in the reset-mac.sh file.
To disconnect, hold alt/option and right click the wifi icon in the top bar.
Click the disconnect under your connected wifi connection.
Once this is done, run switch-mac.sh as admin and then reconnect.
@Darkflib
Darkflib / hetzner.sh
Last active September 4, 2018 05:01
A small set of scripts for bringing up new hetzner images quickly... (The wireguard keys aren't valid anymore)
#!/bin/bash
apt update
apt -y upgrade
apt -y install cifs-utils vim sudo curl tmux apt-transport-https ca-certificates curl software-properties-common git git-crypt lolcat figlet cowsay screenfetch fail2ban git-lfs git-hub sshfs
echo "screenfetch" >> /root/.bash_profile
#!/bin/bash
NETNAME=nbgNet
apt-get -y install tinc
mkdir -p /etc/tinc/$NETNAME/hosts
mkdir -p /mnt/backup/tinc/$NETNAME/
EXTIPADDR=$(ifconfig enp2s0 | grep "inet " | awk -F'[: ]+' '{ print $3 }')
NUMBER=$(hostname -s | sed 's/[^0-9]*//g')
@Darkflib
Darkflib / distributed minio
Created July 15, 2018 14:35
distributed containerised minio with a private network over 6 machines
docker run -d --restart unless-stopped -e MINIO_ACCESS_KEY=AKAARDVARKS -e MINIO_SECRET_KEY=oobidoobidowahwahwahwahhuba \
-v /mnt/minio:/minio \
--network host \
minio/minio server \
http://10.98.88.3/minio \
http://10.98.88.4/minio \
http://10.98.88.5/minio \
http://10.98.88.6/minio \
http://10.98.88.7/minio \
http://10.98.88.9/minio
@Darkflib
Darkflib / agents
Last active July 15, 2018 18:22
consul in docker
docker run -d --restart unless-stopped --name consul --net=host -v consul:/consul/data \
-e CONSUL_BIND_INTERFACE=wg0 -e 'CONSUL_LOCAL_CONFIG={"datacenter":"nbg", "leave_on_terminate": true}' \
consul agent -retry-join=10.88.88.3 -retry-join=10.88.88.5 -retry-join=10.88.88.7
docker run -d -t --name rtorrent --restart on-failure -p 80:80 -p 45566:45566 -p 9527:9527/udp --dns 8.8.8.8 -v /data-store:/rtorrent -e UPLOAD_RATE=1024 kfei/docktorrent
default login: docktorrent p@ssw0rd
not a big fan of this, so change it:
docker exec -it rtorrent /bin/bash
htpasswd -b /usr/share/nginx/html/rutorrent/.htpasswd docktorrent mysup3rs3critp@55
This was honoured in real time since the interface is ajax based...