View sankey
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
{ | |
$schema: https://vega.github.io/schema/vega/v3.0.json | |
data: [ | |
{ | |
// query ES based on the currently selected time range and filter string | |
name: rawData | |
url: { | |
%context%: true | |
%timefield%: @timestamp | |
index: winlogbeat-* |
View bytes_to_sid.rs
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
fn bytes_to_sid(binary :&Vec<u8>) -> String { | |
let version = binary[0]; | |
let length = binary[1] as usize; | |
let authority = u64::from_be_bytes([0, 0, binary[2], binary[3], binary[4], binary[5], binary[6], binary[7]]); | |
let mut string = format!("S-{}-{}", version, authority); | |
let binary = &binary[8..]; | |
assert_eq!(binary.len(), 4 * length); | |
for i in 0..length { |
View pdfExperiment.go
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 ( | |
"bytes" | |
"fmt" | |
"log" | |
"math/rand" | |
"os" | |
"strings" | |
"time" |
View interfaces_demo.go
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 ( | |
"gorm.io/driver/sqlite" | |
"gorm.io/gorm" | |
) | |
type job1 struct { | |
ID int `gorm:"primaryKey"` | |
UniqueField1 string |
View sslCertificatTranparency.go
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 ( | |
"bytes" | |
"crypto/sha256" | |
"encoding/base64" | |
"encoding/json" | |
"fmt" | |
"net/http" | |
"strings" |
View completableFutureSpringMVC.kt
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 com.example.mvc | |
import org.springframework.web.bind.annotation.GetMapping | |
import org.springframework.web.bind.annotation.RestController | |
import java.lang.Thread.sleep | |
import java.util.concurrent.CompletableFuture | |
import java.util.concurrent.ExecutorService | |
import java.util.concurrent.Executors | |
@RestController |
View recompile-and-run.sh
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
# You must first install apktool (https://github.com/iBotPeaches/Apktool) and android SDK | |
# and decompile apk using it | |
# apktool d -rf my-app.apk | |
# then generate a key for sign in: | |
# keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000 | |
rm signed-app.apk | |
apktool b -f -d com.myapp | |
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore com.myapp/dist/com.myapp.apk alias_name | |
zipalign -v 4 com.myapp/dist/com.myapp.apk signed-app.apk |
View reverseCssSelector.js
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
var TopLevelObject = {} | |
TopLevelObject.DOMNodePathStep = function(value, optimized) | |
{ | |
this.value = value; | |
this.optimized = optimized || false; | |
} | |
TopLevelObject.DOMNodePathStep.prototype = { | |
/** | |
* @override | |
* @return {string} |
View SSL_Reverse_Proxy.xml
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
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | |
<template encoding-version="1.2"> | |
<description></description> | |
<groupId>f83b243e-016a-1000-7ae4-d55879bd67a8</groupId> | |
<name>Beats (encrypted)</name> | |
<snippet> | |
<connections> | |
<id>5d08bc84-630a-3e17-0000-000000000000</id> | |
<parentGroupId>75fd9e98-7cb4-3d53-0000-000000000000</parentGroupId> | |
<backPressureDataSizeThreshold>1 GB</backPressureDataSizeThreshold> |
View alerting.xml
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
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | |
<template encoding-version="1.2"> | |
<description></description> | |
<groupId>d562c994-016b-1000-4d13-1985463f364a</groupId> | |
<name>Alerting</name> | |
<snippet> | |
<connections> | |
<id>2afde8dc-2bf8-33e4-0000-000000000000</id> | |
<parentGroupId>308545b5-bdca-3d2b-0000-000000000000</parentGroupId> | |
<backPressureDataSizeThreshold>1 GB</backPressureDataSizeThreshold> |
NewerOlder