Skip to content

Instantly share code, notes, and snippets.

@ismriv
ismriv / javascript-sdk-snippet.js
Last active May 16, 2016 21:33
JavaScript SDK Snippet
(function(i, s, o, g, r, a, m) {
i['altocloud-sdk.js'] = r;
i[r] = i[r] || function() {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date();
a = s.createElement(o),
m = s.getElementsByTagName(o)[0];
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a, m)
@ismriv
ismriv / post-tcpdump
Created November 3, 2013 18:59
TCP dump of an AJAX POST request
21:32:21.281738 IP (tos 0x0, ttl 64, id 38969, offset 0, flags [DF], proto TCP (6), length 441)
192.168.1.11.62543 > somewhere.com.terabase: Flags [P.], cksum 0xc625 (correct), seq 3334:3723, ack 2799, win 8192, options [nop,nop,TS val 1128896825 ecr 279783228], length 389
0x0000: 4500 01b9 9839 4000 4006 b23b c0a8 010b E....9@.@..;....
0x0010: 92b9 9a5d f44f 0fa0 d7da cce1 5a85 a2b1 ...].O......Z...
0x0020: 8018 2000 c625 0000 0101 080a 4349 9939 .....%......CI.9
0x0030: 10ad 273c 4745 5420 2f67 6574 2e68 746d ..'<GET./get.htm
0x0040: 6c20 4854 5450 2f31 2e31 0d0a 486f 7374 l.HTTP/1.1..Host
0x0050: 3a20 6973 6d61 696c 6169 662e 636f 6d3a :.somewhere.com:
0x0060: 3430 3030 0d0a 436f 6e6e 6563 7469 6f6e 4000..Connection
0x0070: 3a20 6b65 6570 2d61 6c69 7665 0d0a 4361 :.keep-alive..Ca
@ismriv
ismriv / get-tcpdump
Created November 3, 2013 18:53
TCP dump of an AJAX GET request.
21:31:26.848910 IP (tos 0x0, ttl 64, id 60396, offset 0, flags [DF], proto TCP (6), length 442)
192.168.1.11.62543 > somewhere.com.terabase: Flags [P.], cksum 0x3202 (correct), seq 2476:2866, ack 2082, win 8192, options [nop,nop,TS val 1128842586 ecr 279780695], length 390
0x0000: 4500 01ba ebec 4000 4006 5e87 c0a8 010b E.....@.@.^.....
0x0010: 92b9 9a5d f44f 0fa0 d7da c987 5a85 9fe4 ...].O......Z...
0x0020: 8018 2000 3202 0000 0101 080a 4348 c55a ....2.......CH.Z
0x0030: 10ad 1d57 4745 5420 2f70 6f73 742e 6874 ...WGET./post.ht
0x0040: 6d6c 2048 5454 502f 312e 310d 0a48 6f73 ml.HTTP/1.1..Hos
0x0050: 743a 2069 736d 6169 6c61 6966 2e63 6f6d t:.somewhere.com
0x0060: 3a34 3030 300d 0a43 6f6e 6e65 6374 696f :4000..Connectio
0x0070: 6e3a 206b 6565 702d 616c 6976 650d 0a43 n:.keep-alive..C
@ismriv
ismriv / god
Created December 30, 2012 21:33
Init script for god service (using RVM)
#!/bin/bash
### BEGIN INIT INFO
# Provides: god
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: God