Skip to content

Instantly share code, notes, and snippets.

View ywkaras's full-sized avatar

Walt Karas ywkaras

View GitHub Profile
@ywkaras
ywkaras / BufferWriter.txt
Created August 2, 2017 18:12
Code without and with BufferWriter class
Old:
*via_string++ = ' ';
*via_string++ = '[';
// incoming_via can be max MAX_VIA_INDICES+1 long (i.e. around 25 or so)
if (s->txn_conf->insert_request_via_string > 2) { // Highest verbosity
via_string += nstrcpy(via_string, incoming_via);
} else {
memcpy(via_string, incoming_via + VIA_CLIENT, VIA_SERVER - VIA_CLIENT);
@ywkaras
ywkaras / gist:77cded83e762f09e5ace41b8ce97686e
Created August 24, 2017 22:34
A uServer req/response JSON DB
{"timestamp": "1234567890.098", "version": "0.1", "encoding": "url_encoded", "txns": [{"timestamp": "", "response": {"timestamp": "1469733493.993", "body": "", "headers": "HTTP/1.1 200 OK\r\nConnection: close\r\n\r\n"}, "uuid": "", "request": {"timestamp": "1469733493.993", "body": "", "headers": "GET / HTTP/1.1\r\nHost: www.example.com\r\n\r\n"}}]}
@ywkaras
ywkaras / gist:239e7843d9313df00a478233dc0160d5
Created September 1, 2017 18:13
traffic_manager privilege elevation failure caused by traffic_ctl config set
[E. Mgmt] log ==> [TrafficManager] using root directory '/home/wkaras/TS2/tests/_sandbox/forwarded/ts2'
[Sep 1 18:10:07.445] Server {0x2b2a378667a0} DEBUG: <DNS.cc:1763 (ink_dns_init)> (dns) ink_dns_init: called with init_called = 0
[Sep 1 18:10:07.452] Server {0x2b2a378667a0} DEBUG: <DNS.cc:283 (dns_init)> (dns) localhost=beliesimplies.corp.ne1.yahoo.com
[Sep 1 18:10:07.452] Server {0x2b2a378667a0} DEBUG: <DNS.cc:284 (dns_init)> (dns) Round-robin nameservers = 1
[Sep 1 18:10:07.462] Server {0x2b2a3c90c700} DEBUG: <DNS.cc:540 (startEvent)> (dns) DNSHandler::startEvent: on thread 0
[Sep 1 18:10:07.462] Server {0x2b2a3c90c700} DEBUG: <DNS.cc:483 (open_con)> (dns) open_con: opening connection 98.138.236.9:53
[Sep 1 18:10:07.462] Server {0x2b2a3c90c700} DEBUG: <DNSConnection.cc:150 (connect)> (dns) random port = 0.0.0.0:31273
[Sep 1 18:10:07.462] Server {0x2b2a3c90c700} DEBUG: <DNS.cc:513 (open_con)> (dns) opening connection 98.138.236.9:53 SUCCEEDED for 0
[Sep 1 18:10:07.462] Server {0x2b2a3c90c700} DEBU
@ywkaras
ywkaras / gzip.config
Created November 22, 2017 22:02
gzip plugin brotli problems
cache true
remove-accept-encoding true
compressible-content-type text/*
supported-algorithms br,gzip
wkaras ~/TS6/doc
$ make clean
Making clean in .
make[1]: Entering directory `/home/wkaras/TS6/doc'
rm -rf .libs _libs
rm -rf docbuild/* _build/html/* xml
rm -f *.lo
make[1]: Leaving directory `/home/wkaras/TS6/doc'
wkaras ~/TS6/doc
$ make html
@ywkaras
ywkaras / gist:f5a6b47804d77e274d8ae0990e60a218
Created March 9, 2018 15:30
Lock fail stack from core dump
(gdb) info stack
#0 0x00002b0ebb91f495 in raise () from /lib64/libc.so.6
#1 0x00002b0ebb920bfd in abort () from /lib64/libc.so.6
#2 0x00002b0eb93fc13d in ink_abort (message_format=0x2b0eb9422afc "%s:%d: failed assertion `%s`") at ink_error.cc:99
#3 0x00002b0eb93f95b2 in _ink_assert (expression=0x7da865 "t != 0", file=0x7da838 "/home/wkaras/TS4/iocore/eventsystem/I_Lock.h",
line=407) at ink_assert.cc:37
#4 0x000000000053b044 in Mutex_lock (location=..., ahandler=0x0, m=0x2b0ec010f260, t=0x0)
at /home/wkaras/TS4/iocore/eventsystem/I_Lock.h:407
#5 0x000000000055e074 in TSMutexLock (mutexp=0x2b0ec010f260) at InkIOCoreAPI.cc:289
#6 0x00002aaaaaecec48 in Test1::thread () at test_cppapi/test_cppapi.cc:31
@ywkaras
ywkaras / VagueDynLink.txt
Last active April 24, 2018 16:33
Example showing vague linkage does not occur with dynamically linked libraries.
@ywkaras
ywkaras / compress_long.log
Created May 1, 2018 19:20
Long log for 'compress' Au test
wkaras ~/TS2/tests/_sandbox/compress
$ cat *long.log
* About to connect() to proxy 127.0.0.1 port 61998 (#0)
* Trying 127.0.0.1... connected
* Connected to 127.0.0.1 (127.0.0.1) port 61998 (#0)
> GET http://ae-0/obj0 HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.19.1 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: ae-0
> Accept: */*
> Proxy-Connection: Keep-Alive
@ywkaras
ywkaras / config.my
Created May 9, 2018 16:02
TS build config script
#!/bin/bash
if [[ ! -f configure.ac ]] ; then
echo "configure.ac not found"
exit 1
fi
DIR="$(basename $PWD )"
# "--enable-layout=Yahoo"
@ywkaras
ywkaras / error.txt
Created July 5, 2018 21:14
Python format error
body = ('''
{
"beacons": [
{
"url" : "http://127.0.0.1:{0}",
"action": "return_204"
}
],
"version": "0.1"
}