Skip to content

Instantly share code, notes, and snippets.

View abraunton's full-sized avatar

Alex Braunton abraunton

View GitHub Profile
#!/bin/bash
echo 'Provisioning Complete:' $1 $2 $3
#!/bin/bash
echo 'Starting Provision: lb1'
sudo apt-get update
sudo apt-get install -y nginx
sudo service nginx stop
sudo rm -rf /etc/nginx/sites-enabled/default
sudo touch /etc/nginx/sites-enabled/default
echo "upstream testapp {
server 10.0.0.11;
#!/bin/bash
echo 'Starting Provision: web'$1
sudo apt-get update
sudo apt-get install -y nginx
echo "<h1>Machine: web"$1"</h1>" >> /usr/share/nginx/html/index.html
echo 'Provision web'$1 'complete'
@abraunton
abraunton / showdifferences.php
Last active December 30, 2015 00:49
This is a simple PHP function that compares two strings and returns the differences in red. Call the function by using showdifferences("string one", "string two"). This will then show the original string but with the new changes in red and bold.
function showdifference($string1, $string2) {
// Both strings are split up by spaces, each word is now an item in an array.
$string1_array = explode(" ", $string1);
$string2_array = explode(" ", $string2);
// We will count both arrays to see which is the largest (used later).
$s1_count = count($string1_array);
$s2_count = count($string2_array);