Skip to content

Instantly share code, notes, and snippets.

@huntrar
huntrar / full-disk-encryption-arch-uefi.md
Last active April 12, 2024 19:09
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.

@karpathy
karpathy / min-char-rnn.py
Last active April 16, 2024 18:25
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@chichunchen
chichunchen / .gitignore
Created November 26, 2014 16:51
Git ignore binary files
# Ignore all
*
# Unignore all with extensions
!*.*
# Unignore all dirs
!*/
### Above combination will ignore all files without extension ###
@tonyseek
tonyseek / README.rst
Last active November 5, 2022 15:20
Build Python binding of C++ library with cffi (PyPy/Py3K compatible)

Run with Python:

pip-2.7 install cffi
PYTHON=python2.7 sh go.sh

Run with PyPy:

pip-pypy install cffi
PYTHON=pypy sh go.sh
@jakab922
jakab922 / cache_decorator.py
Last active July 5, 2018 11:51
Caching decorator with timeout. Might not be good for class instance/class methods.
from functools import wraps
from json import dumps
from datetime import datetime
def timeout_cache(max_timeout):
def timeout_cache_inner(fn):
fn._cache = {}
fn._timeout = max_timeout
@wraps(fn)
@alphazo
alphazo / archlinux-install-guide.md
Created August 7, 2012 12:54
ArchLinux Installation Guide

ArchLinux Installation guide

This will use GPT partitions and GRUB2 on a BIOS enabled PC (see Wiki for EFI). The Installation Guide can be found at /root/install.txt.

Prepare USB stick

Get 2012.08.04 image or later from http://www.archlinux.org/download. Following tutorial requires at least 2011.07.15 image.

dd if=/dev/zero of=/dev/sdx bs=1k count=1

@ekarulf
ekarulf / code128.py
Created November 16, 2010 04:25
Code128 Python Generator (Uses PIL)
#!/usr/bin/env python
# Copyright (c) 2010 Erik Karulf (erik@karulf.com)
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
@jeetsukumaran
jeetsukumaran / custom_iterator.cpp
Created February 18, 2010 02:33
Sample C++/STL custom iterator
// Sample custom iterator.
// By perfectly.insane (http://www.dreamincode.net/forums/index.php?showuser=76558)
// From: http://www.dreamincode.net/forums/index.php?showtopic=58468
#include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
#include <cassert>