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
FROM prom/prometheus:v2.12.0 | |
COPY ./start.sh /start.sh | |
ENTRYPOINT ["/start.sh"] | |
CMD [] |
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
// bulk_load_prometheus fills prometheus tsdb with data (opentsdb-style) from stdin. | |
// | |
// The caller is responsible for assuring that the database is empty before | |
// bulk load. | |
package main | |
import ( | |
"bufio" | |
"encoding/json" | |
"flag" |
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
import ( | |
"encoding/binary" | |
"github.com/spaolacci/murmur3" | |
) | |
func UnsafeToBytes(s string) []byte { | |
return *(*[]byte)(unsafe.Pointer(&s)) | |
} |
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 defer_demo | |
import ( | |
"testing" | |
) | |
func doDefer() int { | |
acc := 0 | |
for i := 0; i < 100; i++ { | |
defer func(i int) { |
I write a buggy server to leak socket fd, which listen on 5000, and as expected there were CLOSE-WAIT left when client is closed
$ ss -ntpa | grep 5000
LISTEN 0 50 :::5000 :::* users:(("java",14586,92))
CLOSE-WAIT 79 0 ::ffff:127.0.0.1:5000 ::ffff:127.0.0.1:55804 users:(("java",14586,96))
CLOSE-WAIT 79 0 ::ffff:127.0.0.1:5000 ::ffff:127.0.0.1:59235 users:(("java",14586,93))
CLOSE-WAIT 5 0 ::ffff:127.0.0.1:5000 ::ffff:127.0.0.1:55803 users:(("java",14586,95))
CLOSE-WAIT 150 0 ::ffff:127.0.0.1:5000 ::ffff:127.0.0.1:59236 users:(("java",14586,94))
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
#BEGIN | |
[wildcard] | |
*://*.pyimagesearch.com/* | |
*://*go.dev/* | |
*://*quora.com/* | |
*://*quoracdn.net/* | |
*://*yandex.com/* | |
*://*ahhhhfs.com/* | |
*://*yandex.ru/* |
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 hystrix; | |
import com.netflix.hystrix.*; | |
import rx.Observable; | |
import java.io.IOException; | |
import java.util.Random; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
import java.util.concurrent.Future; |
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
(ns demo.specter-benchmark | |
(:use [com.rpl.specter] | |
[criterium.core])) | |
;; one big app state, look like | |
;; {app-id1 {peer-id1 #{ch-di1}}} | |
(def clients (atom {})) | |
(def num-app 10) | |
(def num-peer 20) |
All preferences for the DNS-over-HTTPS functionality in Firefox are located under the "network.trr" prefix (TRR == Trusted Recursive Resolver).
set which resolver mode you want.
0 - Off (default). use standard native resolving only (don't use TRR at all)
1 - Race native against TRR. Do them both in parallel and go with the one that returns a result first.