2019-09-27 15:19:27 +00:00
|
|
|
# Local system administration
|
2019-11-13 15:35:32 +00:00
|
|
|
|
|
|
|
# Alias management
|
2019-09-27 15:19:27 +00:00
|
|
|
alias 'editalias'='vim ~/.bash_aliases && . ~/.bash_aliases'
|
2019-10-17 03:07:35 +00:00
|
|
|
alias 'otheralias'='vim ~/.other_aliases && . ~/.bash_aliases'
|
2019-10-17 02:41:30 +00:00
|
|
|
alias 'viewalias'='view ~/.bash_aliases'
|
2019-11-05 16:25:43 +00:00
|
|
|
alias 'refreshalias'='source ~/.bash_aliases'
|
2019-11-13 15:35:32 +00:00
|
|
|
|
|
|
|
# SSH management
|
2019-09-27 15:19:27 +00:00
|
|
|
alias 'editssh'='vim ~/.ssh/config'
|
2019-11-13 15:35:32 +00:00
|
|
|
|
2020-07-01 15:38:48 +00:00
|
|
|
# Edit hosts file
|
|
|
|
alias 'edithosts'='sudo vim /etc/hosts'
|
|
|
|
|
2019-11-13 15:35:32 +00:00
|
|
|
# System packages using apt
|
2019-11-04 15:24:29 +00:00
|
|
|
alias 'update'='sudo apt update'
|
2019-09-27 15:19:27 +00:00
|
|
|
alias 'upgrade'='sudo apt update && sudo apt upgrade'
|
|
|
|
alias 'install'='sudo apt update && sudo apt install'
|
2019-11-13 15:35:32 +00:00
|
|
|
alias 'remove'='sudo apt remove'
|
|
|
|
|
|
|
|
# Restart display manager
|
2019-09-27 15:19:27 +00:00
|
|
|
alias 'restartgui'='sudo service sddm restart'
|
2019-11-13 15:35:32 +00:00
|
|
|
|
|
|
|
# Power management
|
2019-10-17 02:41:30 +00:00
|
|
|
alias 'reboot'='sudo reboot'
|
|
|
|
alias 'shutdown'='sudo shutdown'
|
2019-09-27 15:19:27 +00:00
|
|
|
|
|
|
|
# Vagrant shortcuts
|
|
|
|
alias 'vdup'='vagrant destroy -f && vagrant up'
|
|
|
|
alias 'vpro'='vagrant provision'
|
|
|
|
alias 'vssh'='ssh-add && vagrant ssh'
|
|
|
|
alias 'vup'='vagrant up'
|
2020-07-17 18:22:41 +00:00
|
|
|
alias 'vhalt'='vagrant halt'
|
2019-09-27 15:19:27 +00:00
|
|
|
|
|
|
|
# Change to project folder
|
|
|
|
alias 'sw'='cd /home/$USER/software && clear'
|
|
|
|
|
|
|
|
# Git shortcuts
|
|
|
|
alias 'gad'='git add . && git diff --cached'
|
2019-10-17 02:41:30 +00:00
|
|
|
alias 'gdiff'='git diff'
|
|
|
|
alias 'status'='git status'
|
2019-11-04 15:12:26 +00:00
|
|
|
alias 'pull'='git pull --rebase'
|
2019-11-05 16:25:43 +00:00
|
|
|
alias 'merge'='git merge --ff-only'
|
|
|
|
alias 'upstream'='git push --set-upstream origin'
|
2019-11-04 15:14:10 +00:00
|
|
|
alias 'push'='git push'
|
2019-10-17 22:35:33 +00:00
|
|
|
alias 'branch'='git branch'
|
2019-11-11 16:09:43 +00:00
|
|
|
alias 'list'='git branch -a'
|
2019-11-05 15:16:35 +00:00
|
|
|
alias 'unstage'='git reset HEAD'
|
|
|
|
alias 'discard'='git checkout --'
|
2019-10-17 02:41:30 +00:00
|
|
|
alias 'log'='git log'
|
2020-05-01 15:35:12 +00:00
|
|
|
alias 'logsig'='git log --show-signature'
|
2019-10-17 02:41:30 +00:00
|
|
|
alias 'checkout'='git checkout'
|
|
|
|
alias 'commit'='git commit -S'
|
|
|
|
alias 'amend'='git commit -S --amend'
|
2020-02-27 18:44:00 +00:00
|
|
|
alias 'amendnew'='git commit -S --amend --date "`date -R`"'
|
2019-12-16 22:29:36 +00:00
|
|
|
alias 'fetch'='git fetch'
|
2020-02-25 15:21:42 +00:00
|
|
|
alias 'stash'='git stash'
|
2020-05-01 15:28:10 +00:00
|
|
|
alias 'resetb'='git reset --hard @{u}'
|
2020-06-23 20:54:58 +00:00
|
|
|
alias 'signhist'='git rebase --exec "git commit -S --amend --no-edit -n"'
|
|
|
|
alias 'signhistnew'='git rebase --exec "git commit -S --amend --date '\''`date -R`'\'' --no-edit -n"'
|
2020-02-25 15:21:42 +00:00
|
|
|
|
|
|
|
function gd() {
|
|
|
|
git diff HEAD~$1
|
|
|
|
}
|
2019-09-27 15:19:27 +00:00
|
|
|
|
2020-04-22 15:52:50 +00:00
|
|
|
function rebase() {
|
|
|
|
git rebase -i HEAD~$1
|
|
|
|
}
|
|
|
|
|
2020-06-17 13:34:52 +00:00
|
|
|
function delcommit() {
|
|
|
|
git reset --hard HEAD~$1
|
|
|
|
}
|
|
|
|
|
2020-01-09 22:54:35 +00:00
|
|
|
# Docker shortcuts
|
|
|
|
function inspect() {
|
|
|
|
docker inspect "$1" | less
|
|
|
|
}
|
|
|
|
|
2019-09-27 15:19:27 +00:00
|
|
|
# Color shift
|
2019-10-17 02:41:30 +00:00
|
|
|
alias 'night'='redshift -P -O 2500'
|
2019-09-27 15:19:27 +00:00
|
|
|
alias 'day'='redshift -x'
|
|
|
|
|
|
|
|
# SOCKS proxy over SSH
|
|
|
|
alias 'socks'='screen -dm ssh -D 1337 -q -C -N'
|
2019-10-17 03:07:35 +00:00
|
|
|
|
2020-03-28 00:22:12 +00:00
|
|
|
# sshuttle proxy
|
|
|
|
#e.g. alias 'proxyhome'='proxy user hostdomain:22 192.168.1.0/24'
|
|
|
|
function proxy() {
|
|
|
|
screen -dm sshuttle -v -r $1@$2 -x $2 ${@:2}; screen -r;
|
|
|
|
}
|
|
|
|
|
2020-01-12 06:22:22 +00:00
|
|
|
if [ -f ~/.other_aliases ]; then
|
2020-01-12 00:44:26 +00:00
|
|
|
source ~/.other_aliases
|
|
|
|
fi
|