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
curl -XPUT 'http://localhost:9200/tube/' | |
curl -XPOST 'localhost:9200/tube/_close' | |
curl -XPUT 'localhost:9200/tube/_settings' -d '{ | |
"analysis" : { | |
"tokenizer" : { | |
"comma" : { | |
"type" : "pattern", |
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
[Unit] | |
Description=consul client | |
Requires=network-online.target | |
After=network-online.target | |
[Service] | |
User=consul | |
EnvironmentFile=-/etc/sysconfig/consul | |
Environment=GOMAXPROCS=2 | |
Restart=on-failure |
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 consul | |
import ( | |
"strings" | |
"github.com/hashicorp/consul/api" | |
) | |
func GetKV(client *api.Client, key string, waitIndex uint64) (string, uint64, error) { | |
q := &api.QueryOptions{RequireConsistent: true, WaitIndex: waitIndex} | |
kvpair, meta, err := client.KV().Get(key, q) |
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
map $http_upgrade $connection_upgrade { | |
default upgrade; | |
'' close; | |
} | |
upstream websocket { | |
server 127.0.0.1:8080; | |
} | |
server { |
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 ( | |
"net/http" | |
"time" | |
) | |
func main() { | |
mux := http.NewServeMux() | |
mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { |
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 internal | |
import ( | |
"fmt" | |
"testing" | |
"time" | |
"go.uber.org/zap" | |
) |
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 s3linereader | |
import ( | |
"bufio" | |
"context" | |
"errors" | |
"fmt" | |
"io" | |
"math" | |
"math/rand" |
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 ( | |
"bufio" | |
"bytes" | |
"context" | |
"crypto/rand" | |
"errors" | |
"fmt" | |
"io" |
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
# Параметры — поменяй на свои ИМЕННО ЗДЕСЬ (без <> и прочего) | |
BUCKET="ceph-test-bucket" | |
PROFILE="ceph-local" | |
ENDPOINT="http://127.0.0.1:7480" # для AWS можно убрать весь --endpoint-url | |
aws --profile "$PROFILE" --endpoint-url "$ENDPOINT" \ | |
s3api list-multipart-uploads --bucket "$BUCKET" --output json \ | |
| jq -r '.Uploads[]? | @tsv "\(.Key)\t\(.UploadId)"' \ | |
| while IFS=$'\t' read -r KEY UPID; do | |
echo "Abort: $KEY ($UPID)" |