Skip to content

Instantly share code, notes, and snippets.

@hbjydev
Created January 19, 2021 01:24
Show Gist options
  • Save hbjydev/cc8391d3e989aa8abe1dfea7fe47efa8 to your computer and use it in GitHub Desktop.
Save hbjydev/cc8391d3e989aa8abe1dfea7fe47efa8 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Sudo alias
alias s="sudo"
# systemd-related
alias log="sudo journalctl --output cat -u"
alias log-previous-boot="sudo journalctl --boot=-1"
# Monitoring & process control
alias ports="sudo lsof -Pni"
alias pgrep="pgrep --full"
alias pkill="pkill --full"
# Better LS
alias l="ls -lahXF --group-directories-first"
# nvim
alias v="nvim"
alias vi="nvim"
alias vim="nvim"
# rsync
alias r="rsync -ra --info=progress2"
# Git Aliases
alias g="git"
alias ga="git add"
alias gau="git add -u"
alias gco="git checkout"
alias gc="git commit --message"
alias gca="git commit --all --message"
alias gs="git status --short"
alias gd="git diff"
alias gdc="git diff --cached"
alias gfr="git pull --rebase"
alias gp="git push"
alias gso="git log -p --all --source -S "
# Better find
alias fd="fd --hidden --exclude .git"
# SSH for any terminal
alias ssh="TERM=xterm-256color ssh"
# Get image resolution
function imageres () {
image_path=$1
image_res=`identify -verbose $1 | grep 'Resolution' | sed 's/ Resolution: //g'`
echo $image_res
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment