-
Notifications
You must be signed in to change notification settings - Fork 0
/
m1.setup
138 lines (115 loc) · 4.18 KB
/
m1.setup
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
129
130
131
132
133
134
135
136
137
138
###--------------------------------------------
#
# Decide what platform we are on right now ...
#
case "$(uname -a)" in
*Darwin*) export _BT_PLATFORM_NAME="darwin";;
*)
echo 1>&2 "PANIC: cannot decide what platform this is! Get help."
return 1
;;
esac
###--------------------------------------------
###PATH="/Applications/Chia.app/Contents/Resources/app.asar.unpacked/daemon:$PATH"
PATH="$PATH:$HOME/bin"
PATH="$PATH:/Library/Frameworks/Python.framework/Versions/3.9/bin"
PATH="$PATH:/opt/homebrew/bin"
######--------------------------------------------
###
#### Innovators For Purpose
###
###function ifp() { code "Innovators-For-Purpose-here/$1"; }
###function toc() { ifp tools-of-curiosity/$1; }
###function toca() { t4c tools_of_curiosity_app/$1; }
###
###function her() { heroku "$@"; }
######--------------------------------------------
###
#### Green Crypto Ninjas
###
###export GCN_ROOT_HERE="/Volumes/Sp1V1/Sp1V1-root/GCN"
###export GCN_REPO_HERE="$GCN_ROOT_HERE/repos-here/gcn-repo"
###function gcn() { cd "${GCN_REPO_HERE/$1}"; }
###function gcnrepo() { gcn repos-here/gcn-repo/$1; }
###### Do Not Do This: PATH="$GCN_REPO_HERE:$PATH"
###
###export CHIA_HOME="$HOME/CHIA"
###function chh() { cd "${CHIA_HOME:-$HOME/CHIA}/$1"; }
###function chb() { chh bin/$1; }
###function chl() { chh logs/$1; }
###function chlarch() { chh logs/archive/$1; }
###function chr() { chh reservations-here/$1; }
###function chs() { chh status-here/$1; }
###PATH="$CHIA_HOME/bin:$PATH"
#-----
# Bill's own stuff
function s3api() { Tmp s3api/$1; }
function dih() { desk disk-info-here/$1; }
function dihs() { dih Code/sql-here/$1; }
function sqlv() { sql3 ${1:-v6.db}; }
function s3down(){ desk m1-s3-jpfs-here/$1; }
function jpfs() { s3down just-plain-file-storage/$1; }
function bt1tb() { s3down BT-1TB-WD/$1; }
function dfh_timer() { while dfh ${1:-.};
do
ff | wcl; echo ===== $(date +%F-%R); sleep 5;
done ; }
###--------------------------------------------
# This is fundamental to all other "_BT_GIT_*" env variables.
export CODE="$HOME/Code"
function code() { cd $CODE/$1; pwd; }
export _BT_GIT_REPOS_HERE="$CODE/github-here"
[[ -d "$_BT_GIT_REPOS_HERE" ]] && \
{
function repos() { cd $_BT_GIT_REPOS_HERE/$1; }
} || \
{
echo 1>&2 "PANIC: cannot find Bill Torcaso repository root. Get help."
return 1;
}
###-------------------------------------------
# Things related to my bash_functions repo
[[ -d "$_BT_GIT_REPOS_HERE/bash_functions" ]] && \
{
export _BT_BASH_REPO="$_BT_GIT_REPOS_HERE/bash_functions"
export _BT_BASH_BT_SETUP_FILE="$_BT_BASH_REPO/bt.setup"
export _BT_BASH_FNED_FILES="$_BT_BASH_BT_SETUP_FILE $_BT_BASH_REPO/generic.bash_functions $_BT_BASH_REPO/$_BT_PLATFORM_NAME.bash_functions"
function fnsrepo() { cd $_BT_BASH_REPO/$1; pwd; }
function fndef() { declare -f "$@"; }
function fned() { vi $(echo $_BT_BASH_FNED_FILES) "$@"; fns ; }
function fneg() { declare -F | grep "$@"; }
function fns() {
for thing in $(echo $_BT_BASH_FNED_FILES | \
sed "s@$_BT_BASH_BT_SETUP_FILE@@")
do
[[ -r $thing ]] && \
source $thing || \
{ echo "'source $thing' failed;"; break; }
done
}
# 'm1.setup' replaces 'bt.setup' on Darwin/Big Sur
function m1ed() {
vi $HOME/m1.setup; . $HOME/Code/github/bash_functions/m1.setup; fns
}
} || \
{
echo 1>&2 "PANIC: cannot find bash functions repo directory! Get help."
return 1;
}
###--------------------------------------------
# Activate the definitions in _BT_BASH_FNS_FILES
fns;
###--------------------------------------------
# Set the Bash prompt based on which platform this is.
# Must wait until after the '*_prompt' functions are defined.
case "$_BT_PLATFORM_NAME" in
ubuntu) magenta_prompt;;
awslinux) cyan_prompt;;
###darwin) PS1="";
darwin) setPS1="";
function update_terminal_cwd() {
echo "[$?]""[$(basename "$(dirname "$PWD")")/$(basename "$PWD")]";
}
;;
esac
true # That's all, folks!