Skip to content

Instantly share code, notes, and snippets.

View jmillerdesign's full-sized avatar

J. Miller jmillerdesign

View GitHub Profile
@jmillerdesign
jmillerdesign / password-generator.sh
Created August 21, 2018 23:31
Random password generator
#!/usr/bin/env bash
# Example: lKJjF7cP9V-6GcNOJQJX9
function pw() {
string=$(LC_ALL=C tr -dc "a-zA-Z0-9" < /dev/urandom | head -c 20)
echo ${string:0:10}-${string:10:10}
}
@jmillerdesign
jmillerdesign / remove_real_emails.sql
Created April 19, 2017 06:53
Remove real email addresses from a dev database
UPDATE `users` SET `email` = CONCAT('dev-', `id`, '@example.com');
@jmillerdesign
jmillerdesign / README.md
Last active December 14, 2016 16:51 — forked from lopezjurip/README.md
OSX Homebrew: docker-machine setup

Prerequisites

Make sure you have installed Homebrew and (Homebrew-Cask)[http://caskroom.io/].

# Install Homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

# Install Homebrew-cask
brew install caskroom/cask/brew-cask
@jmillerdesign
jmillerdesign / docker-compose.yml
Created April 15, 2016 21:53
nginx-proxy letsencrypt-nginx-proxy-companion docker-compose
nginxproxy:
image: jwilder/nginx-proxy:latest
ports:
- 80:80
- 443:443
volumes:
- /root/certs:/etc/nginx/certs:ro
- /etc/nginx/vhost.d
- /usr/share/nginx/html
- /var/run/docker.sock:/tmp/docker.sock:ro
@jmillerdesign
jmillerdesign / list-symlinks.sh
Created January 21, 2016 20:19
List all symlinks recursively from current directory
#!/bin/bash
PATH=/usr/sbin:/usr/bin:/sbin:/bin
if [[ $(service mysql status | grep running | wc -l) != 1 ]];
then
echo "$(date "+%Y-%m-%d %T")" >> /root/keep-mysql-running.log
echo "$(service mysql status)" >> /root/keep-mysql-running.log
service mysql start >> /root/keep-mysql-running.log
fi
{
"disallowEmptyBlocks": true,
"disallowKeywords": ["with"],
"disallowMixedSpacesAndTabs": "smart",
"disallowMixedSpacesAndTabs": true,
"disallowMultipleLineStrings": true,
"disallowQuotedKeysInObjects": "allButReserved",
"disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"],
"disallowSpaceBeforeBinaryOperators": [","],
"disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
@jmillerdesign
jmillerdesign / trailing-slash.conf
Created January 17, 2015 22:10
Apache add or remove trailing slash for non-file URLs
# ----------------------------------------------------------------------
# Add trailing slash to (non-file) URLs
# Rewrite "example.com/foo -> example.com/foo/"
# ----------------------------------------------------------------------
<IfModule mod_rewrite.c>
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/|#(.*))$
RewriteRule ^(.*)$ /$1/ [R=301,L]
</IfModule>
@jmillerdesign
jmillerdesign / download_remote_dir.sh
Last active October 8, 2017 07:53
Download a remote directory locally
# Download a remote directory locally
rsync -zatPe ssh --exclude uploads --exclude files [email protected]:/home/username/path/to/directory/ ~/local/path/to/directory/
# Copy a local directory without removing new files
rsync -zatP /path/to/old/ /path/to/new/
# Copy just one file
scp [email protected]:/home/username/path/to/file.txt ~/local/path/to/file.txt
@jmillerdesign
jmillerdesign / convert_to_rgb.sh
Created July 24, 2014 17:18
Convert all images to RGB
sips --matchTo /System/Library/ColorSync/Profiles/Generic\ RGB\ Profile.icc *.jpg