-
Notifications
You must be signed in to change notification settings - Fork 2
/
bashrc.macosx
86 lines (68 loc) · 2.19 KB
/
bashrc.macosx
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
# Macos-specific stuff
#
alias l='/bin/ls -FG'
alias ls='l -lh'
dnsflush() { sudo killall -HUP mDNSResponder; }
# Homebrew stuff
#
# Assuming brew is already in PATH. Set this up in bashrc.local if necessary.
#
rebrew() {
brew update &&
[ -n "$( brew outdated )" ] &&
brew outdated &&
YES_or_no upgrade &&
brew upgrade &&
brew cleanup
}
export DM=boot2docker-vm
dm() {
command="$1"
shift
docker-machine "$command" $DM "$@"
}
dmup() {
if ! dm status 2> /dev/null >/dev/null; then
dm create -d virtualbox --virtualbox-cpu-count -1
fi
dm start
eval $( dm env )
}
dmport() {
for port in "$@"; do
echo "Mapping port $port ..."
for proto in tcp udp; do
VBoxManage controlvm $DM natpf1 \
"$proto-port-$port,$proto,,$port,,$port"
done
done
VBoxManage showvminfo --machinereadable $DM \
| grep '^Forwarding.*-port-'
}
pathat /opt/homebrew/bin /usr/local/bin /usr/local/share/npm/bin /usr/local/sbin
BREW_ROOT=$(brew --prefix)
source_if ${BREW_ROOT}/etc/bash_completion
source_if ${BREW_ROOT}/Library/Contributions/brew_bash_completion.sh
if [[ "$BREW_ROOT" == /opt/homebrew ]]; then
export HOMEBREW_PREFIX="/opt/homebrew";
export HOMEBREW_CELLAR="/opt/homebrew/Cellar";
export HOMEBREW_REPOSITORY="/opt/homebrew";
export MANPATH="/opt/homebrew/share/man${MANPATH+:$MANPATH}:";
export INFOPATH="/opt/homebrew/share/info:${INFOPATH:-}";
fi
fix-docker-time() {
docker run alpine date
#docker run --privileged --rm alpine date -s "$( date -u '+%Y-%m-%d %H:%M:%S' )"
docker run --rm --privileged alpine hwclock -s
docker run alpine date
}
# Our PERL5LIB is for homebrew perl, not system perl. This breaks git.
alias git='PERL5LIB= git'
# Yes, zsh is the new default shell. Got it. Now STFU pls.
export BASH_SILENCE_DEPRECATION_WARNING=1
# Work around +[NSString initialize] may have been in progress in another thread when fork() was called.
export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
# Mac-specific df
alias df='/bin/df -h -Tnoautofs,devfs'
# https://github.com/crystal-lang/crystal/issues/13846
export CRYSTAL_OPTS="--link-flags=-Wl,-ld_classic"