Skip to content

Instantly share code, notes, and snippets.

View anein's full-sized avatar
👨‍🚀
Focusing

Alexander N. anein

👨‍🚀
Focusing
View GitHub Profile
@danielrichman
danielrichman / csrf.py
Last active February 4, 2024 04:14
Flask/Jinja2 CSRF utility functions
import random
from flask import request, session, abort, Markup
@app.template_global('csrf_token')
def csrf_token():
"""
Return the CSRF token for the current session
If not already generated, session["_csrf_token"] is set to a random
string. The token is used for the whole life of the session.
@HardenedArray
HardenedArray / Efficient Encrypted UEFI-Booting Arch Installation
Last active October 22, 2023 12:14
An effcient method to install Arch Linux with encrypted root and swap filesystems and boot from UEFI. Multi-OS, and VirtualBox, UEFI-booting are also supported.
# OBJECTIVE: Install Arch Linux with encrypted root and swap filesystems and boot from UEFI.
# Note this encrypted installation method, while perfectly correct and highly secure, CANNOT support encrypted /boot and
# also CANNOT be subsequently converted to support an encrypted /boot!!! A CLEAN INSTALL will be required!
# Therefore, if you want to have an encrypted /boot or will want an encrypted /boot system at some point in the future,
# please ONLY follow my encrypted /boot installation guide, which lives here: