Skip to content

Instantly share code, notes, and snippets.

View goeroeku's full-sized avatar

Agus Indra Cahaya goeroeku

View GitHub Profile
@fevangelou
fevangelou / my.cnf
Last active June 14, 2024 15:08
Optimized my.cnf configuration for MySQL/MariaDB (on Ubuntu, CentOS, Almalinux etc. servers)
# === Optimized my.cnf configuration for MySQL/MariaDB (on Ubuntu, CentOS, Almalinux etc. servers) ===
#
# by Fotis Evangelou, developer of Engintron (engintron.com)
#
# ~ Updated December 2021 ~
#
#
# The settings provided below are a starting point for a 8-16 GB RAM server with 4-8 CPU cores.
# If you have different resources available you should adjust accordingly to save CPU, RAM & disk I/O usage.
#
@permatis
permatis / 1Instruksi.md
Last active November 25, 2019 02:37
Membuat helper tanggal Indonesia di laravel 5 dengan Carbon.

Membuat Helper di Laravel 5

Berikut ini adalah langkah-langkah membuat helper di laravel 5 dengan contoh kasus membuat helper tanggal / datetime ke Indonesia.

  • Buat folder Helpers atau lainnya didalam folder App.
  • Membuat file Service Provider terlebih dahulu. gunakan perintah php artisan make:provider HelperServiceProvider
  • Kemudian buka file HelperServiceProvider.php di dalam folder App/Providers/
  • Tambahkan kode dibawah ini didalam fungsi register()
@kanibaspinar
kanibaspinar / my.cnf
Last active May 28, 2024 09:46
Mysql My.cnf Optimization - Best Performance For 1000 + Sites Web Server
# Optimized MySQL configuration for cPanel servers by Kani Baspinar - Updated June 2016
#
# The settings provided below are a starting point for a 24GB RAM server with 8 CPU cores.
# If you have less or more resources available you MUST adjust accordingly to save CPU, RAM and disk I/O usage.
# To fine tune these settings for your system, use MySQL DB diagnostics tools like:
# Test your configuration ; https://launchpad.net/mysql-tuning-primer
# or
# http://blog.mysqltuner.com/download/
# Note that if there is NO comment beside a setting, then you don't need to adjust it.
#
@gilyes
gilyes / Backup, restore postgres in docker container
Last active June 11, 2024 21:21
Backup/restore postgres in docker container
Backup:
docker exec -t -u postgres your-db-container pg_dumpall -c > dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql
Restore:
cat your_dump.sql | docker exec -i your-db-container psql -Upostgres
@cagataycali
cagataycali / babelInterpreter.sh
Created July 8, 2016 16:28
Start pm2 process with babel-node interpreter
pm2 start app.js --interpreter ./node_modules/.bin/babel-node
@yegorg
yegorg / sysctl.conf
Created September 20, 2016 09:28
ubuntu sysctl performance tuning
# Kernel sysctl configuration file for Linux
#
# Version 1.12 - 2015-09-30
# Michiel Klaver - IT Professional
# http://klaver.it/linux/ for the latest version - http://klaver.it/bsd/ for a BSD variant
#
# This file should be saved as /etc/sysctl.conf and can be activated using the command:
# sysctl -e -p /etc/sysctl.conf
#
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and sysctl.conf(5) for more details.
@goeroeku
goeroeku / install-old-php-from-source.md
Last active March 28, 2020 11:40
Ubuntu/Debian - PHP & PHP Extension

Old PHP from Source

php 5.4

add old repo, ex jesie

deb http://kartolo.sby.datautama.net.id/debian/ jessie main contrib non-free
deb http://kartolo.sby.datautama.net.id/debian-security/ jessie/updates main contrib non-free
deb-src http://kartolo.sby.datautama.net.id/debian/ jessie main contrib non-free
@goeroeku
goeroeku / adminer.md
Last active November 13, 2018 04:58
Install adminer

install

wget -O d.php https://www.adminer.org/latest-en.php
@goeroeku
goeroeku / CommandLine.md
Last active February 7, 2019 07:07
Some utilities app

batch rename extension to UPERCASE

for f in *.jpg; do mv "$f" "${f//jpg/JPG}"; done
@goeroeku
goeroeku / loadbalancer-nginx.md
Last active April 1, 2021 17:09
Install nginx

ex: vim /etc/nginx/sites-enabled/default

buat block pada site configurasi,tambahkan sejajar dengan block server{}

upstream php { 
  ip_hash;
  server unix:/run/php/php7.4-fpm.sock1 weight=100 max_fails=5 fail_timeout=5; 
  server unix:/run/php/php7.4-fpm.sock2 weight=100 max_fails=5 fail_timeout=5;
  server unix:/run/php/php7.4-fpm.sock; 
}