Skip to content

Instantly share code, notes, and snippets.

@int128
int128 / README.md
Last active April 12, 2025 13:02
Example of Envoy TCP Proxy
@calebschoepp
calebschoepp / bigcache.go
Created April 6, 2020 06:17
Code to wrap Bigcache with a generic interface
package cache
import (
"bytes"
"encoding/gob"
"errors"
"github.com/allegro/bigcache/v2"
)
@jjstill
jjstill / spark-minikube.sh
Last active February 4, 2024 15:58
Running Spark job on local kubernetes (minikube)
# Starting minikube with 8Gb of memory and 3 CPUs
minikube --memory 8192 --cpus 3 start
# Creating separate Namespace for Spark driver and executor pods
kubectl create namespace spark
# Creating ServiceAccount and ClusterRoleBinding for Spark
kubectl create serviceaccount spark-serviceaccount --namespace spark
kubectl create clusterrolebinding spark-rolebinding --clusterrole=edit --serviceaccount=spark:spark-serviceaccount --namespace=spark
@lukebakken
lukebakken / README.md
Last active May 17, 2024 19:25
RabbitMQ / MQTT TCP Tuning

rabbitmq.config

[
    {rabbit, [
        {background_gc_enabled, true},
        {background_gc_target_interval, 60000},
        {tcp_listeners, [5672]},
        {num_tcp_acceptors, 10},
        {connection_max, infinity},
@toritori0318
toritori0318 / nginx_for_production.conf
Last active December 29, 2021 19:04
nginx balancer example
worker_processes 1;
daemon off;
error_log /dev/stdout;
events {
worker_connections 1024;
}
http {
/**
* 百度坐标(BD09)、国测局坐标(火星坐标,GCJ02)、和WGS84坐标系之间的转换的工具
*
* 参考 https://github.com/wandergis/coordtransform 实现的Java版本
* @author geosmart
*/
public class CoordinateTransformUtil {
static double x_pi = 3.14159265358979324 * 3000.0 / 180.0;
// π
static double pi = 3.1415926535897932384626;
@zedar
zedar / ApacheHadoop_NativeLibs.adoc
Last active February 14, 2025 14:41
Add native libraries to Apache Hadoop installation

Apache Hadoop - add native libraries

If native libraries are not available the following message is displayed with every hadoop command: hadoop checknative

WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
  • Clone hadoop source code


@markuman
markuman / unixtime.lua
Created August 6, 2015 16:49
date string to unixtime in redis with lua
local function YearInSec(y)
-- returns seconds of a year
if ((y % 400) == 0) or (((y % 4) == 0) and ((y % 100) ~= 0)) then
return 31622400 -- 366 * 24 * 60 * 60
else
return 31536000 -- 365 * 24 * 60 * 60
end
end
@denji
denji / golang-tls.md
Last active May 14, 2025 16:19 — forked from spikebike/client.go
Simple Golang HTTPS/TLS Examples
Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)