Skip to content

Instantly share code, notes, and snippets.

View derrekbertrand's full-sized avatar

Derrek Bertrand derrekbertrand

View GitHub Profile
@derrekbertrand
derrekbertrand / pre-receive.sh
Created November 25, 2025 23:40
Server Git Hooks
#!/bin/bash
# todo: single commit? CI stuff?
while read old_commit new_commit ref
do
if [ "$old_commit" == "0000000000000000000000000000000000000000" ]; then
range=$new_commit
else
range=$old_commit..$new_commit
@derrekbertrand
derrekbertrand / lemp.sh
Created October 23, 2017 15:13
LEMP on Ubuntu 16.04
#!/usr/bin/env bash
# This installs a multi tenant Nginx setup with PHP FPM 7.1 and MariaDB
# it is suitable for Laravel 5.5
# THIS IS NOT A SCRIPT PER SE!
# THE COMMENTS MAY HAVE INSTRUCTIONS TOO!
# USING: Digital Ocean's vanilla Ubuntu 16.04 droplet
#----------------------------------------------------------
# SECURITY CONCERNS
#----------------------------------------------------------
@derrekbertrand
derrekbertrand / nginx_install.sh
Last active February 17, 2017 22:04
A CentOS 7 Security basics checklist.
#!/usr/bin/bash
NGINX_NPROC=`nproc`
NGINX_RPMREPO=https://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
#set up the repo
wget -qO nginx.rpm $NGINX_RPMREPO
yum install -y nginx.rpm > /dev/null
rm nginx.rpm
@derrekbertrand
derrekbertrand / Checklist.md
Last active November 11, 2021 05:49
Security Checklist for using Laravel on Digital Ocean's LEMP app

Security Checklist

For setting up laravel on Ubuntu 14.04. Assumes using DO's LEMP image to start.

To start:

  • Install and update new software:
    • Run apt-get update
  • Run apt-get install php5-cli php5-mcrypt git