Skip to content

Instantly share code, notes, and snippets.

View nielsmaerten's full-sized avatar

Niels Maerten nielsmaerten

View GitHub Profile
@nielsmaerten
nielsmaerten / nightscout-backup.sh
Created August 11, 2022 15:39
A script to help me export the entries from my main Nightscout DB to a serverless instance for archiving.
##############################
## NIGHTSCOUT BACKUP SCRIPT ##
##############################
# I'm using an Atlas DB called 'nightscout-cluster' at the time of writing.
# This DB is limited to 500MB so every now and then,
# I want pump its records over to 'serverlessnightscout' (a serverless Atlas DB), which is unlimited.
# If Nightscout ever starts supporting serverless databases, I can just update the
# connectionstring in Heroku, and start using the unlimited one.
@nielsmaerten
nielsmaerten / deploy-hooks.js
Created December 15, 2021 16:09
Deploy hooks for Firebase Functions + Yarn Workspaces
#!/usr/bin/env node
/**
* @description Firebase Functions Workspace Deploy Hooks
* @author Niels Maerten <https://github.com/nielsmaerten>
* @license MIT
*
* This script is designed for Yarn v3 workspaces.
*
* ### WHAT DOES THIS SCRIPT DO? ###
@nielsmaerten
nielsmaerten / .info.md
Created May 4, 2020 16:32
Devcontainer for Node in VS Code

Node Devcontainer for VSCode

  • This container definition has an anonymous volume that will mount to /workspace/node_modules.
    This drastically improves IO performance :)
  • yarn install && touch node_modules/.gitkeep runs post container creation
    Commit the .gitkeep to source control, but leave the rest of node_modules ignored.
    This is because the folder needs to exist for it to be mountable
@nielsmaerten
nielsmaerten / ! Mongo+TLS on Docker.md
Last active June 7, 2024 15:04
MongoDB + MongoExpress over TLS on Docker

Secure MongoDB on Docker (incl MongoExpress, Let's Encrypt)

This gist contains files and instructions to setup MongoDB on a simple docker host.
Connections to Mongo are secured using TLS, and the certificate is signed using Let's Encrypt.
MongoExpress is included as well, but should only be used over an SSH tunnel.

  1. Update .env

  2. Make sure docker-compose is available

Required on GCP Cloud Optimized OS

@nielsmaerten
nielsmaerten / ! Wordpress on Docker.md
Last active February 28, 2020 15:53
Blog Ruben Foquet

Wordpress (with full HTTPS) on Docker

Instuctions and files to set up Wordpress on a simple Docker host.
Wordpress sits behind a HTTPS reverse proxy (nginx) which can be signed by Let's Encrypt.

1. Spin up a new VM on Google Compute Engine:

  • start with a micro instance, we can always increase it later **
  • use Container Optimized OS, and a 10GB disk
  • no need to reserve a static IP, we will use DDNS instead
  • enable deletion protection

Keybase proof

I hereby claim:

  • I am nielsmaerten on github.
  • I am nielsmaerten (https://keybase.io/nielsmaerten) on keybase.
  • I have a public key ASBCfl-SakSQKsOd-Q-s7ycA3mbyTHS2tqlcOXt8hcZ59go

To claim this, I am signing this object: