Skip to content

Instantly share code, notes, and snippets.

@curtismckee
curtismckee / sample.sql
Last active July 5, 2018 17:58
postgresql init example file
CREATE USER username WITH PASSWORD 'password';
CREATE DATABASE database;
CREATE EXTENSION IF NOT EXIST "uuid-ossp";
GRANT ALL PRIVILEGES ON DATABASE database to username;
CREATE TABLE IF NOT EXISTS users (
id SERIAL PRIMARY KEY,

A fresh xUbuntu 18.04 LTS installation

The newest Ubuntu LTS version code named Bionic Beaver was released a few months ago and I thought it was finally time to upgrade. I also thought I would take this opportunity to write down the steps taken for my reference and anyone else who might find it useful.


Making sure all your software is up to date and all per-requisites are installed.

First things first, we want to make sure we are fully up-to-date on our fresh system. This will allow us to install the newest versions of all packages currently installed on the system from the sources file at /etc/apt/sources.list.

sudo apt-get upgrade
@curtismckee
curtismckee / docker-rmi-dangling.md
Created August 7, 2018 18:35
Remove dangling docker images

docker rmi $(docker images -q -f dangling=true)

@curtismckee
curtismckee / LinuxFileSystem.md
Created October 24, 2018 14:49
Linux Files System breakdown

/ - Root Directory

As we all know Linux file system starts with /, the root directory. All other directories are 'children' of this directory. The partition which the root file system resides on is mounted first during boot and the system will not boot if it doesn't find it.


/bin - Essential Binaries

@curtismckee
curtismckee / logs-cmd.md
Last active November 1, 2018 16:06
Tailing AWS EB logs for Rails app

tail -f /var/app/current/log/production.log

@curtismckee
curtismckee / unix-notes.md
Last active September 14, 2019 00:27
Useful commands while working with Unix

Add User:
useradd -m -g [group] -G [additional_group] [username]

The -m flag creates /home directory for user

Expire User:
usermod --expiredate [YYYY-MM-DD] [username]

If user try to login, he or she will get the following message:

Your account has expired; please contact your system administrator Authentication failure

@curtismckee
curtismckee / debian-security.md
Created December 3, 2018 20:28
Guideline for locking down your debian installation to be more secure.

Debian Security Guideline

Encryption/ Device Lock Down

  • Revoke GRUB shell access
  • UEFi setup menu supervisor password protected
  • All Boot devices disabled
  • LUKS hard drive encryption

TPM Module

  • Storing LUKS key and doing pre-boot integrity checks
@curtismckee
curtismckee / git-stash.md
Last active March 9, 2021 02:46
Git Stash Cheatsheet

git stash list

  • Lists all stashes on stack.

git stash apply stash@{0}

  • Applies the changes from stash but does not delete from stack.

git stash pop stash@{3}

  • Applies the changes from stash and deletes from the stack.

git stash -m "Message goes here." -- $(git diff --staged --name-only)