Skip to content

Instantly share code, notes, and snippets.

View gilbertoalbino's full-sized avatar

Gilberto Albino gilbertoalbino

View GitHub Profile
@gilbertoalbino
gilbertoalbino / default
Created December 5, 2023 23:10 — forked from badsyntax/default
My basic nginx config files for proxying to a node.js application
server {
listen YOUR_IP_ADDRESS:80 default_server;
root /var/www/nginx;
index index.html index.htm;
# This is just an invalid value which will never trigger on a real hostname.
server_name _;
server_name_in_redirect off;
@gilbertoalbino
gilbertoalbino / nginx-tuning.md
Created December 5, 2023 20:50 — 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.

@gilbertoalbino
gilbertoalbino / centos8-9.sh
Created July 13, 2022 20:24 — forked from yodermk/centos8-9.sh
Commands to live-upgrade CentOS Streams 8 -> 9
# The general procedure here is adapted from the 7->8 guide here. https://www.tecmint.com/upgrade-centos-7-to-centos-8/
#
# It is a curated list of my bash history. I entered other commands so hopefully I got the right ones here.
yum upgrade
reboot
dnf install epel-release
dnf install rpmconf
dnf install yum-utils
rpmconf -a # answer "n" to both things
@gilbertoalbino
gilbertoalbino / models.java
Created June 1, 2021 00:48 — forked from leefsmp/models.java
Basic RESTful API from a Java servlet
package com.autodesk.adn.viewanddata;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Collection;
import java.util.HashMap;
import java.util.UUID;
import javax.servlet.ServletException;
@gilbertoalbino
gilbertoalbino / xdebug-mac.md
Created May 1, 2021 00:24 — forked from ankurk91/xdebug-mac.md
php xDebug v3 on Ubuntu/Mac and phpStorm

🪲 Install and Configure xDebug v3 on MacOS for PhpStorm 🐘

  • Assuming that you have already installed php and apache via Homebrew v1.6+

  • Install xDebug php extension

pecl channel-update pecl.php.net
pecl clear-cache

pecl install xdebug
@gilbertoalbino
gilbertoalbino / repo-reset.md
Last active January 12, 2021 19:35 — forked from heiswayi/repo-reset.md
GitHub - Comandos para excluir histórico de commits

Faça estes procedimentos por sua conta e risco

Primeiro Método

Excluir a pasta .git pode causar problemas ao repositório Git. Se a intenção é excluir todo o histórico de commits, mas manter o código e sua estrutura atual, tente isso:

# Faça Checkout em um branch temporario:
git checkout --orphan TEMP_BRANCH
@gilbertoalbino
gilbertoalbino / Laravel-Container.md
Created November 22, 2020 22:19
Laravel's Dependency Injection Container in Depth

Laravel's Dependency Injection Container in Depth

Translations: Korean (by Yongwoo Lee)

Laravel has a powerful Inversion of Control (IoC) / Dependency Injection (DI) Container. Unfortunately the official documentation doesn't cover all of the available functionality, so I decided to experiment with it and document it for myself. The following is based on Laravel 5.4.26 - other versions may vary.

Introduction to Dependency Injection

I won't attempt to explain the principles behind DI / IoC here - if you're not familiar with them you might want to read What is Dependency Injection? by Fabien Potencier (creator of the Symfony framework).

@gilbertoalbino
gilbertoalbino / media-queries-b4.scss
Created November 9, 2020 21:36 — forked from akolinski/media-queries-b4.scss
Media queries using SASS in Bootstrap 4
// -- Default media queries
// Extra small devices (Mobile phones, 0px and up)
// No media query needed since this is the default in Bootstrap
// Small devices (landscape phones, 576px and up)
@include media-breakpoint-up(sm) { ... }
// Medium devices (tablets, 768px and up)
@include media-breakpoint-up(md) { ... }