Skip to content

Instantly share code, notes, and snippets.

View gleicon's full-sized avatar

Gleicon Moraes gleicon

View GitHub Profile
@gleicon
gleicon / make-icpbrasil-bundle.sh
Created October 31, 2023 12:07 — forked from skarllot/make-icpbrasil-bundle.sh
Download ICP-Brasil certificates and make a bundle
#!/bin/bash
HTTPADDR=http://acraiz.icpbrasil.gov.br/credenciadas/CertificadosAC-ICP-Brasil/ACcompactado.zip
DEST=/etc/ssl/certs/icp-brasil
mkdir -p ${DEST}
cd ${DEST}
rm -f *.crt
rm -f *.zip
@gleicon
gleicon / id_rsa_encryption.md
Created September 13, 2023 02:06 — forked from fcoury/id_rsa_encryption.md
Encrypt/Decrypt a File using your SSH Public/Private Key on Mac OS X

A Guide to Encrypting Files with Mac OS X

This guide will demonstrate the steps required to encrypt and decrypt files using OpenSSL on Mac OS X. The working assumption is that by demonstrating how to encrypt a file with your own public key, you'll also be able to encrypt a file you plan to send to somebody else using their private key, though you may wish to use this approach to keep archived data safe from prying eyes.

Too Long, Didn't Read

Assuming you've already done the setup described later in this document, that id_rsa.pub.pcks8 is the public key you want to use, that id_rsa is the private key the recipient will use, and secret.txt is the data you want to transmit…

Encrypting

$ openssl rand 192 -out key

$ openssl aes-256-cbc -in secret.txt -out secret.txt.enc -pass file:key

library(readxl)
library(readr)
library(tidyverse)
library(lubridate)
library(rsiconfi)
arquivo_geral <- read_excel("HIST_PAINEL_COVIDBR_30jun2020.xlsx",
col_types = c("text", "text", "numeric",
"text", "numeric", "numeric", "numeric",
"date", "numeric", "text", "numeric",
@gleicon
gleicon / mapa_eleicoes_deformado.r
Created November 19, 2022 20:29 — forked from fernandobarbalho/mapa_eleicoes_deformado.r
Gera mapa do Brasil deformado de acordo com variação da votação do PT entre 2018 e 2022 (2º turno)
library(readr)
library(tidyverse)
library(data.table)
library(geobr)
library(cartogram)
library(sf)
library(colorspace)
@gleicon
gleicon / mobile-headers.sh
Created August 11, 2022 13:53 — forked from quarkness/mobile-headers.sh
request headers with iphone / desktop user-agent
#!/bin/sh
echo "iPhone:"
curl -I -H "User-Agent: Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_2 like Mac OS X; nl-nl) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8H7 Safari/6533.18.5" $1
echo "Desktop:"
curl -I -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/534.55.3 (KHTML, like Gecko) Version/5.1.5 Safari/534.55.3" $1
@gleicon
gleicon / audit-on-push.yml
Created January 6, 2022 16:55 — forked from LukeMathWalker/audit.yml
GitHub Actions - Rust setup
name: Security audit
on:
push:
paths:
- '**/Cargo.toml'
- '**/Cargo.lock'
jobs:
security_audit:
runs-on: ubuntu-latest
steps:

EDIT: go to https://golang.org/, skip the rest of this doc.

Quick Tips for Fast Code on the JVM

I was talking to a coworker recently about general techniques that almost always form the core of any effort to write very fast, down-to-the-metal hot path code on the JVM, and they pointed out that there really isn't a particularly good place to go for this information. It occurred to me that, really, I had more or less picked up all of it by word of mouth and experience, and there just aren't any good reference sources on the topic. So… here's my word of mouth.

This is by no means a comprehensive gist. It's also important to understand that the techniques that I outline in here are not 100% absolute either. Performance on the JVM is an incredibly complicated subject, and while there are rules that almost always hold true, the "almost" remains very salient. Also, for many or even most applications, there will be other techniques that I'm not mentioning which will have a greater impact. JMH, Java Fligh

@gleicon
gleicon / README.md
Created August 9, 2017 16:35 — forked from lucindo/README.md
Using Graphite/Grafana to gather Locust.io test data

Using Locust.io with Grafana

On your locust master server:

  • Install and configure Graphite. Follow a good tutorial
  • Install and configure Grafana: tutorial

Use logra.py on your locust test file. See locustfile.py.

@gleicon
gleicon / service-checklist.md
Created January 15, 2017 00:03 — forked from acolyer/service-checklist.md
Internet Scale Services Checklist

Internet Scale Services Checklist

A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."

Basic tenets

  • Does the design expect failures to happen regularly and handle them gracefully?
  • Have we kept things as simple as possible?