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 / microcloud-preseed.bash
Last active August 6, 2025 08:55
RUN Preseed command to All Node Secara bersama
# 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
## Read output command
$ for i in {01,02,03}; do ssh root@MicroCloud-${i} "hostname && \
tail 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 7, 2025 02:34
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: enp1s0 ## 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
@echo off & setlocal enableextensions
title Reset AnyDesk
reg query HKEY_USERS\S-1-5-19 >NUL || (echo Please Run as administrator.& pause >NUL&exit)
chcp 437
call :stop_any
del /f "%ALLUSERSPROFILE%\AnyDesk\service.conf"
del /f "%APPDATA%\AnyDesk\service.conf"
copy /y "%APPDATA%\AnyDesk\user.conf" "%temp%\"
rd /s /q "%temp%\thumbnails" 2>NUL
xcopy /c /e /h /r /y /i /k "%APPDATA%\AnyDesk\thumbnails" "%temp%\thumbnails"
@muhamad-ridwant-tech
muhamad-ridwant-tech / ssh-copy-id.sh
Created July 15, 2025 04:42
ssh-copy-id to all server.
### Don't forget to add the SSH key to all remote server
### Verify that the naming has already been created at /etc/host.
## install Microcloud to all remote server
[ridwan@WarMachine]$
for i in {01,02,03}; do ssh-copy-id root@MicroCloud-${i};done
@muhamad-ridwant-tech
muhamad-ridwant-tech / install microcloud.sh
Created July 15, 2025 03:58
The easy way install MicroCloud by Canonical
### Don't forget to add the SSH key to all remote server
### Verify that the naming has already been created at /etc/host.
## install Microcloud to all remote server
[ridwan@WarMachine]$
for i in {01,02,03}; do ssh root@MicroCloud-${i} "hostname && \
apt update && apt upgrade -y && \
snap install lxd microceph microovn microcloud";done
## check installed version
[ridwan@WarMachine]$
for i in {01,02,03}; do ssh root@MicroCloud-${i} "hostname && lsb_release -d && \
cat <<'EOF' | tee /etc/hosts
# Server MicroCloud
127.0.0.1 localhost
192.168.100.101 MicroCloud-01
192.168.100.102 MicroCloud-02
192.168.100.103 MicroCloud-03
EOF";done
@muhamad-ridwant-tech
muhamad-ridwant-tech / 01-netplan-network.yaml
Last active July 15, 2025 05:45
netplan config for ubuntu netwok dengan dua adapter erthenet
network:
version: 2
renderer: networkd
ethernets:
# Interface untuk Internet (Default Route)
internet_if:
match:
macaddress: # 52:54:00:f3:45:f2# ## Masukan alamat Mac Addr sesuai dengan devices
addresses:
- # 192.168.124.101/24 # Static IP
@muhamad-ridwant-tech
muhamad-ridwant-tech / install-with-ssh_loop.bash
Last active July 11, 2025 08:08
Install Horizon Plugins Storware on Red Hat OpenStack Platform.
########
# git & install plugins via ssh loop
[stack@openstack-director]$
for i in {0,1,2}; do ssh tripleo-admin@controller-${i}.ctlplane "hostname && \
sudo podman exec -it horizon bash -c \"git clone https://github.com/Storware/openstack-horizon-ui-vprotect-extensions && \
cd /openstack-horizon-ui-vprotect-extensions/ && \
python3 install.py https://192.168.1.214:8181/api useradmin ridwan 7.0.0-3\""; done
########