Skip to content

Instantly share code, notes, and snippets.

View linuxmalaysia's full-sized avatar
🏠
Working from home

Harisfazillah Jamel linuxmalaysia

🏠
Working from home
View GitHub Profile
@linuxmalaysia
linuxmalaysia / gist:a3846de604e5f6ed95d48368389f7471
Created April 12, 2025 04:21
This script is designed to enhance the security and monitoring capabilities of an AlmaLinux 9 system by installing and configuring various security-related tools and making some system-level adjustments.
```bash
#!/bin/bash
# By harisfazillah Jamel with Google Gemini Help
# 20250411
# This script is designed to enhance the security and monitoring capabilities
# of an AlmaLinux 9 system by installing and configuring various security-related
# tools and making some system-level adjustments.
# --- Initial System Setup ---
@linuxmalaysia
linuxmalaysia / setup_kibana.sh
Created April 1, 2025 23:43
Script to set up Kibana using Podman with the hardened Wolfi image. This script should be run after setup_elasticsearch.sh.
#!/bin/bash
# Script to set up Kibana using Podman with the hardened Wolfi image,
# based on the official Docker documentation.
# Note: Using Wolfi images might have specific kernel or dependency requirements.
# https://www.elastic.co/guide/en/kibana/current/docker.html
# GNU GENERAL PUBLIC LICENSE Version 3
# Harisfazillah Jamel and Google Gemini
# 2 Apr 2025
# Script to set up Kibana using Podman with its own custom kibana.yml.
@linuxmalaysia
linuxmalaysia / setup_elasticsearch_podman.sh
Created April 1, 2025 04:05
Script to set up Elasticsearch 8.17.4 using Podman with the hardened Wolfi image, based on the official Docker documentation.
#!/bin/bash
# Script to set up Elasticsearch 8.17.4 using Podman with the hardened Wolfi image, based on the official Docker documentation.
# Note: Using Wolfi images might have specific kernel or dependency requirements.
# https://www.elastic.co/guide/en/elasticsearch/reference/8.17/docker.html
# GNU GENERAL PUBLIC LICENSE Version 3
# Harisfazillah Jamel and Google Gemini
# 31 Mac 2025
# https://github.com/HarisfazillahJamel/podman-elastic-stack
# --- Script Description ---
@linuxmalaysia
linuxmalaysia / Install_WSL2_Move_AlmaLinux9_Another_Drive.md
Last active April 1, 2025 01:47
Install WSL2 and Move AlmaLinux 9 to Another Drive

HOWTO: Install Almalinux 9 WSL2 and Move AlmaLinux 9 to Another Drive

TL;DR

A guide for myself—born from my professional experience as a Linux system administrator and enhanced with AI tools to ensure comprehensive coverage and clarity for technical audiences.

This guide details the process of installing the Windows Subsystem for Linux version 2 (WSL2) on Windows 11 Pro and installing AlmaLinux 9 onto a non-default drive (D:), ensuring a secure and efficient setup.


Phase 1: Installing WSL2 on Windows 11 Pro

@linuxmalaysia
linuxmalaysia / download-elastic-assets.sh
Last active March 26, 2025 13:24
Download Elastic Assets for airgap installation
#!/bin/bash
### Script mudah untuk download asset daripada elastic downloads bagi tujuan
### Internal repo kepada Elastic Fleet.
### use with own risks
### buat directory ini bawah html /usr/share/nginx/html
### Harisfazillah Bin Jamel 28/12/2024, update 26/03/2025
### Ubuntu / Debian - apt install nginx
### Alma Linux / Rocky Linux - dnf install nginx
### Created with Google Gemini
@linuxmalaysia
linuxmalaysia / configure_pgbouncer.sh
Last active September 15, 2024 02:16
# Harisfazillah Jamel - 11 Sept 2024 # Need to create systemd template for [email protected] and [email protected] # By using so_reuseport in pgbouncer setting # and copy of /etc/pgbouncer/pgbouncer.ini to /etc/pgbouncer/pgbouncer.ini # Do this after all the tune and test run with single pgbouncer done. # https://www.2ndquadrant.com/en/blog/run…
#!/bin/bash
# Harisfazillah Jamel - 11 Sept 2024
# Need to create systemd template for [email protected] and [email protected]
# By using so_reuseport in pgbouncer setting
# and copy of /etc/pgbouncer/pgbouncer.ini to /etc/pgbouncer/pgbouncer.ini
# Do this after all the tune and test run with single pgbouncer done.
# https://www.2ndquadrant.com/en/blog/running-multiple-pgbouncer-instances-with-systemd/
# https://www.enterprisedb.com/postgres-tutorials/pgbouncer-setup-extended-architecture-use-cases-and-leveraging-soreuseport
# Please check for running pgbouncer if you find this script in your server
# ps -ef | grep pgbouncer
@linuxmalaysia
linuxmalaysia / rsynctoserver.sh
Last active May 15, 2024 23:27
Old School Backup Using Rsync - Yeahhh on SCO Unix (BSD Style) - Convert to Linux Bash
#!/bin/bash
# Script to transfer directories from a remote server using rsync over SSH
# Harisfazillah Jamel (LinuxMalaysia)
# Circa 2006 For SCO Unix and BSD
# Adjust for Bash Linux 16 Mei 2024
# Target remote server details
# User need to be create and remote backup dir need to own by the user
# RADD can be local or remote IP
@linuxmalaysia
linuxmalaysia / Goaccess_for_nginx_access_log.md
Last active March 23, 2024 22:10
Terminal-Based Log Analysis with GoAccess for Nginx

Unleash the Power of Terminal-Based Log Analysis with GoAccess for Nginx

Running a website necessitates constant monitoring. However, wading through complex web interfaces to analyse server logs can be time-consuming. Enter GoAccess, a free, open-source tool that empowers you to analyse your Nginx server logs directly from the terminal.

Why GoAccess?

  • Blazing Speed: Gain real-time insights instantly, ditching the wait for reports.
  • Terminal Magic: Analyse logs directly from the command line, perfect for SSH access or terminal enthusiasts.
  • Flexible Output: Go beyond the terminal with reports in HTML (ideal for sharing and visualisation), JSON, and CSV formats.
@linuxmalaysia
linuxmalaysia / ujian-random-files.sh
Last active December 23, 2023 00:16
Random create files with in current directory the script running. The dd output is use to compare the write speed.
#!/bin/bash
# Haris - 20231223
# Make sure you have enough disk space (max 200GB).
# Randomly create files inside./files, within current directory of this script.
# The dd output is used to compare the write speed.
# Ensure variables are declared before use.
declare -i min=5 # min size (GB)
declare -i max=10 # max size (GB)
@linuxmalaysia
linuxmalaysia / sysctl-proxmox-tune.conf
Last active March 1, 2025 17:25 — forked from sergey-dryabzhinsky/sysctl-proxmox-tune.conf
Most popular speedup sysctl options for Proxmox. Put in /etc/sysctl.d/
###
# Proxmox or other server kernel params cheap tune and secure.
# Try it if you have heavy load on server - network or memory / disk.
# No harm assumed but keep your eyes open.
#
# @updated: 2020-02-06 - more params used, adjust some params values, more comments on params
# Origin https://gist.github.com/sergey-dryabzhinsky/bcc1a15cb7d06f3d4606823fcc834824
# @updated: 2023-12-21 - To test with proxmox v8
# # update: https://gist.github.com/linuxmalaysia/7ba3ded2dd3ec7f2491e549e6dcd73ec