Skip to content

Instantly share code, notes, and snippets.

@hopeseekr
Last active September 18, 2020 19:26
Show Gist options
  • Save hopeseekr/fb85b7a179e3b9c97212925a2bd8400b to your computer and use it in GitHub Desktop.
Save hopeseekr/fb85b7a179e3b9c97212925a2bd8400b to your computer and use it in GitHub Desktop.
Amazing Linux, PHP and Git aliases
# Dev aliases
alias free="free -m"
alias dup='(docker-compose up -d && docker-compose logs -ft)'
# I recomment putting this in /etc/cron.daily/
alias docker-prune='docker rmi $(docker images | grep "^<none>" | awk "{print $3}")'
# Git
alias gd='git diff'
alias ga='git add'
alias gco='git checkout --ours'
alias gcp='git cherry-pick'
alias grd='git rebase --committer-date-is-author-date'
alias gpm='git pull --rebase origin master'
alias gs='git show'
alias git-nuke="find . -maxdepth 1 ! -name '.' ! -name '.git' -exec rm -rf {} \; && git reset --hard"
# PHP aliases
alias art='php artisan'
alias rdb='art migrate:refresh; art db:seed'
alias pu='phpunit'
alias puf='phpunit --filter='
alias puh='phpunit --coverage-html coverage'
alias put='phpunit --testdox'
alias behat='behat --format-settings='"'"'{"expand": true}'"'"''
alias psql="sudo -u postgres psql"
alias pf='php-cs-fixer fix'
# System Usability aliases
# Shows dates as 2020-06-11 18:31:39.070085867
alias lsdate="ls -l --time-style=full-iso"
# Always use less with colors.
alias less="less -r"
alias opti='optimus-manager --print-mode'
# Best possible 7z compression. Change to "-mx=9e" for real intensity.
alias super7="7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on"
alias qmv='qmv --format=destination-only'
alias youtube-dl='youtube-dl -f best --external-downloader aria2c --external-downloader-args="-x8 -s8 -k 1M"'
alias youtube-archive='youtube-dl --external-downloader aria2c --external-downloader-args="-x8 -s8 -k 1M" --write-description -o "%(playlist_index)s-%(title)s-%(id)s.%(upload_date)s.%(ext)s" -f "bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]"'
# Place in ~/.gitconfig
[alias]
gpg-log = log --show-sigature
shows = show --show-signature
redate = rebase --committer-date-is-author-date
resign = rebase --exec 'git commit --amend --no-edit -n -S' -i
cloneup = clone --origin upstream
c = checkout
cp = cherry-pick
cpm = cherry-pick -m1
## Outputs like (with pretty colors):
## 7b993a6 G 2020-09-18 12:21:14 -0500 Theodore R. Smith Initial v0.9. origin/master
ll = log --pretty=shortlog --date=iso
pretty = ll
fix = rebase -i HEAD~2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment