Skip to content

Instantly share code, notes, and snippets.

View keithmorris's full-sized avatar

Keith Morris keithmorris

  • Athens, Georgia USA
View GitHub Profile
@keithmorris
keithmorris / remove_closing_tags.sh
Created January 9, 2018 15:55 — forked from lorenzo/remove_closing_tags.sh
Script to remove all closing ?> php tags in a folder
#!/bin/bash
# vim:ft=sh:ts=3:sts=3:sw=3:et:
###
# Strips the closing php tag `?>` and any following blank lines from the
# end of any PHP file in the current working directory and sub-directories. Files
# with non-whitespace characters following the closing tag will not be affected.
#
# Author: Bryan C. Geraghty <bryan@ravensight.org>
# Date: 2009-10-28
@keithmorris
keithmorris / keybase.md
Created January 1, 2018 14:18
keybase.md

Keybase proof

I hereby claim:

  • I am keithmorris on github.
  • I am keithmorris (https://keybase.io/keithmorris) on keybase.
  • I have a public key ASDSFHRtkRNgkJAOWcOCZFH09qOvlczUMwZQA5xOSTNhswo

To claim this, I am signing this object:

@keithmorris
keithmorris / nginx-s3.conf
Created October 17, 2017 16:18 — forked from surjikal/nginx-s3.conf
Nginx - Wildcard subdomains, basic auth and proxying to s3. Set a policy to only allow your server's IP.
server {
listen 80;
server_name *.foo.example.com;
# We need this to resolve the host, because it's a wildcard.
# This is google's DNS server.
resolver 8.8.8.8;
include /etc/nginx/includes/proxy.conf;
@keithmorris
keithmorris / drive-format-ubuntu.md
Last active May 1, 2024 12:39
Partition, format, and mount a drive on Ubuntu
@keithmorris
keithmorris / backup-excludes.txt
Last active August 29, 2015 14:06
backup-excludes
*/.Trash
.Spotlight-*/
.Trash
.Trashes
/.DocumentRevisions-V100
/.file
/.fseventsd
/.PKInstallSandboxManager
/.Spotlight-V100
/.vol
@keithmorris
keithmorris / backup.sh
Last active June 5, 2017 10:59
OSX Rsync Backup to External Drive
#!/bin/bash
src=/Users/kmorris
backupPath=/Volumes/Backups/backups
date=`date "+%Y-%m-%dT%H%M%S"`
dirname=backup_$date
excludeFile=/Users/kmorris/bin/backup-excludes.txt
rsync -aAXPlv --exclude-from=$excludeFile --link-dest=$backupPath/latest $src $backupPath/$dirname
rm -f $backupPath/latest
@keithmorris
keithmorris / gini
Created June 19, 2014 21:14
Simple shell script to initialize a Git repository, create an initial commit, add origin server, create a develop branch and push to the server
#!/usr/bin/env bash
git init .
touch .gitignore
git add --all
git commit -m"initial commit"
git remote add origin $1
git branch develop
git push origin --all
@keithmorris
keithmorris / reanme-dev.sh
Created May 29, 2014 01:27
Rename multiple files from command prompt
for i in .ebextensions/*.dev.yaml; do cp "$i" "`echo $i | sed 's/\.dev\.yaml/\.config/g'`"; done
@keithmorris
keithmorris / password.config
Created May 28, 2014 13:40
AWS Password protection
files:
"/etc/httpd/conf.d/allow_override.conf":
mode: "000644"
owner: ec2-user
group: ec2-user
encoding: plain
content: |
<Directory /var/www/html/myproject/>
AllowOverride AuthConfig
</Directory>
@keithmorris
keithmorris / zip-em-up.sh
Created May 27, 2014 23:05
Zip files in current directory excluding .git*
zip -r -9 gpb-test.zip . -x ".git*"