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
@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 January 27, 2026 06:51
Blackbox-Exporter systemd service file ( /etc/systemd/system/blackbox.service )
[Unit]
Description=Blackbox-Exporter
Wants=network-online.target
After=network-online.target
[Service]
Type=simple
ExecStart=/usr/local/bin/blackbox_exporter \
--config.file /etc/blacbkox-exporter/blackbox.yml
Restart=on-failure
#!/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
@muhamad-ridwant-tech
muhamad-ridwant-tech / remove-microcloud.sh
Last active August 6, 2025 12:10
how clean remove a microcloud node
### Remove Member from Cluster
$ sudo microceph.ceph mon remove <name>
$ sudo microcloud remove <node> --force
#$ # Before removing the cluster member, ensure that there are no LXD instances, storage volumes, or MicroCeph OSDs located on it.
## Ref : https://documentation.ubuntu.com/microcloud/stable/microcloud/how-to/member_remove/
### Stop services on Node
$ sudo snap stop lxd.daemon
$ sudo snap stop microcloud.daemon
@muhamad-ridwant-tech
muhamad-ridwant-tech / preseed.yml
Last active August 22, 2025 15:24
MicroCloud Preseed yaml file for automation initialize Non-interactive configuration
initiator_address: 192.168.100.101 ## Alamat node initiator (Isolated network)
session_passphrase: H1dUPJkvv!1!1 ## Passphrase to join microcloud (Pastikan dibaca dengan lantang!!)
session_timeout: 500 ## Timeout promt dalam satuan detik
systems:
- name: MicroCloud-01 ## Hostname (Pastikan sesuai $hostnamectl)
address: 192.168.100.101 ## Addr Isolated network
ovn_uplink_interface: br0 ## interface Internet Network (Pastikan sesuai interface naming)
storage:
ceph: ## list disk yang akan digunakan oleh Ceph OSD
- path: /dev/sdb ## Pastikan alamat path sesuai dengan ($lsblk)
@muhamad-ridwant-tech
muhamad-ridwant-tech / nmcli.bash
Created July 29, 2025 06:00
How to use "nmcli" for network config
## list all network connections / ip a
$ sudo nmcli connection show
## Set static network
$ sudo nmcli con mod "Network Name" \
ipv4.method manual \
ipv4.addresses 192.168.15.14/24 \
ipv4.gateway 192.168.15.1 \
ipv4.dns 8.8.8.8