-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathbash_rc.aliases
executable file
·96 lines (82 loc) · 4.16 KB
/
bash_rc.aliases
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/usr/bin/env bash
#########################################################################
# High-Octane .bashrc aliase and functions #
# #
# These aliases and functions have revolutionized how I develop #
# via the command line (CLI) and how I interact with Linux / UNIX. #
# #
# Part of HopeSeekr's BashScripts Collection #
# https://github.com/hopeseekr/BashScripts/ #
# #
# Copyright © 2015-2020 Theodore R. Smith <[email protected]> #
# GPG Fingerprint: 4BF8 2613 1C34 87AC D28F 2AD8 EB24 A91D D612 5690 #
# #
# Copyright © 2016-2018 Rishi Ramawat https://github.com/rishi-ramawat #
# #
# License: Creative Commons Attribution v4.0 International #
#########################################################################
# Ease-of-use Aliases
alias ..="cd .."
# Colorized grep and less!
alias grep='grep --color=auto'
alias less="less -r"
alias ls="ls -CF --color=auto --block-size=MB"
alias ll="ls -lisa --color=auto"
alias lsl="ls -lhFA | less"
alias mkdir="mkdir -pv"
alias userlist="cut -d: -f1 /etc/passwd"
alias psgrep="ps aux | grep -v grep | grep -i -e VSZ -e"
alias wget="wget -c"
# Instantly grabs your EXTERNAL IP from a 3rd party service.
alias myip="curl http://ipecho.net/plain; echo"
alias logs="find /var/log -type f -exec file {} \; | grep 'text' | cut -d' ' -f1 | sed -e's/:$//g' | grep -v '[0-9]$' | xargs tail -f"
alias folders='find . -maxdepth 1 -type d -print0 | xargs -0 du -sk | sort -rn'
alias free="free -m"
## Shows full ISO dates to the nanosecond:
## -rwxr-xr-x 1 tsmith tsmith 1MB 2020-10-01 00:48:49.759629612 -0500 bash_rc.aliases*
## -rwxr-xr-x 1 tsmith tsmith 1MB 2020-10-01 00:24:46.749613559 -0500 clone-github-repos.php*
alias lsdate="ls -l --time-style=full-iso"
# Creates an archive (*.tar.gz) from given directory.
function maketar() { tar cvzf "${1%%/}.tar.gz" "${1%%/}/"; }
# Create a ZIP archive of a file or folder.
function makezip() { zip -r "${1%%/}.zip" "$1" ; }
# create an directory and directly cd into it
mcd () {
mkdir -p $1
cd $1
}
# Dev aliases [RR=Copyright by Rishi Ramawat]
alias csup='(docker-compose up -d && docker-compose logs -ft)'
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 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 nuke="find . -maxdepth 1 ! -name '.' ! -name '.git' -exec rm -rf {} \; && git reset --hard"
alias behat='behat --format-settings='"'"'{"expand": true}'"'"''
alias gd='git diff'
alias ga='git add'
## End copyright by Rishi Ramawata
alias docker-prune='docker rmi $(docker images | grep "^<none>" | awk "{print $3}")'
alias psql="sudo -u postgres psql"
alias gco='git checkout --ours'
alias pf='php-cs-fixer fix'
# System performance
alias opti='optimus-manager --print-mode'
alias super7="7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on"
alias qmv='qmv --format=destination-only'
# Video Archiving aliases
# Part of the https://www.ourtube.me/ Platform.
alias youtube-dl='youtube-dl -f best --external-downloader aria2c --external-downloader-args="-x8 -s8 -k 1M"'
alias youtube-mp3="youtube-dl -x --audio-format mp3"
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]"'
# Get the video resolution [e.g., 1920x1080]
alias vidres="mediainfo mediainfo --Inform='Video;%Width%x%Height%'"
# Use Intel QSV for video hardware acceleration of VLC and mpv.
export LIBVA_DRIVER_NAME=iHD
alias mpv="mpv --hwdec=libva-intel-driver"