Skip to content

Instantly share code, notes, and snippets.

@wolfeidau
wolfeidau / awssetup.md
Last active February 12, 2019 14:32
Kubernetes Setup Guide

This is a simple guide to getting up and running with kubernetes on AWS.

Install the aws CLI.

brew install awscli

Setup a profile in the aws CLI and enter some credentials, I create an IAM account in my AWS and give it admin, then generate some credentials.

service postgresql stop # Stop the server first
rm -rf /var/lib/postgresql/9.4/main # Remove the data directory
envdir /etc/wal-e.d/env /usr/local/bin/wal-e backup-fetch /var/lib/postgresql/9.4/main LATEST # Fetch the backup
restore_command = '/usr/bin/envdir /etc/wal-e.d/env /usr/local/bin/wal-e wal-fetch %f %p' # Create recovery.conf inside data directory
service postgresql start # Start the server
@juliandunn
juliandunn / postgresql-on-aws-tips.md
Last active September 27, 2022 10:55
Notes on PostgreSQL performance optimization on RDS

Deep Dive: PostgreSQL on AWS

When loading data

  • disable backups (backup_retention=0)
  • disable multi-AZ and autovacuum
  • pg_dump -Fc (compressed) and pg_restore -j (parallel)
  • Increase maintenance_work_mem
@dysinger
dysinger / aws-cfn-coreos-kubernetes.json
Last active December 6, 2024 10:55
CoreOS Kubernetes on AWS CloudFormation
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "CoreOS on EC2: http://coreos.com/docs/running-coreos/cloud-providers/ec2/",
"Mappings": {
"RegionMap": {
"ap-northeast-1": {
"AMI": "ami-f9b08ff8"
},
"ap-southeast-1": {
"AMI": "ami-c24f6c90"
@aarroyoc
aarroyoc / apt-ftparchive.conf
Last active April 4, 2025 19:32
Debian/Ubuntu repo using apt-ftparchive
Dir {
ArchiveDir "./debian";
CacheDir "./cache";
};
Default {
Packages::Compress ". gzip bzip2";
Sources::Compress ". gzip bzip2";
Contents::Compress ". gzip bzip2";
};
TreeDefault {
@grugq
grugq / gist:03167bed45e774551155
Last active April 15, 2025 11:22
operational pgp - draft

Operational PGP

This is a guide on how to email securely.

There are many guides on how to install and use PGP to encrypt email. This is not one of them. This is a guide on secure communication using email with PGP encryption. If you are not familiar with PGP, please read another guide first. If you are comfortable using PGP to encrypt and decrypt emails, this guide will raise your security to the next level.

@gravyboat
gravyboat / .aptly.conf
Created August 11, 2014 22:15
aptly formula
{
"rootDir": "{{ salt['pillar.get']('aptly:rootdir') }}",
"downloadConcurrency": 4,
"architectures": [],
"dependencyFollowSuggests": false,
"dependencyFollowRecommends": false,
"dependencyFollowAllVariants": false,
"dependencyFollowSource": false,
"gpgDisableSign": false,
"gpgDisableVerify": false,
@claws
claws / zmq.sls
Created July 12, 2014 12:10
This gist shows a method for using Saltstack to automate the build and install of libsodium, libzmq, czmq and pyzmq. This state can be used to keep the ZMQ stack up to date.
#
# Author: Chris Laws
#
# This saltstack state automates the build and install of the
# current version of the Github master branch for libsodium,
# libzmq, czmq and pyzmq (for both python2 and python3).
#
# This state is part of a suite of states I use to recreate my
# development machine and keep it up to date. It contains some
# configuration instructions that slightly beyond the common
@brenopolanski
brenopolanski / merge-pdf-ghostscript.md
Last active April 25, 2025 03:15
Merge multiple PDFs using Ghostscript

A simple Ghostscript command to merge two PDFs in a single file is shown below:

gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=combine.pdf -dBATCH 1.pdf 2.pdf

Install Ghostscript:

Type the command sudo apt-get install ghostscript to download and install the ghostscript package and all of the packages it depends on.

@joostrijneveld
joostrijneveld / gpg2qrcodes.sh
Created May 20, 2014 19:43
Producing printable QR codes for persistent storage of GPG private keys
# Heavily depends on:
# libqrencode (fukuchi.org/works/qrencode/)
# paperkey (jabberwocky.com/software/paperkey/)
# zbar (zbar.sourceforge.net)
# Producing the QR codes:
# Split over 4 codes to ensure the data per image is not too large.
gpg --export-secret-key KEYIDGOESHERE | paperkey --output-type raw | base64 > temp
split temp -n 4 IMG
for f in IMG*; do cat $f | qrencode -o $f.png; done