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
#!/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} | |
} |
UPDATE `users` SET `email` = CONCAT('dev-', `id`, '@example.com'); |
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
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 |
# List all symlinks | |
find . -type l | awk '{ sub(/.\/+/, ""); print }' | |
# List broken symlinks | |
find -L . -type l |
#!/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": ["++", "--"], |
# ---------------------------------------------------------------------- | |
# 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> |
# 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 |
sips --matchTo /System/Library/ColorSync/Profiles/Generic\ RGB\ Profile.icc *.jpg |