-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.sh_aliases
63 lines (50 loc) · 2.08 KB
/
.sh_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
#!/bin/sh
# shellcheck shell=bash
# NOTE: This aliases file is sourced from both .zshrc and .bashrc, so must be compatible with both shells
# enable color support of ls and also add handy aliases
if [[ -x /usr/bin/dircolors ]]; then
if [[ -r ~/.dircolors ]]; then eval "$(dircolors -b ~/.dircolors)"; else eval "$(dircolors -b)"; fi
alias ls='ls --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
if command -v lsd >/dev/null 2>&1; then
alias ls='lsd'
else
alias ls="ls -G"
fi
alias la='ls --color=auto -alF'
alias ll='la'
alias tools='echo "gron\nyq"'
alias sucode="sudo code --user-data-dir='/root/.config/Code/' --no-sandbox --disable-gpu-sandbox --"
alias clear="clear.sh"
alias rmdir="rmdir.sh"
alias dotedit='code $(dirname $(realpath ~/.bashrc))/dotfiles.code-workspace'
# shellcheck disable=2142
alias current-paths='echo $PATH | awk -F : '"'"'BEGIN {OFS="\n"}; {$1=$1; print $0}'"'"
alias dirs='dirs -v'
alias macbook='ssh -L 3001:localhost:3001 -L 3002:localhost:3002 -L 3003:localhost:3003 -L 8089:localhost:8089 ca-dschoof-02.local'
# Remove any ram disks that have been created
alias remove-ram-disks="ll /dev | rg -e 'damien\.schoof.* disk' | sed -E 's/.* (disk)/\1/' | xargs -I{} hdiutil detach -verbose '/dev/{}'"
# Update all installed cargo binaries
alias cargo-update="cargo install \$(cargo install --list | rg '^[a-z0-9_-]+ v[0-9.]+:$' | cut -f1 -d' ')"
# alias temp-chrome="~/.local/share/flatpak/exports/bin/org.chromium.Chromium --temp-profile --user-data-dir=/tmp/${RANDOM}"
source_or_err ~/.talos_aliases
function killp() (
if [[ -z "$1" ]]; then
echo "Usage: killp <process name> [<kill args>]"
return 1
fi
search=$1
shift
# set -x
ps -eaf | awk '/[[:blank:]]awk[[:blank:]]/{next;} /'"${search}"'/{print $2}' | while read -r pid; do
echo "Kill process $(ps -p "$pid" -o pid=) ${GRAY}$(ps -p "$pid" -o command=)${RESET}? (y/N)"
if read -qs; then
kill "$@" "$pid"
else
echo "Skipping $pid"
fi
done
)