Skip to content

Instantly share code, notes, and snippets.

View muhamad-ridwant-tech's full-sized avatar
🎯
Focusing

Muhamad Ridwan muhamad-ridwant-tech

🎯
Focusing
View GitHub Profile
{{ define "Cluster_Down_Detection" }}
{{ if gt (len .Alerts.Firing) 0 }}
Alerts : {{ len .Alerts.Firing }} 🔔
{{ range .Alerts.Firing }} {{ if gt (len .Annotations) 0 }}
Alert Name :
{{ .Annotations.summary }} ⚠️
Description:
🔵 {{ .Annotations.description }}
🟢 Available : {{ .Values.A }}
@muhamad-ridwant-tech
muhamad-ridwant-tech / Notificationg.tmpl
Last active February 11, 2026 13:08
Notification Templates - Grafana
{{ define "Notificationg" }}
{{ if gt (len .Alerts.Firing) 0 }}
Alerts : {{ len .Alerts.Firing }} 🔔
{{ range .Alerts.Firing }} {{ if gt (len .Annotations) 0 }}
⚠️ {{ .Annotations.summary }}
{{ .Annotations.description }}
Timestamp:
@muhamad-ridwant-tech
muhamad-ridwant-tech / Hypervisor resource usage
Last active January 31, 2026 01:23
Menemukan instances pengguna CPU/Memory tertinggi di server Hypervisor
## Menemukan instances pengguna CPU/Memory tertinggi ( --sort=-%cpu / --sort=-%mem)
[tripleo-admin@Openstack-Compute-2 ~]$ ps aux --sort=-%cpu | awk 'NR==1 {print $1, $2, $3, $4, "UUID"} / -uuid / {for(i=1;i<=NF;i++) if($i=="-uuid") {print $1, $2, $3, $4, $(i+1)}}' | column -t
USER PID %CPU %MEM UUID
qemu 691730 2646 16.9 457990e4-8d26-4f18-9940-72f652b99572
qemu 75529 1165 1.1 e6175dac-d40f-4375-855c-b48632a28d68
qemu 213227 775.4 4.1 148f0a0b-b13d-4718-aff2-1bc2b11ec505
admin 1642873 0.0 0.0 /
@muhamad-ridwant-tech
muhamad-ridwant-tech / prometheus.yml
Created January 27, 2026 07:00
Prometheus config for Blacbox-Exporter
scrape_configs:
- job_name: 'blackbox' ## Backbox-Exporter Config
metrics_path: /probe
params:
module: [http_2xx] # Module defined in blackbox.yml
static_configs:
- targets:
- https://i-3.co.id/ # Website 01
- https://fake-json-api.mock.beeceptor.com/users # Function 01
- https://fake-json-api.mock.beeceptor.com/companies # Function 02
@muhamad-ridwant-tech
muhamad-ridwant-tech / blackbox.yml
Created January 27, 2026 05:55
blackbox.yml with private CA File ssl / self signed ssl
modules:
http_2xx:
prober: http
http:
preferred_ip_protocol: "ip4"
http_post_2xx:
prober: http
http:
method: POST
tcp_connect:
@muhamad-ridwant-tech
muhamad-ridwant-tech / blackbox.service
Last active February 11, 2026 08:02
Blackbox-Exporter systemd service file ( /etc/systemd/system/blackbox.service )
[Unit]
Description=Blackbox Exporter
Documentation= Blackbox
Wants=network-online.target
After=network-online.target
[Service]
User=root
Group=root
Type=simple
#!/bin/bash
DAY="$(date +%Y_%m_%d)"
BACKUP="/home/$USER/DIRECTORY/$DAY-backup-ServiceAA.tar.gz"
tar -csvpzf $BACKUP /home/$USER/ServiceAA
@muhamad-ridwant-tech
muhamad-ridwant-tech / ops-cloud
Created September 17, 2025 06:54
reset root password & allow user root ssh
#cloud-config
chpasswd:
list: |
root:ridwan
expire: false
ssh_pwauth: true
runcmd:
- sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config
@muhamad-ridwant-tech
muhamad-ridwant-tech / HAProxy.cfg - LXD Dashboard
Created September 2, 2025 09:45
HAProxy Config for Microcloud LXD Dashboard
global
log /dev/log local0
log /dev/log local1 notice
maxconn 2048
user haproxy
group haproxy
daemon
tune.ssl.default-dh-param 2048
defaults
@muhamad-ridwant-tech
muhamad-ridwant-tech / microcloud-preseed.bash
Last active August 14, 2025 14:23
RUN Preseed command to All Node Secara bersama
## SSH Copy ID
[ridwan@WarMachine]$
$ for i in {01,02,03}; do ssh-copy-id root@MicroCloud-${i};done
# SCP File preseed.yml
$ for i in {01,02,03}; do scp preseed.yaml root@MicroCloud-${i}:/root/; done
## RUN Preseed command to All Node Secara bersama
$ for i in {01,02,03}; do ssh root@MicroCloud-${i} "hostname && \
cat preseed.yaml | microcloud preseed > initialize-output.txt"& done