JSFiddler Tealeaf Test

Tealeaf-JSFiddle-Test-2015-08-10_17-04-20

Refer: http://jsfiddle.net/crd9abzd/2/

Source: JSFiddler-Tealeaf-Test.txt

External Resources:
https://qabook.hollandamerica.com/secondaryFlow/assets/analytics/tealeaf/tealeaf.4.0.0.1607.js?v=201507240707

HTML
<div id="report"></div>

JavaScript
var iteration = 0;
var reportDiv = document.getElementById("report");
var interval = setInterval(function(){
try{
iteration++;
TLT.flushAll();
reportDiv.innerHTML = "Minutes elapsed "+(iteration/60).toFixed(2)+" minutes";
}catch(e){
console.log(e);
reportDiv.innerHTML = "Tealeaf broke after "+(iteration/60).toFixed(2)+" minutes";
clearInterval(interval);
}
}, 1000);

CSS
None

Using Akamai Pragma headers to investigate or troubleshoot Akamai content delivery

Use ModifyHeaders for Firefox
Action: Add
Name: Pragma
Value: akamai-x-cache-on, akamai-x-cache-remote-on, akamai-x-check-cacheable, akamai-x-get-cache-key, akamai-x-get-extracted-values, akamai-x-get-nonces, akamai-x-get-ssl-client-session-id, akamai-x-get-true-cache-key, akamai-x-serial-no
Comment: Akamai Pragma

Refer: https://community.akamai.com/community/web-performance/blog/2015/03/31/using-akamai-pragma-headers-to-investigate-or-troubleshoot-akamai-content-delivery

Akamai servers are configured to provide plenty of useful information using HTTP headers - the key to extracting this information is making a HTTP request along with some custom Pragma headers. Below is the most commonly used set of Pragma request headers:

Pragma: akamai-x-cache-on, akamai-x-cache-remote-on, akamai-x-check-cacheable, akamai-x-get-cache-key, akamai-x-get-ssl-client-session-id, akamai-x-get-true-cache-key, akamai-x-get-request-id

And here is the explanation of what can be extracted using these headers as a response from Akamai Edge Server:

X-Check-Cacheable: NO
This header simply indicates whether this particular URL can be cached on Akamai or not.

X-Akamai-Request-ID: 2256a92
Request ID provides a unique request identifier on Akamai network. Value of this header can be used to trace a request on Akamai network by support representative.

X-Cache: TCP_MISS from a165-254-246-9.deploy.akamaitechnologies.com

X-Cache-Remote: TCP_HIT from a23-67-252-148.deploy.akamaitechnologies.com
Values of X-Cache headers mention which Akamai servers participated in serving your request. TCP_MISS/TCP_HIT will tell whether the content was served from cache (TCP_HIT) or if the machine had to go forward to fetch the file from somewhere else (TCP_MISS). X-Cache headers can also give an IP address of Akamai machine serving the content - as in the example above - the machines serving content are 165-254-246-9 and 23-67-252-148 - just replace dashes with dots and you will get an exact Akamai IP address!

A few other useful cache responses:

