Last active 1742540822

.zshrc Raw
1# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
2# Initialization code that may require console input (password prompts, [y/n]
3# confirmations, etc.) must go above this block; everything else may go below.
4if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
5 source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
6fi
7
8export ZSH="/root/.oh-my-zsh"
9PATH=/snap/bin:/usr/sbin:/sbin:/usr/local/sbin:$PATH
10export LC_ALL="en_US.UTF-8"
11ZSH_THEME="aussiegeek"
12plugins=(
13 zsh-syntax-highlighting
14 zsh-autosuggestions
15)
16source $ZSH/oh-my-zsh.sh
17alias sync="rsync -avz -e 'ssh -p1079'"
18alias udemydl="youtube-dl -u malin@cenusa.me -o '%(playlist)s/%(chapter_number)s - %(chapter)s/%(playlist_index)s. %(title)s.%(ext)s'"
19alias clmac="find ./ -name '._*' -o -name '.DS_Store' -o -name '.apdisk' -o -name '.lyndisk' | sed 's/.*/\"&\"/' | xargs rm -rfv"
20alias cpwp="cp -a /root/wordpress/* ."
21alias fixow="chown -R nobody:nogroup ./"
22alias wpht="cat /root/.htaccess >> ./.htaccess"
23alias fixwp="cpwp && wpht && fixow"
24alias goup="apt update && apt upgrade -y && apt autoremove && apt dist-upgrade -y"
25alias flt="mkdir $1{files,tmp,log}"
26alias wssl="wget --no-check-certificate"
27alias wrip="wget -r -nc -np"
28alias move="rsync -avz --remove-source-files --progress"
29alias wbulk="wget --content-disposition -c -N --tries=0 --read-timeout=20 -q --show-progress"
30alias mp3rip="youtube-dlc --restrict-filenames --extract-audio --audio-format mp3"
31alias cleancrap="find ./ -type f -regex '.*\.exe\|.*\.diz\|.*\.nfo\|.*\.txt\|.*\.url\|.*\.nzb\|.*\.torrent' -exec rm -rfv {} \;"
32alias license="/usr/local/cpanel/cpkeyclt"
33
34editz() {
35pdnsutil edit-zone $1
36 }
37
38createz() {
39 pdnsutil create-zone $1
40 }
41
42push() {
43 for i in {1..10}
44 do
45 pdnsutil increase-serial $1
46 pdns_control notify $1
47 done
48}
49
50sslcert() {
51 certbot certonly --webroot -w /home/www/$1/files -d $1 -d www.$1 -d cdn.$1
52}
53
54wban() {
55 fail2ban-client set wordpress banip $1
56}
57
58flickr() {
59 ruby flickr-photo-downloader.rb $1 -d /flickr/$2
60}
61
62weather() {
63 curl "wttr.in/${1:-vilafranca de bonany}?m"
64}
65
66resolve() {
67 dig +short $1 $2
68}
69
70ns12() {
71 echo -n 'NS1: '; dig +short $1 @ns1.palmasolutions.net
72 echo -n 'NS2: '; dig +short $1 @ns2.palmasolutions.net
73}
74
75ttfb() {
76 curl -s -w 'Testing Website Response Time for :%{url_effective}\n\nLookup Time:\t\t%{time_namelookup} seconds\nConnect Time:\t\t%{time_connect} seconds\nAppCon Time:\t\t%{time_appconnect} seconds\nRedirect Time:\t\t%{time_redirect} seconds\nPre-transfer Time:\t%{time_pretransfer} seconds\nStart-transfer Time:\t%{time_starttransfer} seconds\n\nTotal Time:\t\t%{time_total}\n' -o /dev/null https://$1
77}
78
79lcheck() {
80 latency=`ttfb $1 | grep Total | cut -f3-`
81 if (( $(bc -l <<< "$latency >= 1") ));
82 then
83 echo -n $1; echo -n ' > lag > '; echo $latency
84 else
85 echo -n $1; echo -n ' > no lag > '; echo $latency
86 fi
87}
88
89pwg() {
90 printf "%s" "$(tr -cd '[:graph:]' < /dev/urandom | tr -d '\-#&\+,\.\/\:\`\"'\' | head -c"${1:-32}")";
91};
92
93getpings() {
94 for i in $(cat /root/sites);
95 do lcheck $i;
96 done
97}
98
99alias dfd='df -h | grep -e "/dev/sd" -e "Filesystem" --color=never'
100
101login() {
102 ssh root@$i -p 1079
103}
104
105wlfw() {
106 ufw allow from $1 to any port $2 proto $3 comment "$4"
107}
108
109inst() {
110 apt install $1 -y
111}
112
113ripw() {
114 wget -r -np -nc --tries=0 --reject iso,exe,html,htm,nfo,nzb,torrent --read-timeout=20 --no-check-certificate -q --show-progress $1
115}
116
117# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
118[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
119