Skip to content

Instantly share code, notes, and snippets.

View Lewiscowles1986's full-sized avatar
🤓

Lewis Cowles Lewiscowles1986

🤓
View GitHub Profile
@Lewiscowles1986
Lewiscowles1986 / rPi3-mariadb-10.1.sh
Last active November 24, 2020 06:21
Raspberry Pi MariaDB 10.1 with Galera Cluster build
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Must be root"
exit
fi
apt-get update -y
apt-get upgrade -y
apt-get dist-upgrade -y
@Lewiscowles1986
Lewiscowles1986 / setup.sh
Created June 29, 2016 21:15
Alphagov calculators deploy...
#!/bin/bash
sudo apt-get update
sudo apt-get remove --purge ruby -y
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
curl -sSL https://get.rvm.io | bash -s stable
export PATH="$PATH:$HOME/.rvm/bin"
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.2/install.sh | bash
export NVM_DIR="/home/vagrant/.nvm"
@Lewiscowles1986
Lewiscowles1986 / migrate.sh
Created August 2, 2016 11:56
WordPress Migrate Site
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Must be root"
exit
fi
if[ $# -ne 3 ]; then
echo "Sorry, we need both the source site, and the destination site"
echo "Usage:"
@Lewiscowles1986
Lewiscowles1986 / checkout.py
Last active August 10, 2016 08:43
interview example in python
import copy
from items import CheckoutItem
from discounts import ItemDiscount
class Checkout(object):
def __init__(self):
self.items = {}
self.offers = []
@Lewiscowles1986
Lewiscowles1986 / adapter-passthrough
Last active March 11, 2019 20:27
Allows passthrough for bridges, wireless access-point's and range extenders
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Must be root"
exit
fi
ADAPTER="eth0"
# Allow overriding from eth0 by passing in a single argument
@Lewiscowles1986
Lewiscowles1986 / jenkinsfile
Created October 20, 2016 13:18
PHP Jenkins Unit Test Pipeline Basic PHP-Ulid
node {
stage('Cleanup') {
sh 'rm -rf ./*'
}
stage('Fetch from GitHub') {
sh 'git clone https://github.com/Lewiscowles1986/ulid'
}
stage('Get Composer') {
sh 'wget -q http://getcomposer.org/download/1.2.1/composer.phar'
}
@Lewiscowles1986
Lewiscowles1986 / Dockerfile
Last active May 7, 2022 12:18
Bigcommerce Stencil Dockerfile
FROM ubuntu:xenial
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
RUN apt-get update -qq
RUN apt-get install -y -qq git curl python python-pip build-essential
RUN pip install virtualenv
ENV NVM_DIR /usr/local/nvm
ENV NODE_VERSION 4.1.2
@Lewiscowles1986
Lewiscowles1986 / install.sh
Last active October 28, 2016 12:46
Install Go 1.7.3
#!/bin/bash
wget https://storage.googleapis.com/golang/go1.7.3.linux-amd64.tar.gz
tar -xvf go1.7.3.linux-amd64.tar.gz
sudo mv go /opt/go
sudo cat > /etc/profile.d/go.sh <<EOF
export GOROOT=/opt/go
export PATH=\$PATH:\$GOROOT/bin
EOF
@Lewiscowles1986
Lewiscowles1986 / merry-xmas.py
Created November 12, 2016 02:23
Merry Christmas PyGame
import pygame
import random
class Snowfield():
def __init__(self, density, speed, size, color, bounds, pygame, screen):
self.color = color
self.flakes = []
self.speed = speed
self.size = size
@Lewiscowles1986
Lewiscowles1986 / swagger.yaml
Created December 6, 2016 05:11
Useless Swagger - What I imagine most start off with
swagger: '2.0'
info:
title: Testing Swagger
description: This is a test repo
version: "1.0.0"
# the domain of the service
host: api.codesign2.co.uk
# array of all schemes that your API supports
schemes:
- https