Skip to content

Instantly share code, notes, and snippets.

View onnimonni's full-sized avatar

Onni Hakala onnimonni

View GitHub Profile
onnimonni / 0_reuse_code.js
Created June 9, 2017 08:43
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
onnimonni /
Last active August 3, 2016 20:28 — forked from pebo/
envsubst like substitution; only replacing $VAR or ${VAR} if they have a value in in env
# envsubst like substitution; only replacing ${VAR} if they exists
# based on
# source:
while read -r; do
while [[ $REPLY =~ \$(\{([a-zA-Z_][a-zA-Z_0-9]*)\})(.*) ]]; do
if [[ -n ${!BASH_REMATCH[2]} ]]; then
printf %s "${REPLY%"$BASH_REMATCH"}${!BASH_REMATCH[2]}"
printf %s "${REPLY%"$BASH_REMATCH"}\$${BASH_REMATCH[2]}"
onnimonni /
Created July 7, 2016 12:49 — forked from bjornjohansen/
Run all due cron events for WordPress with WP-CLI. Works with both single sites and multisite networks.
# Copyright © 2015 Bjørn Johansen
# This work is free. You can redistribute it and/or modify it under the
# terms of the Do What The Fuck You Want To Public License, Version 2,
# as published by Sam Hocevar. See for more details.
# Source:
# Github:
# This is modified for our container. In this container you don't need to use --path
# because it's automatically included
onnimonni /
Created April 19, 2015 09:20 — forked from kimus/


I use Ubuntu’s Uncomplicated firewall because it is available on Ubuntu and it's very simple.

Install UFW

if ufw is not installed by default be sure to install it first.

View gist:c0e6fcd565fcffe7c6a8