Skip to content

Instantly share code, notes, and snippets.

View jonathonsim's full-sized avatar

Jonathon Sim jonathonsim

View GitHub Profile
[idealstack]
aws_account_id = 440805312024
[idealstackidentity]
role_arn = arn:aws:iam::440805312024:role/IdealstackAdminRole
source_profile = idealstack
region = us-west-2
color = 3D9970
[idealstacksandpit]
[idealstack]
aws_account_id = 440805312024
[idealstackidentity]
role_arn = arn:aws:iam::440805312024:role/IdealstackAdminRole
source_profile = idealstack
region = us-west-2
color = 3D9970
[idealstacksandpit]
@jonathonsim
jonathonsim / .htaccess
Last active April 14, 2020 00:11
Redirect http requests to https
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP:X-Forwarded-Proto} !https [NC]
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
@jonathonsim
jonathonsim / install-test-moodle.sh
Last active January 14, 2020 22:18
install a simple test version of moodle
#Install moodle via commandline
if [[ -z $5 ]]; then
echo "Usage $0 url dbhost dbname dbuser dbpass"
exit 1
fi
cd ~
curl -O https://download.moodle.org/download.php/direct/stable38/moodle-3.8.1.tgz
tar -xzf moodle-3.8.1.tgz
shopt -s dotglob nullglob
@jonathonsim
jonathonsim / install-test-wp.sh
Last active January 14, 2020 22:17
Sript to install a test copy of wp for benchmarking and testing. Usage is ` curl https://gist.githubusercontent.com/jonathonsim/09b9fc5ca9c387fed01cdcb618df1520/raw/install-test-wp.sh | bash -s -- wpdb dbuser dbpass`
#!/bin/bash
if [[ -z $5 ]]; then
echo "Usage $0 url dbhost dbname dbuser dbpass"
exit 1
fi
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
chmod +x wp-cli.phar
mkdir ~/bin
@jonathonsim
jonathonsim / deploy.sh
Last active February 7, 2019 03:21
Idealstack Deployment example
#!/bin/bash
#Copyright 2017-2019, Idealstack Limited
#
#Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
#documentation files (the "Software"), to deal in the Software without restriction, including without limitation
#the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
#and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
#
#The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
#
<?php
/**
* Idealstack Healthcheck.
*
* This file is checked by the load balancer to see whether the site is healthy.
* If it returns a 500 error the site is considered unhealthy, and the site's container
* will be rebooted.
*
* This default check doesn't do much except check that PHP is running.
* You can customise this file to check other important resources
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowDuplicity",
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:GetObject",
"s3:ListBucket",
@jonathonsim
jonathonsim / setup_xenial_lamp_php5.sh
Last active January 18, 2018 21:01
Setup a php5 LAMP environment on ubuntu xenial. Used in various vagrant boxes
#To run this add something like this to your Vagrantfile:
#
#
# config.vm.provision "shell", inline: <<-SHELL
# #Install LAMP stack
# export VAGRANT_DIR=/vagrant
# curl https://gist.githubusercontent.com/jonathonsim/ac13a63a38ffdbe831246ab809d97158/raw/ | bash
# SHELL
#
#
@jonathonsim
jonathonsim / keychain
Created November 17, 2017 00:46
keychain
#!/bin/sh
# Copyright 1999-2005 Gentoo Foundation
# Copyright 2007 Aron Griffis <agriffis@n01se.net>
# Copyright 2009-2010 Funtoo Technologies, LLC
# lockfile() Copyright 2009 Parallels, Inc.
# Distributed under the terms of the GNU General Public License v2
# Originally authored by Daniel Robbins <drobbins@gentoo.org>