-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.bashrc.macosx
144 lines (120 loc) · 3.96 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
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
139
140
141
142
143
144
# function vim {
# # Access parameters $1, $2, ${$1:mydefaultvalue} "$@"
# mvim -v "$@"
# }
# function jupyterserver {
# cd ~/Dropbox/JupyterNotebooks
# ~/.pyenv/versions/venv-jupyter/bin/jupyter notebook
# }
# function jupyter {
# # Access parameters $1, $2, ${$1:mydefaultvalue} "$@"
# ~/.pyenv/versions/venv-jupyter/bin/jupyter "$@"
# }
function ls {
command ls -G "$@"
}
function installpythonprereq {
brew upgrade openssl readline xz
}
function installkibana {
FILENAME="kibana-5.5.2-darwin-x86_64.tar.gz"
wget -c "https://artifacts.elastic.co/downloads/kibana/$FILENAME"
cat $FILENAME | (cd ~/.local/stow && tar xzf -)
}
function installopt {
brew install --HEAD coursier/formulas/coursier
brew install git
brew install scala
brew install go
brew install ctags
brew install global # replacement for ctags
brew install ffmpeg
brew install neovim
brew install the_silver_searcher
brew install stow
brew install watch
brew install tree
brew install jq
brew install wget
brew install curl
brew install sbt
brew install ripgrep
brew install midnight-commander
brew install ncdu
brew install cscope
brew install tig
}
function installkivy {
brew install pkg-config sdl2 sdl2_image sdl2_ttf sdl2_mixer gstreamer
pyenv virtualenv 3.6.2 venv-kivy
pyenv shell venv-kivy
pip install Cython==0.26.1
#pip install kivy
# Currently kivy==0.10.0 doesn't work due to SDL changes need to use developement version of kivy
pip install http://github.com/kivy/kivy/archive/master.zip
}
function ports {
# https://apple.stackexchange.com/questions/117644/how-can-i-list-my-open-network-ports-with-netstat
# netstat -ap tcp | grep -i "listen"
# sudo lsof -PiTCP -sTCP:LISTEN
# lsof -Pn -i4
sudo lsof -iTCP -sTCP:LISTEN -n -P
}
function openports {
ports
}
function ports2 {
netstat -anv|grep -i listen
# -a : show the status of each socket LISTEN , etc.
# -n : numeric ports and addresses instead of trying to dns resolve the addresses and servicename for ports
# -v : increase verbosity
}
function postgresqlserverstart {
pg_ctl -D /usr/local/var/postgres start
}
function postgresqlserverstop {
pg_ctl -D /usr/local/var/postgres stop
}
function pjc {
# prettify the json contents in the clipboard
pbpaste | jq -S . | pbcopy
}
function installasciidoctor {
brew upgrade asciidoctor
GEM_HOME=$(brew --prefix asciidoctor) gem install asciidoctor-diagram
GEM_HOME=$(brew --prefix asciidoctor) gem install coderay
GEM_HOME=$(brew --prefix asciidoctor) gem install pygments.rb
}
# export JAVA_HOME=`/usr/libexec/java_home -v 1.8`
# export BROWSER='/usr/bin/open -a "/Applications/Google Chrome.app" %s' # https://github.com/cli/cli/issues/8658
export BROWSER='/usr/bin/open -a "/Applications/Google Chrome.app"' # remove the %s
# export BROWSER='/usr/bin/open -a "/Applications/Safari.app"' #
export LESS='-FRX' # less support colors
function reset_printer {
lpadmin -p SecurePrintMac -o "CNDuplex=DuplexFront"
lpadmin -p SecurePrintMac -o "CNSrcOption=None"
lpadmin -p SecurePrintMac -o "MediaType=Auto"
lpadmin -p SecurePrintMac -o "InputSlot=Auto"
lpoptions -p SecurePrintMac -l|grep -E '^(CNDuplex|CNSrcOption|InputSlot|MediaType)'
}
function print_default {
reset_printer
}
function print_single_sided {
lpadmin -p SecurePrintMac -o "CNDuplex=None"
lpoptions -p SecurePrintMac -l|grep -E '^(CNDuplex|CNSrcOption|InputSlot|MediaType)'
}
function print_double_sided {
lpadmin -p SecurePrintMac -o "CNDuplex=DuplexFront"
lpoptions -p SecurePrintMac -l|grep -E '^(CNDuplex|CNSrcOption|InputSlot|MediaType)'
}
function print_cardboard {
lpadmin -p SecurePrintMac -o "CNDuplex=None"
lpadmin -p SecurePrintMac -o "MediaType=HEAVY6"
lpadmin -p SecurePrintMac -o "InputSlot=Manual"
lpoptions -p SecurePrintMac -l|grep -E '^(CNDuplex|CNSrcOption|InputSlot|MediaType)'
}
function print_regular_paper {
lpadmin -p SecurePrintMac -o "MediaType=Auto"
lpoptions -p SecurePrintMac -l|grep -E '^(CNDuplex|CNSrcOption|InputSlot|MediaType)'
}