Skip to content

Instantly share code, notes, and snippets.

View reski-rukmantiyo's full-sized avatar

Reski Rukmantiyo reski-rukmantiyo

View GitHub Profile
version: '3'
volumes:
mysql_data:
driver: local
services:
mysql:
image: mysql:5.7
volumes:
@reski-rukmantiyo
reski-rukmantiyo / k3s_on_alpine.md
Created February 19, 2022 03:04 — forked from ruanbekker/k3s_on_alpine.md
Install k3s on Alpine Linux
$ apk add --no-cache curl
$ echo "cgroup /sys/fs/cgroup cgroup defaults 0 0" >> /etc/fstab

$ cat > /etc/cgconfig.conf <<EOF
mount {
  cpuacct = /cgroup/cpuacct;
  memory = /cgroup/memory;
  devices = /cgroup/devices;
  freezer = /cgroup/freezer;
@reski-rukmantiyo
reski-rukmantiyo / docker-compose.yml
Last active January 30, 2022 05:54
Thingsboard Trendz
version: '3.4'
services:
mytrendz:
restart: always
image: "thingsboard/trendz:latest"
container_name: mytrendz
ports:
- "8888:8888"
environment:
TB_API_URL: http://182.23.67.112:8080
@reski-rukmantiyo
reski-rukmantiyo / WSL2 Cheat Sheet.md
Last active January 5, 2022 00:06
WSL 2 Cheat Sheet

WSL2 sometimes need to sync time after windows sleep

sudo ntpdate pool.ntp.org
@reski-rukmantiyo
reski-rukmantiyo / const.py
Created July 4, 2021 11:11
Xiaomi MIIO Air Purifier 3C : Hassio 2021.6.6
"""Constants for the Xiaomi Miio component."""
DOMAIN = "xiaomi_miio"
CONF_FLOW_TYPE = "config_flow_device"
CONF_GATEWAY = "gateway"
CONF_DEVICE = "device"
CONF_MODEL = "model"
CONF_MAC = "mac"
KEY_COORDINATOR = "coordinator"
@reski-rukmantiyo
reski-rukmantiyo / snapd.sh
Created May 12, 2021 13:15
WSL2 + Snap Installation
# Taken from https://github.com/microsoft/WSL/issues/5126#issuecomment-653715201
sudo apt-get update && sudo apt-get install -yqq daemonize dbus-user-session fontconfig
sudo daemonize /usr/bin/unshare --fork --pid --mount-proc /lib/systemd/systemd --system-unit=basic.target
exec sudo nsenter -t $(pidof systemd) -a su - $LOGNAME
snap version
@reski-rukmantiyo
reski-rukmantiyo / go-build-all.sh
Created April 8, 2021 16:56 — forked from makew0rld/go-build-all.sh
Cross compile for all possible Golang targets. This script will always be updated, because it uses the `go` command to see what can be built.
#!/usr/bin/env bash
# Based on https://gist.github.com/eduncan911/68775dba9d3c028181e4
# but improved to use the `go` command so it never goes out of date.
type setopt >/dev/null 2>&1
contains() {
# Source: https://stackoverflow.com/a/8063398/7361270
[[ $1 =~ (^|[[:space:]])$2($|[[:space:]]) ]]
@reski-rukmantiyo
reski-rukmantiyo / postgres-benchmark.sh
Last active March 23, 2021 22:12 — forked from sharoonthomas/postgres-benchmark.sh
Benchmark postgres servers
# Create the file repository configuration:
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
# Import the repository signing key:
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
# Update the package lists:
sudo apt-get update
# Install the latest version of PostgreSQL.
@reski-rukmantiyo
reski-rukmantiyo / go-os-arch.md
Created March 22, 2021 23:58 — forked from asukakenji/0-go-os-arch.md
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.14.7 darwin/amd64.

A list of valid GOOS values

(Bold = supported by go out of the box, ie. without the help of a C compiler, etc.)

  • aix
  • android
@reski-rukmantiyo
reski-rukmantiyo / 2021.txt
Created March 18, 2021 02:37
Hari Libur Indonesia
2021-03-12,2021-05-17,2021-05-18,2021-05-19,2021-12-27,2022-01-01,2021-02-12,2021-03-11,2021-03-14,2021-04-02,2021-05-01,2021-05-13,2021-05-13,,2021-05-14,2021-05-26,2021-06-01,2021-07-20,,2021-08-10,2021-08-17,2021-10-19,2021-12-25,2021-05-12,2021-12-24