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 March 18, 2024 19:17
Teleport behind Nginx Reverse Proxy

General Teleport

If you want to make a cluster for jump host/bastion to your server, you can install Teleport. on this guide, will be guided to install then expose with NGINX Reverse proxy.

Prerequisites

  • Ubuntu 20.04LTS
  • 1 GB RAM
  • 1 VCPU
  • 20 GB Storage

Installation Teleport

@gilangvperdana
gilangvperdana / ubuntu-hardening.md
Created October 10, 2022 03:13 — forked from dfedorov-ciena/ubuntu-hardening.md
List of things for hardening Ubuntu

System Updates

http://bookofzeus.com/harden-ubuntu/initial-setup/system-updates/

Keeping the system updated is vital before starting anything on your system. This will prevent people to use known vulnerabilities to enter in your system.

sudo apt-get update
sudo apt-get upgrade
sudo apt-get autoremove
sudo apt-get autoclean
@gilangvperdana
gilangvperdana / README.md
Last active March 18, 2024 18:58
Multiple VLAN with Multiple Gateway on Ubuntu Server

TOPOLOGY

Internet -> Ubuntu Server -> Mikrotik -> End Device

  • Ubuntu Server has 2 physical interface (ens3 & ens4)
    • 1 from Internet (ens3)
    • 1 for Mikrotik (ens4)

Goals

  • Can create 1 Virtual Interface (ens3.2) from 1 Physycal Interface (ens3)
  • Can deliver multiple vlan tag (1 & 10) for ens4 with different gateway
@gilangvperdana
gilangvperdana / README.md
Last active March 18, 2024 18:57
Setup Proxmox Exporter & Visualize it to Grafana

General

Here is my experience installing Exporter on Proxmox and visualizing it on Grafana.

Install PVE Exporter

python3 -m pip install prometheus-pve-exporter

Add User

@gilangvperdana
gilangvperdana / README.md
Last active March 18, 2024 18:57
Fail2ban on Ubuntu Server 20.04

General

Protect your Ubuntu Server with Fail2ban

Installation

apt install -y fail2ban

Check Status Ban

  • Default jail name is sshd
@gilangvperdana
gilangvperdana / README.md
Created July 2, 2023 16:22
SSH Session Exporter

General

Version 1: Docker Run

docker run -d -p 999:9999 -v /run/utmp:/run/utmp flor0/prometheus-ssh-exporter
@gilangvperdana
gilangvperdana / README.md
Created January 11, 2024 02:07
Install STUNNEL for SSH over HTTPS

General

This is workaround for install stunnel4 (SSH over HTTPS)

Command

apt install -y stunnel4

cd /etc/stunnel/
openssl req -new -newkey rsa:2048 -days 3650 -nodes -x509 -sha256  -subj '/CN=127.0.0.1/O=localhost/C=US'  -keyout /etc/stunnel/stunnel.pem  -out /etc/stunnel/stunnel.pem
@gilangvperdana
gilangvperdana / README.md
Last active March 10, 2024 16:08
VirtualBox CLI
@gilangvperdana
gilangvperdana / README.md
Created March 10, 2024 14:47
Overwrite /etc/resolv.conf on Linux with Netplan Configuration

General

If you want to overwrite your /etc/resolv.conf configuration with Netplan configuration you can follow this step.

Remove & Link

sudo rm /etc/resolv.conf
sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf

Reference

@gilangvperdana
gilangvperdana / README.md
Last active February 25, 2024 17:30
Make your Ubuntu Server be Router!

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)