1
0
mirror of https://git.decapod.one/brethil/dotfiles synced 2024-11-23 12:01:30 +01:00
dotfiles/aliases/aliases.zsh

Failed to ignore revisions in .git-blame-ignore-revs.

82 lines
2.2 KiB
Bash
Raw Normal View History

2017-06-12 16:22:05 +02:00
###########################
#### ALIAS #
###########################
####
#### Easier life (MAC SPECIFIC)
####
if [[ "$(uname)" == "Darwin" ]]; then
2021-10-02 13:22:44 +02:00
alias o="open"
alias ls="ls -G"
## Colorize system.log contents (with grc), and inspect with less.
alias console="grc cat /var/log/system.log | sort -r | less -R"
2017-11-10 01:24:10 +01:00
2021-10-02 13:22:44 +02:00
## Quicklook shortcut
alias quicklook='qlmanage -px 2>/dev/null'
alias ql='quicklook'
2017-11-10 01:24:10 +01:00
2021-10-02 13:22:44 +02:00
## Airport command line interface
alias airport='/System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport'
2017-11-10 01:24:10 +01:00
2021-10-02 13:22:44 +02:00
## Flush dns cache
#alias dnsflushcache='sudo discoveryutil mdnsflushcache' # used to work until 10.6
alias dnsflushcache='sudo killall -HUP mDNSResponder' # Works up until 10.9 and after 10.10.4
2018-02-15 00:58:51 +01:00
alias lsrt='ls -G -lrt | tail -5'
else
alias ls='ls --color'
2017-06-12 16:22:05 +02:00
fi
####
#### Easier life (everything)
2020-03-08 23:50:14 +01:00
alias dot="cd $DOTFILES"
2017-06-12 16:22:05 +02:00
#### Audible bell
alias bell='echo -en "\007"'
2020-04-10 20:42:37 +02:00
alias grep="grep --colour=auto"
2017-07-14 21:20:20 +02:00
2017-06-12 16:22:05 +02:00
##############
## ls aliases
############
# ls -al, only show files that start with a dot
alias lsdot="ls -al | awk '\$9 ~ /^\./ {print \$0}'"
alias lt='ls -lrt | tail -10'
alias ll='ls -lhL' #long ls output
alias ka="killall"
2020-04-10 20:42:37 +02:00
alias ipy='ipython'
alias ipyl='ipython --pylab'
2022-03-25 08:34:35 +01:00
alias treep='tree -I __pycache__'
2017-06-12 16:22:05 +02:00
## Show the last 10 modified files
2018-02-15 00:58:51 +01:00
if [[ ! "$(uname)" == "Darwin" ]]; then
alias lsrt="ls -lrt | tail -10"
fi
2017-06-12 16:22:05 +02:00
## Stress one CPU core
2017-06-12 16:22:05 +02:00
alias stress='yes >> /dev/null'
# define ssh without controlmaster
2017-11-10 01:24:10 +01:00
alias ssh1="ssh -o ControlMaster=no"
2017-06-12 16:22:05 +02:00
alias watcha='watch ' # note the space after watch. This makes watch work with aliases
2020-03-30 03:37:11 +02:00
# A short version of docker ps
alias dps='docker ps --format "table {{.Image}}\t{{.RunningFor}}\t{{.Status}}\t{{.Ports}}\t{{.Names}}"'
# Get ip for a docker container, usage: `docker inspect <container> | dockerip`
alias dockerip="jq -r '.[].NetworkSettings.Networks.bridge.IPAddress'"
2020-03-30 03:37:11 +02:00
2020-11-16 01:46:01 +01:00
alias pvim='poetry run vim'
alias pshell='poetry shell'
2021-04-05 18:15:04 +02:00
alias venv='source .venv/bin/activate'
2020-11-16 01:46:01 +01:00
2021-09-26 17:32:11 +02:00
# Run fzf with file preview
alias pf="fzf --preview='BAT_STYLE='header,changes' bat --color=always {}' --bind shift-up:preview-page-up,shift-down:preview-page-down"
2021-10-03 11:18:18 +02:00
# dvc
alias dst='dvc status'
alias dstc='dvc status --cloud'
alias drp='dvc repro'
alias drps='dvc repro -s'