dotfiles/dot_zsh_aliases

241 lines
8.9 KiB
Plaintext
Raw Normal View History

2019-03-01 08:17:42 +00:00
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
#
2019-07-18 09:55:54 +00:00
# Git, dotfiles, ripgrep, Node.JS
2019-03-01 08:17:42 +00:00
alias cm='chezmoi'
2020-06-30 12:44:23 +00:00
alias gcls='git clone --depth 1 --recurse-submodules'
alias gpar='gitpushallremote'
2020-07-08 15:09:19 +00:00
alias gpcr='gitpushcurrentremote'
alias lg='lazygit'
alias neworigin='setorigin'
alias origin='setorigin'
alias goto='git go'
alias master='goto master'
alias develop='goto develop'
alias gg='git config -l | grip' # search git config for ...
alias ucommit='PRE_COMMIT_ALLOW_NO_CONFIG=1 git commit --no-verify'
2019-07-18 09:55:54 +00:00
2020-06-30 12:44:23 +00:00
# Docker
alias lzd='lazydocker'
2020-07-03 06:13:15 +00:00
# PM : Jira & trello & asana & moro
2019-07-18 09:55:54 +00:00
alias jirasearch='issues'
2019-09-16 12:05:52 +00:00
alias cicdlist="jira issue jql \"project = 'CICD' AND resolution = Unresolved\""
alias backlogs="jira issue jql \"status = New AND project IN (CICD) AND Created > -2w ORDER BY Priority DESC\""
2019-07-18 09:55:54 +00:00
alias bakclogs='backlogs'
2020-02-22 15:31:41 +00:00
alias support="jira issue jql \"project in (CICD) AND (Created > -2w AND resolution = Unresolved AND (type = 'Engineering Incident' AND status not in ('Waiting for external information') OR type IN ('Engineering Request', 'Task', 'User Story') AND status in ('New', 'To be picked next')) OR resolution != Unresolved AND status = 'In Progress') ORDER BY key DESC\""
alias guardian="support"
alias lastissues='jira issue jql "project IN (CICD) AND Created > -2w ORDER BY Created DESC, Priority DESC"'
2020-02-22 15:31:41 +00:00
alias workingon="jira issue jql \"assignee = currentUser() AND resolution = Unresolved AND status not in ('In Review', 'Done', 'In Testing', 'Waiting For Build') OR QA = currentUser() AND status = 'In Testing' ORDER BY updated DESC, priority DESC\""
2020-06-21 10:38:50 +00:00
alias toreview='jira issue jql "project in (CICD) AND Updated > -2w AND issue.property[development].openprs > 0 ORDER BY Created DESC, Priority ASC"'
alias newissues="jira issue jql \"project IN (CICD) AND Created > -2w AND resolution = Unresolved AND status not in ('In Progress') ORDER BY Created DESC, Priority DESC\""
2019-08-13 13:32:47 +00:00
alias n='newissues'
alias backlog=cicdlist
2019-07-18 09:55:54 +00:00
alias bakclog='backlog'
2019-03-01 09:45:50 +00:00
alias b='backlog'
alias mybacklog="jira issue ls && asana && confluencetasks && trello_web"
2019-03-01 12:34:54 +00:00
alias mb='mybacklog'
alias myissues='mb'
alias me='mb'
alias j='jira issue open'
2020-06-30 12:44:23 +00:00
alias trello='3llo'
2020-07-03 06:13:15 +00:00
alias work='moro'
2019-07-18 09:55:54 +00:00
# News
2019-03-01 12:34:54 +00:00
alias hack='hacker'
alias crypto='curl rate.sx'
2020-06-30 12:44:23 +00:00
alias weather='weather "?lang=fr&"'
2019-07-18 09:55:54 +00:00
2019-08-09 02:36:12 +00:00
# Twitter
alias twitter='\t'
alias tsearch='twitter search all'
alias tweets='tsearch --long -a -d'
2019-08-09 02:36:12 +00:00
alias tsearchfav='twitter search favorites'
alias tsearchtimeline='twitter search timeline'
alias tstream='rainbowstream'
alias mystream='tstream'
2019-08-09 02:36:12 +00:00
2020-06-30 12:22:03 +00:00
# RSS
alias addfeed='rssadd'
alias addrss='rssadd'
2020-07-01 10:52:50 +00:00
alias rss='newsboat'
alias feed='rss'
alias feeds='rss'
2020-06-30 12:22:03 +00:00
# Search
alias ddg='ddgr'
alias goo='googler'
alias se='sr -elvi'
alias eg='env | grip' # search env variables for pattern
alias engines='sr -elvi'
2020-06-30 12:44:23 +00:00
alias grep='rg'
2020-07-08 10:07:34 +00:00
alias grip='grep -i'
2020-06-30 12:44:23 +00:00
alias usernames="python3 $HOME/Code/sherlock/sherlock.py --rank --print-found"
2020-07-01 08:46:10 +00:00
alias ygg="torrengo -s ygg"
alias ag='alias | grip' # search for patten among aliases
alias hg='history | grip' # search for pattern among history
alias hist='history'
2020-07-08 10:07:04 +00:00
alias codestats='tokei'
alias dups='file_dups'
alias pairs='file_getpairs'
alias words='file_getwords'
2020-07-08 12:08:02 +00:00
alias fd="\fd"
2020-07-08 12:17:14 +00:00
alias wiki='wikit'
alias dico='dict'
2019-07-18 09:55:54 +00:00
# Events
alias agenda='calendar'
alias mails="gmail && gmail2"
alias mailperso="gmail2"
alias mailpro="gmail"
2019-08-16 13:01:45 +00:00
# Viewing files
2019-08-17 12:07:21 +00:00
alias cat='bat --style=plain --color "always"'
2019-12-01 11:01:19 +00:00
alias preview="fzf --preview 'bat --color \"always\" --style=plain {}' --cycle "
2020-02-22 15:31:41 +00:00
alias markdown2='pandoc README.md | lynx -stdin -dump'
alias markdown='glow'
2019-07-18 09:55:54 +00:00
# Management / Security / SSH / SSL
alias mgmt='ssh $(whoami)@$PROXY_HOST -i ~/.ssh/id_ed25519'
2019-07-18 09:55:54 +00:00
alias m='mgmt'
alias tunnel='ssh -D 8000 -N $(whoami)@$PROXY_HOST -i ~/.ssh/id_ed25519'
2019-07-29 08:17:42 +00:00
alias sshpub='cat ~/.ssh/id_ed25519.pub'
alias ssla="openssl x509 -alias -noout -in" # Usage : ssla <cert>
alias encrypt='ansible-vault encrypt **/vault.yml --vault-password-file=$VAULT_PASSWORD_FILE'
alias decrypt='ansible-vault decrypt **/vault.yml --vault-password-file=$VAULT_PASSWORD_FILE'
alias bitwarden-cli='bw'
2020-06-24 13:21:13 +00:00
alias newpass='bw generate --special --uppercase --lowercase --number --length 30'
# Network
2020-06-21 10:38:50 +00:00
alias ip='echo $(curl ident.me -4 2>/dev/null)'
alias ipinfo='curl "ipinfo.io/"$(ip)'
2020-06-21 10:38:50 +00:00
alias getips='\egrep "\b(([0-9]{1,2}|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}(1[0-9][0-9]|2[0-4][0-9]|25[0-5]|[0-9]{1,2})\b"'
alias ping='prettyping -c 5 --nolegend' # Stop after sending count ECHO_REQUEST packets
alias fastping='ping -c 100 -i.2' # don't wait interval 1 second, go fast
# Downloads
alias get="curl -O -L" # Download file and save it with filename of remote file
2020-06-30 12:44:23 +00:00
# Files & folder tricks
alias biggerthan10='biggerthan 10M'
alias c='cat'
2019-07-18 09:55:54 +00:00
alias h='cd $HOME'
alias cp='cp -i' # confirmation before overwrite #
2020-07-02 14:27:34 +00:00
alias del='rm -rf'
alias mv='mv -i' # confirmation before overwrite
alias mkcd='take'
2020-02-22 15:31:41 +00:00
alias rm='gomi'
alias df='df -H'
2020-06-30 12:44:23 +00:00
alias diff='colordiff --side-by-side --ignore-space-change --width=200 --suppress-common-lines --recursive'
2019-08-16 22:24:10 +00:00
alias du='ncdu --color dark -rr -x --exclude .git --exclude node_modules'
alias ctrl-c='pbcopy'
2020-06-30 12:44:23 +00:00
alias s=ls
alias sl=ll
alias ls='lsd'
alias lsg='ll | grip' # show me files matching "ls grep"
alias lh='ls -alt | head' # see the last modified files
2020-06-30 12:44:23 +00:00
alias tree='ls --almost-all --tree'
alias v=vi
alias x='extract'
# Empty the Trash on all mounted volumes and the main HDD.
# Also, clear Apples System Logs to improve shell startup speed.
# Finally, clear download history from quarantine. https://mths.be/bum
alias emptytrash="sudo rm -rfv /Volumes/*/.Trashes; sudo rm -rfv ~/.Trash; sudo rm -rfv /private/var/log/asl/*.asl; sqlite3 ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV* 'delete from LSQuarantineEvent'"
alias ve='vim ~/.vimrc' # vimrc editing
alias ze='vim ~/.zshrc' # zsh profile editing
alias zf='vim ~/.zsh_functions' # edit zsh_functions
alias za='vim ~/.zsh_aliases' # edit zsh_aliases
alias dots='cd $HOME/Code/dotfiles'
alias dotfiles='dots'
alias code='cd $HOME/Code'
2020-07-10 11:23:15 +00:00
alias gochezmoi='cd ~/.local/share/chezmoi'
alias blog='z morgangeek-blog'
2020-06-30 12:44:23 +00:00
# System Utils
2020-06-30 12:44:23 +00:00
alias systeminfo='neofetch'
alias monitoring='glances'
alias afk="/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend" # Lock the screen (when going AFK)
alias reload="exec ${SHELL} -l" # Reload the shell (i.e. invoke as a login shell)
alias sc="source $HOME/.zshrc"
alias lastlogin="log show --style syslog --last 1d | awk '/Enter/ && /unlockUIBecomesActive/ {print \$1 \" \" \$2}'"
alias loginhistory='lastlogin'
2020-07-02 13:50:30 +00:00
# Infrastructure
alias awsls='awsls -profile default -region eu-west-1 --attributes tags aws_instance'
2020-06-30 12:44:23 +00:00
# Package management tricks
alias npmlist='npm list -g --depth 0'
alias pip='pip3'
# RTFM
alias learnmore="apropos . | sort --random-sort | awk 'NR == 1 {print$1}' | cut -d'(' -f 1 | xargs man"
alias help='tldr'
alias latency='curl cheat.sh/latency'
# Misc
alias adhoc="ansible --one-line 127.0.0.1 -m"
alias ans='adhoc'
2020-06-30 12:44:23 +00:00
alias bash="/usr/local/bin/bash"
#alias date="gdate"
alias away='moro break 10 && coffee'
alias afk='away'
alias current_year='`echo date +"%Y"`'
alias headers='curl -I --compress' # Find out if remote server supports gzip / mod_deflate or not #
alias https='http --default-scheme=https' # useful alias stealed from a colleague. http is provided by httpie
alias path='echo -e ${PATH//:/\\n}' # Explode and display current PATH
alias p='ps -ef | grip ' # Show matching processes. Usage : p <process name>
alias root='sudo -i'
2019-09-19 14:36:55 +00:00
alias ':q'='exit'
2020-07-06 12:27:33 +00:00
alias current_hour='date +"%H:%M"'
alias current_time='current_hour'
alias runhooks='pre-commit run -a'
alias tryhook='pre-commit try-repo .'
alias whatyear='current_year'
alias whathour='current_time'
alias whattime='whathour'
2020-06-30 12:44:23 +00:00
# Linters
alias checken="aspell check -d en"
alias checkfr="aspell check -d fr"
alias fixallscripts="shfmt -w -l -i 2 -ci **/*.sh"
2020-06-30 12:44:23 +00:00
# Development
alias gw='./gradlew'
2020-06-30 12:44:23 +00:00
# NSFW
alias irc='weechat'
# Terraform
2020-07-10 11:23:15 +00:00
source $HOME/.aliases/terraform.sh
2020-07-10 11:27:47 +00:00
source $HOME/.aliases/terragrunt.sh
2019-06-18 08:57:44 +00:00
2020-06-30 12:44:23 +00:00
# Fun
alias moon='curl "wttr.in/Moon?lang=fr"'
alias lune='moon'
alias unix='curl -L http://git.io/unix'
alias coffee="curl -L http://git.io/coffee"
alias hotcoffee="curl -sL git.io/hotcoffee | sh"
2020-06-21 10:55:38 +00:00
# Music
2020-07-10 11:23:15 +00:00
source $HOME/.aliases/music.sh
2020-06-21 10:55:38 +00:00
2020-06-21 10:38:50 +00:00
# K8S
alias k9s='COLORTERM=256bit k9s --all-namespaces'
alias 9=k9s
alias K=k9s
2019-03-01 08:17:42 +00:00
# Show/hide hidden files in Finder
alias show="defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder"
alias hide="defaults write com.apple.finder AppleShowAllFiles -bool false && killall Finder"
# Hide/show all desktop icons (useful when presenting)
alias hidedesktop="defaults write com.apple.finder CreateDesktop -bool false && killall Finder"
alias showdesktop="defaults write com.apple.finder CreateDesktop -bool true && killall Finder"
# Flush Directory Service cache
alias flush="dscacheutil -flushcache && killall -HUP mDNSResponder"
2019-06-18 08:47:12 +00:00
2019-07-18 09:55:54 +00:00
# This is the end ;( ... for now ;D