Skip to content

Instantly share code, notes, and snippets.

@huntrar
huntrar / full-disk-encryption-arch-uefi.md
Last active May 23, 2024 12:54
Arch Linux Full-Disk Encryption Installation Guide [Encrypted Boot, UEFI, NVMe, Evil Maid]

Arch Linux Full-Disk Encryption Installation Guide

This guide provides instructions for an Arch Linux installation featuring full-disk encryption via LVM on LUKS and an encrypted boot partition (GRUB) for UEFI systems.

Following the main installation are further instructions to harden against Evil Maid attacks via UEFI Secure Boot custom key enrollment and self-signed kernel and bootloader.

Preface

You will find most of this information pulled from the Arch Wiki and other resources linked thereof.

Note: The system was installed on an NVMe SSD, substitute /dev/nvme0nX with /dev/sdX or your device as needed.

@rvrsh3ll
rvrsh3ll / windows-keys.md
Created February 18, 2024 22:44
Windows Product Keys

NOTE

These are NOT product / license keys that are valid for Windows activation.
These keys only select the edition of Windows to install during setup, but they do not activate or license the installation.

Index

@Klerith
Klerith / git-alias.md
Last active May 23, 2024 12:53
Useful Git Alias

Log

git config --global alias.lg "log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all"

Status

git config --global alias.s status --short

Alternativa útil de status

git config --global alias.s status -sb

@msrose
msrose / combining-git-repositories.md
Last active May 23, 2024 12:49
How to combine two git repositories.

Combining two git repositories

Use case: You have repository A with remote location rA, and repository B (which may or may not have remote location rB). You want to do one of two things:

  • preserve all commits of both repositories, but replace everything from A with the contents of B, and use rA as your remote location
  • actually combine the two repositories, as if they are two branches that you want to merge, using rA as the remote location

NB: Check out git subtree/git submodule and this Stack Overflow question before going through the steps below. This gist is just a record of how I solved this problem on my own one day.

Before starting, make sure your local and remote repositories are up-to-date with all changes you need. The following steps use the general idea of changing the remote origin and renaming the local master branch of one of the repos in order to combine the two master branches.

@zawzaww
zawzaww / twrp-recovery-flags.mk
Last active May 23, 2024 12:48
Makefile Flags for Compiling TWRP
# USEFUL TWRP RECOVERY FLAGS
# by ZawZaw @XDA-Developers
# Thanks to : @xda-developers for helps
# Add EXT4 support
TARGET_USERIMAGES_USE_EXT4 := true
# Disable/enable SELinux. Only suggested when you want to enable SELinux support
TWHAVE_SELINUX := true
@dminca
dminca / unlock_yubikey.md
Last active May 23, 2024 12:48
YubiKey - unblock PIN after locking it with 3 wrong PIN attempts

Unlock YubiKey ⚠️

After entering the wrong password 3 times your YubiKey is locked in order to avoid brute-forcing the password. Luckily, there's a way of unlocking yourself.

⚠️ you will lose all data on it

gpg2 --card-status
Application ID ...: D2760001240102010006042126520000
@jilleb
jilleb / crc32adlatus.py
Created December 16, 2021 11:01
CRC32_ADLATUS calculator
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------------
# Created By : Jille
# This is meant specifically for calculating CRC32_ADLATUS for a file
import sys
import crcmod
import argparse
@ttomasz
ttomasz / google_sheets_example.py
Created May 24, 2023 19:16
Query Google Spreadsheet directly using Duckdb and Fabduckdb extension
import duckdb
import fabduckdb
import gspread
import pandas as pd
def read_gsheet(service_account_json_path: str, gsheets_url: str, worksheet_name: str) -> pd.DataFrame:
gc = gspread.service_account(filename=service_account_json_path, scopes=gspread.auth.READONLY_SCOPES)
gsheet = gc.open_by_url(gsheets_url)
data = gsheet.worksheet(worksheet_name).get_all_records()
...
import auth from "@react-native-firebase/auth"
...
const __doSignUp = () => {
if (!UserEmail) {
Alert.alert('Error',"Email required *")
return
} else if (!UserPassword && UserPassword.trim() && UserPassword.length > 6) {
Alert.alert('Error',"Weak password, minimum 6 chars")
@rponte
rponte / using-uuid-as-pk.md
Last active May 23, 2024 12:44
Não use UUID como PK nas tabelas do seu banco de dados

Pretende usar UUID como PK em vez de Int/BigInt no seu banco de dados? Pense novamente...

TL;TD

Não use UUID como PK nas tabelas do seu banco de dados.

Um pouco mais de detalhes