Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View ericandrewlewis's full-sized avatar

Eric Lewis ericandrewlewis

View GitHub Profile

top (the UNIX process inspector) cheat sheet

This is a list of the most helpful keyboard commands I use within top.

The basics

h shows help on interactive commands. Also see the top manual page

q to quit the program.

@ericandrewlewis
ericandrewlewis / gist:95239573dc97c0e86714
Last active December 12, 2023 09:52
Setting up a WordPress site on AWS

Setting up a WordPress site on AWS

This tutorial walks through setting up AWS infrastructure for WordPress, starting at creating an AWS account. We'll manually provision a single EC2 instance (i.e an AWS virtual machine) to run WordPress using Nginx, PHP-FPM, and MySQL.

This tutorial assumes you're relatively comfortable on the command line and editing system configuration files. It is intended for folks who want a high-level of control and understanding of their infrastructure. It will take about half an hour if you don't Google away at some point.

If you experience any difficulties or have any feedback, leave a comment. 🐬

Coming soon: I'll write another tutorial on a high availability setup for WordPress on AWS, including load-balancing multiple application servers in an auto-scaling group and utilizing RDS.

This cheat sheet is only for the ca65 assembler, and probably not compatible with others

adc - Add to the accumulator

lda #1 ; A = 1
adc #1 ; A = 2
ldx #5 ; X = 5
stx $01 ; memory address $01 = 5
adc $01 ; A = 7
@ericandrewlewis
ericandrewlewis / index.md
Last active November 24, 2023 14:07
C++ Pointer Tutorial

C++ Pointer Tutorial

Because pointers can be ugh

"Regular" variables (not pointers)

To understand a pointer, let's review "regular" variables first. If you're familiar with a programming language without pointers like JavaScript, this is what you think when you hear "variable".

When declaring a variable by identifier (or name), the variable is synonymous with its value.

@ericandrewlewis
ericandrewlewis / index.md
Last active November 11, 2023 18:18
Set up an Ubuntu Web Server on an Intel Nuc, steps and code snippets
@ericandrewlewis
ericandrewlewis / LICENSE
Last active October 19, 2023 14:03
Circles on an Axis in a Static Force Layout
The MIT License (MIT)
Copyright (c) 2016 Eric Andrew Lewis
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
@ericandrewlewis
ericandrewlewis / gist:a5bc6c31b840a556a813
Last active March 18, 2022 08:46
Notes on making a keyboard

Notes on making a keyboard

Instructions for making a 60% keyboard with an abbreviated navigation cluster.

Parts & Tools

  • A keycap is the part of the key that the user touches. It is non-mechanical, it is just a piece of plastic. It sits on top of a switch.
  • A switch is the electro-mechanical component that, when compressed, makes an electronic connection.
  • Switches are wired to a controller, which aggregates keypress info and tells the target device (e.g. Macbook Pro) what to do over USB.
  • Switches sit on either a PCB or a piece of metal.
  • The PCB or piece of metal sits inside a case.
@ericandrewlewis
ericandrewlewis / nginx-application-router.conf
Last active November 21, 2021 08:53
NGINX application router
# Borrowed some configuration from
# https://github.com/h5bp/server-configs-nginx/blob/master/nginx.conf
# Default: nobody nobody
user nginx;
# Sets the worker threads to the number of CPU cores available in the system for best performance.
# Should be > the number of CPU cores.
# Maximum number of connections = worker_processes * worker_connections
# Default: 1
@ericandrewlewis
ericandrewlewis / noip2.service
Last active May 17, 2021 03:08 — forked from NathanGiesbrecht/noip2.service
Systemd Service file for no-ip.com dynamic ip updater
# Simple No-ip.com Dynamic DNS Updater
#
# 1) Install DUC (Dynamic Update Client) and create the configuration file
# as described on noip website https://my.noip.com/#!/dynamic-dns/duc
# 2) Copy this file noip2.service to /etc/systemd/system/
# 3) Execute `sudo systemctl enable noip2`
# 4) Execute `sudo systemctl start noip2`
[Unit]
Description=No-ip.com Dynamic Update Client
@ericandrewlewis
ericandrewlewis / 32.asm
Last active November 24, 2020 08:54 — forked from FiloSottile/32.asm
NASM Hello World for x86 and x86_64 Intel Mac OS X(get yourself an updated nasm with brew)
; /usr/local/bin/nasm -f macho 32.asm && ld -macosx_version_min 10.7.0 -o 32 32.o && ./32
global start
section .text
start:
push dword msg.len
push dword msg
push dword 1
mov eax, 4