Skip to content

Instantly share code, notes, and snippets.

View viniciusjssouza's full-sized avatar

Vinícius Souza viniciusjssouza

View GitHub Profile
@viniciusjssouza
viniciusjssouza / keep-alive.ts
Created May 23, 2020 20:56
Keep-Alive connection experiment
import { HttpsAgent } from 'agentkeepalive';
import Axios, { AxiosInstance } from 'axios';
import http from 'http';
const KEEP_ALIVE_TIMEOUT = 10_000;
const keepAliveAgent = new HttpsAgent({
maxSockets: 100,
keepAlive: true,
maxFreeSockets: 10,
@viniciusjssouza
viniciusjssouza / broker-auth.md
Created April 29, 2020 14:31
Broken Authentication

Broken Authentication

O que é?

  • Formas de se obter as credenciais de usuários e se passar por eles;
  • Segunda posição no rank de riscos de 2017 da OWASP (most critical security risks to web applications)

Exemplos

Ameaça 1 - Credential stuffing

@viniciusjssouza
viniciusjssouza / delete-old-branches.sh
Last active March 1, 2023 18:19
Delete git old (no merged) branches
git branch -D $(git branch --no-merged | paste -s -)
@viniciusjssouza
viniciusjssouza / runkt.sh
Created February 25, 2020 17:59
Run kotlin challenge solution
#!/bin/bash
kotlinc $1 -include-runtime -d main.jar
java -jar main.jar < input

pipenv Cookbook

What is it?

A package manager like npm, bundler, etc. Some features:

  • Manage dependencies;
  • Deterministic builds: everyone uses the same dependency and python versions;
  • Manage virtualenv;
@viniciusjssouza
viniciusjssouza / .vimrc
Last active December 4, 2024 23:08
Basic .vimrc config
set runtimepath+=~/.vim_runtime
"" To install vim ultimate:
"" git clone --depth=1 https://github.com/amix/vimrc.git ~/.vim_runtime \
"" && sh ~/.vim_runtime/install_awesome_vimrc.sh
""
source ~/.vim_runtime/vimrcs/basic.vim
source ~/.vim_runtime/vimrcs/filetypes.vim
source ~/.vim_runtime/vimrcs/plugins_config.vim
source ~/.vim_runtime/vimrcs/extended.vim
@viniciusjssouza
viniciusjssouza / mp4_convert.sh
Created December 30, 2019 14:56
Convert videos files to mp4 format
#!/bin/bash
# Convert all the MKV files inside the current working directory to MP4.
#
for i in $(echo "*.$1"); do
# copy with all audio channels
#ffmpeg -i "$i" -c copy -map 0 -copyts "${i%.*}.mp4"
# copy with subtitles
ffmpeg -i "$i" -codec copy -c:s mov_text "${i%.*}.mp4"
@viniciusjssouza
viniciusjssouza / Number to text - tests
Last active December 4, 2019 22:27
Number to text
import { asText } from '../src/number';
describe("number", () => {
describe("when an unsupported number is provided", () => {
it('should raise an assertion error', () => {
});
});
@viniciusjssouza
viniciusjssouza / docker_clean.sh
Created November 20, 2019 21:08
Clean Docker resources
#!/bin/bash
# remove exited containers:
docker ps --filter status=dead --filter status=exited -aq | xargs -r docker rm -v
# remove unused images:
docker images --no-trunc | grep '<none>' | awk '{ print $3 }' | xargs -r docker rmi
# remove unused volumes:
find '/var/lib/docker/volumes/' -mindepth 1 -maxdepth 1 -type d | grep -vFf <(
@viniciusjssouza
viniciusjssouza / software-architecture.txt
Last active November 18, 2019 12:03
Software Architecture Guides - Links
https://herbertograca.com/2017/07/03/the-software-architecture-chronicles/