-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdot_aliases.tmpl
86 lines (69 loc) · 2.29 KB
/
dot_aliases.tmpl
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
#
# General Aliases
#
# replacement for 'ls' (https://eza.rocks)
if [ "$(command -v eza)" ]; then
alias eza="eza --icons --group-directories-first --time-style=iso --git"
export LS_CMD=eza
else
export LS_CMD=ls
fi
if [[ $OSTYPE == darwin* ]]; then
alias l.="$LS_CMD -d .*"
alias ll="$LS_CMD -lh"
alias ls="$LS_CMD"
elif [[ $OSTYPE == linux* ]]; then
alias l.="$LS_CMD -d .* --color=auto"
alias ll="$LS_CMD -lh --color=auto"
alias ls="$LS_CMD --color=auto"
fi
if [ "$(command -v nvim)" ]; then
alias vi=nvim
export EDITOR=nvim
elif [ "$(command -v vim)" ]; then
alias vi=vim
export EDITOR=vim
fi
if [ "$(command -v docker)" ]; then
alias docker-stop-all="docker stop $(docker ps -a -q)"
fi
# /~https://github.com/defunkt/gist
if [ "$(command -v gist)" ]; then
alias gist="gist -c"
fi
# List open ports
alias openports2='netstat -nape --inet'
alias openports="netstat -tunlp"
# What are my DNS servers (for the cases where you can't just cat /etc/resolv.conf)
# Only works if NetworkManager CLI is installed.
if [ "$(command -v nmcli)" ]; then
alias which-dns="( nmcli dev list || nmcli dev show ) 2>/dev/null | grep DNS"
fi
# SSH using password authentication
alias sshpw="ssh -o PreferredAuthentications=password -o PubkeyAuthentication=no "
alias ssh-nocheck="ssh -o StrictHostKeyChecking=no "
alias ssh-noconfig="ssh -F /dev/null "
# What files are using all my disk space - sorted list
alias diskspacehogs="du -S | sort -n -r | more"
# Some filesystem queries
alias emptydirs="find . -type d -empty"
alias emptyfiles="find . -type f -empty"
# To see if a command is aliased, a file, or a built-in command
alias checkcommand="type -t"
# lovely directory trees
alias tree='tree -CAhF --dirsfirst'
alias treed='tree -CAFd'
{{ if .work }}
alias caget="caget -a"
alias quota="quota -s -f /nsls2/users/$USER"
alias okta="flatpak run com.okta.developer.CLI"
{{ end }}
# Show what git aliases I have defined
alias git-aliases="git config --get-regexp ^alias"
{{ if eq .chezmoi.os "linux" }}
# systemd TUI
alias isd-tui="uvx --python=3.12 isd-tui"
{{ end -}}
# Clean up local branches where remote has "gone".
# TODO: Fix this, doesn't currently work correctly
#alias git-clean-local-branches="git fetch -p && git branch -vv | awk '/: gone]/{print $1}' | xargs git branch -d"