Skip to content

Instantly share code, notes, and snippets.

View framon's full-sized avatar

Fábio Ramon framon

  • Feira de Santana
View GitHub Profile
@framon
framon / index.js
Created May 10, 2020 18:47
Vuex: Importar automaticamente todos os módulos do diretório
import Vue from "vue";
import Vuex from "vuex";
import createLogger from 'vuex/dist/logger';
Vue.use(Vuex);
const debug = process.env.NODE_ENV !== "production";
/**
* Automatically imports all the modules and exports as a single module object

Gerar chave privada da CA

openssl genrsa -out ca.key 2048

Gerar certificado da CA autoassinado

openssl req -new -x509 -days 365 -key ca.key -subj "/C=CN/ST=GD/L=SZ/O=Acme, Inc./CN=Acme Root CA" -out ca.crt

Gerar a requisição de certificado com SAN

openssl req -newkey rsa:2048 -nodes -addext "subjectAltName = otherName:2.16.76.1.3.1;IA5STRING:010119801234567857700000000000000001234567890SSPBA" -keyout person.key -subj "/C=CN/ST=GD/L=SZ/O=Acme, Inc./CN=Acme CTO" -out person.csr

Assinar o certificado pela CA

@framon
framon / vim-cheatsheet.md
Created April 20, 2020 01:00 — forked from 0xadada/README.md
VIM movement, keyboard commands and shortcuts
@framon
framon / Preferences
Created November 23, 2019 10:53
Definir diretório de download no chromium
"download":{"default_directory":"/home/framon/download"}
@framon
framon / sed.sh
Created September 10, 2019 01:52
Exibir apenas uma faixa de linhas de um arquivo
sed -n '97623,97667p;97667q' input
@framon
framon / logback.xml
Created September 5, 2019 16:27
Definir o charset do arquivo de log
<encoder>
<charset>UTF-8</charset>
<pattern>...</pattern>
</encoder>
@framon
framon / CustomContextListener.java
Created September 5, 2019 16:24
ContextListener do Logback e acesso a propriedades
import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.Logger;
import ch.qos.logback.classic.LoggerContext;
import ch.qos.logback.classic.spi.LoggerContextListener;
import ch.qos.logback.core.Context;
import ch.qos.logback.core.spi.ContextAwareBase;
import ch.qos.logback.core.spi.LifeCycle;
public class CustomContextListener extends ContextAwareBase implements LoggerContextListener, LifeCycle {
@framon
framon / nginx.conf
Created September 5, 2019 14:35
Preservar RequestURL do nginx para o Tomcat
location / {
proxy_pass http://my_app_upstream;
proxy_set_header Host $host;
# ...
}
@framon
framon / cmd.sh
Last active June 11, 2016 22:53
Convert MTS to Android
ffmpeg -i <file>.MTS \
-c:v libx264 -profile:v baseline -crf 18 -s 640x360 \
-c:a aac -ar 44100 -ac 2 -b:a 128k \
-movflags faststart output.mp4