Top

Tags: Linux

Count website views in Bash script

Sep 29, 2020 | 690 views

#Linux #Bash


count_website_views.sh

First line combine all log files into STDIN stream, then grep certain website host, use double quote as seperator and filter second column as it is a url. Finally, sort it, count it, and sort it again.

zcat /var/log/nginx/access.log*.gz | cat - /var/log/nginx/access.log | \
    grep -E 'https://(www.|)stateofemptiness.com/' | \
    awk -F '"' '{print $2}' | awk '{print $2}' | sort | uniq -c | sort -n 

Filter a certain period of time in access.log

sed -n '/25\/Sep\/2020/,/30\/Sep\/2020/p' /var/log/nginx/access.log
# Or in a less concise way
grep -E $(for i in `seq 25 30`; do echo -n "$i/Sep/2020"; [ $i -ne 30 ] && echo -n "|"; done) /var/log/nginx/access.log


Comments: 0

Kubernetes Dynamic Provisioning Using Dedicated GlusterFS and Heketi

Sep 17, 2020 | 753 views

#Linux #Docker #k8s


Comments: 0

Install GlusterFS on CentOS7 Tutorial

Sep 16, 2020 | 762 views

#Linux #k8s


Tutorial:

Comments: 0

Set Up a Private Docker Registry on CentOS

Sep 10, 2020 | 745 views

#Linux #Docker

Tutorial refer to here: How To Set Up a Private Docker Registry on Ubuntu 18.04

Also check Sharing docker images without a registry

Comments: 0