-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzshrc.Linux.after.sh
88 lines (76 loc) · 2.44 KB
/
zshrc.Linux.after.sh
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
export DPKG_PAGER="cat"
export SYSTEMD_PAGER="cat"
# alias systemctl="systemctl --no-pager"
function binstall() {
local base="$(basename "$1")"
[[ ! -f "$base" ]] && echo "🔴 !file -> '$base'" && return 1
local target="$(readlink -f "${2:-"/usr/local/bin"}")"
[[ ! -d "$target" ]] && echo "🔴 !directory -> '$target'" && return 1
sudo cp -f -t "$target" "$base"
sudo chown root:root "$target/$base"
sudo chmod 755 "$target/$base"
rd "$base"
}
function ldd() {
local v && for v in "$@"; do
$(which -p ldd) "$v" | bl nix
done
}
unalias sc-status &>/dev/null
alias sc-status="systemctl --full status"
# unalias sc-list-units &>/dev/null
# alias sc-list-units="systemctl --all list-units"
# unalias sc-list-unit-files &>/dev/null
# alias sc-list-unit-files="systemctl --all list-unit-files"
alias nftls="sudo nft --handle list ruleset | bat --file-name='nft list ruleset' -l nft"
alias sshdtest="sudo sshd -T -f /etc/ssh/sshd_config | sortt"
alias .h2o="sudo subl /etc/h2o/h2o.conf"
alias cdd="cd ~/downloads"
function upg() {
bhr && echo "🟡 brew" && bhr
bupd; bupg; bclr
bhr && echo "🟡 tldr" && bhr
tldr --update
bhr && echo "🟡 cargo" && bhr
cgout; cgupg
bhr && echo "🟡 antidote update" && bhr
abupd
bhr && echo "🟡 npm" && bhr
npmo -g
}
function ubuntu-bak() {
local outzip=ubuntu.$(dateiso).zip
aptls > aptls.log
bls > bls.log
sudo zip -e -r $outzip \
/etc /usr/local/etc \
/var/lib/emby/root/default /var/lib/emby/config \
~/.config ~/.local \
~/.bashrc ~/.profile ~/.zshenv ~/.zshrc \
~/.megarc ~/.megaCmd \
~/.z ~/.zsh_history \
aptls.log bls.log \
-x '*/.config/emby-server/*'
echo
sudo chown ubuntu:ubuntu $outzip
rm aptls.log bls.log
echo
l $outzip
}
# if [[ -x "$HOME/.linuxbrew/bin/brew" ]]; then
# alias brew="$HOME/.linuxbrew/bin/brew"
# source "$DOTFILES/modules/homebrew.sh"
# fi
# alias nixcp="sudo cp -f $HOME/.nix-profile/bin/* /usr/local/bin"
# alias nixln="sudo ln -sfv $HOME/.nix-profile/bin/* /usr/local/bin"
# if which -w cglnbin | grep -q "alias$"; then
# unalias cglnbin &>/dev/null
# alias cglnbin="sudo ln -sf $HOME/.cargo/bin/* /usr/local/bin"
# fi
# if which -w golnbin | grep -q "alias$"; then
# unalias golnbin &>/dev/null
# alias golnbin="sudo ln -sf $GOBIN/* /usr/local/bin"
# fi
# if [[ -x "$(which pm2)" ]]; then
# source <(pm2 completion)
# fi