Skip to content

Instantly share code, notes, and snippets.

View yohangdev's full-sized avatar
🏠
Working from home

Yoga Hanggara yohangdev

🏠
Working from home
View GitHub Profile
@yohangdev
yohangdev / iptables
Created November 17, 2019 14:26
My iptables Cheatsheet
# bind to 0.0.0.0, block public
iptables -A INPUT -p tcp --dport 3306 -i eth0 -j DROP
@yohangdev
yohangdev / kubernetes.sh
Last active November 2, 2019 13:29
Kubernetes Cheatsheet
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.16.0/bin/darwin/amd64/kubectl
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
kubectl version
# Latest provider
# Amazon EKS 1.14.7
# GCP GKE 1.14.7
minikube start --vm-driver=virtualbox --memory=8192 --kubernetes-version=1.14.7
@yohangdev
yohangdev / docker-compose.yml
Created August 13, 2019 16:27
Wordpress Docker Compose
version: '3.3'
services:
wordpress:
depends_on:
- db
image: wordpress:latest
volumes:
- wordpress_files:/var/www/html
ports:
@yohangdev
yohangdev / random_test_1.txt
Last active August 10, 2019 13:46
Random String Tester
.^2a&ust*g'%+dTzRz^9&=T]q\<`vsQ6bdq]g9)Xm23"FL(u7VgV,pC`/Q8.q@\}p%e~;9")j(rxL9&w~w,88D:TRMJ_A{cFHs!f
@yohangdev
yohangdev / mysql_debian_apt.sh
Last active June 30, 2019 04:23
Debian 9 Install MySQL APT Repository
wget http://repo.mysql.com/mysql-apt-config_0.8.9-1_all.deb
dpkg -i mysql-apt-config_0.8.9-1_all.deb
apt-get install dirmngr --install-recommends
apt-key adv --keyserver keys.gnupg.net --recv-keys 8C718D3B5072E1F5
@yohangdev
yohangdev / regex.js
Created June 20, 2019 14:28
Regular Expression (RegEx) Cheatsheet
// URL
const reg = /^(http:\/\/|https:\/\/)[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/
@yohangdev
yohangdev / arch-linux-install
Last active May 22, 2019 17:08 — forked from mattiaslundberg/arch-linux-install
Minimal instructions for installing arch linux on an UEFI system with full system encryption using dm-crypt and luks
# Install ARCH Linux with encrypted file-system and UEFI
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# Download the archiso image from https://www.archlinux.org/
# Copy to a usb-drive
dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration.
# Set swedish keymap
@yohangdev
yohangdev / docker-gitlab.sh
Created May 8, 2019 02:07
Setup and connect Gitlab CI Runner in my server
docker run --rm -t -i -v $(pwd):/etc/gitlab-runner gitlab/gitlab-runner register
docker run -d --name jdsteam-gitlab-runner-01 --restart always \
-v $(pwd):/etc/gitlab-runner \
-v /var/run/docker.sock:/var/run/docker.sock \
gitlab/gitlab-runner:latest
@yohangdev
yohangdev / Workers.sql
Created January 17, 2019 08:50
SQL #2 - Workers
SELECT a.name FROM employees a WHERE a.id NOT IN (SELECT b.managerId FROM employees b WHERE b.managerId IS NOT NULL);
@yohangdev
yohangdev / Students.sql
Created January 17, 2019 08:38
SQL #1 - Students
SELECT COUNT(*) FROM students WHERE firstName = 'John';