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 / nginx-tuning.md
Created April 18, 2022 04:45 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

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
{
}
@adbrsln
adbrsln / Development-Best-Practice.md
Last active November 12, 2019 10:15
Development Best Practice

Tips & Best Practices

Naming Conventions

it would be nice if the variable naming conventions follows Laravel Best Practice it would be like 20 minutes reading.

Pushing and Pulling Codes from Repositories

  • refer this docs git forks and upstreams
  • always pull from Master (upstream/master) upstream branch every single time u want to commit or start coding or before pushing codes.
  • always check for conflict issue and fix it before pushing .
  • always follow commit message formats Commit Message Standards . most of the time i'll be using feat and fix. below are the sample of my commit message
    • fixes - fix : update logic codes of this feature
    • feature - feat : create new endpoints for feature
@adbrsln
adbrsln / mysql-cluster.md
Last active November 12, 2019 07:23
MySQL Innodb Cluster Setup In Private Network

MySQL Innodb Cluster Setup

Out off all the tutorial out there, all the cluster setup are shown for non private networks. since the setup is for private network, u need to skip certain stuff or might as well add few stuffs.

First thing first, the checklist:

  • All the server nodes in the same Private Network.
  • Minimum of 3 Servers nodes.
  • MySQL 8.0 community version installed on all those servers over here MySQL Installation.
  • MySQL Shell installed on one those servers MySQL Shell Installation.