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 June 23, 2024 19:15
Monitor our Server with Blackbox Exporter

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
Created October 4, 2022 14:41
Setting IPMI with IPMITOOL

Brief

We can set our IPMI just with IPMITOOL.

Installation IPMITOOL

apt update -y
apt install -y ipmitool

Create User

@gilangvperdana
gilangvperdana / README.md
Created October 6, 2022 12:09
Alert IP Client when Connect to SSH

Goals

  • We can monitor IP of SSH Client.
  • Alert will be goes to Telegram.

Execute

Make Alert Script

mkdir -p /opt/alert-ssh-remote/
nano alert.sh
@gilangvperdana
gilangvperdana / README.md
Last active December 11, 2023 00:57
Mikrotik Monitoring Alert to Telegram

Goals

  • Make anything alerting model on Mikrotik to Telegram

Monitoring User Connect

This script will be monitor every user connect / disconnect to your telegram.

IP > DHCP SERVER > INTERFACE > SCRIPT

:if ($leaseBound = "1") do={/tool netwatch add down-script=":local BotID \"5486642116:AAEffzy6StfFBeZ3CnouyRLeaOqLwJu3Hb7\
    \";\r\
@gilangvperdana
gilangvperdana / ubuntu-hardening.md
Created October 10, 2022 03:13
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
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
Created October 29, 2022 00:28
Alert when Network Floating on Openstack is Unreachable

Brief

This script just a simple logic, when vRouter on Openstack not reachable script will execute Network Agent Report to Telegram

Use

  • 172.20.1.230 is your vRouter
  • TELEGRAM_BOT_TOKEN is your
  • CHAT_ID is your Telegram CHAT ID

Create Network Agent Watchers

@gilangvperdana
gilangvperdana / README.md
Last active November 12, 2022 13:10
SMTP Client on our Ubuntu Server

Goals

  • Can use SMTP platform on our ubuntu server

Install SSMTP

sudo apt-get install ssmtp

Configure Account

@gilangvperdana
gilangvperdana / README.md
Last active December 2, 2022 11:59
Nova Timeout Cause Cinder Very Slow

Brief

If you meet a problem when create instance with Volume then Instance created failed, you can use this workaround. The point is just increase timeout of Nova compute service when creating instance to 1h30m or 90minutes.

Env :

  • Kolla Ansible Xena Deplyoment

Execute on all of Compute Node :

nano /etc/kolla/nova-compute/nova.conf
@gilangvperdana
gilangvperdana / README.md
Last active November 14, 2022 13:06
Setup RKE Cluster on Ubuntu 20.04LTS

Brief

RKE a.k.a Rancher Kubernetes Engine are Kubernetes Deployer by Rancher. Now we will create RKE cluster on Ubuntu 20.04 LTS

Environment

  • 2x Ubuntu 20.04LTS
  • 16GB RAM
  • 50GB Storage
  • 4VCPU