Skip to content

Instantly share code, notes, and snippets.

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

Paul Miu mamiu

🏄‍♂️
Gone kitesurfing
  • Barbados
View GitHub Profile
@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 / 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 / odoo_image_caption.html
Last active May 18, 2016 10:23
Image caption for an Odoo image gallery. Add an inline caption to a image in an image gallery.
Website assets:
<style>
.image-caption {
background-color: #000;
opacity: 0.7;
position: absolute;
width: 600px;
padding: 8px 10px;
left: 50%;
@mamiu
mamiu / popup.html
Created November 19, 2015 08:17
Chrome extension improvement for "LEO Dictionary Quick Search Pop-up" (pda.leo.org instead of dict.leo.org)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style type="text/css">
iframe {
border: none;
/* Scrolling: no */
overflow: hidden;
}
@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 / debian_post_install.md
Last active December 2, 2015 20:26
Setup Debian 8 after installation.

Things to do first after Linux Server installation (Debian 8 or Fedora 23)

Variables in this guide:

<SERVER_HOSTNAME>   = servers hostname or IP address
<SERVER_SHORTNAME>  = an abbreviation/short name for the server
<SERVER_USERNAME>   = the admins username on the server (not root)
<FIRST_NAME>        = admins first name
<LAST_NAME>         = admins last name

= admins email address

@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 / 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: