Skip to content

Instantly share code, notes, and snippets.

View johnnyasantoss's full-sized avatar
🤓
Learning

Johnny Santos johnnyasantoss

🤓
Learning
View GitHub Profile
@RobinLinus
RobinLinus / covenants.md
Last active March 4, 2024 12:04
A collection of resources related to covenants
@XSystem252
XSystem252 / RaspberryPi4Archlinux64EncryptionUSBBootBtrfsGuide.md
Last active March 31, 2024 17:51
How To Set Up a Raspberry Pi 4 with Archlinux 64-bit (AArch64) and Full Disk Encryption (+SSH unlock), USB Boot (No SD-Card) and btrfs

How To Set Up a Raspberry Pi 4 with Archlinux 64-bit (AArch64) and Full Disk Encryption (+SSH unlock), USB Boot (No SD-Card) and btrfs

Written by: XSystem
First published on: 20 Dec 2020
Last updated on: 20 Dec 2020

[0] Introduction

Overview

@keilmillerjr
keilmillerjr / Creating an AUR Package.md
Last active April 23, 2024 22:36
How to create and manage an AUR package. #AUR #ARCH #makepkg #PKGBUILD
@laanwj
laanwj / blocktoimg.py
Last active January 31, 2024 11:06
tools to write (block) data to png files and vice versa
#!/usr/bin/env python3
# Distributed under the MIT software license
import binascii, struct, sys, io, argparse
from PIL import Image
IMG_WIDTH = 512 # could be made adaptive...
MIN_HEIGHT = 4 # minimum height of image; twitter won't let us upload anything smaller
BYTES_PER_PIXEL = 4 # RGBA, 8 bit
def div_roundup(x,y):
@guilhermednt
guilhermednt / check_intermedium_private_key_leak.sh
Created May 9, 2018 23:08
Verifying Banco Intermedium's private key leak
# Today the twitter user @ayubio said he had received the private key for a Brazillian bank's HTTPS certificate:
# - https://twitter.com/ayubio/status/994260981294469120
# - https://twitter.com/ayubio/status/994262029929246722
# - https://twitter.com/ayubio/status/994277992351391744
# To prove he actualy had the key, another user asked him to sign a message with such key and so he did:
# - http://pastebin.xyz/p?q=bXllODA
# The commands bellow will check that signature
# Store the message in a file (tweet.txt) in the same way @ayubio did:
@PaulSec
PaulSec / certstream_watchdog_paypal.py
Created November 6, 2017 15:27
certstream utility to retrieve paypal and few other fraud keywords
import certstream
keywords = ['paypal', 'paypol']
def extract_domains(domains):
res = []
for domain in domains:
for keyword in keywords:
if keyword in domain:
res.append(domain)
@mgravell
mgravell / Odd findings.txt
Last active April 19, 2017 10:39
async; ValueTask vs Task
Objective: compare Task<T> vs ValueTask<T> in a scenario that should
be ideal for ValueTask<T> - non-trivial results, but usually (always)
already completed.
Hypothesis: ValueTask<T> should be more efficient, as it does not (in
the "already completed" case) involve allocation.
Methodology: create a test rig that computes a number using multiple
nested roll-up operations, comparing sync vs async-Task<T> vs async-ValueTask<T>;
use "async"/"await" for the rollups in the async cases. Run all tests using
@jean-lourenco
jean-lourenco / dapper.cs
Last active April 7, 2017 19:45
Exemplo de queries com o Dapper
public static void Main()
{
var paraCadastrar = new []
{
new { Chave = "CSVDEFAULT", Descricao = "Descrição detalhada (ou não)" },
new { Chave = "JSONDEFAULT", Descricao = "Descrição detalhada (ou não)" },
new { Chave = "YAML", Descricao = "Descrição detalhada (ou não)" },
new { Chave = "INIT", Descricao = "Descrição detalhada (ou não)" },
new { Chave = "CONFIG", Descricao = "Descrição detalhada (ou não)" },
new { Chave = "BSON", Descricao = "Descrição detalhada (ou não)" },
@so0k
so0k / kubectl.md
Last active April 25, 2024 12:40
Playing with kubectl output

Kubectl output options

Let's look at some basic kubectl output options.

Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).

We can start with:

kubectl get no
@lukechilds
lukechilds / get_latest_release.sh
Created August 9, 2016 19:43
Shell - Get latest release from GitHub
get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
}
# Usage
# $ get_latest_release "creationix/nvm"
# v0.31.4