Skip to content

Instantly share code, notes, and snippets.

Avatar

Steve Campbell DukeyToo

  • Minneapolis, MN, USA
View GitHub Profile
@DukeyToo
DukeyToo / curl_good_behavior.txt
Created Mar 26, 2020
Envoy chunked upstream captures
View curl_good_behavior.txt
1 2020-03-26 15:22:56.490142 172.22.0.104 172.22.0.33 TCP 74 49202 → 9445 [SYN] Seq=0 Win=42600 Len=0 MSS=1420 SACK_PERM=1 TSval=111349014 TSecr=0 WS=2048
Frame 1: 74 bytes on wire (592 bits), 74 bytes captured (592 bits)
Ethernet II, Src: 42:01:ac:16:00:01 (42:01:ac:16:00:01), Dst: 42:01:ac:16:00:21 (42:01:ac:16:00:21)
Internet Protocol Version 4, Src: 172.22.0.104, Dst: 172.22.0.33
Transmission Control Protocol, Src Port: 49202, Dst Port: 9445, Seq: 0, Len: 0
2 2020-03-26 15:22:56.490259 172.22.0.33 172.22.0.104 TCP 74 9445 → 49202 [SYN, ACK] Seq=0 Ack=1 Win=43648 Len=0 MSS=1420 SACK_PERM=1 TSval=16024870 TSecr=111349014 WS=2048
Frame 2: 74 bytes on wire (592 bits), 74 bytes captured (592 bits)
@DukeyToo
DukeyToo / .gitconfig
Created Mar 11, 2020 — forked from Kovrinic/.gitconfig
git global url insteadOf setup
View .gitconfig
# one or the other, NOT both
[url "https://github"]
insteadOf = git://github
# or
[url "git@github.com:"]
insteadOf = git://github
@DukeyToo
DukeyToo / linkerd.log
Last active Dec 7, 2017
linkerd leak log
View linkerd.log
systemd[1]: Started linkerd.
systemd[1]: Starting linkerd...
linkerd[20228]: -XX:+AggressiveOpts -XX:+CMSClassUnloadingEnabled -XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled -XX:+CMSScavengeBeforeRemark -XX:InitialHeapSize=1073741824 -XX:MaxHeapSize=1073741824 -XX:MaxNewSize=357916672 -XX:MaxTenuringThreshold=6 -XX:NewSize=357916672 -XX:OldPLABSize=16 -XX:OldSize=715825152 -XX:+PrintCommandLineFlags -XX:+ScavengeBeforeFullGC -XX:-TieredCompilation -XX:+UseCMSInitiatingOccupancyOnly -XX:+UseCompressedClassPointers -XX:+UseCompressedOops -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+UseStringDeduplication
linkerd[20228]: Dec 06, 2017 5:01:56 PM com.twitter.finagle.http.HttpMuxer$ $anonfun$new$1
linkerd[20228]: INFO: HttpMuxer[/admin/metrics.json] = com.twitter.finagle.stats.MetricsExporter(<function1>)
linkerd[20228]: Dec 06, 2017 5:01:56 PM com.twitter.finagle.http.HttpMuxer$ $anonfun$new$1
linkerd[20228]: INFO: HttpMuxer[/admin/per_host_metrics.json] = com.twitter.finagle.stats.HostMetric
View rexray-client.log.sh
INFO[0000] updated log level logLevel=debug
DEBU[0000] created scoped scope new=rexray.cli parentScopes=rexray,
DEBU[0000] os.args time=1510847816918 val=[rexray volume ls]
DEBU[0000] activating libStorage cmd=ls time=1510847816918
DEBU[0000] host is empty; initiliazing default services time=1510847816926
DEBU[0000] libStorage auto service mode disabled; services defined time=1510847816928
DEBU[0000] starting embedded libStorage server time=1510847816928
DEBU[0000] created scoped scope new=libstorage.server parentScopes=rexray.cli,rexray,
INFO[0000] configured logging libstorage.logging.httpRequests=true libstorage.logging.httpResponses=true libstorage.logging.level=debug server=typhoon-hoof-lr time=1510847816981
DEBU[0000] parsed server auth property libstorage.server.auth.disabled=false server=typhoon-hoof-lr time
@DukeyToo
DukeyToo / setup.md
Last active Jan 5, 2016
FRC Robotics Windows setup
View setup.md

If you have admin access...

Use chocolatey to install software. From an administrative command prompt:

@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin

Re-open the administrative command prompt afterward to ensure all changes are reflected.

Eclipse

@DukeyToo
DukeyToo / decoded.js
Last active Oct 31, 2016
Optimized filter in es6 for decoding html values for angularjs when displaying in input or options
View decoded.js
//simple filter to decode html-encoded values, for display in options or inputs
//optimized so that it doesn't redo the expensive decoding every time
myApp.filter('decoded', function() {
"use strict";
let e = null; //only init as-needed, and keep around
let cache = {};
function htmlDecode(input) {
if (cache[input]) {
@DukeyToo
DukeyToo / expressjs benchmark 2012-4-11
Created Apr 11, 2012
ab benchmarks on EC2 medium instance
View expressjs benchmark 2012-4-11
ubuntu@domU-12-31-39-0C-49-FB:~$ ab -n 8000 -c 250 -k http://localhost:8001/middleware
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Completed 800 requests
Completed 1600 requests
Completed 2400 requests
Completed 3200 requests
View fib.json
{ "exports": "fib",
"signature": [
{
"name": "fib",
"synopsis": "runs a fibonacci sequence",
"verb": "POST",
"parameters": [
{"name": "number", "required":true, "description":"which fibonacci to calculate"}
]
},
@DukeyToo
DukeyToo / benchmark.md
Created Mar 19, 2012
Benchmarks exploring different patterns of Node.js worker processes on an HTTP server
View benchmark.md

This set of benchmarks explores the impact on a Node.js HTTP API server when some responses take more cpu than others. The requests are to a JSON page that calculates a random fibonacci sequence between 1 and 30. The server is using node-perfectapi with a feature that scales the http server across available cpus, while leaving the user's API code in the main Node.js process.

In the red series, the http server is running in the same process as the Fibonacci calculations. In the green series, the handling of all of the http web server stuff has been moved to separate node workers. In both cases, the Fibonacci calculations occur in a single thread in the main (master) Node process.

Benchmark showing response time hit

Now obviously the red series is going to be slower than the green series (because it is restricted to a single cpu for both http requests/responses and the calculati

View Perfectapi.md

The perfectapi benchmark used an actual module that uses perfectapi, namely node-sharedmem. This module was chosen because it has no external dependencies, and has very little logic.

You can’t perform that action at this time.