Skip to content

Instantly share code, notes, and snippets.

View cab-1729's full-sized avatar
☣️
"Sometimes my genius, it's almost frightening."

cab-1729

☣️
"Sometimes my genius, it's almost frightening."
View GitHub Profile
@cab-1729
cab-1729 / synctime.sh
Created March 17, 2023 08:59
synctime.sh
#!/bin/sh
echo -e "\033[0;31m$(figlet WARNING)\nThis script uses the internet to ping \033[1;36mwww.archlinux.org\033[1;32m"
timedatectl set-time "$(date -d "$(curl --head www.archlinux.org | grep Date | cut -d ' ' -f 3-6) $(sed -n '$s/:/ hours /;$s/^[A-Z]*-//;$p' /etc/localtime) minutes" +"%Y-%m-%d %H:%M:%S")"
@cab-1729
cab-1729 / CTAN.sh
Last active May 8, 2024 00:19
Download all LaTeX documentation from CTAN
#!/bin/sh
#last run: Fri 03 May 2024 08:10:25 PM IST
#Program to download all CTAN Latex documentation and store it locally
set -x #show commands
cd "$(dirname "$0")" #be proper directory
echo "#!/bin/sh
#last run: $(date +'%c')
$(tail -n +3 "$0")" > .temp #store file with new date
[ -d "Source" ] || mkdir Source;[ -d "Docs" ] || mkdir Docs;[ -d "Pages" ] || mkdir Pages #make directories
rm Docs/*;rm -rf Source/* #clean existing documentation