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 / 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
########
@muhamad-ridwant-tech
muhamad-ridwant-tech / local-http.repo
Created June 3, 2025 05:57
file repo local via http services
[Local_Ridwan_BaseOS]
name=Local_Ridwan_BaseOS
metadata_expire=-1
enabled=1
gpgcheck=1
baseurl=http://192.168.124.XXX/rhel8/BaseOS/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[Local_Ridwan_AppStream]
name=Local_Ridwan_AppStream
@muhamad-ridwant-tech
muhamad-ridwant-tech / local-files.repo
Created June 3, 2025 05:49
file repo via local files/directory
[Local_Ridwan_BaseOS]
name=Local_Ridwan_BaseOS
metadata_expire=-1
enabled=1
gpgcheck=1
baseurl=file:///var/www/html/rhel8/BaseOS/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[LocalRepo_AppStream]
name=Local_Ridwan_AppStream
@muhamad-ridwant-tech
muhamad-ridwant-tech / rbd-flatten.sh
Created March 30, 2025 07:21
Hystax Accura - Clean up resources in the target cloud after a successful migration.
#!/bin/bash
### Hystax Accura - Clean up resources in the target cloud after a successful migration.
### https://support.hystax.com/portal/en/kb/articles/how-to-clean-up-resources-in-the-target-cloud-after-a-successful-migration
## Pastikan file "volume_ids.txt" sudah terisi list volume id.
VOLUME_FILE="volume_ids.txt"
if [[ ! -f "$VOLUME_FILE" ]]; then
echo "File $VOLUME_FILE tidak ditemukan!"