Skip to content

Instantly share code, notes, and snippets.

View thibaultcha's full-sized avatar
🕉️

Thibault Charbonnier thibaultcha

🕉️
View GitHub Profile
@thibaultcha
thibaultcha / brew-legacy.sh
Last active November 19, 2023 18:34
Ever wondered which of your homebrew formulas are unused legacy dependencies? Run this!
#!/bin/bash
GREEN="\033[1;32m";
RESET="\033[m";
echo "Searching for standalone formulae...";
dependencies=();
for formula in $(brew list); do
deps=(`brew uses $formula --installed | tr '\n' ' '`);
# Add the formula if it's being used by another, installed one
if [ ${#deps[@]} -lt 1 ]; then
@thibaultcha
thibaultcha / metamethods.txt
Created November 30, 2015 19:54
Lua metamethods table
Sean Conner
http://lua-users.org/lists/lua-l/2015-04/msg00033.html
5.1 5.2 5.3 function
__add * * * a + b
__sub * * * a - b
__mul * * * a * b
__div * * * a / b
__mod * * * a % b
__pow * * * a ^ b
@thibaultcha
thibaultcha / about.md
Last active January 23, 2022 19:08
Irssi setup

Irssi setup in 3 minutes

  1. Install irssi:
  1. Install the script manager (usefull to manage other scripts):
@thibaultcha
thibaultcha / README.md
Last active September 9, 2020 18:07
Align Nginx variables declarations with Vim

The Nginx code style asks for a specific alignment of variables declarations that is strainuous to manually enforce:

size_t                    slen;
uint32_t                  hash;
ngx_int_t                 rc;
const u_char             *p;
ngx_shm_zone_t           *shm_zone;
ngx_slab_pool_t          *shpool;
ngx_rbtree_node_t        *node, *sentinel;
ngx_ssl_session_t *sess;
@thibaultcha
thibaultcha / cla.md
Created December 3, 2019 21:59
Kong Contributor License Agreement

Kong Contributor License Agreement

Thank you for your interest in making a Contribution to a project of Kong Inc., a Delaware USA corporation with notice address at 150 Spear Street, Suite 1600, San Francisco, CA, 94105, USA (“Kong”, “we” or “us”). In order to clarify the intellectual property license granted with Contributions from you, Kong must have a Contributor License Agreement (“CLA”) on file that has been signed by you, a developer of software or other technology (either an individual or an entity), indicating agreement to the license terms below. By electronically signing below, you are consenting to transact electronically and are entering into a binding contract, and you accept and agree to the following terms and conditions for your Contributions submitted to Kong.

BEFORE SIGNING AND/OR CLICKING A BUTTON TO E-SIGN OR ACCEPT, CAREFULLY READ THE TERMS AND CONDITIONS OF THIS AGREEMENT AND ANY TERMS OF USE PROVIDED THROUGH THE SIGNING PROCESS.

If you are not authorized as set forth above, do not

@thibaultcha
thibaultcha / nginx-1.11.2-cve_2018_16843_cve_2018_16844.patch
Last active August 14, 2019 00:19
NGINX [1.11.2 + 1.13.6] CVE-2018-16843 CVE-2018-16844 CVE-2019-9511 CVE-2019-9513 CVE-2019-9516
diff --git a/src/http/v2/ngx_http_v2.c b/src/http/v2/ngx_http_v2.c
index 19e5f3a0..cef8b5b5 100644
--- a/src/http/v2/ngx_http_v2.c
+++ b/src/http/v2/ngx_http_v2.c
@@ -623,6 +623,7 @@ ngx_http_v2_handle_connection(ngx_http_v2_connection_t *h2c)
h2c->pool = NULL;
h2c->free_frames = NULL;
+ h2c->frames = 0;
h2c->free_fake_connections = NULL;
@thibaultcha
thibaultcha / term.app
Last active June 28, 2018 01:28
Injected Nginx directives in Kong CE 0.14.0 (env variable)
$ export KONG_NGINX_PROXY_OUTPUT_BUFFERS="4 64k"
@thibaultcha
thibaultcha / kong.conf
Last active June 28, 2018 01:25
Injected Nginx directives in Kong CE 0.14.0 (kong.conf)
nginx_proxy_large_client_header_buffers = 16 128k
@thibaultcha
thibaultcha / handler.lua
Last active June 28, 2018 01:17
Kong 0.14.0 PDK example
-- fictional example of a plugin's handler.lua using the PDK
function Handler:access(conf)
if kong.request.get_method() == "GET" then
-- retrieve the client request's path
local path = kong.request.get_path()
-- make the request to the service with the updated path
kong.service.request.set_path(path .. "/hello/world")
end
@thibaultcha
thibaultcha / luarocks-licenses.awk
Last active June 21, 2018 22:17
Extract licenses of installed LuaRocks modules to CSV
#!/bin/awk -f
BEGIN {
while ("luarocks list --porcelain" | getline) {
i = 0
name = ""
license = ""
homepage = ""
c = "luarocks show " $1
while (c | getline) {