Skip to content

Instantly share code, notes, and snippets.

View justinhartman's full-sized avatar
🏠
Working from home

Justin Hartman justinhartman

🏠
Working from home
View GitHub Profile
@justinhartman
justinhartman / 01_nginx-reload-post-hook.sh
Last active January 22, 2026 14:10
Let's Encrypt Certbot post hook command for Nginx which checks the updated configuration files and reloads the server if everything validates.
#!/usr/bin/env bash
#
# Certbot Nginx Reload
#
# Let's Encrypt Certbot post hook command for Nginx which checks the updated
# configuration files and reloads the server if everything validates.
#
# Author : Justin Hartman <code@justinhartman.co>
# Version : 1.0.1
# License : MIT <https://opensource.org/licenses/MIT>
@justinhartman
justinhartman / 01_self-signed-ssl-howto.md
Last active December 12, 2025 09:06
How to create self-signed SSL certificates for localhost that actually works

How to create self-signed SSL certificates for localhost

Option 1

Create a directory in your user root directory where we will store the necessary generated files.

$ cd ~/
$ mkdir .localhost
$ cd .localhost

Now run this single command and you will have both a certificate and private key which was used to sign the certificate.

@justinhartman
justinhartman / 01_introduction.md
Last active March 13, 2025 09:40
Setup Debian 10 LEMP Virtual Machine or Server

How To Install Nginx, MySQL, PHP, Redis and more on a Debian 10 Virtual Machine

This series of documents will configure and setup a Nginx, MySQL, and PHP (LEMP) server on a pretty feature-rich VM running Debian. I used a VM with 8GB RAM and 4 CPU Cores so YMML with some of the settings below.

This will also install other useful packages and configurations like, Redis, Memcached, Node, NPM, Composer, and a fully automated SSL service using certbot for Let's Encrypt.

@justinhartman
justinhartman / 0_introduction.md
Last active July 11, 2023 08:23
Setup Azure Ubuntu 18.04 LEMP VM

How To Install Nginx, MySQL, PHP, SFTP on an Ubuntu Azure Virtual Machine

This series of documents will configure and setup a Nginx, MySQL, and PHP (LEMP) server on a basic Standard B1s (1 vcpus, 1 GiB memory) Ubuntu 16.04 or 18.04 LTS Virtual Machine on Microsoft Azure.

This will also install other useful packages and configurations for SFTP and a fully automated SSL service using certbot for Let's Encrypt.

The B1s is Azure's entry level Linux VM and only comes with 1 GiB memory so

@justinhartman
justinhartman / .bash_aliases
Last active March 8, 2023 12:47
Bash Aliases and Colours
# Bash
alias ls='ls --color=always'
alias ll='ls -lh --color=always'
alias la='ls -lha --color=always'
alias ..='cd ..'
alias ...='cd ...'
alias ....='cd ....'
# Apt
alias apt-update='sudo apt update'
alias apt-upgrade='sudo apt update && sudo apt upgrade'
@justinhartman
justinhartman / lz4-aliases.sh
Created March 6, 2023 16:14
Aliases for creating and extracting LZ4 archives
# Make an LZ4 archive
lz4make () {
tar -c - "${1}" | lz4 - "${1}.tar.lz4"
}
# Extract an LZ4 archive
lz4extract () {
pv "${1}" | lz4 -dc - | tar -x
}
@justinhartman
justinhartman / yarn-npm-replacement.md
Last active August 17, 2022 13:20
Replace NPM with Yarn as global package manager

List installed NPM global packages

$ npm list -g --depth 0
~/.nvm/versions/node/v16.13.2/lib
├── corepack@0.10.0
├── eas-cli@0.52.0
├── expo-cli@5.4.7
├── npm@8.1.2
└── yarn@1.22.18
@justinhartman
justinhartman / fireants-qt5-macos-build.md
Last active October 25, 2021 17:34
Fireants Qt5 macOS build

Build Fireants Qt5 macOS App

Berkley DB 6.2

The v1.0.0.0-g application uses Berkley DB 6.2.38 but there is no version of this to download off Oracle so I had to compile using 6.2.32. You can see my build of this version by viewing this gist

Building the App

With the current main branch cloned I have attempted to build the app with the following:

@justinhartman
justinhartman / compile-db-6.2.32-big-sur.md
Created October 25, 2021 14:00
Compile Berkley DB 6.2.32 on macOS Big Sur

Compile Berkley 6.2.32

There is no 6.2.38 version of DB to download off Oracle so I had to compile using 6.2.32.

Configure

$ wget http://download.oracle.com/berkeley-db/db-6.2.32.tar.gz
$ tar -zxf db-6.2.32.tar.gz
$ cd db-6.2.32/build_unix/
@justinhartman
justinhartman / blessing.md
Last active March 29, 2021 15:34
The most amazing copyright notice, ever!

Copyright Notice for Projects

Instead of a copyright notice contained inside of a source code file, I found the following blessing instead. I want to use this at some point.

*
* The author disclaims copyright to this source code. In place of
* a legal notice, here is a blessing:
*
* May you do good and not evil.