Skip to content

Instantly share code, notes, and snippets.

View erikgaal's full-sized avatar

Erik Gaal erikgaal

View GitHub Profile
@erikgaal
erikgaal / find_default
Created July 18, 2022 12:04
Small utility to find keys for preferences on macOS
#!/usr/bin/env bash
app_name=$1
tmp_before=$(mktemp)
defaults read $app_name > $tmp_before
printf "%s" "Make the changes in the app now."
printf "\n%s" "Press any key to continue."
{
"basics": {
"name": "Erik Gaal",
"label": "Full Stack Engineer",
"image": "https://github.com/erikgaal.png",
"email": "me@erikgaal.nl",
"summary": "I'm Erik (he/him), a full stack engineer at Scrn a small digital agency based in Amsterdam, Netherlands. Projects I'm currently working on are almost anything web related to Eurovision and we're launching our first event accreditation platform Accredion soon.",
"location": {
"city": "Rotterdam",
"countryCode": "NL"
opendb () {
[ ! -f .env ] && { echo "No .env file found."; return 1; }
DB_CONNECTION=$(grep DB_CONNECTION .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
DB_HOST=$(grep DB_HOST .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
DB_PORT=$(grep DB_PORT .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
DB_DATABASE=$(grep DB_DATABASE .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
DB_USERNAME=$(grep DB_USERNAME .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
DB_PASSWORD=$(grep DB_PASSWORD .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
@erikgaal
erikgaal / provision.sh
Last active December 6, 2019 08:35
Forge Provision Script for PHP7.4 and Postgres 12
#
# REQUIRES:
# - server (the forge server instance)
# - event (the forge event instance)
# - sudo_password (random password for sudo)
# - db_password (random password for database user)
# - callback (the callback URL)
# - recipe_id (recipe id to run at the end)
#
#!/usr/bin/env python3
import os
import re
import click
import digitalocean
BEGIN = '\n# BEGIN DigitalOcean\n'
END = '# END\n'

Keybase proof

I hereby claim:

  • I am erikgaal on github.
  • I am erikgaal (https://keybase.io/erikgaal) on keybase.
  • I have a public key ASCTGwUIR5hQ4hrkprm7LEuiG5ybiL_TSecCEJ4gSAn71Qo

To claim this, I am signing this object: