Skip to content

Instantly share code, notes, and snippets.

View mamiu's full-sized avatar
🏄‍♂️
Gone kitesurfing

Paul Miu mamiu

🏄‍♂️
Gone kitesurfing
  • Gold Coast, Australia
View GitHub Profile
@mamiu
mamiu / K3D_EXEC_AS_ROOT_INTO_CONTAINER.md
Created October 5, 2020 03:45
k3d exec as root user into pod / container

k3d exec as root user into pod / container

Let's assume we have a pod called nginx running in the namespace nginx-test.

kubectl create namespace nginx-test
kubectl run nginx --image=nginx -n nginx-test

1. Check if the current cluster is a k3d cluster

@mamiu
mamiu / led.ahk
Created September 17, 2015 07:38
control keyboard LEDs with AutoHotkey
/*
Keyboard LED control for AutoHotkey_L
http://www.autohotkey.com/forum/viewtopic.php?p=468000#468000
KeyboardLED(LEDvalue, "Cmd", Kbd)
LEDvalue - ScrollLock=1, NumLock=2, CapsLock=4
Cmd - on/off/switch
Kbd - index of keyboard (probably 0 or 2) try 0 to 5
@mamiu
mamiu / worker.js
Created August 21, 2023 10:43
Cloudflare Worker Script for MTA-STS
const mode = 'testing';
// const mode = 'enforce';
const max_age = 604800; // 1 week
addEventListener('fetch', (event) => {
event.respondWith(handleRequest(event.request));
});
const handleRequest = async (request) => {
const url = new URL(request.url);
@mamiu
mamiu / macos_bootable_usb_stick_guide.md
Last active October 11, 2021 09:54
Create bootable USB stick from an ISO image on macOS

Create bootable USB stick from an ISO image on macOS

If you want to create a bootable USB stick for Windows (Windows 10/11 installation media) have a look at this guide.

  1. Download the desired ISO file

  2. Open a terminal application (like the Apple Terminal or iTerm)

  3. Convert the .iso image to a .dmg file (UDIF image) using the convert option of hdiutil:

@mamiu
mamiu / launch-pma.sh
Created August 26, 2021 03:27
This script will launch a PhpMyAdmin container in a kubernetes cluster and connect it to a wordpress installation (that was setup with the bitnami wordpress helm chart https://github.com/bitnami/charts/tree/master/bitnami/wordpress).
#!/usr/bin/env bash
# helper variables to make text bold
bold_start=$(tput bold)
bold_end=$(tput sgr0)
while [ $# -gt 0 ]; do
case "$1" in
-c|--context)
CONTEXT="$2"
@mamiu
mamiu / install_mosh.md
Last active November 8, 2019 18:30
Set up mosh (mobile shell) on Uberspace and Mac OS X

##Set up mosh (mobile shell) on Uberspace and Mac

First of all you have to email the Uberspace team (hallo@uberspace.de) and ask for opening an UDP port for mosh (don't forget to mention your username and uberspace server [you can get it with the command hostname]).

####On the Uberspace server:

Issue following command to execute the script from below:

curl -L http://goo.gl/PBo45c | bash
@mamiu
mamiu / install_fish_debian.sh
Last active November 24, 2018 12:25
Install fish shell in Debian 8 (commands from the original fish shell website).
#!/bin/bash
echo 'deb http://download.opensuse.org/repositories/shells:/fish:/release:/2/Debian_8.0/ /' >> /etc/apt/sources.list.d/fish.list
apt-get update
wget -qO - http://download.opensuse.org/repositories/shells:fish:release:2/Debian_8.0/Release.key | apt-key add -
apt-get update
apt-get install -y fish
@mamiu
mamiu / install_vagrant.sh
Created March 21, 2015 18:35
install vagrant on uberspace
#!/bin/bash
mkdir ~/vagrant_tmp
cd ~/vagrant_tmp
wget https://dl.bintray.com/mitchellh/vagrant/vagrant_1.7.2_x86_64.rpm
rpm2cpio vagrant_1.7.2_x86_64.rpm | cpio -id
mv ./opt/vagrant/bin/vagrant ~/.toast/armed/bin/
mv ./opt/vagrant/embedded/ ~/.toast/armed/
cd && rm -rf ~/vagrant_tmp
@mamiu
mamiu / install_fish.sh
Last active April 19, 2017 14:18
Fish shell installer for uberspace.
#!/bin/bash
std_install_dir="${HOME}/.toast/armed"
printf "The standard install directory is [${std_install_dir}].\nIf you want to change it, insert another directory: ${HOME}/"
read install_dir
if [[ "$install_dir" == "" ]]; then
install_dir="$std_install_dir"
else
@mamiu
mamiu / install_habitrpg.md
Last active March 4, 2017 22:43
Install HabitRPG on Uberspace.

##This is a guide to install HabitRPG on an Uberspace.

###Installation

First you have to create a folder which is accessable from the web (e.g. habitrpg.yourdomain.com) and then move to it. In this folder execute

git clone https://github.com/HabitRPG/habitrpg.git .

After that, you have to download some dependencies with: