This sample Go file shows how to use sandbox_init
on macOS (now deprecated, but it still works)
to prevent a Go application from accessing the network beyond localhost
.
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
Feature: Parsing Protocol Buffer schemas | |
Scenario: Parsing a valid Protocol Buffer schema | |
Given a Protocol Buffer schema named my_message.proto with body | |
""" | |
syntax = "proto3"; | |
message MyMessage { | |
string message_content = 1; | |
} |
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
=============== | |
Primer Requests | |
=============== | |
Running 5s test @ http://localhost:9090/json | |
8 threads and 8 connections | |
Thread Stats Avg Stdev Max +/- Stdev | |
Latency 11.61ms 28.59ms 287.04ms 96.75% | |
Req/Sec 169.75 52.18 300.00 69.27% | |
Latency Distribution | |
50% 7.11ms |
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
#!/bin/sh | |
HOST=localhost | |
PORT=9090 | |
URL=/json | |
CONTENT_TYPE_HEADER="application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7" | |
CONNECTION_HEADER="Connection: keep-alive" | |
# Parameters: |
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
ab -c 1 -n 1 https://hw9j2li3ma.execute-api.us-east-1.amazonaws.com/prod/NodeSayHello | |
This is ApacheBench, Version 2.3 <$Revision: 1663405 $> | |
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ | |
Licensed to The Apache Software Foundation, http://www.apache.org/ | |
Benchmarking hw9j2li3ma.execute-api.us-east-1.amazonaws.com (be patient)...SSL handshake failed (1). | |
10445:error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure:/BuildRoot/Library/Caches/com.apple.xbs/Sources/OpenSSL098/OpenSSL098-59/src/ssl/s23_clnt.c:593: | |
..done | |
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
$ ./wrk -t 10 -c 50 -d 60s --latency --timeout 15s http://hw9j2li3ma.execute-api.us-east-1.amazonaws.com/prod/NodeSayHello | |
Running 1m test @ http://hw9j2li3ma.execute-api.us-east-1.amazonaws.com/prod/NodeSayHello | |
10 threads and 50 connections | |
Thread Stats Avg Stdev Max +/- Stdev | |
Latency 3.22ms 3.93ms 206.21ms 93.68% | |
Req/Sec 1.72k 366.83 2.19k 83.31% | |
Latency Distribution | |
50% 2.34ms | |
75% 2.59ms | |
90% 4.61ms |
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 io.dropwizard.Application; | |
import io.dropwizard.setup.Environment; | |
import javax.ws.rs.GET; | |
import javax.ws.rs.HeaderParam; | |
import javax.ws.rs.Path; | |
import javax.ws.rs.PathParam; | |
import java.util.UUID; | |
public class TestUuidApplication extends Application<TestUuidConfiguration> { |
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
WARN [2015-09-28 04:48:24,010] org.eclipse.jetty.server.AbstractConnector: | |
! java.lang.BootstrapMethodError: java.lang.NoClassDefFoundError: Could not initialize class java.lang.invoke.CallSite | |
! at sun.net.ExtendedOptionsImpl.<clinit>(ExtendedOptionsImpl.java:47) ~[na:1.8.0_20] | |
! at sun.nio.ch.SocketChannelImpl$DefaultOptionsHolder.defaultOptions(SocketChannelImpl.java:241) ~[na:1.8.0_20] | |
! at sun.nio.ch.SocketChannelImpl$DefaultOptionsHolder.<clinit>(SocketChannelImpl.java:228) ~[na:1.8.0_20] | |
! at sun.nio.ch.SocketChannelImpl.supportedOptions(SocketChannelImpl.java:250) ~[na:1.8.0_20] | |
! at sun.nio.ch.SocketChannelImpl.setOption(SocketChannelImpl.java:169) ~[na:1.8.0_20] | |
! at sun.nio.ch.SocketAdaptor.setBooleanOption(SocketAdaptor.java:271) ~[na:1.8.0_20] | |
! at sun.nio.ch.SocketAdaptor.setTcpNoDelay(SocketAdaptor.java:306) ~[na:1.8.0_20] | |
! at org.eclipse.jetty.server.AbstractConnector.configure(AbstractConnector.java:391) ~[jetty-server-8.1.10.v20130312.jar:8.1.10.v20130312] |
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 com.amazonaws.auth.BasicAWSCredentials; | |
import com.amazonaws.regions.Region; | |
import com.amazonaws.regions.RegionUtils; | |
import com.amazonaws.services.sns.AmazonSNS; | |
import com.amazonaws.services.sns.AmazonSNSClient; | |
import com.amazonaws.services.sns.model.Endpoint; | |
import com.amazonaws.services.sns.model.ListEndpointsByPlatformApplicationRequest; | |
import com.amazonaws.services.sns.model.ListEndpointsByPlatformApplicationResult; | |
import com.amazonaws.services.sns.model.SetEndpointAttributesRequest; | |
import com.google.common.collect.ImmutableMap; |
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
$ node substring.js 🙅🏿 | |
🙅🏿.substring(0, 1) = � | |
🙅🏿.substring(0, 2) = 🙅 | |
🙅🏿.substring(0, 3) = 🙅� | |
🙅🏿.substring(0, 4) = 🙅🏿 |
NewerOlder