This file contains 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
yum install -y libnet && cd /tmp/ | |
wget http://mirror.chpc.utah.edu/pub/epel/5/i386/epel-release-5-4.noarch.rpm && rpm -Uvh epel-release-5-4.noarch.rpm | |
wget http://mirror.cogentco.com/pub/linux/epel//5/x86_64/syslog-ng-2.1.4-9.el5.x86_64.rpm && rpm -Uvh syslog-ng-2.1.4-9.el5.x86_64.rpm |
This file contains 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
HTTP/1.1 200 OK |
This file contains 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
$ tail -50000 access.log |grep -Po '(?<=http://)[^/]+' |sort |uniq -c |sort -n |tail -30 |sort -nr | |
2051 s3.domain.com | |
506 encdn.foo.com | |
417 www.barfoo.com | |
384 cdn.example.com |
This file contains 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
sed 's/[abc]/2/gi;s/[def]/3/gi;s/[ghi]/4/gi;s/[jkl]/5/gi;s/[mno]/6/gi;s/[pqrs]/7/gi;s/[tuv]/8/gi;s/[wxyz]/9/gi' <<<"1-800-SHOWNUM" -- Command Line Magic (@climagic) |
This file contains 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 | |
function getapistats () { | |
curl -s http://api.example.com/stats > api-stats.txt | |
awk {'print $1'} api-stats.txt > api-stats-int.txt | |
awk {'print $2'} api-stats.txt > api-stats-fqdm.txt | |
} | |
# api-stats.txt example | |
# 992 cdn.example.com |
This file contains 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
curl -IH "Accept-Encoding: gzip" http://cp2pull.rwstest.netdna-cdn.com/flowplayer-3.2.6.min.js | |
HTTP/1.1 200 OK | |
Date: Tue, 07 Aug 2012 03:49:44 GMT | |
Content-Type: application/javascript | |
Connection: keep-alive | |
Last-Modified: Fri, 04 Mar 2011 10:01:08 GMT | |
ETag: "5c04508-41af-49da53993e100" | |
Vary: Accept-Encoding | |
Server: NetDNA-cache/2.2 |
This file contains 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
curl -IH "Accept-Encoding: gzip" http://cp2pull.rwstest.netdna-cdn.com/flowplayer-3.2.6.min.js | |
HTTP/1.1 200 OK | |
Date: Tue, 07 Aug 2012 03:43:35 GMT | |
Content-Type: application/javascript | |
Content-Length: 16815 | |
Connection: keep-alive | |
Last-Modified: Fri, 04 Mar 2011 10:01:08 GMT | |
ETag: "5c04508-41af-49da53993e100" | |
Vary: Accept-Encoding |
This file contains 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
location / { | |
gzip on; # Enables Gzip | |
gzip_min_length 100; # If file is below 100 bytes no on-the-fly compression is made | |
gzip_types text/plain text/xml application/xml text/css text/javascript application/javascript application/x-javascript text/x-component application/json application/xhtml+xml application/rss+xml application/atom+xml application/vnd.ms-fontobject image/svg+xml application/x-font-ttf font/opentype; # Sets the file/mime types to gzip | |
gzip_disable "MSIE [1-6]\."; # Disable GZip for IE versions 1-6 user-agents | |
} |
This file contains 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
curl -I http://cp2pull.rwstest.netdna-cdn.com/flowplayer-3.2.6.min.js | |
HTTP/1.1 200 OK | |
Date: Tue, 07 Aug 2012 01:56:43 GMT | |
Content-Type: application/javascript | |
Connection: keep-alive | |
Last-Modified: Fri, 04 Mar 2011 10:01:08 GMT | |
ETag: "5c04508-41af-49da53993e100" | |
Vary: Accept-Encoding | |
Server: NetDNA-cache/2.2 |
This file contains 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
curl -I http://cp2pull.rwstest.netdna-cdn.com/flowplayer-3.2.6.min.js | |
HTTP/1.1 200 OK | |
Date: Tue, 07 Aug 2012 01:56:43 GMT | |
Content-Type: application/javascript | |
Connection: keep-alive | |
Last-Modified: Fri, 04 Mar 2011 10:01:08 GMT | |
ETag: "5c04508-41af-49da53993e100" | |
Vary: Accept-Encoding | |
Server: NetDNA-cache/2.2 |