.cfg/.bash_aliases

116 lines
2.7 KiB
Bash
Raw Normal View History

2023-01-20 23:20:29 +01:00
#!/bin/bash
2022-05-01 10:32:59 +02:00
#
#
# Please include these in the `.bashrc`
2022-04-29 22:35:23 +02:00
#
# ~/.bash_aliases
#
2023-01-20 23:20:29 +01:00
alias svim='sudo -E -s nvim'
2022-04-29 22:35:23 +02:00
# dotfiles
alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'
2022-05-01 10:32:59 +02:00
#alias cfg="config"
#alias cfgcsm"config commit -S -m"
#alias cfgp2om="config push -u origin master"
2022-04-29 22:35:23 +02:00
# Assumes `exa` package is installed
2023-01-20 23:20:29 +01:00
alias l='exa -l'
2022-04-29 22:35:23 +02:00
alias la='exa -la'
alias lh='exa -lha'
alias ltnew='exa -lrah --sort=newest --git'
alias lg='exa -Ga'
alias ltr='exa --tree --level=3 --long'
2023-01-20 23:20:29 +01:00
# utils
alias cat='bat'
2022-04-29 22:35:23 +02:00
# Add a function to open ranger in either a new tmux
# or a new window if already in a tmux.
# Note: Refuse to Nest!!!
alias rn='ranger'
alias cpv='rsync -ah --info=progress2'
alias gh='history|grep'
# count files in directory
alias count='find . -type f | wc -l'
2023-01-20 23:20:29 +01:00
############
# shareutils - uploads and pastes
# privatebin
#alias pbsend="
2022-04-29 22:35:23 +02:00
2023-01-20 23:20:29 +01:00
#alias hugz="curl -sT '$*' https://hugz.io"
2022-04-29 22:35:23 +02:00
alias uploadhgz='curl -sT - https://hugz.io/' # upload
alias ixio="curl -F 'f:1=<-' ix.io" # pipe output to ix.io
alias termbin="nc termbin.com 9999" # needs netcat
## commit faster, you git!
2023-01-20 23:20:29 +01:00
#alias gconsolidate="git branch -r | grep -v '\->' | while read remote; do git branch --track '${remote#origin/}' '$remote'; done"
2022-04-29 22:35:23 +02:00
alias gad='git add'
alias gst='git status'
alias gfa='git fetch --all --prune'
alias gpp='git pull --ff-only --prune'
alias gsl='git stash list'
alias gls='git ls-files'
alias gss='git stash show -p'
alias gsd='git stash drop'
alias gcam='git commit -am'
alias gcsm='git commit -sm'
alias gdb='git branch -d'
alias glb='git branch'
alias gck='git checkout'
alias gckb='git checkout -b'
alias gvrf='git rev-parse --verify HEAD'
alias gscm='git commit -S -m'
2022-05-01 10:15:12 +02:00
# aureport and ausearch
alias aurepwk='aureport --start this-week'
alias aurepwkv='aureport --start this-week --key --summary'
# syscall audit rule for failure to open files due to EPERM with key field access
# add to syscall.rules
# -a always,exit -F arch=b64 -S open -S openat -F exit=-EPERM -k access
# check which files have been attempted
alias aurfilist='ausearch --start this-week -k access --raw | aureport --file --summary'
# check the user accounts implicated
alias aurlusfi='ausearch --start this-week -k access --raw | aureport --user --summary'
2023-01-20 23:20:29 +01:00
# kitty
# needs ImageMagick
alias icat="kitty +kitten icat"
# diff
alias d="kitty +kitten diff"
# hyperlinked grep
alias hg="kitty +kitten hyperlinked_grep"
# hugz.io
# Packaging
#
# Open Build Service
#
# osc
alias oscb="osc build --ccache"
alias oscsd="osc service runall download_files"
# folder travel
alias cdsof="cd /home/mogad0n/litter/Software"
alias cdpic="cd /home/mogad0n/Pictures"
alias yaygitsyu="pacman -Qmq | grep -Ee '-(cvs|svn|git|hg|bzr|darcs)$' | yay -S --needed -"