Skip to content

Instantly share code, notes, and snippets.

layout title description tags
default
SQL Style Guide
A guide to writing clean, clear, and consistent SQL.
data
process

Purpose

@jwoo92
jwoo92 / Dockerfile
Created February 1, 2022 18:31 — forked from hermanbanken/Dockerfile
Compiling NGINX module as dynamic module for use in docker
FROM nginx:alpine AS builder
# nginx:alpine contains NGINX_VERSION environment variable, like so:
# ENV NGINX_VERSION 1.15.0
# Our NCHAN version
ENV NCHAN_VERSION 1.1.15
# Download sources
RUN wget "http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz" -O nginx.tar.gz && \
@jwoo92
jwoo92 / dump-and-restore-a-database.md
Created April 22, 2020 22:20
Dump And Restore A PostgreSQL Database

Dump And Restore A Database

PostgreSQL comes with two command-line utilities for dumping and then restoring a database -- pg_dump and pg_restore, respectively.

Using the pg_dump with the -Fc flag will create a dump of the given database in a custom format. The output of this command can be redirected into a file (the .dump extension is a standard convention):

@jwoo92
jwoo92 / watch_wal-e.py
Created April 19, 2020 22:25 — forked from mikeyk/watch_wal-e.py
Watch_wal-e script
#! /usr/bin/env python
from boto.ses.connection import SESConnection
import os
import sys
import subprocess
import socket
TMPFILE = '/var/run/postgresql/last-wal-archive-error-file.tmp'
if __name__ == '__main__':
@jwoo92
jwoo92 / getListOfIPV4Address.js
Created February 5, 2020 20:18
Get all IP address of the server
/**
* Get all IP address of the server
* @param {Object|undefined} [{}] - An object.
* @param {Boolean} [obj.skipLocalhost=false] - Determines if the localhost address is returned in the result list
* @return {Array} Array of IPs
*/
const getListOfIPV4Address = ({ skipLocalhost = false } = {}) => {
const os = require('os');
const ifaces = os.networkInterfaces();
@jwoo92
jwoo92 / create-local-trusted-certificate.md
Created December 9, 2019 15:08
Create a trusted certificate for local development on MacOS

Create a trusted certificate for local development on MacOS

1. Copy openSSL config to local temp file

cp /System/Library/OpenSSL/openssl.cnf ~/openssl-temp.cnf

2. Add Subject Alternative Name to openssl-temp.cnf, under [v3_ca]

@jwoo92
jwoo92 / iterm2_shortcuts.md
Last active November 21, 2019 14:46
iTerm2 Shortcut Keys

iTerm2 Shortcut Keys

Instructions

  1. iTerm2 -> Preferences (⌘ + ,)
  2. Click on Profile, select your profile, and open the “Keys” tab
  3. Add the following Global Shortcut Keys

Shortcuts