Skip to content

Instantly share code, notes, and snippets.

Wellington Torrejais da Silva wellington1993

Block or report user

Report or block wellington1993

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@wellington1993
wellington1993 / nginx.conf
Created May 16, 2019 — forked from v0lkan/nginx.conf
Configuring NGINX for Maximum Throughput Under High Concurrency
View nginx.conf
user web;
# One worker process per CPU core.
worker_processes 8;
# Also set
# /etc/security/limits.conf
# web soft nofile 65535
# web hard nofile 65535
# /etc/default/nginx
View default-scope-rails.rb
default_scope
This works for Rails 4+:
class Book < ActiveRecord::Base
default_scope { order(created_at: :desc) }
end
For Rails 2.3, 3, you need this instead:
@wellington1993
wellington1993 / letsencrypt_2019.md
Created May 14, 2019 — forked from cecilemuller/letsencrypt_2019.md
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)
View letsencrypt_2019.md

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

View Nginx-Conf-Example.conf
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name localhost;
ssl_certificate /etc/ssl/certs/localhost.crt;
ssl_certificate_key /etc/ssl/private/localhost.key;
ssl_protocols TLSv1.2 TLSv1.1 TLSv1;
View git-gc.sh
git count-objects -v -H
#
git reflog expire --expire=now --all
git repack -a -d -f --depth=250 --window=250
git gc --aggressive --prune=now --force
#
git gc
git gc --aggressive
git repack -Ad # kills in-pack garbage
@wellington1993
wellington1993 / 0-my-way.sh
Last active Apr 25, 2019
CSR CERT Generation Wildcard ECC
View 0-my-way.sh
# openssl ecparam -name secp521r1 -genkey | openssl ec -out STAR_yoursite_com_br.key
openssl ecparam -name secp384r1 -genkey | openssl ec -out STAR_yoursite_com_br.key
openssl req -new -key STAR_yoursite_com_br.key -out STAR_yoursite_com_br.csr # -subj /CN=*.yoursite.com.br;
cat STAR_yoursite_com_br.csr
View Install-Libnotify.sh
sudo apt install libappindicator\* monodoc-\* libnotify\*
View Install-LibappIndicator-Ubuntu.sh
sudo apt install libappindicator\* monodoc-\*
@wellington1993
wellington1993 / bash-etc-profile-d-vte-sh-Arquivo-ou-diretorio-inexistente.sh
Created Mar 7, 2019
bash: /etc/profile.d/vte.sh: Arquivo ou diretório inexistente
View bash-etc-profile-d-vte-sh-Arquivo-ou-diretorio-inexistente.sh
# bash: /etc/profile.d/vte.sh: Arquivo ou diretório inexistente
# https://www.vivaolinux.com.br/topico/vivaolinux/Erro-no-xubuntu-bash-etcprofiledvtesh-Arquivo-ou-diretorio-inexistente
sudo ln -s /etc/profile.d/vte-2.91.sh /etc/profile.d/vte.sh
@wellington1993
wellington1993 / xls_spec.rb
Created Feb 13, 2019 — forked from aya-soft/xls_spec.rb
Spreadsheet: wrong value from formula
View xls_spec.rb
#encoding: utf-8
require 'spreadsheet'
xls_file_name = "/tmp/status_data.xls"
xls_book = Spreadsheet.open(xls_file_name, "rb")
xls_book.worksheet(0).each do |row|
puts row[6].value if row[6] and row[6].is_a?(Spreadsheet::Formula)
You can’t perform that action at this time.