This file contains hidden or 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 com.tmna.ct.telematics.one.core.filter; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.OutputStream; | |
import java.io.Writer; | |
import java.net.HttpURLConnection; | |
import java.net.MalformedURLException; | |
import java.net.ProtocolException; | |
import java.net.URL; |
This file contains hidden or 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
# Full text search | |
[hendry@t480s 5xx]$ cat bugzilla.sh | |
aws --profile uneet-dev logs filter-log-events --log-group-name bugzilla --start-time $(date -d "-1 hour" +%s000) \ | |
--filter-pattern '"apex/ping/v1.0"' | |
# (faster) Query on a JSON structured log | |
[hendry@t480s 5xx]$ cat alambda.sh | |
aws --profile uneet-demo logs filter-log-events --log-group-name "/aws/lambda/alambda_simple" --start-time $(date -d "-8 |
This file contains hidden or 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
private String getBody(HttpServletRequest request) { | |
StringBuffer sb = new StringBuffer(); | |
BufferedReader br = null; | |
InputStream is = null; | |
try { | |
is = request.getInputStream(); | |
if (is != null) { | |
br = new BufferedReader(new InputStreamReader(is)); |
This file contains hidden or 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
def image = '' | |
def registry = '' | |
node('slaves'){ | |
stage('Checkout'){ | |
checkout scm | |
} | |
stage('Build'){ | |
docker.build(image) |
This file contains hidden or 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
This demonstrates how to make client side certificates with go | |
First generate the certificates with | |
./makecert.sh [email protected] | |
Run the server in one terminal | |
go run server.go |
This file contains hidden or 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 ( | |
"fmt" | |
"math" | |
"reflect" | |
"runtime" | |
"sort" | |
"time" | |
) |
This file contains hidden or 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
type T struct { | |
A int | |
B string | |
} | |
t := T{23, "skidoo"} | |
s := reflect.ValueOf(&t).Elem() | |
typeOfT := s.Type() | |
for i := 0; i < s.NumField(); i++ { |
This file contains hidden or 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
func mergeMaps(x1, x2 map[string]interface{}) interface{} { | |
for k, v2 := range x2 { | |
if v1, ok := x1[k]; ok { | |
if m1, ok := v1.(map[string]interface{}); ok { | |
if m2, ok := v2.(map[string]interface{}); ok { | |
x1[k] = mergeMaps(m1, m2) | |
continue | |
} | |
} | |
} |
This file contains hidden or 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" | |
"encoding/pem" | |
"fmt" | |
"log" | |
) | |
func main() { |
This file contains hidden or 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 console | |
import "fmt" | |
const ( | |
TextBlack = iota + 30 | |
TextRed | |
TextGreen | |
TextYellow | |
TextBlue |