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
package main | |
import ( | |
"crypto/x509" | |
"fmt" | |
"net/http" | |
) | |
func main() { | |
if req, err := http.NewRequest("GET", "https://too.long.s3.amazonaws.com/index.html ", nil); err != nil { |
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
[david@sjc1-b4-8 ~]$ go tool pprof $HOME/bin/hwy-fetcher http://localhost:6060/debug/pprof/heap | |
Fetching profile from http://localhost:6060/debug/pprof/heap | |
Saved profile in /home/david/pprof/pprof.hwy-fetcher.localhost:6060.inuse_objects.inuse_space.062.pb.gz | |
Entering interactive mode (type "help" for commands) | |
(pprof) top | |
12612.08MB of 14824.44MB total (85.08%) | |
Dropped 799 nodes (cum <= 74.12MB) | |
Showing top 10 nodes out of 87 (cum >= 201.56MB) | |
flat flat% sum% cum cum% | |
6202.85MB 41.84% 41.84% 6202.85MB 41.84% crypto/tls.(*block).reserve |
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
events { worker_connections 10240; } | |
worker_processes 1; | |
daemon off; | |
pid /tmp/ngx/n.pid; | |
error_log /dev/stderr debug; | |
worker_rlimit_nofile 10240; | |
http { |
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
package server | |
import ( | |
"code.google.com/p/go-uuid/uuid" | |
"github.com/zebrafishlabs/heka/client" | |
"github.com/zebrafishlabs/heka/message" | |
"fmt" | |
"net/url" | |
"os" |
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
server { | |
listen 127.0.0.10:9001; | |
location / { return 404; } | |
} |
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
SUPER PROTEIN CHILI | |
three beans, quinoa, rice blend, pickled cabbage | |
Add to Cart | |
$9.95 | |
Ingredients | |
Brown rice | |
Black Beans |
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
import vanilla, vanilla.consul | |
import consul | |
c = consul.Consul() | |
_, d = c.health.service('mogtracker', passing=1) | |
for row in d: | |
print '%s:%d' % (row['Node']['Address'], row['Service']['Port']) | |
h = vanilla.Hub() |
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
[david@foulplay ~]$ sudo socklog -R inet 0 5112 | |
listening on 0.0.0.0:5112, starting. | |
<134>2015-07-16T03:43:13Z cache-lax1420 flog-tls[406151]: foo bar | |
[david@foulplay ~]$ echo "<134>2015-07-16T03:43:13Z cache-lax1420 flog-tls[406151]: foo bar" | nc -u localhost 5112 |
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
[david@foulplay ~]$ sudo tcpsvd -c 300 -u log 0 5112 socklog -R ucspi | |
local0.info: 2015-07-16T03:43:13Z cache-lax1420 flog-tls[406151]: foo bar | |
# in another shell | |
[david@foulplay ~]$ echo "<134>2015-07-16T03:43:13Z cache-lax1420 flog-tls[406151]: foo bar" | nc localhost 5112 |
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
local cjson = require('cjson') | |
local data = cjson.decode(json_string) |