TCP_HIT: Object was fresh in cache and object from disk cache.
TCP_MISS: Object was not in cache, server fetched object from origin.
TCP_REFRESH_HIT: Object was stale in cache and was successfully refreshed with the origin on an If-Modified-Since request.
TCP_REFRESH_MISS: Object was stale in cache and refresh obtained a new object from origin in response to our IF-Modified-Since request.
TCP_REFRESH_FAIL_HIT: Object was stale in cache and failed on refresh (couldn't reach origin) so the stale object was served .
TCP_IMS_HIT: IF-Modified-Since request from client and object was fresh in cache and served.
TCP_NEGATIVE_HIT: Object previously returned a "not found" (or any other negatively cacheable response) and that cached response was a hit for this new request.
TCP_MEM_HIT: Object was on disk and in the memory cache. Server served it without hitting the disk.

X-Cache-Key: /L/152/14351/1d/origin-www.akamai.com/index2.html * - depracated
This header will return a Cache Key value which is used to store content on Akamai network.

There's also crucial information in the X-Cache-Key (Thank you Iain Hunneybell!):

That /1d/ means the item is on a 1 day cache setting. Useful if you want to check. Useful ones to look out for are:
0s: 0 second cache meaning serve from cache but revalidate on every request, e.g. check origin but don't re-download unless changed
000: Non-cacheable...a key code to recognise
5s: 5 (or however many) seconds
5m: 5 (or however many minutes)
5h: You'll never guess this one!

Small point:
akamai-x-get-cache-key has actually been deprecated because it doesn't indicate if a query string has been ignored in the cache key. It also shows serial, CP Code and TTL, which are not part of the cache key used to store the object.
While the information given in X-Cache-Key is useful it can be misleading, for example the TTL shown won't reflect any baseline value being overridden by origin cache-control or edge control headers. It can also show extra query parameters added by internal processes like RUM or FEO.

You should use akamai-x-get-true-cache-key and X-True-Cache-Key to get the real cache key used to store the object. It will represent the parts of the original URI used to form the key after any metadata rule processing.

Akamai Pragma HTTP headers can be injected into your request by one of the browser extensions or one of HTTP debugging applications. Some most popular examples include:

- Charles Proxy - HTTP/Web Debugging Proxy software
- Fiddler - free web debugging proxy
- Modify Headers Firefox plugin
- Firebug - another powerful Firefox plugin
- For Chrome, try experimenting with this extension: CDN Headers & Cookies - Chrome Web Store (Thank you Dwi Taniel!)

Create a Splunk Alert that Checks Logs Every 5 minutes

Refer: http://answers.splunk.com/answers/149182/alert-when-splunk-user-did-not-login-for-last-15-minutes.html

Create an Alert and these are the key pieces:

Search for Today, to work with wizard
index=book2-prod-app-porta | head 1 | eval age = now() - _time

crontab run every 5 minutes
*/5 * * * *

# This is for 300 seconds or 5 minutes
Custom Condition: search age > 300

Open here terminal in Ubuntu

Refer: http://askubuntu.com/questions/602234/is-it-possible-to-open-a-terminal-in-the-current-directory

Run sudo apt-get install nautilus-open-terminal in a terminal, followed by nautilus -q to quit all open nautilus windows. When nautilus is next opened, a line saying open in terminal should appear in the right click menu.

Please note that the package nautilus-open-terminal is in the universe repositories.

Checking / Pinging a Port

Ports are a concept of UDP and TCP. Ping messages are technically referred to as ICMP Echo Request and ICMP Echo Reply which are part of ICMP. ICMP, TCP, and UDP are "siblings"; they are not based on each other, but are three separate protocols that run on top of IP. Therefore you can not ping a port. What you can do, is use a port scanner like nmap.

$ nmap -p 80 mruckman.com

You can also use:

$ telnet mruckman.com 80

It will give an error if the port is closed or filtered

---

telnet 10.194.55.47 11222
nmap -p 11222 10.194.55.47

$ nmap -p 11222 10.194.55.47

Starting Nmap 6.40 ( http://nmap.org ) at 2015-07-08 06:09 PDT
Nmap scan report for haldevcache01.hq.halw.com (10.194.55.47)
Host is up (0.23s latency).
PORT STATE SERVICE
11222/tcp open unknown

Nmap done: 1 IP address (1 host up) scanned in 0.60 seconds

# Sign onto server itself
$ netstat -ntpl | grep 11222

Rename files in Linux

Here's how I use rename:

rename 's/search/replace/' *
And here's it in action:

oli@bert:~/Desktop/rawr$ ls
pie\u333.sh
oli@bert:~/Desktop/rawr$ rename 's/\\u333/PIE/' *
oli@bert:~/Desktop/rawr$ ls
piePIE.sh

Mac What’s Locking File

Refer: http://apple.stackexchange.com/questions/22259/how-to-check-whats-locking-a-file

$ sudo lsof | grep -i looking-for

You will still need to kill the process and you can try the rm command too.