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 / contacForm.js
Last active August 29, 2015 14:15
EventEmitter sample for Lornez ;)
var contactForm = function(){
EventEmitter.call(this);
var submit = function(email, name, message){
this.emit("submitContactForm", email, name, message);
}
var validateForm = function(email, name, message){
//check if all required fields are filled and the text is valid (no attacks)
this.emit("validated", email, name, message);
@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_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_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:

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