Skip to content

Instantly share code, notes, and snippets.

View cmccormack's full-sized avatar
🔍
Code Reviews

Christopher McCormack cmccormack

🔍
Code Reviews
View GitHub Profile

Setup new Ubuntu 20.04.4LTS deployment with customizations

Initial Setup

Proceed through the initial configuration, entering username and password.

Update packages:

sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get dist-upgrade
@cmccormack
cmccormack / blm.md
Created June 16, 2020 02:30
blm-main

Rename master to main and update remote while setting new upstream

git branch -m master main && git push -u origin main

Make your main branch on Github the default: Settings > Branches > Default Branch

Delete remote master branch

@cmccormack
cmccormack / 0-image-webpack-loader-dependencies.json
Last active March 1, 2019 19:56
image-webpack-loader external binaries
{
"imagemin": "^5.3.1",
"imagemin-gifsicle": "^6.0.0",
"imagemin-mozjpeg": "^8.0.0",
"imagemin-optipng": "^6.0.0",
"imagemin-pngquant": "^6.0.0",
"imagemin-svgo": "^7.0.0",
"imagemin-webp": "^5.0.0",
"loader-utils": "^1.1.0",
"object-assign": "^4.1.1",
@cmccormack
cmccormack / 0-vim.md
Last active November 26, 2018 17:28
VIM Commands and Tools

Vim - Vi IMproved

Vim is a highly configurable text editor for efficiently creating and changing any kind of text. It is included as "vi" with most UNIX systems and with Apple OS X.

Vim is rock stable and is continuously being developed to become even better. Among its features are:

  • persistent, multi-level undo tree
  • extensive plugin system
  • support for hundreds of programming languages and file formats
@cmccormack
cmccormack / 0-fork_and_clone.md
Last active March 27, 2019 10:45
Updating a PR branch with upstream

Fork and Clone the freeCodeCamp Repository

Fork the freeCodeCamp repository

  1. Go to the freeCodeCamp repository on GitHub: https://github.com/freeCodeCamp/freeCodeCamp
  2. Click the "Fork" Button in the upper right hand corner of the interface.
  3. After the repository has been forked, you will be taken to your copy of the freeCodeCamp at https://github.com/YOUR_USER_NAME/freeCodeCamp

Clone your fork locally

@cmccormack
cmccormack / fake.json
Created October 26, 2018 17:10
Fake JSON for testing
{
"url": "https://api.github.com/gists/53e1780a5a68fe9281cfbbc9820d381f",
"forks_url": "https://api.github.com/gists/53e1780a5a68fe9281cfbbc9820d381f/forks",
"commits_url": "https://api.github.com/gists/53e1780a5a68fe9281cfbbc9820d381f/commits",
"id": "53e1780a5a68fe9281cfbbc9820d381f",
"git_pull_url": "https://gist.github.com/53e1780a5a68fe9281cfbbc9820d381f.git",
"git_push_url": "https://gist.github.com/53e1780a5a68fe9281cfbbc9820d381f.git",
"html_url": "https://gist.github.com/53e1780a5a68fe9281cfbbc9820d381f",
"files": {
"forgeLikeServerSetup.md": {
@cmccormack
cmccormack / linux_commands.md
Last active August 30, 2018 15:00
Common Linux commands with examples

tee

The tee utility copies standard input to standard output, making a copy in zero or more files. The output is unbuffered.

Example:

echo "I am the very model of a modern Major General" | tee general.txt
I am the very model of a modern Major General # Output
cat general.txt
I am the very model of a modern Major General # Output
@cmccormack
cmccormack / Linux-Notes.md
Last active August 31, 2018 20:10
Notes on Linux Systems

Linux Boot Process

Bootloaders - Starts the OS:

  • LILO - Linux Loader -
  • GRUB - Grand Unified Bootloader
    • Replaced LILO

initrd - initial RAMDisk

  • Temporary filesystem loaded into memory with helpers that can perform hardware detection and loads modules to get the filesystem mounted
@cmccormack
cmccormack / linux_networking.sh
Last active November 2, 2024 18:23
Linux Networking Commands
# View device IP Address(es)
ip -o address show [interface] | awk '{print $4}' # Prints the IP address(es) of a single interface
ip address # Displays all interfaces
ifconfig # (deprecated)
hostname -I # Displays only IP addresses
# DNS name and resolution
host
dig
/etc/hosts # Add manual DNS record to hostname mappings (normally checked before configured DNS server(s))
@cmccormack
cmccormack / AccurateInterval.js
Created August 3, 2018 17:43
A more accurate timer to replace setInterval
class AccurateInterval {
intervalId = null
constructor(fn, timer) {
this.fn = fn
this.timer = timer
}
start = () => {