-
Notifications
You must be signed in to change notification settings - Fork 0
/
bashrc
129 lines (97 loc) · 3.49 KB
/
bashrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#!/bin/bash
#
# Based on:
# http://github.com/rtomayko/dotfiles - Ryan Tomayko
#
# setup some basic variables
: ${HOME=~}
: ${LOGNAME=$(id -un)}
: ${UNAME=$(uname)}
# ----------------------------------------------------------------------
# CONFIGURATION
# ----------------------------------------------------------------------
# complete hostnames from
: ${HOSTFILE=~/.ssh/known_hosts}
# readline inputrc
: ${INPUTRC=~/.inputrc}
# ----------------------------------------------------------------------
# SHELL OPTIONS
# ----------------------------------------------------------------------
# bring in system bashrc
test -r /etc/bashrc &&
. /etc/bashrc
# notify of bg job completion immediately
set -o notify
# shell opts. see bash(1) for details
shopt -s cdspell >/dev/null 2>&1
shopt -s extglob >/dev/null 2>&1
shopt -s histappend >/dev/null 2>&1
shopt -s hostcomplete >/dev/null 2>&1
shopt -s interactive_comments >/dev/null 2>&1
shopt -u mailwarn >/dev/null 2>&1
shopt -s no_empty_cmd_completion >/dev/null 2>&1
# fuck that you have new mail shit
unset MAILCHECK
# disable core dumps
ulimit -S -c 0
# default umask
umask 0022
# ----------------------------------------------------------------------
# PATH
# ----------------------------------------------------------------------
# we want the various sbins on the path along with /usr/local/bin
PATH="$PATH:/usr/local/sbin:/usr/sbin:/sbin"
PATH="/usr/local/bin:$PATH"
# put ~/bin on PATH if you have it
test -d "$HOME/bin" &&
PATH="$HOME/bin:$PATH"
# ----------------------------------------------------------------------
# ENVIRONMENT CONFIGURATION
# ----------------------------------------------------------------------
# detect interactive shell
case "$-" in
*i*) INTERACTIVE=1 ;;
*) unset INTERACTIVE ;;
esac
# detect login shell
case "$0" in
-*) LOGIN=1 ;;
*) unset LOGIN ;;
esac
# enable en_US locale w/ utf-8 encodings if not already configured
: ${LANG:="en_US.UTF-8"}
: ${LANGUAGE:="en"}
: ${LC_CTYPE:="en_US.UTF-8"}
: ${LC_ALL:="en_US.UTF-8"}
export LANG LANGUAGE LC_CTYPE LC_ALL
# ignore backups, CVS directories, python bytecode, vim swap files
FIGNORE="~:CVS:#:.pyc:.swp:.swa:apache-solr-*"
HISTCONTROL=ignoreboth
# ----------------------------------------------------------------------
# PAGER / EDITOR
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# PROMPT
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# MACOS X / DARWIN SPECIFIC
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# ALIASES / FUNCTIONS
# ----------------------------------------------------------------------
# bundler
alias be="bundle exec"
# gem
alias gem-uninstall-all="gem list | cut -d\" \" -f1 | xargs gem uninstall -aIx"
# --------------------------------------------------------------------
# MISC
# --------------------------------------------------------------------
# aws tools
if [ -d "$HOME/.aws" ]; then
export JAVA_HOME="$(/usr/libexec/java_home)"
export EC2_PRIVATE_KEY="$(/bin/ls "$HOME"/.aws/pk-*.pem | /usr/bin/head -1)"
export EC2_CERT="$(/bin/ls "$HOME"/.aws/cert-*.pem | /usr/bin/head -1)"
export AWS_RDS_HOME="/usr/local/Library/LinkedKegs/rds-command-line-tools/jars"
fi
# let rbenv do it's thing
type -P rbenv >/dev/null && eval "$(rbenv init -)"