Skip to content

Instantly share code, notes, and snippets.

View alexishida's full-sized avatar
👨‍💻
Coding

Alex Ishida alexishida

👨‍💻
Coding
View GitHub Profile
@alexishida
alexishida / nginx-config-auth-cert-ssl.md
Last active September 21, 2025 20:08
Tutorial to configure Nginx client-side SSL certificates.

Client-side SSL

For excessively paranoid client authentication.

Original: https://gist.github.com/mtigas/952344

Convert SSL certificate from CRT format to PEM

openssl x509 -in server.crt -out server.der -outform DER
openssl x509 -in server.der -inform DER -out server.pem -outform PEM
@alexishida
alexishida / precompile.md
Created April 3, 2018 01:25 — forked from mrbongiolo/precompile.md
HOW TO: Rails 4.2 add 'vendor/asset' to precompile list

To enable the precompilation of all non.js/.css assets within vendor/assets just add this to config/initializers/assets.rb:

Rails.application.config.assets.precompile << Proc.new { |path, fn| fn =~ /vendor\/assets/ && !%w(.js .css).include?(File.extname(path)) }

Be aware that this will precompile ALL non .js/.css assets that you have there, some plugins or libraries might have .txt or other files around, and those would end up into your precompiled list also.

If you need to precompile images only, you could use this:

Rails.application.config.assets.precompile += %w(*.png *.jpg *.jpeg *.gif)
@alexishida
alexishida / ssh-root-tutorial.txt
Created April 10, 2018 16:21
Habilitando ssh como root
# Link Referência
https://www.vivaolinux.com.br/topico/Acesso-remoto-OpenSSH-SSH-VNC-RDP-Telnet-TeamViewer-etc./Permission-denied-apenas-com-conexao-root-via-ssh
Para habilitar o acesso ssh root:
Edite o arquivo
pico /etc/ssh/sshd_config
@alexishida
alexishida / mongodb-docker.txt
Created April 16, 2018 23:17
Docker mongodb
docker run -d \
--name=mongodb \
--restart=always \
-p 27017:27017 \
-v /etc/localtime:/etc/localtime:ro \
-v /storage/mongodb:/data/db \
mongo:latest
# Link
@alexishida
alexishida / .rubocop.yml
Created April 17, 2018 14:49
Rubocop Default Pattern
Metrics/LineLength:
Max: 140
Style/SymbolArray:
EnforcedStyle: brackets
Style/Documentation:
Enabled: no
Style/NonNilCheck:
Enabled: no
@alexishida
alexishida / mongod-commands.txt
Last active May 15, 2019 02:09
Mongodb Comands
# References
https://www.digitalocean.com/community/tutorials/how-to-securely-configure-a-production-mongodb-server
docker run -d \
--name=mongodb \
--restart=always \
-p 27017:27017 \
-v /etc/localtime:/etc/localtime:ro \
-v /mystorage/mongodb/db:/data/db \
@alexishida
alexishida / allow-usb-arduino-linux.txt
Created May 9, 2018 00:54
Allow arduino connect to usb in linux
sudo chmod a+rw /dev/ttyACM0
sudo chmod a+rw /dev/ttyUSB0
@alexishida
alexishida / nokogiri-example.rb
Created May 21, 2018 17:02
Exemplo de webscraping usando nokogiri
#! /usr/bin/env ruby
require 'nokogiri'
require 'open-uri'
# Fetch and parse HTML document
doc = Nokogiri::HTML(open('https://lista.mercadolivre.com.br/power-bank'))
itens = []
@alexishida
alexishida / docker-hub.txt
Created June 28, 2018 15:03
Install dockehub unreliable certificates
# Instalando o certificado nas maquinas
mkdir -p /etc/docker/certs.d/dockerhub.site.com
cd /etc/docker/certs.d/dockerhub.site.com
wget http://s3.site.com/certificados/dockerhub.site.com.crt
docker login dockerhub.site.com
# Login: login Senha: senha123456
@alexishida
alexishida / s3-minio-nginx.conf
Created July 4, 2018 13:40
Nginx Minio S3 config
server {
listen 80;
server_name s3.exemplo.com;
client_max_body_size 20000M;
location / {
proxy_buffering off;
proxy_set_header Host $http_host;