Skip to content

Instantly share code, notes, and snippets.

View gist:d518b4374db928d66ee4376bd8fb4963
### Keybase proof
I hereby claim:
* I am catap on github.
* I am catap ( on keybase.
* I have a public key ASBb8IhTr1ACFnLLeB8PozKLhUa1YvFWao1NnJpAoZxsMwo
To claim this, I am signing this object:
catap /
Created Oct 17, 2018
CVE-2018-10933 proof-of-concept by Minh Tuan Luong
import paramiko
import socket
import sys
nbytes = 4096
hostname = ""
port = 2222
sock = socket.socket()
catap / kresd-config.lua
Created Oct 28, 2018
An example configuration to random selection between Quad9, Cloudflare and Google DNS-over-TLS for knot-resolver (kresd)
View kresd-config.lua
require 'math'
dns_providers = {
{ -- Quad9
{'', hostname='', ca_file='/usr/local/etc/kresd/DigiCertECCSecureServerCA.pem'},
{'', hostname='', ca_file='/usr/local/etc/kresd/DigiCertECCSecureServerCA.pem'}
{ -- Cloudflare
{'', hostname='', ca_file='/usr/local/etc/kresd/DigiCertECCSecureServerCA.pem'},
catap /
Created Dec 12, 2018
Very simple and naive tools to force recreate Lucene index. It may be used when your elastic data is corrupted, you have only one shard and Lucen's CheckIndex doesn't help.
mport org.apache.lucene.index.IndexWriter;
import org.apache.lucene.index.IndexWriterConfig;
import java.nio.file.Paths;
public class IndexFixer {
public static void main(String[] args) throws IOException {
catap / gist:e133275e3c65331b4848de43eea4581f
Created Dec 14, 2018
Example how you can recovery your elastic from red status to green but lose your data
View gist:e133275e3c65331b4848de43eea4581f
POST _cluster/reroute?retry_failed
"commands" : [
"allocate_empty_primary": {
"index" : "Index-YYYY-MM-DD-HH",
"shard" : 66,
"node": "some-node",
"accept_data_loss": true
catap / SplayTree.scala
Created Apr 21, 2020
Scala implementation of SplayTree
View SplayTree.scala
// This implementation based on:
// -
sealed trait SplayTree[+K, V] {
val left: SplayTree[K, V]
def key: K
def value: V
val right: SplayTree[K, V]
catap / intel.txt
Created Nov 20, 2020
`openssl speed` on Macmini9,1 with `Apple M1` and Macmini8,1 with `Intel® Core™ i7-8700B`
View intel.txt
LibreSSL 2.8.3
built on: date not available
options:bn(64,64) rc4(16x,int) des(idx,cisc,16,int) aes(partial) blowfish(idx)
compiler: information not available
The 'numbers' are in 1000s of bytes per second processed.
type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes
md2 0.00 0.00 0.00 0.00 0.00
md4 104247.41k 302673.38k 640475.47k 896989.80k 1020123.39k
md5 78389.66k 235437.10k 523467.57k 759192.69k 869210.24k
hmac(md5) 77018.96k 227375.22k 515807.50k 750403.53k 859425.89k