Skip to content

Instantly share code, notes, and snippets.

View leesiongchan's full-sized avatar
🦀

Lee Siong Chan leesiongchan

🦀
View GitHub Profile
@leesiongchan
leesiongchan / add_floating_route.sh
Created June 26, 2019 10:38 — forked from eagafonov/add_floating_route.sh
[DigitalOcean] Simple script to route outgoing traffic through Floating IP
#!/bin/bash -x
set -e
# https://www.digitalocean.com/community/tutorials/how-to-use-floating-ips-on-digitalocean
# more info: https://www.digitalocean.com/community/questions/send-outbound-traffic-over-floating-ip
DESTINATION_IP=$1
shift || (echo "E: Destination IP is not provided. Aborting"; exit 1)
ANCHOR_GW=$(curl -s http://169.254.169.254/metadata/v1/interfaces/public/0/anchor_ipv4/gateway)
@leesiongchan
leesiongchan / initial_server.sh
Created May 14, 2019 14:50
New server setup script
#!/bin/bash
set -euo pipefail
# Create swapfile
sudo fallocate -l 7G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
---
kind: Deployment
apiVersion: extensions/v1beta1
metadata:
name: stilton
labels:
app: cheese
cheese: stilton
spec:
replicas: 2

Keybase proof

I hereby claim:

  • I am leesiongchan on github.
  • I am leesiongchan (https://keybase.io/leesiongchan) on keybase.
  • I have a public key ASBj1WfY7UfTAki_ecJ-hmlaHqIyfmQnTapRJWRagXzkrAo

To claim this, I am signing this object:

@leesiongchan
leesiongchan / .env
Created April 7, 2018 13:53
Docker Compose + Wordpress + Traefik
MYSQL_ROOT_PASSWORD=
MYSQL_DATABASE=wordpress
MYSQL_USER=wordpress
MYSQL_PASSWORD=
WORDPRESS_DB_HOST=db
WORDPRESS_DB_PASSWORD=
WORDPRESS_DB_USER=wordpress