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 / 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

@drejohnson
drejohnson / arch-linux-install
Created December 20, 2019 00:29 — forked from mattiaslundberg/arch-linux-install
Minimal instructions for installing arch linux on an UEFI system with full system encryption using dm-crypt and luks
# Install ARCH Linux with encrypted file-system and UEFI
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# Download the archiso image from https://www.archlinux.org/
# Copy to a usb-drive
dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration.
# Set swedish keymap
@drejohnson
drejohnson / authentication_with_express_postgres.md
Created December 17, 2019 16:41 — forked from laurenfazah/authentication_with_express_postgres.md
Authentication with an Express API and Postgres

Authentication with an Express API and Postgres

Setting Up

Let's make sure our Express app has the required base modules:

# within root of API
npm install --save express pg knex bcrypt
npm install --save-dev nodemon
@drejohnson
drejohnson / dumb-ap-wired-link.sh
Created August 14, 2019 08:40 — forked from braian87b/dumb-ap-wired-link.sh
How to setup a Dumb AP, Wired backbone for OpenWRT / LEDE
@drejohnson
drejohnson / install.sh
Last active March 18, 2020 12:45
install openwrt router in china
#!/bin/sh
set -e
# you may want upgrade netifd first
# timezone
TIMEZONE=HKT-8
# override shadowsocks server config