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 1, 2026 08:11
Remote Mikrotik from OpenVPN Client with Pritunl VPN Server

Mikrotik OpenVPN Client

If you want to make your Mikrotik to be OpenVPN Client you can follow this guide.

Goals

  • Can remote mikrotik from Pritunl VPN Server Endpoint

Environment

  • Mikrotik
  • Pritunl Server
@gilangvperdana
gilangvperdana / README.md
Last active February 26, 2026 22:56
Install GeoIP for Nginx

General

  • If you want to see your client website region, you can install GeoIP module on Nginx
  • The project I've worked on, using (Filebeat, Logstash, Elasticsearch) after GeoIP is installed then visualized using Kibana or Grafana : image

Installation

sudo apt update
sudo apt install libnginx-mod-http-geoip
@gilangvperdana
gilangvperdana / README.md
Created May 15, 2022 07:29
Fix SSH Key are too open on Windows 11

Fix SSH Key are too open on Windows 11

If you want to login with your key, but you see an error permission windows 11 "SSH key are too open" do this :

  • Make sure you was regenerate your key from puttygen to OpenSSH Key format
  • Open your Windows PowerShell then :
$path = ".\path\to\your\key.pem"
icacls.exe $path /reset
icacls.exe $path /GRANT:R "$($env:USERNAME):(R)"
icacls.exe $path /inheritance:r
@gilangvperdana
gilangvperdana / README.md
Created October 24, 2022 06:15
Convert ISO to QCOW2

ISO to QCOW2 Convert

When you run OS with format .iso on baremetal, you must convert it to qcow2 to run on Cloud

Goals

  • Convert from .iso to .qcow2

Convert with Qemu-utils

  • Prepare utils
apt update -y
@gilangvperdana
gilangvperdana / README.md
Last active February 5, 2026 14:57
OpenStack Horizon over TLS

Make Horizon Dashboard over TLS

Configuration

  • Generate Certificate with OpenSSL
apt install -y apache2
apt install -y openssl

sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout horizon.key -out horizon.crt
mv horizon.crt /etc/ssl/certs/
@gilangvperdana
gilangvperdana / PFwithSSH.md
Last active February 4, 2026 10:52
Port Forwarding on Ubuntu

Local Forwarding

If you want to locally access a cloud application that has the address 192.168.100.2:82 and can only be reached by your VM, you can use the technique below. That way you can access your local localhost:80.

ssh -L LocalPortAccess:AppsIPAddresses:AppsPortAddresses user@VPSPublicIP -pXXXX
ssh -L 80:127.0.0.1:30001 student@lab4.btech.id -p10013

Remote Forwarding

If you want to access your local application with the application address 127.0.0.1:30001 then you can access it on your VPS on port 80 you can use the technique below:

@gilangvperdana
gilangvperdana / README.md
Last active January 9, 2026 12:18
Reset Ubuntu Root Password from Openstack Console (VNC)

General

I get a case that I have to log in to an instance on Openstack without going through the instance IP (because it can't be reached) so I have to try to enter from the console for troubleshooting in the OS. Here's one of my ways to log in using the root user on Ubuntu Server 20.04 LTS running on top of Openstack.

Goes to VNC

  • Goes to Horizon -> Project -> Instance -> Click on your Instance -> Console.
  • If you doesn't have access to Horizon, you can use virsh console but will not shows in here.

Execution

  • Click on SendCtrlAltDel
  • while rebooting from the beginning immediately press esc repeatedly until it enters the boot order menu
@gilangvperdana
gilangvperdana / README.md
Last active January 3, 2026 15:04
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)
@gilangvperdana
gilangvperdana / README.md
Last active December 5, 2025 08:41
Integrate Logging with Promtail & Loki

General

Hello world, in this topic actually I'm making a logging visualization in grafana for GeoIP purposes. As we know, GeoIP cannot use Prometheus, we have to use metrics in the form of raw logs, which is called logging. Because I don't have a lot of resources for running the ELK Stack, in the end I just ran logging with Promtail + Loki. Follow this technical for installation and integration of Promtail & Loki.

I will continue from this article to visualize it with Promtail + Loki.

Change nginx.conf

	log_format json_analytics escape=json '{'
						'"msec": "$msec", ' # request unixtime in seconds with a milliseconds resolution
						'"connection": "$connection", ' # connection serial number
@gilangvperdana
gilangvperdana / README.md
Last active October 15, 2025 13:41
Kubernetes with KubeSpray on BareMetal Ubuntu Server 20.04 LTS

Kubernetes with KubeSpray on BareMetal Ubuntu Server 20.04 LTS

Provisioning Kubernetes Cluster BareMetal with KubeSpray

Environment

2x Ubuntu Server 20.04LTS