Skip to content

Instantly share code, notes, and snippets.


General Zod olen2006

  • Solar System, Earth
View GitHub Profile
npearce /
Last active June 8, 2023 16:48
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See:

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
nikhita /
Last active June 8, 2023 13:48
How to update the Go version

How to update the Go version

System: Debian/Ubuntu/Fedora. Might work for others as well.

1. Uninstall the exisiting version

As mentioned here, to update a go version you will first need to uninstall the original version.

To uninstall, delete the /usr/local/go directory by:

bradmontgomery / install-comodo-ssl-cert-for-nginx.rst
Last active June 7, 2023 19:56
Steps to install a Comodo PositiveSSL certificate with Nginx.
View install-comodo-ssl-cert-for-nginx.rst

Setting up a SSL Cert from Comodo

I use as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

fevangelou / my.cnf
Last active June 7, 2023 15:19
Optimized my.cnf configuration for MySQL/MariaDB (on Ubuntu, CentOS, Almalinux etc. servers)
View my.cnf
# === Optimized my.cnf configuration for MySQL/MariaDB (on Ubuntu, CentOS, Almalinux etc. servers) ===
# by Fotis Evangelou, developer of Engintron (
# ~ Updated December 2021 ~
# The settings provided below are a starting point for a 8-16 GB RAM server with 4-8 CPU cores.
# If you have different resources available you should adjust accordingly to save CPU, RAM & disk I/O usage.
afloesch /
Last active May 23, 2023 18:41
Jenkins in Docker (docker-in-docker)

Jenkins in Docker (docker-in-docker)

Testing Jenkins flows on your local machine, or running Jenkins in production in a docker container can be a little tricky with a docker-in-docker scenario. You could install Jenkins to avoid any docker-in-docker issues, but then you have Jenkins on your machine, and the local environment is likely going to be a fairly different from the actual production build servers, which can lead to annoying and time-consuming issues to debug.

Build environment differences are precisely why there is a strong argument to be made to run build processes strictly in docker containers. If we follow the philosophy that every build step or action should run in a docker container, even the Jenkins server itself, then we get massive benefits from things like, total control over the build environment, easily modify the build environment without the possibility of adversely effecting other jobs, explicit and strongly controlled tool versions,

duluca /
Last active May 5, 2023 15:11
Step-by-step Instructions to Setup an AWS ECS Cluster

Configuring AWS ECS to have access to AWS EFS

If you would like to persist data from your ECS containers, i.e. hosting databases like MySQL or MongoDB with Docker, you need to ensure that you can mount the data directory of the database in the container to volume that's not going to dissappear when your container or worse yet, the EC2 instance that hosts your containers, is restarted or scaled up or down for any reason.

Don't know how to create your own AWS ECS Cluster? Go here!

New Cluster

Sadly the EC2 provisioning process doesn't allow you to configure EFS during the initial config. After your create your cluster, follow the guide below.

New Task Definition for Web App

If you're using an Alpine-based Node server like duluca/minimal-node-web-server follow this guide:

gavinhungry / nginx-tls.conf
Last active April 26, 2023 02:04
Nginx SSL/TLS configuration for "A+" Qualys SSL Labs rating
View nginx-tls.conf
# Name: nginx-tls.conf
# Auth: Gavin Lloyd <>
# Desc: Nginx SSL/TLS configuration for "A+" Qualys SSL Labs rating
# Enables HTTP/2, PFS, HSTS and OCSP stapling. Configuration options not related
# to SSL/TLS are not included here.
# Additional tips:
lukeplausin /
Last active April 15, 2023 16:36
AWS, JQ and bash command cheat sheet. How to query, cut and munge things in JSON generally.
# Count total EBS based storage in AWS
aws ec2 describe-volumes | jq "[.Volumes[].Size] | add"
# Count total EBS storage with a tag filter
aws ec2 describe-volumes --filters "Name=tag:Name,Values=CloudEndure Volume qjenc" | jq "[.Volumes[].Size] | add"
# Describe instances concisely
aws ec2 describe-instances | jq '[.Reservations | .[] | .Instances | .[] | {InstanceId: .InstanceId, State: .State, SubnetId: .SubnetId, VpcId: .VpcId, Name: (.Tags[]|select(.Key=="Name")|.Value)}]'
# Wait until $instance_id is running and then immediately stop it again
aws ec2 wait instance-running --instance-id $instance_id && aws ec2 stop-instances --instance-id $instance_id
# Get 10th instance in the account
lesstif /
Last active March 28, 2023 12:51
openssl 1.1 & nginx compile script for TLS 1.3 support on RHEL/CentOS 7
## nginx
if [ ! -f "${NGINX}" ];then
ND=$(basename $NGINX .tar.gz)
epicserve /
Last active March 11, 2023 14:04
Example Terraform file for importing DNS Records from DigitalOcean
digitalocean_record.example,<DO ID>
digitalocean_record.fd-gmail-txt,<DO ID>
digitalocean_record.fd-mx[""],<DO ID>
digitalocean_record.fd-mx[""],<DO ID>
digitalocean_record.fd-mx[""],<DO ID>
digitalocean_record.fd-mx[""],<DO ID>
digitalocean_record.fd-mx[""],<DO ID>
digitalocean_record.fd-ns["1"],<DO ID>
digitalocean_record.fd-ns["2"],<DO ID>