Skip to content

Instantly share code, notes, and snippets.

View f3llps's full-sized avatar

f3llps f3llps

View GitHub Profile
@f3llps
f3llps / gist:33c0fb711f3971d6f912acc1ea3ebb10
Created May 13, 2024 13:14
How to update a forked repo with git rebase
https://medium.com/@topspinj/how-to-git-rebase-into-a-forked-repo-c9f05e821c8a
Step 1: Add the remote (original repo that you forked) and call it “upstream”
git remote add upstream https://github.com/original-repo/goes-here.git
Step 2: Fetch all branches of remote upstream
git fetch upstream
@f3llps
f3llps / CPFValidator.kt
Created April 27, 2024 18:59 — forked from trfiladelfo/CPFValidator.kt
Validador de CPF em Kotlin
fun isCPF(document: String): Boolean {
if (document.isEmpty()) return false
val numbers = document.filter { it.isDigit() }.map {
it.toString().toInt()
}
if (numbers.size != 11) return false
//repeticao
[
{
"metadata": {
"id": "6e440e71-8ed9-4f25-bb78-4b13096b8a03",
"publisherId": "formulahendry.auto-rename-tag",
"publisherDisplayName": "formulahendry"
},
"name": "auto-rename-tag",
"publisher": "formulahendry",
"version": "0.1.9"

******* Amazon EC2 --utilitarios
sudo yum upgrade -y \
&& sudo yum upgrade -y \
&& sudo yum install \
htop \
mc \
wget \
curl \
ca-certificates \

@f3llps
f3llps / nginx-tuning.md
Created August 23, 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.

@f3llps
f3llps / nginx.conf
Created August 23, 2020 17:32 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@f3llps
f3llps / docker-help.md
Created August 23, 2020 17:30 — forked from bradtraversy/docker-help.md
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

@f3llps
f3llps / iptables_rules.sh
Created August 23, 2020 17:29 — forked from virtualstaticvoid/iptables_rules.sh
25 Most Frequently Used Linux IPTables Rules Examples
# Modify this file accordingly for your specific requirement.
# http://www.thegeekstuff.com
# 1. Delete all existing rules
iptables -F
# 2. Set default chain policies
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT DROP
@f3llps
f3llps / install.sh
Created August 23, 2020 17:27 — forked from wdullaer/install.sh
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
@f3llps
f3llps / sane-caching.nginx.conf
Created August 23, 2020 17:24 — forked from philipstanislaus/sane-caching.nginx.conf
Sample Nginx config with sane caching settings for modern web development
# Sample Nginx config with sane caching settings for modern web development
#
# Motivation:
# Modern web development often happens with developer tools open, e. g. the Chrome Dev Tools.
# These tools automatically deactivate all sorts of caching for you, so you always have a fresh
# and juicy version of your assets available.
# At some point, however, you want to show your work to testers, your boss or your client.
# After you implemented and deployed their feedback, they reload the testing page – and report
# the exact same issues as before! What happened? Of course, they did not have developer tools
# open, and of course, they did not empty their caches before navigating to your site.