Skip to content

Instantly share code, notes, and snippets.

View gilangvperdana's full-sized avatar
🎓
Still Learning

Gilang Virga Perdana gilangvperdana

🎓
Still Learning
View GitHub Profile
@gilangvperdana
gilangvperdana / README.md
Last active December 8, 2023 02:49
Postman SOCKSv5 Proxy
View README.md
@gilangvperdana
gilangvperdana / README.md
Created December 4, 2023 07:23
Auto Change Default GW Ubuntu Script
View README.md
#!/bin/bash
# List of gateways with corresponding interfaces
gateways=("192.168.100.1" "192.168.70.1" "192.168.80.1")
interfaces=("eth0" "eth1" "eth2")
# Function to check internet connectivity using a specific interface and gateway
check_gateway_connectivity() {
interface=$1
gateway=$2
@gilangvperdana
gilangvperdana / README.md
Last active December 3, 2023 03:08
Make your Ubuntu Server be Router!
View README.md

Goals

  • Can use Ubuntu Server 20.04 LTS to be Router Gateway include DHCP Server
  • Client who connected to Ubuntu Server can be access Internet

Environement

  • Ubuntu 20.04 LTS
  • 2 Interface
    • 1 Interface from WAN / ISP (enp2s0)
    • 1 Interface for distribution clients (enx00e04c534458)
@gilangvperdana
gilangvperdana / BlockPortfromOutside.md
Last active November 29, 2023 02:44
Node Exporter + Prometheus + Grafana Provisioning
View BlockPortfromOutside.md

General

If you want to block port node exporter access from outside you can use this command

iptables -A INPUT -p tcp -s 10.7.0.0/24 --dport 9100 -j ACCEPT
iptables -A INPUT -p tcp -s localhost --dport 9100 -j ACCEPT
iptables -A INPUT -p tcp --dport 9100 -j DROP
  • 10.7.0.0/24 & localhost are IP ALLOWED to access port 9100
@gilangvperdana
gilangvperdana / README.md
Last active November 12, 2023 06:36
Mount NFS Directory on Windows Server 2019
View README.md

General

If you want to mount your NFS Directory to Windows Server 2019 you can follow this guide.

Install NFS Client on Windows Server

Open Powershell then execute this

Import-Module ServerManager
Install-WindowsFeature -Name FS-NFS-Service
Install-WindowsFeature NFS-Client
@gilangvperdana
gilangvperdana / ChangeLogo.md
Last active November 7, 2023 13:28
Proxmox Playground
View ChangeLogo.md

General

If you want to change favicon & left logo side you can replace this path

  • /usr/share/pve-manager/images/proxmox_logo.png
  • /usr/share/pve-manager/images/favicon.ico
  • /usr/share/pve-manager/images/logo-128.png

Size requirement

  • proxmox_logo.png -> 172x30
  • favicon.ico -> 32x32
  • logo-128.png -> 128x128
@gilangvperdana
gilangvperdana / README.md
Last active November 4, 2023 12:50
Authenticate our Reverse Proxy
View README.md

General

  • This note, just wanna to share about OAUTH2PROXY for authenticate all our endpoints behind Nginx.

Prepare OAUTH2PROXY

wget https://github.com/oauth2-proxy/oauth2-proxy/releases/download/v7.4.0/oauth2-proxy-v7.4.0.linux-amd64.tar.gz
tar -xzvf oauth2-proxy-v7.4.0.linux-amd64.tar.gz
cd oauth2-proxy-v7.4.0.linux-amd64
@gilangvperdana
gilangvperdana / README.md
Last active October 27, 2023 10:12
Kubernetes with KubeSpray on BareMetal Ubuntu Server 20.04 LTS
View README.md

Kubernetes with KubeSpray on BareMetal Ubuntu Server 20.04 LTS

Provisioning Kubernetes Cluster BareMetal with KubeSpray

Environment

2x Ubuntu Server 20.04LTS
@gilangvperdana
gilangvperdana / WSL-ssh-server.md
Created October 22, 2023 03:50 — forked from dentechy/WSL-ssh-server.md
A step by step tutorial on how to automatically start ssh server on boot on the Windows Subsystem for Linux
View WSL-ssh-server.md

How to automatically start ssh server on boot on Windows Subsystem for Linux

Microsoft partnered with Canonical to create Bash on Ubuntu on Windows, running through a technology called the Windows Subsystem for Linux. Below are instructions on how to set up the ssh server to run automatically at boot.

  1. Edit the /etc/ssh/sshd_config file by running the command sudo vi /etc/ssh/sshd_config and do the following
    1. Change Port to 2222 (or any other port above 1000)
    2. Change PasswordAuthentication to yes. This can be changed back to no if ssh keys are setup.
  2. Restart the ssh server:
    • sudo service ssh --full-restart
  3. With this setup, the ssh server must be turned on every time you run Bash on Ubuntu on Windows, as by default it is off. Use this command to turn it on:
@gilangvperdana
gilangvperdana / README.md
Last active October 12, 2023 08:50
Pritunl behind Nginx Reverse Proxy
View README.md

Install Pritunl

sudo apt-get update
sudo apt-get -y upgrade

echo "deb http://repo.pritunl.com/stable/apt focal main" | sudo tee /etc/apt/sources.list.d/pritunl.list
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list
curl -fsSL https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv 9DA31620334BD75D9DCB49F368818C72E52529D4
sudo apt update