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
Created May 6, 2022 00:48
DevStack with Magnum & Heat local.conf Template

DevStack with Magnum & Heat local.conf Template

Installaion

Provisioning with DevStack can be seen Here

Local.conf Configuration

nano local.conf
@gilangvperdana
gilangvperdana / PFwithSSH.md
Last active September 26, 2023 05:09
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 July 2, 2023 16:14
Some Note About IPTables

Note about IPTables on Linux

Commands

  • Flush existing ruleset:
iptables -F
iptables -t nat -F
  • Set reasonable policy defaults (that is, these are "reasonable" for an exposed firewall; you may decide that an input policy of ACCEPT is, well, acceptable in this particular scenario):
@gilangvperdana
gilangvperdana / README.md
Last active May 8, 2022 12:39
Apache2 / HTTPD Server Block

All About Apache / Httpd

Baremetal

  • Installation
apt install -y apache2
  • Configuration on /etc/apache2/
@gilangvperdana
gilangvperdana / README.md
Last active May 9, 2022 07:53
All About Web Server on Docker

All About Web Server on Docker

Nginx

  • QuickStart

    docker pull gilangvperdana/landingpages:nginx
    
  • Dockerfile

@gilangvperdana
gilangvperdana / README.md
Last active June 12, 2022 09:32
Self Hosted Minecraft Server

Self Hosted Minecraft Server on Linux with Docker

PC Version

mkdir mc
cd mc
mkdir minecraft-data
touch docker-compose.yml
@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
Last active July 20, 2022 13:28
Nginx Reverse Proxy for SSH

Nginx Reverse Proxy for SSH

Use Case

  • 10.10.10.50 is Target VM will to SSH
  • We will expose this to localhost:32

Configuration

  • Make upstream conf :
nano /etc/nginx/conf.d/stream.conf.ssh
@gilangvperdana
gilangvperdana / README.md
Last active July 20, 2022 12:11
Make OpenVPN auto Reconnect on Reboot

Make OpenVPN auto Reconnect on Reboot

Configuration

  • Edit on openvpn configuration
sudo nano /etc/default/openvpn
  • Uncomment AUTOSTART="all"
  • mv your_cred.ovpn /etc/openvpn/your_cred.conf
  • Reload Daemon
@gilangvperdana
gilangvperdana / README.md
Last active May 19, 2022 09:54
Systemd Alert to Telegram

Systemd Alert to Telegram

The purposes is to auto alerting while systemd goes to failed/activate/stopped state to telegram with efficient scripting & services.

Warn

your_service is your systemd service who you want to monitor.

Configure

  • Set Telegram Key
mkdir /etc/telegram