Skip to content

Instantly share code, notes, and snippets.

Avatar
🎓
Still Learning

Gilang Virga Perdana gilangvperdana

🎓
Still Learning
View GitHub Profile
@gilangvperdana
gilangvperdana / README.md
Last active Sep 30, 2022
Monitor our Server with Blackbox Exporter
View README.md

Briefing

If you want to monitor your server with existing monitoring mainstream stack (Prometheus, Grafana) you can use Blackbox Exporter to monitor it.

Installation

wget https://github.com/prometheus/blackbox_exporter/releases/download/v0.19.0/blackbox_exporter-0.19.0.linux-amd64.tar.gz
tar -xvf blackbox_exporter-0.19.0.linux-amd64.tar.gz
mv blackbox_exporter-0.19.0.linux-amd64/blackbox_exporter /usr/local/bin/
cd blackbox_exporter-0.19.0.linux-amd64/
sudo useradd -rs /bin/false blackbox_exporter
@gilangvperdana
gilangvperdana / README.md
Last active Sep 27, 2022
Teleport behind Nginx Reverse Proxy
View README.md

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

View README.md

Automaticly delete image dangling on Docker Image

  • Create script
nano dockerimageprune.sh
docker image prune -a -f
@gilangvperdana
gilangvperdana / grafana_nodeexp.json
Created Sep 22, 2022
Grafana NodeExporter Dashboard Template
View grafana_nodeexp.json
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "datasource",
"uid": "grafana"
},
"enable": true,
View manifests.yaml
apiVersion: v1
kind: Namespace
metadata:
name: loki-stack
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: loki
namespace: loki-stack
@gilangvperdana
gilangvperdana / README.md
Last active Sep 19, 2022
RSyslog for Monitor LOGS
View README.md

RSyslog for Monitor LOGS

Goals

  • Use rsyslog to export log

Prerequisites

  • Validates rsyslog available?
apt-cache policy rsyslog
@gilangvperdana
gilangvperdana / README.md
Last active Sep 18, 2022
BIND9 DNS Forwarder
View README.md

Forward DNS with BIND9 and Reverse It with NGINX !

  • If you want to create a DNS forwarder Instance who will be Forward your IP DNS Private to DNS Public you can follow this guide.
  • This guide will be implemented on Ubuntu 20.04 LTS.
  • This bind9 port (53) will be forwarded too with Nginx.

Prerequisite

  • Ubuntu Server 20.04 LTS
    • 1 for BIND9
    • 1 for VM testing
    • 1 for Nginx Reverse Proxy
View sysctl.conf
vm.swappiness=10
vm.vfs_cache_pressure=50
net.core.rmem_max=26214400
net.core.rmem_default=26214400
net.core.default_qdisc=fq
net.ipv4.tcp_congestion_control=bbr
fs.file-max = 2097152
net.core.wmem_default = 31457280
net.core.wmem_max = 12582912
@gilangvperdana
gilangvperdana / README.md
Last active Sep 10, 2022
Remote Mikrotik from OpenVPN Client with Pritunl VPN Server
View README.md

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 Sep 6, 2022
IPTables Script
View README.md

Inject IP Tables

#/bin/bash
iptables -t nat -v -L -n --line-number
echo -n "IP VM who want to exposed (x.x.x.x:port): "
read ip_vm
echo $ip_vm

echo -n "Enter Port Access: " 
read port