Skip to content

Commit 67637dd

Browse files
committed
✨ Add rich, maccy, kubetop
1 parent cbe646a commit 67637dd

File tree

4 files changed

+5896
-5529
lines changed

4 files changed

+5896
-5529
lines changed

.bash_profile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ eval "$(zoxide init bash)" || true
2828

2929
# pyenv direnv
3030

31+
export PYENV_ROOT="$HOME/.pyenv"
32+
export PATH="$PYENV_ROOT/bin:$PATH"
33+
eval "$(pyenv init --path)"
3134
eval "$(pyenv init -)"
3235
eval "$(direnv hook bash)"
3336
eval "$(pyenv virtualenv-init -)"
@@ -74,14 +77,17 @@ alias sm='smerge'
7477
alias xdg-open='open'
7578
alias pyenvls='pyenv virtualenvs | grep --invert-match "/envs/"'
7679
alias i="
77-
python -c 'import autotime, ipdb' || pip install ipython-autotime ipdb
80+
python -c 'import autotime, ipdb, pandas, rich' || pip install ipython-autotime ipdb pandas rich
7881
7982
ipython -i -c '
8083
# just make sure to use escaped double quotes
8184
import os, logging, numpy as np, pandas as pd
8285
from pathlib import Path
8386
here = Path(\".\").resolve()
8487
88+
from rich import pretty
89+
pretty.install()
90+
8591
# set to WARNING by default
8692
logging.basicConfig(level=logging.INFO)
8793
logger = logging.getLogger(__name__)
@@ -126,6 +132,7 @@ PS1="⨊ 𝕯𝓭𝓵:\[\033[36m\]\w\[\033[m\]$ " # ⚛ ⨊ 𝓓𝔇𝒟ℓℒ
126132

127133
# functions
128134

135+
alias kubetop="watch -n4 ~/git/kubetop.py"
129136
# https://gist.github.com/ddelange/24575a702a10c2cb6348c4c7f342e0eb
130137
kubelogs() {
131138
# View logs as they come in (like in Rancher) using mktemp and less -r +F.
@@ -170,7 +177,7 @@ kubebash() {
170177
echo "Pod \"${pod}\" not found in namespace \"${namespace}\""
171178
return
172179
fi
173-
kubectl exec -ti --kubeconfig ${KUBECONFIG:-"$HOME/.kube/config"} --namespace ${namespace} ${podname} bash
180+
kubectl exec -ti --kubeconfig ${KUBECONFIG:-"$HOME/.kube/config"} --namespace ${namespace} ${podname} -- bash
174181
}
175182

176183
kubebranch() {

README.md

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ defaults write com.google.Chrome NSRequiresAquaSystemAppearance -bool yes
8383
- Under `Shortcuts`, tick `Use keyboard navigation to move focus between controls` on the bottom
8484
- Under `Input Sources`, set keyboard layout to U.S. (remove U.S. International)
8585
- Under `Touch Bar shows`, choose `Expanded Control Strip`
86-
- `System Preferences/Keyboard/`
8786
- `System Preferences/Security & Privacy/`
8887
- Under `FileVault`, turn on FileVault
8988
- `System Preferences/Accessibility/`
@@ -144,14 +143,14 @@ brew doctor
144143

145144
# and some essentials
146145
# - ruby, gcc-8 are linked in `.bash_profile`
147-
# - node@12 (LTS at time of writing) installs npm
146+
# - node@14 (LTS at time of writing) installs npm
148147
brew install \
149148
git git-lfs gitmoji bash-completion rsync curl openssl readline automake xz zlib \
150149
osxfuse sshfs htop ncdu direnv pwgen \
151-
gcc@8 rust ruby node@12 sqlite3
150+
gcc@8 rust ruby node@14 sqlite3
152151
# check out caveats from command above!
153152
# npm installs yarn
154-
PATH="/usr/local/opt/node@12/bin:$PATH" npm install -g yarn
153+
PATH="/usr/local/opt/node@14/bin:$PATH" npm install -g yarn
155154
```
156155

157156

@@ -181,8 +180,6 @@ alias ll="ls --long --sort=age --git --time=modified --time-style=iso"
181180
# Docker CE - docker.com/community-edition - Open Docker.app manually to install helper and to enable CLI
182181
brew install --cask docker
183182
brew install docker-compose
184-
# PostgresApp - postgresapp.com
185-
brew install --cask postgres
186183
# Sublime Text - sublimetext.com
187184
brew install --cask sublime-text
188185
# Sublime Merge - sublimemerge.com
@@ -200,7 +197,7 @@ brew install --cask flux
200197
# VLC - videolan.org/vlc
201198
brew install --cask vlc
202199
# Slack - slack.com
203-
brew install --cask slack
200+
# brew install --cask slack
204201
# Zoom.us - zoom.us
205202
brew install --cask zoom
206203
# Whatsapp - whatsapp.com
@@ -209,6 +206,10 @@ brew install --cask zoom
209206
# brew install --cask dropbox
210207
# Authy - authy.com - Set Master Password in preferences after init
211208
brew install --cask authy
209+
# Jitsi Meet - jit.si
210+
brew install --cask jitsi-meet
211+
# Maccy - maccy.app
212+
brew install --cask maccy
212213
```
213214

214215

@@ -234,8 +235,6 @@ mas install 411643860
234235
mas install 937984704
235236
# Telegram - macos.telegram.org - set password and enter behaviour after init
236237
mas install 747648890
237-
# Copyclip - fiplab.com/apps/copyclip-for-mac
238-
mas install 595191960
239238
```
240239

241240

@@ -288,18 +287,13 @@ Note: first open Chrome for the first time
288287
git clone git://github.com/concordusapps/pyenv-implict.git "$(pyenv root)"/plugins/pyenv-implict
289288
# list all available python versions
290289
pyenv install -l | grep '^\s*[0-9]'
291-
pyenv install-latest 2.7
292-
pyenv install-latest 3.7
293-
pyenv install-latest 3.8
294-
pyenv global $(pyenv install-latest --print 3.7) $(pyenv install-latest --print 2.7) # set default versions: prefer py3 over py2
295-
source ~/.bash_profile # make them visible
296-
pip2.7 install wheel Cython
297-
pip3.7 install wheel Cython
298-
pip3.8 install wheel Cython
290+
pyenv install-latest 2
291+
pyenv install-latest 3
292+
pyenv versions # see currently installed versions
293+
pyenv global $(pyenv install-latest --print 3.8) $(pyenv install-latest --print 2) # set default versions: prefer py3 over py2
299294
# install virtualenv 'vv' based latest pyenv Python version 3.7, inheriting installed packages
300-
pyenv virtualenv $(pyenv install-latest --print 3.7) --system-site-packages vv
301-
pyenv virtualenv $(pyenv install-latest --print 2.7) --system-site-packages vv27
302-
pyenv virtualenv $(pyenv install-latest --print 3.8) --system-site-packages vv38
295+
pyenv virtualenv $(pyenv install-latest --print 3.8) --system-site-packages vv
296+
pyenv virtualenv $(pyenv install-latest --print 2) --system-site-packages vv27
303297
```
304298
- Manage envs
305299
```bash
@@ -357,6 +351,7 @@ git config --global core.untrackedCache true # https://git-scm.com/docs/git-upd
357351
git config --global merge.log true # Include summaries of merged commits in newly created merge commit messages
358352
git config --global push.default "simple" # https://git-scm.com/docs/git-config#Documentation/git-config.txt-pushdefault
359353
git config --global push.followTags true # https://git-scm.com/docs/git-config#Documentation/git-config.txt-pushfollowTags
354+
git config --global init.defaultBranch master
360355
```
361356

362357

@@ -412,7 +407,7 @@ git config --global alias.amend "commit --amend --no-edit -a"
412407
# "commit all amend with message" - add all modified tracked files to the last commit with a new commit message
413408
git config --global alias.camend "commit --amend -am"
414409
# "squash last" X commits - allowing to edit a pre-generated commit message before committing - known caveat: when trying to squash into an initial commit, the reset fails
415-
git config --global alias.squashlast '"!f(){ git reset --soft HEAD~${1} && git commit --edit -m\"$(git log --format=%B --reverse HEAD..HEAD@{1})\"; };f"'
410+
git config --global alias.squashlast '!f(){ git reset --soft HEAD~${1} && git commit --edit -m\"$(git log --format=%B --reverse HEAD..HEAD@{1})\"; };f'
416411
# "undo" whatever you did last, for instance an erroneous squashlast - ref https://megakemp.com/2016/08/25/git-undo/
417412
git config --global alias.undo '! f() { git reset --hard $(git rev-parse --abbrev-ref HEAD)@{${1-1}}; }; f'
418413
```

0 commit comments

Comments
 (0)