Skip to content

Instantly share code, notes, and snippets.

View melchoy's full-sized avatar
👩‍💻

Melissa Choy melchoy

👩‍💻
View GitHub Profile
@melchoy
melchoy / australian-postcodes.sql
Created May 9, 2017 11:39 — forked from randomecho/australian-postcodes.sql
Australian postcodes (with states and suburb names) geocoded with latitude and longitude.
/*
Taken and cribbed from blog.datalicious.com/free-download-all-australian-postcodes-geocod
May contain errors where latitude and longitude are off. Use at own non-validated risk.
*/
SET NAMES utf8;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
DROP TABLE IF EXISTS postcodes_geo;
@melchoy
melchoy / server.md
Created September 14, 2018 00:41 — forked from jtadeulopes/server.md
Server setup with ubuntu, nginx and puma for rails app.

Update and upgrade the system

sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade && sudo apt-get autoremove
sudo reboot

Configure timezone

@melchoy
melchoy / sync-github-to-bitbucket.md
Created November 16, 2019 02:30 — forked from derick-montague/sync-github-to-bitbucket.md
Sync github repo to bitbucket repo

Set up remotes

setup local repo

mkdir myrepository
cd myrepository
git init

add bitbucket remote as "origin"

@melchoy
melchoy / portforwarding.md
Created December 8, 2019 04:49 — forked from kujohn/portforwarding.md
Port forwarding in Mavericks

Port Forwarding in Mavericks


Since Mavericks stopped using the deprecated ipfw (as of Mountain Lion), we'll be using pf to allow port forwarding.

####1. anchor file Create an anchor file under /etc/pf.anchors/<anchor file> with your redirection rule like:

@melchoy
melchoy / unifi_ubuntu_jammy.sh
Created September 23, 2023 07:47 — forked from thimslugga/unifi-ubuntu-jammy.sh
Install Ubiquiti UniFi Controller Software v7.x on Ubuntu 22.04 Jammy
#!/usr/bin/env bash
# Install UniFi Controller Software v7.x on Ubuntu 22.04 (Jammy)
#
# - https://help.ui.com/hc/en-us/articles/360012282453
# - https://help.ui.com/hc/en-us/articles/220066768-UniFi-How-to-Install-and-Update-via-APT-on-Debian-or-Ubuntu
# - https://help.ui.com/hc/en-us/articles/360006634094-UniFi-Repairing-Database-Issues-on-the-UniFi-Network-Application
#
# lxc init -p default -p br0 images:ubuntu/22.04 unifi-controller
# lxc init -p default images:ubuntu/22.04 unifi-controller
@melchoy
melchoy / pre-commit
Created July 28, 2024 04:18
Pre-commit hook to check for ansible encryption
#!/bin/bash
VAULT_DIR="secrets"
EXIT_CODE=0
for file in $(git diff --cached --name-only | grep "^$VAULT_DIR/"); do
if [ ! -f "$file" ]; then
echo "Warning: $file does not exist. Skipping."
continue
fi