Skip to content

Instantly share code, notes, and snippets.

View adbrsln's full-sized avatar

Muhammad Adib bin Ahmad Roslan adbrsln

View GitHub Profile
@adbrsln
adbrsln / gist:d28e6a3e442e0b310ed0dcf4640abfec
Created June 20, 2026 05:19
🚀 VPS Setup for SlimPHP Application with Cloudflare Zero Trust
#!/bin/bash
# Create README.txt file
cat > README.txt << 'EOF'
================================================================================
VPS SETUP FOR SLIMPHP APPLICATION WITH CLOUDFLARE ZERO TRUST
================================================================================
A complete, secure, and optimized VPS setup script for deploying SlimPHP
applications with MySQL, Nginx, PHP-FPM, and Cloudflare Zero Trust integration.
@adbrsln
adbrsln / HTTPD-TUNING.MD
Last active September 8, 2025 04:42
HTTPD TUNING
@adbrsln
adbrsln / nginx-tuning.md
Created April 18, 2022 04:45 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@adbrsln
adbrsln / mulitple-mysqlrouter.md
Last active April 5, 2022 05:18
Multiple MySQL Router Client (Different Cluster) on Single Server

Introductions

Planning to connect to multiple Cluster at once from a single server? heres the plan...

  • Cluster 1
    • c1-node-1
    • c1-node-2
    • c1-node-3
  • Cluster 2
    • c2-node-1
    • c2-node-2
@adbrsln
adbrsln / ssl.md
Last active November 1, 2021 08:22
Caucho Resin SSL lets encrypt certificate
  • Generate Certificate from Certbot likewise
  • Open Keytool
  • create new keystore name after the domain
  • save
  • open up the fullchain.pem directory and run cmd from there and run openssl pkcs12 -export -in fullchain.pem -out fullchain.pkcs12 -inkey priv.key
  • from the keytool , import the key then select the pkcs12 file that we just created, then enter empty password.
  • once certificate chain is updated, save the key with your desired password.
[2021-06-27 09:42:41] production.ERROR: Return value of Spatie\Once\Backtrace::getObject() must be an instance of Spatie\Once\mixed, instance of Laravel\Nova\Http\Requests\NovaRequest returned {"userId":1,"exception":"[object] (TypeError(code: 0): Return value of Spatie\\Once\\Backtrace::getObject() must be an instance of Spatie\\Once\\mixed, instance of Laravel\\Nova\\Http\\Requests\\NovaRequest returned at D:\\eTender\\marii-etender\\vendor\\spatie\\once\\src\\Backtrace.php:34)
[stacktrace]
#0 D:\\eTender\\marii-etender\\vendor\\spatie\\once\\src\\functions.php(19): Spatie\\Once\\Backtrace->getObject()
#1 D:\\eTender\\marii-etender\\vendor-licensed\\laravel\
ova\\src\\Http\\Requests\\InteractsWithResources.php(93): once()
#2 D:\\eTender\\marii-etender\\vendor-licensed\\laravel\
ova\\src\\Http\\Controllers\\UpdateFieldController.php(18): Laravel\\Nova\\Http\\Requests\\NovaRequest->findModelOrFail()
#3 D:\\eTender\\marii-etender\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Controller.php(54): Larave
@adbrsln
adbrsln / billplz-mobile.php
Created April 15, 2020 17:30 — forked from wzul/billplz-mobile.php
PHP Example: Parse and generate valid mobile number for Billplz Create a BIll API
<?php
// https://github.com/giggsey/libphonenumber-for-php
// composer require giggsey/libphonenumber-for-php
require 'vendor/autoload.php';
use libphonenumber\PhoneNumberUtil;
use libphonenumber\PhoneNumberType;
use libphonenumber\PhoneNumberFormat;
$phoneNumber = "0107989480";
$phoneNumberUtil = PhoneNumberUtil::getInstance();
[
{
"id": 3,
"uuid": "9cc0d734-5cf3-11ea-aaa4-685b35a97702",
"name": "Ayer Baloi",
"code": "01",
"states_id": 2,
"created_at": "2020-03-03 02:06:36",
"updated_at": "2020-03-03 02:06:36",
"deleted_at": ""
{"update_date":"2020-04-2T04:15:22.851Z","stat":[
{"id":1,"nationality":"Malaysian","age":34,"gender":"Male","transmission_source":"Tabligh cluster"},
{"id":2,"nationality":"Malaysian","age":60,"gender":"Male","transmission_source":"Others"},
{"id":3,"nationality":"Malaysian","age":58,"gender":"Male","transmission_source":"Tabligh cluster"},
{"id":4,"nationality":"Malaysian","age":50,"gender":"Male","transmission_source":"Tabligh cluster"},
{"id":5,"nationality":"Malaysian","age":79,"gender":"Female","transmission_source":"Others"},
{"id":6,"nationality":"Malaysian","age":40,"gender":"Female","transmission_source":"Others"},
{"id":7,"nationality":"Malaysian","age":57,"gender":"Male","transmission_source":"Tabligh cluster"},
{"id":8,"nationality":"Malaysian","age":69,"gender":"Male","transmission_source":"Tabligh cluster"},
{"id":9,"nationality":"Malaysian","age":48,"gender":"Male","transmission_source":"Covid-19 patients"},
@adbrsln
adbrsln / test.json
Created March 31, 2020 06:19
corono json malaysia status
{
}