Last active
February 12, 2022 14:05
-
-
Save Zerophase/3dfc16f9593b884b5b2627a84344d873 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"aria2": { | |
"args": [ | |
"--no-conf", | |
"--allow-overwrite=true", | |
"--always-resume=false", | |
"--auto-file-renaming=false", | |
"--check-integrity=true", | |
"--conditional-get=true", | |
"--continue=true", | |
"--file-allocation=falloc", | |
"--log-level=error", | |
"--max-concurrent-downloads=100", | |
"--max-connection-per-server=5", | |
"--min-split-size=5M", | |
"--remote-time=true", | |
"--show-console-readout=true" | |
], | |
"path": "/usr/bin/aria2c" | |
}, | |
"pacman": { | |
"config": "/etc/pacman.conf", | |
"path": "/usr/bin/pacman" | |
}, | |
"pacserve": { | |
"server": null | |
}, | |
"powerpill": { | |
"select": true, | |
"reflect databases": false | |
}, | |
"reflector": { | |
"args.unused": [ | |
"--protocol", | |
"http", | |
"--latest", | |
"50" | |
] | |
}, | |
"rsync": { | |
"args": [ | |
"--no-motd", | |
"--progress" | |
], | |
"db only": true, | |
"path": "/usr/bin/rsync", | |
"servers": | |
[ | |
"rsync://mirror.csclub.uwaterloo.ca/archlinux/$repo/os/$arch", | |
"rsync://rsync.localmsp.org/arch/$repo/os/$arch", | |
"rsync://lug.mtu.edu/archlinux/$repo/os/$arch", | |
"rsync://mirrors.kernel.org/archlinux/$repo/os/$arch", | |
"rsync://mirror.lty.me/archlinux/$repo/os/$arch", | |
"rsync://archlinux.polymorf.fr/archlinux/$repo/os/$arch", | |
"rsync://mirror.js-webcoding.de/pub/archlinux/$repo/os/$arch", | |
"rsync://ftp.nluug.nl/archlinux/$repo/os/$arch", | |
"rsync://mirror.de.leaseweb.net/archlinux/$repo/os/$arch", | |
"rsync://mirror.neuf.no/archlinux/$repo/os/$arch", | |
"rsync://archlinux.honkgong.info/archlinux/$repo/os/$arch", | |
"rsync://mirrors.uni-plovdiv.net/archlinux/$repo/os/$arch", | |
"rsync://ftp.sh.cvut.cz/arch/$repo/os/$arch", | |
"rsync://archlinux.mirror.pkern.at/archlinux/$repo/os/$arch", | |
"rsync://mirror.f4st.host/archlinux/$repo/os/$arch", | |
"rsync://mirror.datacenter.by/archlinux/$repo/os/$arch", | |
"rsync://ftp.swin.edu.au/archlinux/$repo/os/$arch", | |
"rsync://archlinux.c3sl.ufpr.br/archlinux/$repo/os/$arch", | |
"rsync://mirror.dkm.cz/archlinux/$repo/os/$arch", | |
"rsync://ftp.yzu.edu.tw/Linux/archlinux/$repo/os/$arch" | |
] | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
declare -a servers | |
servers=($(reflector -p rsync -f 30 -l 20 -p 20 --sort rate | grep -o 'rsync:\/\/.*')) | |
linesToWrite=$(printf "\t\t\t\"%s\",\\\n" "${servers[@]}" | head -c -3 ) | |
perl -i -0pE 'my $repo = "\$repo"; my $arch = "\$arch";'\ | |
's|([[:blank:]]+\"rsync://[^\]]+)|'"${linesToWrite}"'\n\t\t|gs' /home/zerophase/testSed # change to powerpill.json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment