Skip to content

Instantly share code, notes, and snippets.

View drejohnson's full-sized avatar

DeAndre Johnson drejohnson

View GitHub Profile
@drejohnson
drejohnson / csallseeingeye.py
Created September 19, 2023 17:49 — forked from wanghailei/csallseeingeye.py
Code snippets of All Seeing Eye
# The following code and the code generated art works are the intellectrual properities of Hailei Wang.
# © 2009 - 2014, Hailei Wang. All rights reserved.
from nodebox import geo
colors = ximport("colors")
# Define Brush
def composeimage( x, y, colr, radius, points, diminish ) :
nofill()
stroke()
@drejohnson
drejohnson / next-auth-fauna-adapter.ts
Created January 24, 2021 04:50
faunadb adapter for next-auth in typescript
import { query as q } from 'faunadb';
import { createHash, randomBytes } from 'crypto';
import type {
EmailSessionProvider,
Profile,
Session,
} from 'next-auth/adapters';
import type { AppOptions, User } from 'next-auth';
import { SessionProvider } from 'next-auth/client';
@drejohnson
drejohnson / machine.js
Created January 1, 2021 01:18
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@drejohnson
drejohnson / machine.js
Created January 1, 2021 00:31
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
#!/bin/bash
encryption_passphrase=""
root_password=""
user_password=""
hostname=""
user_name=""
continent_city=""
swap_size="16"
@drejohnson
drejohnson / Thinkpad-X1-CarbonGen7.md
Created February 3, 2020 08:35 — forked from codemodify/Thinkpad-X1-CarbonGen7.md
Arch Linux on Thinkpad X1 Carbon Gen 7 (i7-10710U)

Arch Linux on Thinkpad X1 Carbon Gen 7 (i7-10710U)

  • Download the latest ISO from https://www.archlinux.org/download
  • sudo dd if=archlinux-2019.11.01-x86_64.iso of=/dev/sda bs=4M status=progress oflag=sync
  • Boot the ISO
  • IF and ONLY IF you have a 4k or some HiDPI screen and fonts are super super small
    • ls /usr/share/kbd/consolefonts
    • setfont latarcyrheb-sun32
  • ls /sys/firmware/efi/efivars verifies we booted in UEFI
@drejohnson
drejohnson / arch-linux.txt
Created February 3, 2020 08:34 — forked from woopstar/arch-linux.txt
Efficient UEFI Encrypted Root and Swap Arch Linux Installation Procedure with an ENCRYPTED BOOT using KDE Plasma 5
# This guide will be using LVM on LUKS, see https://wiki.archlinux.org/index.php/Dm-crypt/Encrypting_an_entire_system#LVM_on_LUKS
# Download the archlinux-*.iso image from https://www.archlinux.org/download/ and its GnuPG signature.
# Use gpg --verify to ensure your archlinux-*.iso is exactly what the Arch developers intended. For example:
$ gpg -v archlinux-2019.11.01-x86_64.iso.sig
# Burn the archlinux-*.iso to a 1+ Gb USB stick. On Mac, do something like:
$ diskutil unmountDisk /dev/disk4
$ sudo dd bs=4m of=/dev/rdisk4 if=archlinux-2020.01.01-x86_64.iso
@drejohnson
drejohnson / arch-linux.txt
Created February 3, 2020 08:34 — forked from woopstar/arch-linux.txt
Efficient UEFI Encrypted Root and Swap Arch Linux Installation Procedure with an ENCRYPTED BOOT using KDE Plasma 5
# This guide will be using LVM on LUKS, see https://wiki.archlinux.org/index.php/Dm-crypt/Encrypting_an_entire_system#LVM_on_LUKS
# Download the archlinux-*.iso image from https://www.archlinux.org/download/ and its GnuPG signature.
# Use gpg --verify to ensure your archlinux-*.iso is exactly what the Arch developers intended. For example:
$ gpg -v archlinux-2019.11.01-x86_64.iso.sig
# Burn the archlinux-*.iso to a 1+ Gb USB stick. On Mac, do something like:
$ diskutil unmountDisk /dev/disk4
$ sudo dd bs=4m of=/dev/rdisk4 if=archlinux-2020.01.01-x86_64.iso
@drejohnson
drejohnson / app.js
Created January 7, 2020 16:14 — forked from joshnuss/app.js
Express.js role-based permissions middleware
// the main app file
import express from "express";
import loadDb from "./loadDb"; // dummy middleware to load db (sets request.db)
import authenticate from "./authentication"; // middleware for doing authentication
import permit from "./permission"; // middleware for checking if user's role is permitted to make request
const app = express(),
api = express.Router();
// first middleware will setup db connection
@drejohnson
drejohnson / Installing Arch on a ThinkPad X1 Extreme.md
Created December 20, 2019 05:28 — forked from CodingCellist/Installing-Arch-on-a-ThinkPad-X1-Extreme-Gen-1.md
A detailed overview of how I installed Arch Linux on my Lenovo ThinkPad X1 Extreme, having never installed Arch before.

DISCLAIMER

I am not responsible for any damages, loss of data, system corruption, or any other mishap you may somehow cause by following this guide.

This is mainly a step-by-step reminder/log for myself of how I installed Arch on my laptop. I am putting this out there in case it is useful for someone else, it is not intended to be an official guide. As a result, you may find that this guide is very tedious or lists a lot of unnecessary/intuitive steps or just straight up does things in a way that is considered bad practice. Apart from the latter, this is intentional, as I did not find these steps intuitive at all when