Skip to content

Instantly share code, notes, and snippets.

View kartikeytewari's full-sized avatar
🖥️
Programming

Kartikey Tewari kartikeytewari

🖥️
Programming
View GitHub Profile
cat server_log_14-01-2021.log | egrep -o '([0-9]{1,3}\.){3}[0-9]{1,3}' | sort | uniq > temp_file
cat temp_file | while read line
do
curl "https://tools.keycdn.com/geo.json?host=$line" 2>/dev/null | jq .data.geo.city >>country_name_of_requests
done
cat country_name_of_requests | sort
rm temp_file
rm country_name_of_requests
cat /var/log/qeats-server.log | egrep -o '([0-9]{1,3}\.){3}[0-9]{1,3}' | sort | uniq > temp_file
cat temp_file | while read line
do
curl "https://tools.keycdn.com/geo.json?host=$line" 2>/dev/null | jq .data.geo.country_name >>country_name_of_requests
done
cat country_name_of_requests | sort | uniq
rm temp_file
rm country_name_of_requests
function build_latex()
{
for arg in "$@"
do
case $arg in
# for building latex without bibliography
-bs|--build_small)
pdflatex ${1}.tex
;;
# for building latex with bibliography