Count IP Occurrences in Apache / Nginx Logs

This command will parse an Apache or Nginx log file and print-out the 50 highest occurring IP’s, along with the number of occurrences, to the shell prompt. machine:~ User$ cat access.log | awk ‘{print $1}’ | sort -n | uniq -c | sort -nr | head -50 cat – reads the file access.log – is… Continue reading Count IP Occurrences in Apache / Nginx Logs

Quickly Testing TTFB (Time To First Byte) with Apache Benchmarking Tool

Checking the cause of a high TTFB (Time To First Byte) can be time consuming. And pinpointing the issue requires multiple tests against even the smallest changes. Enter Apache’s Benchmarking Tool ab to help with quick testing. ab -n 100 http://www.website.com/ The above command will execute 100 tests against the website entered. The results are… Continue reading Quickly Testing TTFB (Time To First Byte) with Apache Benchmarking Tool

AWS EC2 Amazon Linux AMI change timezone

AWS (Amazon Web Services) EC2 Amazon Linux AMI timezone will most likely be different than your local machines’ timezone. To remedy this issue on Amazon’s Linux machine image, ssh in and type the following commands in prompt: sudo su become root user ln -sf /usr/share/zoneinfo/America/Toronto /etc/localtime Choose your time zone ( in this example Toronto… Continue reading AWS EC2 Amazon Linux AMI change timezone

RSYNC – Fastest Way to Download a Clone of any directory

RSYNC is the fastest way to clone and sync directories from any server. Below is an rsync example using ssh tunneling on port 2222 to a server using cPanel, thus the exclusion of the .cpanel and public_ftp. /home/user is the folder to clone/sync to /Volumes/HardDrive/BackupLocation. And a log file is created to log any issues… Continue reading RSYNC – Fastest Way to Download a Clone of any directory

Secure Google search – encrypted search string and url

https://encrypted.google.com/ If you want to search Google securely, over an encrypted connection, use the above link. This prevents your search from being seen by anyone but you and Google, that includes your ISP. Resources: http://stackoverflow.com/questions/499591/are-https-urls-encrypted Video explaining SSL Security Now, episode #195

Generate CSR file for GoDaddy SSL certificate in OSX, using terminal command line and openssl

This works for generating CSR files required by GoDaddy SSL certificates. This will work with more than just GoDaddy SSL certificates, you can even sign your own certificates. In the Terminal application, type: $ openssl genrsa -des3 -out domain.key 2048 You will now have to enter a passphrase, so type: $ openssl req -new -key… Continue reading Generate CSR file for GoDaddy SSL certificate in OSX, using terminal command line and openssl

Duplicate row in MySQL

INSERT INTO `table` (`col1`, `col2`, `col3`, `col4`) SELECT `col1`, `col2`, `col3`, `col4` FROM `table` WHERE `id`=1; `id` can be anything unique.

Published
Categorized as Networking