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 / elasticsearch-secure-ssl.txt
Last active December 14, 2020 21:02
Elasticsearch secure with ssl
1. Create SSL
Please adjust IP and domain name as per site.
=========
Rujukan
https://www.elastic.co/guide/en/elasticsearch/reference/current/configuring-security.html
@linuxmalaysia
linuxmalaysia / MySQL-Directory-Move-Into-New-Partition.md
Created November 24, 2020 05:50
MySQL / MariaDB / Percona Server For MySQL Directory Move Into New Partition (Example /home)

MySQL Directory Move Into New Partition (Example /home)

Login as root or any user that NOT using /home stop mariadb service such as systemctl stop MariaDB

Make sure SELINUX is permissive mode. View file /etc/selinux/config

Step 1 - Copy /home Contents

To backup the contents of /home, do the following:

@linuxmalaysia
linuxmalaysia / resizerootpartfromhomecentos8.md
Created November 17, 2020 05:26
Resize root partition by removing the default /home partition) on CentOS 8

Resize root partition by removing the default /home partition) on CentOS 8

This requires you to be able to ssh into the instance using the root user account and that no services be running as users out of /home on the target machine. You can check this by command fuser /home

The examples are from a default installation with no customation-you NEED to know what you're working with for volumes/partitions to not horribly break things. Use this at your own risk. *** AT YOUR OWN RISK ***. Im only tested this on Centos 8 of mine.

By default, CentOS 8 uses XFS for the file system and Logical Volume Manager (LVM), creating 3 partitions: /,/home and /boot. Check with df -h and du -h of /home to make sure the space is enough.

Step 1 - Copy /home Contents

To backup the contents of /home, do the following:

@linuxmalaysia
linuxmalaysia / Installing-And-Setup-Streamsets-Using-Podman-For-Centos-8.md
Last active November 14, 2020 00:28
Installing And Setup Streamsets Data Collector Using Podman For Centos 8

Installing And Setup Streamsets Using Podman For Centos 8

StreamSets Data Collector is open source software for building dataflows quickly and easily, spanning on-premises, multi-cloud and edge infrastructure.

It has an advanced and easy to use User Interface that allows data scientists, developers and data infrastructure teams easily create data pipelines in a fraction of the time typically required to create complex ingest scenarios.

To learn more, check out https://github.com/streamsets/datacollector

@linuxmalaysia
linuxmalaysia / load-to-postgresql-shpfile-epsg4742.sh
Last active August 11, 2020 00:13
Bash script to load to postgresql shpfile epsg4742
#!/bin/bash
### Gunakan command shp2pgsql daripada projek PostGIS Versi 3.0
### SHPNAME => shape file name tanpa shp (dalam command dimasukkan)
### MYSCHEMA => ikut nama folder kandungan setiap shp, pastikan schema dibuat dahulu dalam PosrgreSQL
### Database juga telah dibuat
### Malaysia menggunakan DATUM2000 EPSG:4742
### Semua perlu huruf kecil nama table dan fail. Sebab command shp2pgsql akan kecilkan huruf yang besar. Nanti pening nak debug.
### Harisfazillah Jamel 4 Ogos 2020
### FILENAME hanyalah shp file
@linuxmalaysia
linuxmalaysia / sysctl-conf.txt
Created June 7, 2020 02:33
sysctl.conf for elasticsearch node
vm.max_map_count=262144
net.core.default_qdisc = fq
net.ipv4.tcp_congestion_control = bbr
net.ipv4.tcp_notsent_lowat = 16384
net.core.somaxconn = 4096
# Increase size of file handles and inode cache
fs.file-max = 20971520
# Do less swapping
@linuxmalaysia
linuxmalaysia / Platform_Kubernetes_Setempat_Untuk_Elastic_Cloud_Kubernetes.txt
Created May 17, 2020 04:43
Platform Kubernetes Setempat Untuk Elastic Cloud Kubernetes
Platform Kubernetes Setempat Untuk Elastic Cloud Kubernetes
A) Rancher 2.0 Didalam K3S
Gabungan 3 Nodes master K3S dengan MariaDB Cluster untuk cluster K3S
MariaDB Cluster dengan mariadbcopy.
Cluster A adalah untuk Rancher 2.0, diasingkan. Nodes tidak perlu besar.
Pemasangan K3S
https://rancher.com/docs/k3s/latest/en/installation/datastore/
@linuxmalaysia
linuxmalaysia / Filebeat For Iptables Centos 7 And Iptables using UFW For Ubuntu 18.04.txt
Created May 7, 2020 04:35
Filebeat For Iptables Centos 7 And Iptables using UFW For Ubuntu 18.04
Filebeat For Iptables Centos 7 And Iptables using UFW For Ubuntu 18.04
1) Enable firewalld log
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/security_guide/configuring_logging_for_denied_packets
firewall-cmd --get-log-denied
off
firewall-cmd --set-log-denied=all
@linuxmalaysia
linuxmalaysia / Demo use case: integrating a COVID-19 tracker API with the Elastic Stack plus story telling with Kibana.txt
Last active May 7, 2020 04:37
Demo use case: integrating a COVID-19 tracker API with the Elastic Stack plus story telling with Kibana
Demo use case: integrating a COVID-19 tracker API with the Elastic Stack plus story telling with Kibana
https://medium.com/@quoeamaster/use-case-integrating-a-covid-19-tracker-api-with-the-elastic-stack-plus-story-telling-with-kibana-8805cb67678
Create the pipeline in the Elasticsearch before start the filebeat.
=== Update for filebeat
filebeat.inputs:
- type: log
@linuxmalaysia
linuxmalaysia / nginx-for-elasticsearch-with-username-password.conf
Last active April 26, 2020 09:15
nginx for elasticsearch with username password
### http://shairosenfeld.blogspot.com/2011/03/authorization-header-in-nginx-for.html
### https://www.opinionatedgeek.com/codecs/base64encoder
### (Pilih URL safe)
### Example user ujian and password ujian 1234
# ujian:ujian1234
# Base64 for nginx
# dWppYW46dWppYW4xMjM0
### ================