Skip to content

Instantly share code, notes, and snippets.

View exu's full-sized avatar
🔨
forging testkube

Jacek Wysocki exu

🔨
forging testkube
View GitHub Profile
@exu
exu / kubernetes-websocket.go
Created September 16, 2022 11:26 — forked from jezell/kubernetes-websocket.go
Connect to Kubernetes endpoint over websockets
package main
import (
"bytes"
"flag"
"golang.org/x/net/websocket"
"io"
"k8s.io/client-go/1.4/rest"
"k8s.io/client-go/1.4/tools/clientcmd"
"log"
@exu
exu / fssse.go
Created November 9, 2021 15:09 — forked from dudochkin-victor/fssse.go
fasthttp sse
package main
import (
"bufio"
"fmt"
"log"
"time"
"github.com/valyala/fasthttp"
)
@exu
exu / keybase.md
Created September 16, 2021 07:09

Keybase proof

I hereby claim:

  • I am exu on github.
  • I am ex00 (https://keybase.io/ex00) on keybase.
  • I have a public key ASA64vm8QItIOkLbBvBbpHqRQpNnxmEISrW2qI2QVFw2EQo

To claim this, I am signing this object:

@exu
exu / keybase.md
Created September 15, 2021 05:38

Keybase proof

I hereby claim:

  • I am exu on github.
  • I am ex00 (https://keybase.io/ex00) on keybase.
  • I have a public key ASDPy0ZW9L2wtGYzcic-fjJZNr0sXSLKeaiu5mXV8tlhsgo

To claim this, I am signing this object:

@exu
exu / 00_destructuring.md
Created October 15, 2020 17:32 — forked from john2x/00_destructuring.md
Clojure Destructuring Tutorial and Cheat Sheet

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors and Sequences

@exu
exu / sse.go
Created June 15, 2020 07:56 — forked from schmohlio/sse.go
Example SSE server in Golang
// v2 of the great example of SSE in go by @ismasan.
// includes fixes:
// * infinite loop ending in panic
// * closing a client twice
// * potentially blocked listen() from closing a connection during multiplex step.
package main
import (
"fmt"
"log"
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1
@exu
exu / RestConfiguration.java
Created September 3, 2019 06:37 — forked from ripla/RestConfiguration.java
The different ways of accessing a REST HATEOAS resource created with Spring Data. Using a Spring RestTemplate.
import java.util.Arrays;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.hateoas.MediaTypes;
import org.springframework.hateoas.hal.Jackson2HalModule;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.web.client.RestTemplate;
@exu
exu / nginx-tuning.md
Created July 13, 2017 12:13 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.