Skip to content

Instantly share code, notes, and snippets.

View masitings's full-sized avatar
🏠
Working from home

Rafi Bagaskara Halilintar masitings

🏠
Working from home
View GitHub Profile
@masitings
masitings / laravel-fastcgi-cache-config.md
Created November 20, 2023 03:54 — forked from murdercode/laravel-fastcgi-cache-config.md
Optimizing Laravel (and Nova) with FastCGI Cache Configuration

Laravel + FastCGI Cache = ❤️

Using FastCGI cache allows you to speed up your website up to 1000x. In fact, the FastCGI cache (or Varnish) mechanism consists of putting a server-caching mechanism between a client and your web server. The whole page will be cached as an HTML output, and it will be delivered instead of using the PHP/MySQL/Redis stack, etc. for all users, but only for the first visit (and others after some specified time).

WARNING: This is not a take-away how-to. Please read it carefully and use it at your own risk.

This config is based on the ploi.io stack. We will not cover the FastCGI installation process, so please prepare FastCGI and adapt the next config if you need it.

What you need to know

@masitings
masitings / laravel-socket-io.md
Created September 14, 2022 02:16 — forked from brainlagid/laravel-socket-io.md
Setup Laravel with Socket.io [Ubuntu 20.04]

Server Requirement

  • Redis sudo apt install redis-server
  • Composer here
  • npm sudo apt install nodejs npm
  • laravel-echo-server npm install -g laravel-echo-server

Laravel Dependencies Requirement

  • predis
  • laravel-echo
  • socket.io-client ^2.4.0 issue
@masitings
masitings / imagick3.4.4-PHP7.4-forge.sh
Created April 11, 2022 11:34 — forked from danielstgt/imagick3.4.4-PHP7.4-forge.sh
Install ImageMagick / Imagick 3.4.4 on PHP 7.4 server (Laravel Forge)
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
apt-get install pkg-config libmagickwand-dev -y
cd /tmp
wget https://pecl.php.net/get/imagick-3.4.4.tgz
tar xvzf imagick-3.4.4.tgz
@masitings
masitings / nginx-tuning.md
Created April 9, 2020 17:34 — 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.

@masitings
masitings / cloudSettings
Created March 28, 2020 03:14 — forked from sarthaksavvy/cloudSettings
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-01-29T09:00:59.907Z","extensionVersion":"v3.4.3"}
@masitings
masitings / Instructions.sh
Created February 9, 2020 15:19 — forked from GhazanfarMir/Instructions.sh
Install PHP7.2 NGINX and PHP7.2-FPM on Ubuntu 16.04
########## Install NGINX ##############
# Install software-properties-common package to give us add-apt-repository package
sudo apt-get install -y software-properties-common
# Install latest nginx version from community maintained ppa
sudo add-apt-repository ppa:nginx/stable
# Update packages after adding ppa
@masitings
masitings / delete-orphans-usermeta.sql
Created December 5, 2019 09:14 — forked from carlosleopoldo/delete-orphans-usermeta.sql
Delete all orphans user meta in WordPress
DELETE FROM wp_usermeta
WHERE NOT EXISTS (
SELECT * FROM wp_users
WHERE wp_usermeta.user_id = wp_users.ID
)