-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.aliases
68 lines (59 loc) · 2.08 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
57
58
59
60
61
62
63
64
65
66
67
68
# Variables
CONFIG="$HOME/.config"
# Dotfiles Repo
alias dotfiles='$(which git) --git-dir=$HOME/.df --work-tree=$HOME'
# Main
case "$(uname)" in
Linux)
alias ls='ls --color'
[ -x "$(command -v xsel)" ] && alias pbcopy='xsel --clipboard --input'
[ -x "$(command -v xsel)" ] && alias pbpaste='xsel --clipboard --output'
;;
Darwin)
alias ls='ls -G'
alias battery='pmset -g batt'
alias dc='docker compose'
;;
esac
# Base
alias la='ls -A'
alias ll='ls -l'
alias lla='ls -lA'
alias cp='cp -v'
alias mv='mv -v'
alias rm='rm -v'
alias ln='ln -iv'
mcd() { mkdir -p -- "$1" && cd "$1" }
mrename() { for file in $1; do mv -- "$file" "${file}.txt"; done; }
mtouch() { mkdir -p -- "$1"; touch "$1/$2"; }
alias shred='shred -fvuzn 35'
alias whereami='echo $PWD'
alias off='sudo shutdown now'
alias reboot='sudo shutdown -r now'
alias rmswap='sudo swapoff -a; sudo swapon -a;'
[ -x "$(command -v batcat)" ] && alias bat='batcat'
#[ -x "$(command -v python3)" ] && alias python='python3'
[ -x "$(command -v xsel)" ] && alias pbcopy='xsel --clipboard --input'
[ -x "$(command -v xsel)" ] && alias pbpaste='xsel --clipboard --output'
alias g='git'
alias notebook='sh $CONFIG/scripts/notebook.sh'
alias aws='docker run --rm -it -v $HOME/.aws:/root/.aws:ro -v $(pwd):/aws public.ecr.aws/aws-cli/aws-cli'
alias harp='ssh otsaw-rnd1 "cat ~/Downloads/harp.mp3" | play --type mp3 -'
alias rickroll='ssh otsaw-rnd1 "cat ~/Downloads/rickroll.mp3" | play --type mp3 -'
porttest() { curl portquiz.net:$1; }
cheat() { curl cht.sh/$1; }
ipaddress() { curl -4 ifconfig.co/$1; }
# Docker / Podman
# [ -x "$(command -v podman)" ] && alias docker='podman'
# [ -x "$(command -v podman)" ] && alias d='podman' || alias d='docker'
alias dps='docker ps -a'
alias di='docker images'
alias drm='docker rm $(docker ps -aqf status=exited)'
alias drmi='docker rmi -f'
alias drun='docker run --rm'
alias dalias='alias | grep ^docker'
alias docker-compose='docker compose'
alias dcb='docker compose build'
alias dcu='docker compose up -d'
alias dcd='docker compose down'
dbash() { d exec -it $1 bash; }