Skip to content

Instantly share code, notes, and snippets.

View eneiasramos's full-sized avatar

Enéias Ramos de Melo eneiasramos

View GitHub Profile
@eneiasramos
eneiasramos / test.php
Created October 26, 2019 05:47 — forked from claudiosanches/test.php
Regex for test credit card brand
<?php
// Test cards
$cards = array(
'378282246310005', // American Express
'371449635398431', // American Express
'5078601870000127985', // Aura
'5078601800003247449', // Aura
'30569309025904', // Diners Club
'38520000023237', // Diners Club
@eneiasramos
eneiasramos / README.md
Created July 10, 2020 23:35 — forked from erikhansen/README.md
Magento 2 performance comparison after disabling unnecessary third-party extensions

Overview

I ran some tests to determine the speed impact of removing unnecessary third-party extensions, per this article: https://www.integer-net.com/make-magento-2-small-again/ The TL;DR is that pages loaded about 10% faster (with full_page and block_html disabled) with the unnecessary extensions removed.

Extensions I removed:

"replace": {
        "magento/module-dhl": "*",
        "magento/module-fedex": "*",
<?php
function validar_cnpj($cnpj)
{
$cnpj = preg_replace('/[^0-9]/', '', (string) $cnpj);
// Valida tamanho
if (strlen($cnpj) != 14)
return false;
<?php
function validar_cpf($cpf)
{
$cpf = preg_replace('/[^0-9]/', '', (string) $cpf);
// Valida tamanho
if (strlen($cpf) != 11)
return false;
@eneiasramos
eneiasramos / clear_cache_MS_Teams.sh
Created January 3, 2022 21:16 — forked from mrcomoraes/clear_cache_MS_Teams.sh
Clear cache Microsoft Teams on Linux
#!/bin/bash
# This script cleans all cache for Microsoft Teams on Linux
# Tested on Ubuntu-like, Debian by @necrifede and Arch Linux by @lucas-dclrcq. Feel free to test/use in other distributions.
# Tested with Teams via snap package.
#
# How to use in terminal:
# ./clear_cache_MS_Teams.sh ( deb-stable | deb-insider | snap )
# or
# bash clear_cache_MS_Teams.sh ( deb-stable | deb-insider | snap )
@eneiasramos
eneiasramos / GeoIP Block NGINX Ubuntu 20.04.md
Created March 3, 2023 23:46 — forked from dunderrrrrr/GeoIP Block NGINX Ubuntu 20.04.md
Allow or block GeoIP in Nginx on Ubuntu 20.04

GeoIP Block NGINX Ubuntu 20.04

Block or filter IPs based on location in Nginx (tested on 1.18.0) on Ubuntu 20.04.

Install Nginx modules

To make use of the geographical filtering, we must first install the Nginx GeoIP module as well as the GeoIP database containing the mappings between visitors’ IP addresses and their respective countries. To do so, let’s execute:

$ sudo apt install libnginx-mod-http-geoip geoip-database
@eneiasramos
eneiasramos / magento-1-nginx.md
Created April 24, 2023 06:47 — forked from hanhpv/magento-1-nginx.md
Magento 1 nginx configuration
server { 
	listen 80; 
	root /Users/admin/htdocs/vax-uk;
	index index.php index.html index.htm;
	 
	server_name vax.local; 
	access_log /usr/local/etc/nginx/logs/vax_access.log;
	access_log /usr/local/etc/nginx/logs/vax_error.log;
	 
@eneiasramos
eneiasramos / magento-check.php
Created April 25, 2023 00:10 — forked from sonnygauran/magento-check.php
Magento System Requirements Check
<?php
// Updated the "HOW DO I KNOW IF MY SERVER MEETS THESE SYSTEM REQUIREMENTS"
// from http://www.magentocommerce.com/knowledge-base/entry/how-do-i-know-if-my-server-is-compatible-with-magento
// specified at http://magento.com/resources/system-requirements
//
// minor adjustments made from original script
// http://www.magentocommerce.com/_media/magento-check.zip
extension_check(array(
'curl',
'dom',
@eneiasramos
eneiasramos / opcache.ini
Created May 12, 2023 04:47 — forked from rohankhudedev/opcache.ini
Best Zend OpCache Settings / Tuning / Configurations
[opcache]
; Determines if Zend OPCache is enabled
opcache.enable=1
; Determines if Zend OPCache is enabled for the CLI version of PHP
;opcache.enable_cli=1
; The OPcache shared memory storage size.
opcache.memory_consumption=512
@eneiasramos
eneiasramos / ConectivaLinux.md
Created August 22, 2023 13:52 — forked from ruda/ConectivaLinux.md
Conectiva Linux ISOs, Repos and etc.

Conectiva Linux (ISO Images):