-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaliases
56 lines (49 loc) · 2.53 KB
/
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
# APT
alias dpki='sudo dpkg -i'
alias apti='sudo apt install -y'
alias aptr='sudo apt remove --purge -y'
alias update="sudo apt-get update ; sudo apt-get -y upgrade ; sudo apt-get -y dist-upgrade; aptclean"
alias aptclean="sudo apt-get -y autoremove ; sudo apt-get -y autoclean; sudo apt-get install -f ; sudo apt-get clean"
alias fullupdate='update && npm -g upgrade && sudo -H composer self-update && composer global update'
# Files & folders
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias mkcd='foo(){ mkdir -p "$1"; cd "$1" }; foo '
alias octal='stat -c "%a %n"'
alias lla='ls -la'
alias ls='ls --group-directories-first --color'
alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'"
# System
alias psa="ps auxf"
alias psg="ps aux | grep -v grep | grep -i -e VSZ -e"
alias meminfo='free -m -l -t'
# Git
alias gl='git log --graph --pretty=format:"%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset" --abbrev-commit'
alias nah='nah(){ git reset --hard; git clean -df; if [ -d ".git/rebase-apply" ] || [ -d ".git/rebase-merge" ]; then; git rebase --abort; fi; }; nah'
alias wip='git add . && git commit -m "wip"'
alias wtc="curl --silent 'https://whatthecommit.com/index.txt'"
alias gcom='git commit -m "$(wtc)"'
# PHP
#alias php="docker run --rm --interactive --tty --volume $PWD:/app -w /app php:latest php"
#alias composer="docker run --rm --interactive --tty --volume $PWD:/app composer/composer"
alias p='./vendor/bin/phpunit --stop-on-error'
alias pf='./vendor/bin/phpunit --stop-on-error --filter'
alias pw='phpunit-watcher watch --stop-on-error'
alias pwf='phpunit-watcher watch --stop-on-error --filter'
# Go
alias gorun='gorunfunc(){ reflex -d none -s -r "\.go$" -- go run $(find $1 -type f -name "*.go" | grep -v _test.go) }; gorunfunc'
# Docker
alias dcom='docker compose --profile development'
alias docker-cl='docker rm -vf $(docker ps -a -q) && docker rmi -f $(docker images -a -q) && docker system prune -f'
alias phpd='docker run --rm -it -v $PWD:/app -w /app php:latest php'
alias openapi='docker run --rm -p 8123:8080 -e SWAGGER_JSON=/tmp/schema.yaml -v $PWD:/tmp swaggerapi/swagger-ui'
# Shortcuts
alias showalias="cat ~/.aliases"
alias myip='curl http://ipecho.net/plain; echo'
alias hs='history | grep'
alias ft='ft(){ grep -rnw `pwd` -e "$1" }; ft'
alias snano='sudo nano'
alias weather='curl -H "Accept-Language: pt-BR" wttr.in'
alias w='curl -s -H "Accept-Language: pt-BR" wttr.in\?format\=3'
alias randpw='randpw(){ < /dev/urandom tr -dc "_!@#$%A-Z-a-z-0-9" | head -c${1:-16}; echo;}; randpw'