Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Harisfazillah Jamel linuxmalaysia

🏠
Working from home
View GitHub Profile
@linuxmalaysia
linuxmalaysia / load-to-postgresql-shpfile-epsg4742.sh
Last active Aug 11, 2020
Bash script to load to postgresql shpfile epsg4742
View load-to-postgresql-shpfile-epsg4742.sh
#!/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 Jun 7, 2020
sysctl.conf for elasticsearch node
View sysctl-conf.txt
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
Platform Kubernetes Setempat Untuk Elastic Cloud Kubernetes
View Platform_Kubernetes_Setempat_Untuk_Elastic_Cloud_Kubernetes.txt
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
Filebeat For Iptables Centos 7 And Iptables using UFW For Ubuntu 18.04
View Filebeat For Iptables Centos 7 And Iptables using UFW For Ubuntu 18.04.txt
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
Demo use case: integrating a COVID-19 tracker API with the Elastic Stack plus story telling with Kibana
View Demo use case: integrating a COVID-19 tracker API with the Elastic Stack plus story telling with Kibana.txt
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 Apr 26, 2020
nginx for elasticsearch with username password
View nginx-for-elasticsearch-with-username-password.conf
### 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
### ================
@linuxmalaysia
linuxmalaysia / winlogbeat.template.json
Created Mar 3, 2020
winlogbeat.template.json for Winlogbeat 7.6.0
View winlogbeat.template.json
{
"index_patterns": [
"winlogbeat-7.6.0-*"
],
"mappings": {
"_meta": {
"beat": "winlogbeat",
"version": "7.6.0"
},
"date_detection": false,
@linuxmalaysia
linuxmalaysia / Monitoring_Setting_For_Elastic_Stack_7.txt
Created Jan 31, 2020
Monitoring Setting For Elastic Stack 7.x
View Monitoring_Setting_For_Elastic_Stack_7.txt
*** Monitoring Setting For Elastic Stack 7.x ***
===> elasticsearch.yml
xpack.monitoring.enabled: true
xpack.monitoring.collection.enabled: true
===> kibana.yml
xpack.monitoring.enabled: true
@linuxmalaysia
linuxmalaysia / logstash-example-haris22012020.conf
Last active Jan 22, 2020
logstash example filter by rules with if then else
View logstash-example-haris22012020.conf
filter {
# start if
if "syslog" in [tags] and "sshd" in [program] {
### Start Rule 1
## https://github.com/ossec/ossec-rules/blob/master/rules.d/50-sshd_rules.xml
grok {
match => {
@linuxmalaysia
linuxmalaysia / logstash-config-example-searching-filebeat-index.txt
Created Oct 13, 2019
Example logstash configuration file. Tested using Logstash 7.4.0 and Filebeat as input and Elasticsearch. Terima Kasih Kepada Amir Haris Ahmad, Localhost Sdn Bhd # kerana izinkan saya gunakan servers ujian mereka di Digital Ocean # dan team beliau dengan berkongsi pengalaman dan pandangan mereka. # Untuk saya menguji bruteforce attack log kepada…
View logstash-config-example-searching-filebeat-index.txt
### Terima Kasih Kepada Amir Haris Ahmad, Localhost Sdn Bhd
### kerana izinkan saya gunakan servers ujian mereka di Digital Ocean
### dan team beliau dengan berkongsi pengalaman dan pandangan mereka.
###
### Untuk saya menguji bruteforce attack log kepada syslog dengan fail2ban
###
### Server telah dipasang dengan fail2ban dan SSH dibuka dengan port 22.
### SSH tidak membenarkan module password dan hanya digital cert.
###
### Filebeat telah digunakan untuk mengumpulkan log.
You can’t perform that action at this time.