This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Generate a self-signed SSL cert for local development and (optionally) | |
# add it as trusted in the system keychain to prevent browser warnings. | |
# Files are generated in the current directory; copy them as needed | |
# to your /etc/apache2/... | |
# Tested on OS X El Capitan. | |
# | |
# Sample Usage: | |
# ./gencert.sh -n example.localhost [-y] # -y to bypass all prompts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
crontab() { | |
crontab_usage() { | |
echo 'Usage:' >&2 | |
echo ' $ crontab -[elr]' >&2 | |
echo ' $ crontab ~/crons # to update your crons' >&2 | |
} | |
if [ $# -eq 1 ]; then | |
if [ "$*" = '-' ]; then # worse than crontab -e | |
crontab_usage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simple, lightweight git prompt for ksh93: if inside a git repo, adds the | |
# branch name to PS1, using a different color for master, develop* and other. | |
# Put this snippet at the bottom of your ~/.kshrc | |
__get_current_git_branch_name() { | |
__determine_branch_color() { | |
case "${1:-}" in | |
master) branch_color=196 ;; # red | |
develop*) branch_color=226 ;; # yellow | |
*) branch_color=39 # blue | |
esac |