Skip to content

Instantly share code, notes, and snippets.

View Zenithar's full-sized avatar

Thibault NORMAND Zenithar

View GitHub Profile
@Zenithar
Zenithar / lua_boring_ssl.patch
Last active May 18, 2017 15:07
LUA Nginx Module Boring SSL Patch
diff --git a/src/ngx_http_lua_socket_tcp.c b/src/ngx_http_lua_socket_tcp.c
index 6db6e2d..cdad556 100644
--- a/src/ngx_http_lua_socket_tcp.c
+++ b/src/ngx_http_lua_socket_tcp.c
@@ -1327,7 +1327,7 @@ ngx_http_lua_socket_tcp_sslhandshake(lua_State *L)
#ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
- if (SSL_set_tlsext_host_name(c->ssl->connection, name.data)
+ if (SSL_set_tlsext_host_name(c->ssl->connection, (const char*)name.data)
@Zenithar
Zenithar / brightness.sh
Last active November 28, 2024 03:28
i3 fancy volume && brightness
#!/bin/bash
LEVEL=$(xbacklight -get | xargs printf "%.f")
case "$1" in
"up")
[[ "$LEVEL" -eq 100 ]]
xbacklight -inc 5
;;
"down")
diff --git a/src/event/ngx_event_openssl.c b/src/event/ngx_event_openssl.c
index 1b39f33..7a19157 100644
--- a/src/event/ngx_event_openssl.c
+++ b/src/event/ngx_event_openssl.c
@@ -2040,7 +2040,9 @@ ngx_ssl_connection_error(ngx_connection_t *c, int sslerr, ngx_err_t err,
/* handshake failures */
if (n == SSL_R_BAD_CHANGE_CIPHER_SPEC /* 103 */
+#ifdef blockcipher
|| n == SSL_R_BLOCK_CIPHER_PAD_IS_WRONG /* 129 */
@Zenithar
Zenithar / Caddyfile
Last active July 21, 2019 21:06
Hugo + Caddy + Webhook
0.0.0.0:2015
root blog.zenithar.org/public
ext .html
gzip
git github.com/zenithar/zenithar.hugo {
path ../
hook /_admin/github/hook/zenithar.org secret
@Zenithar
Zenithar / multihash.go
Last active November 29, 2015 19:39
One read multiple hash
package main
import (
"crypto/md5"
"crypto/sha1"
"crypto/sha256"
"crypto/sha512"
"fmt"
"hash"
"hash/crc32"
@Zenithar
Zenithar / anonymize_nginx.patch
Last active July 7, 2016 20:55
Anonymize NGINX
diff --git a/src/core/nginx.h b/src/core/nginx.h
index 75a4a40..b481fab 100644
--- a/src/core/nginx.h
+++ b/src/core/nginx.h
@@ -11,7 +11,7 @@
#define nginx_version 1011002
#define NGINX_VERSION "1.11.2"
-#define NGINX_VER "nginx/" NGINX_VERSION
+#define NGINX_VER "nginx"
@Zenithar
Zenithar / fix.patch
Last active September 30, 2015 10:10 — forked from krobertson/fix.patch
AUR package vmware-patch patch for Workstation 11.1.2 with 4.2 kernel
commit 1fb71794b4d53d203fc64dc5d57baa5850991303
Author: Ken Robertson <[email protected]>
Date: Tue Sep 29 12:58:00 2015 -0700
Applied patches for Workstation 11.1.2 on 4.2 kernel.
Patches were taken from the VMware forums here:
https://communities.vmware.com/thread/517279
#!/bin/sh
#
# Convert the Yoyo.org anti-ad server listing
# into an unbound dns spoof redirection list.
# Modified by Y.Voinov (c) 2014
#
# Note: Wget required!
#
# Source : https://github.com/jedisct1/unbound/blob/master/contrib/create_unbound_ad_servers.sh
#
@Zenithar
Zenithar / dnscrypt-proxy
Last active January 29, 2024 17:42
Unbound + DNSCrypt configuration
DNSCRYPT_LOCALIP=127.0.0.1
DNSCRYPT_LOCALIP2=127.0.0.2
DNSCRYPT_LOCALPORT=9053
DNSCRYPT_RESOLVERPORT=443
DNSCRYPT_USER=nobody
DNSCRYPT_PROVIDER_NAME=2.dnscrypt-cert.resolver2.dnscrypt.eu
DNSCRYPT_PROVIDER_NAME2=2.dnscrypt-cert.resolver1.dnscrypt.eu
DNSCRYPT_PROVIDER_KEY=3748:5585:E3B9:D088:FD25:AD36:B037:01F5:520C:D648:9E9A:DD52:1457:4955:9F0A:9955
DNSCRYPT_PROVIDER_KEY2=67C0:0F2C:21C5:5481:45DD:7CB4:6A27:1AF2:EB96:9931:40A3:09B6:2B8D:1653:1185:9C66
DNSCRYPT_RESOLVERIP=77.66.84.233
@Zenithar
Zenithar / main.go
Last active May 18, 2020 11:08
More secure password storage using HMAC-SHA256 and scrypt
// Inspired by https://blog.filippo.io/salt-and-pepper/
package main
import (
"crypto/hmac"
"crypto/rand"
"crypto/sha256"
"crypto/subtle"
"encoding/base64"
"encoding/json"