Skip to content

Instantly share code, notes, and snippets.

Decoded before:
{
data = { {
application_context = {
application_id = "app_id",
developer_id = "dev_id",
organization_id = "org_id",
portal_id = "p_id",
product_version_id = "pv_id"
@gszr
gszr / KongMemUsage.md
Last active April 8, 2024 18:33
Kong Memory Usage

Some notes on Kong memory usage

As I was tweaking the Kong config I use in my VPS, I took the opportunity to take some screenshots of the Kong container memory usage pattern. What follows is a brief summary of my findings.

The deployment is pretty small:

$ http :8001/services | jq '.data | length'
11

$ http :8001/routes | jq '.data | length'
@gszr
gszr / readme.md
Created April 5, 2024 14:33
lua-protobuf issue

Before

(kong-dev) kong $ luarocks install lua-protobuf 0.5.0 CC=/usr/bin/gcc CFLAGS="-O2 -fPIC -fstrict-aliasing -Wstrict-aliasing=2"              master
Installing https://luarocks.org/lua-protobuf-0.5.0-1.src.rock

lua-protobuf 0.5.0-1 depends on lua >= 5.1 (5.1-1 provided by VM: success)
/usr/bin/gcc -O2 -fPIC -fstrict-aliasing -Wstrict-aliasing=2 -I/home/gs/code/work/kong/bazel-bin/build/kong-dev/openresty/luajit/include/luajit-2.1 -c pb.c -o pb.o
In file included from pb.c:11:
pb.h: In function ‘pb_nexttype’:
https://github.com/openresty/lua-nginx-module?tab=readme-ov-file#ngxrematch
```
Specify options to control how the match operation will be performed. The following option characters are supported:
a anchored mode (only match from the beginning)
d enable the DFA mode (or the longest token match semantics).
this requires PCRE 6.0+ or else a Lua exception will be thrown.
first introduced in ngx_lua v0.3.1rc30.
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 6.8.0 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="gcc (GCC) 13.2.1 20230801"
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=130201
CONFIG_CLANG_VERSION=0
CONFIG_AS_IS_GNU=y
CONFIG_AS_VERSION=24200
@gszr
gszr / gist:108abd44063086a19cb0e171d9c6a3f3
Created March 21, 2024 20:59
openrgb -vv --gui --loglevel 6
$ openrgb -vv --gui --loglevel 6
Parsing CLI option: --gui
Parsing CLI option: --loglevel
Loglevel set to 6
Attempting to connect to local OpenRGB server.
Connection attempt failed
Local OpenRGB server unavailable.
Running standalone.
[ResourceManager] Calling detection start callbacks.
[ResourceManager] Calling detection progress callbacks.
0xffffffffb2fae15d
C:ngx_http_lua_socket_tcp_receive
@./kong/runloop/plugin_servers/pb_rpc.lua:263
@./kong/runloop/plugin_servers/pb_rpc.lua:301
@./kong/runloop/plugin_servers/pb_rpc.lua:394
@./kong/runloop/plugin_servers/bridge.lua:175
23
0xffffffffb22fdc3a
C:ngx_http_lua_socket_tcp_receive
@./kong/runloop/plugin_servers/pb_rpc.lua:263
=header_filter_by_lua(nginx-kong.conf:116):0;@./kong/init.lua:1528;@./kong/runloop/handler.lua:1468;T:@./kong/runloop/handler.lua:1468;0x7049c48dad63 3
=header_filter_by_lua(nginx-kong.conf:116):0;@./kong/init.lua:1528;@./kong/runloop/handler.lua:1468;T:@./kong/runloop/handler.lua:1468;0x7049c48dae2a 3
=header_filter_by_lua(nginx-kong.conf:116):0;@./kong/init.lua:1528;@./kong/runloop/handler.lua:1468;T:@./kong/runloop/handler.lua:1468;ngx_http_lua_escape_uri 3
=log_by_lua(nginx-kong.conf:124):0;@./kong/init.lua:1701;@./kong/init.lua:432;@./kong/plugins/file-log/handler.lua:73;@./kong/pdk/log.lua:794;@./kong/tools/table.lua:204;T:@./kong/tools/table.lua:204;__default_morecore 5
=log_by_lua(nginx-kong.conf:124):0;@./kong/init.lua:1701;@./kong/init.lua:432;@./kong/plugins/file-log/handler.lua:73;@./kong/plugins/file-log/handler.lua:40;C:json_encode;0x7049c48ec009 7
=log_by_lua(nginx-kong.conf:124):0;@./kong/init.lua:1701;@./kong/init.lua:432;@./kong/plugins/file-log/handler.lua:73;@./kong/plugins/file-log/handle
@gszr
gszr / gist:6164e79c596bd98d3a4fd170ff351611
Created March 8, 2024 14:26
GCC optimization levels
# -O1
-fauto-inc-dec
-fbranch-count-reg
-fcombine-stack-adjustments
-fcompare-elim
-fcprop-registers
-fdce
-fdefer-pop
-fdelayed-branch
@gszr
gszr / README
Last active February 26, 2024 16:10
Not following me back!
From: https://stackoverflow.com/questions/32407851/instagram-api-how-can-i-retrieve-the-list-of-people-a-user-is-following-on-ins