Skip to content

Instantly share code, notes, and snippets.

@nullifye
nullifye / double_reverse_proxy.md
Created January 26, 2021 09:44
Double Reverse Proxy (Case Study: Metabase)

my.domain.com —> WAF —> Nginx A (svr1) —> Nginx B (svr2) —> localhost:3000 (svr2)

/etc/nginx/conf.d/reverse-proxy.conf (Nginx A (svr1))

gzip on;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
@nullifye
nullifye / app.js
Created October 17, 2021 03:01 — forked from RamadhanAmizudin/app.js
Decrypt Cordova Crypt File Plugin
// Blogpost: http://blog.rz.my/2017/11/decrypting-cordova-crypt-file-plugin.html
var fs = require("fs"),
path = require("path"),
crypto = require("crypto");
var config = {
key : 'CRYPT_KEY',
iv : 'CRYPT_IV'
}
@nullifye
nullifye / pru15-candidates.json
Created November 6, 2022 05:49
Senarai calon PRU15 Malaysia / Candidates for Malaysia GE15
{
"P.001": {
"kod_negeri": 9,
"nama": "PADANG BESAR",
"calon": [{
"nama": "RUSHDAN BIN RUSMI",
"pekerjaan": "AHLI PERNIAGAAN",
"jantina": "L",
"kod_parti": "PN"
}, {
@nullifye
nullifye / UNDIMalaysia-PRU15.csv
Last active November 7, 2022 23:58
This CSV can be exported out of my web app https://nullifye.github.io/UNDIMalaysia/ (excepts for two columns namely 'pengundi berdaftar sebelum' and '% penambahan pengundi')
We can make this file beautiful and searchable if this error is corrected: It looks like row 8 should actually have 23 columns, instead of 22. in line 7.
kod,negeri,parlimen,dun,nama kawasan,jumlah calon,pengundi berdaftar,pengundi berdaftar sebelum,% penambahan pengundi,pengundi biasa,pengundi awal,pengundi tidak hadir luar negara,jumlah undi,tidak mengundi,undi bersih,undi tolak,majoriti,dimenangi,keluar mengundi,tidak mengundi / majoriti,undi tolak / majoriti,pilihan raya,tarikh
9,PERLIS,P.001,,PADANG BESAR,5,60192,46096,30.6%,57992,2191,9,,,,,,,,,,PRU KE-15 (2022),19 November 2022
9,PERLIS,P.001,N.01,TITI TINGGI,6,13403,10111,32.6%,13019,383,1,,,,,,,,,,PRU KE-15 (2022),19 November 2022
9,PERLIS,P.001,N.02,BESERI,4,12128,8914,36.1%,11793,330,5,,,,,,,,,,PRU KE-15 (2022),19 November 2022
9,PERLIS,P.001,N.03,CHUPING,3,14248,10542,35.2%,14247,,1,,,,,,,,,,PRU KE-15 (2022),19 November 2022
9,PERLIS,P.001,N.04,MATA AYER,3,9662,7617,26.8%,8182,1478,2,,,,,,,,,,PRU KE-15 (2022),19 November 2022
9,PERLIS,P.001,N.05,SANTAN,3,10751,8912,20.6%,10751,,,,,,,,,,,,PRU KE-15 (2022),19 November 2022
9,PERLIS,P.002,,KANGAR,5,74859,55938,33.8%,73837,1016,6,,,,,,,,,,PRU KE-15 (20
@nullifye
nullifye / gs.js
Last active March 20, 2023 00:24
Google App Script / Telegram bot / Notify if web is inaccessible / Run every 4 hours
const TOKEN = "YOUR-BOT-TOKEN";
let telegramUrl = "https://api.telegram.org/bot" + TOKEN;
// Telegram send message
function tgNotify(txt, to) {
let url = telegramUrl + "/sendMessage?parse_mode=Markdown&disable_web_page_preview=true&chat_id=" + to + "&text=" + txt;
let response = UrlFetchApp.fetch(url);
//Logger.log(response.getContentText());
}
@nullifye
nullifye / malay_dict
Last active July 16, 2024 06:27
Malay Dictionary for Password Generator (BUAH, WARNA, BENDA, HAIWAN, TEMPAT)
Anggur
Aprikot
Ara
Asam
Avokado
Bacang
Belimbing
Betik
Binjai
Bidara
@nullifye
nullifye / genpass.sh
Created July 19, 2024 23:40
Password Generator with Malay words
#!/bin/bash
# URL containing the list of words
#URL="https://raw.githubusercontent.com/asrafulsyifaa/Malay-Dataset/master/dictionary/malay-text.txt"
URL="https://gist.githubusercontent.com/nullifye/a20b52a10fcbaef73850f4905e23d2d5/raw/4b5ca641b6473be9f3cf019aecbf7b3f9e491c7a/malay_dict"
# Fetch the list of words from the URL
words=$(curl -s $URL)
# Check if the curl command was successful