Skip to content

Instantly share code, notes, and snippets.

View andikurnia's full-sized avatar

Andhika Kurniawanto andikurnia

View GitHub Profile
@andikurnia
andikurnia / nat-setup.sh
Created June 3, 2025 08:02
Linux iptables configuration for communicate two interfaces
#!/bin/bash
iptables -t nat -A POSTROUTING -o <iface1> -j MASQUERADE
iptables -A FORWARD -i <iface1> -o <iface2> -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i <iface2> -o <iface1> -j ACCEPT
@andikurnia
andikurnia / bridge.sh
Created July 18, 2024 02:25
Raspberry Pi Bridge Tethering
#!/usr/bin/env bash
set -e
[ $EUID -ne 0 ] && echo "run as root" >&2 && exit 1
##########################################################
# You should not need to update anything below this line #
##########################################################
@andikurnia
andikurnia / compose.sh
Last active March 25, 2025 03:52
A little tools for running a new laravel application and setup it's container by using the power of Sail
#!/bin/bash
SAIL="./vendor/bin/sail"
if [ ! -f "$SAIL" ]; then
echo "Sail not found. Run sail.sh to install sail...."
docker run --rm \
-u "$(id -u):$(id -g)" \
-v "$(pwd):/var/www/html" \