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 / cloudSettings
Created October 23, 2018 10:39
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-10-23T10:39:38.915Z","extensionVersion":"v3.2.0"}
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Aws\S3\S3Client;
use League\Flysystem\AwsS3v3\AwsS3Adapter;
use League\Flysystem\Filesystem;
use Storage;
class DOSpacesStorageServiceProvider extends ServiceProvider
{
/**
@masitings
masitings / gist:045282ea39ab8e181a973858ec800313
Last active October 11, 2019 06:41
Git initialiation for submodules
Git Submodules
==============
STRUCTURE
-- Main Branch
- App (Second Branch)
- Frontend (Third Branch)
===============
#Warming up
sudo apt update -y; sudo apt dist-upgrade -y; sudo apt autoremove -y;
#Install Nginx
sudo apt update -y; sudo apt install nginx -y;
#Restart Nginx
sudo systemctl stop nginx.service; sudo systemctl start nginx.service; sudo systemctl enable nginx.service
#Install MariaDB
sudo apt-get install mariadb-server mariadb-client
@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
)
@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 / 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 / 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.

{"lastUpload":"2020-08-31T19:50:52.147Z","extensionVersion":"v3.4.3"}
@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