Skip to content

Instantly share code, notes, and snippets.

luarocks --verbose --tree /tmp/test install lua-cjson
-------------------------------------------------------------------------------
Current configuration:
-------------------------------------------------------------------------------
accept_unknown_fields = false
arch = "linux-aarch64"
cache = {}
cache_fail_timeout = 86400
cache_timeout = 60
check_certificates = false
@gszr
gszr / t.lua
Created May 30, 2025 16:09
luarocks issue repro
function run_file(filename, env)
local fd, err = io.open(filename)
if not fd then
return nil, err, "open"
end
local str, err = fd:read("*a")
fd:close()
if not str then
return nil, err, "open"
end
@gszr
gszr / gist:98962ed0ccc2c9503d942f5f31570efa
Created April 17, 2025 16:19
callout-custom-cache-key
{
"name": "request-callout",
"config": {
"callouts": [
{
"name": "callout1",
"request": {
"url": "http://httpbin.org/anything",
"by_lua": "kong.ctx.shared.callouts.callout1.caching.cache_key = kong.request.get_header('cache-key')"
},
{
"name": "request-callout",
"config": {
"callouts": [
{
"name": "c1",
"request": {
"url": "http://httpbin.org/uuid",
"method": "GET"
},
{
"name": "request-callout",
"config": {
"callouts": [
{
"name": "callout1",
"request": {
"url": "http://httpbin.org/anything",
"method": "GET"
},
{
"name": "request-callout",
"config": {
"callouts": [
{
"name": "callout1",
"request": {
"url": "http://httpbin.org/anything",
"by_lua": "local body = kong.request.get_body() or {}; local id = body.id; if id then kong.ctx.shared.callouts.callout1.request.params.url = 'http://httpbin.org/anything/' .. id end",
"method": "GET"
{
"name": "request-callout",
"config": {
"callouts": [
{
"name": "callout1",
"request": {
"url": "http://httpbin.org/anything",
"method": "GET",
"query": {
worker_processes 1;
events{}
http {
server {
listen 10000 http2;
location / {
grpc_pass_header Server;
@gszr
gszr / go_leak.md
Created February 7, 2025 21:46
Go plugin investigation

After some more testing, I found no confirmation for the hypothesis below.

In testing, I instrumented Go pluginserver with the pprof library, as follows:

import (
  ...
	_ "net/http/pprof"
)
func main() {
\documentclass{article}
\usepackage{amsmath}
\usepackage{algorithm}
\usepackage{algpseudocode}
\begin{document}
\noindent
\begin{minipage}{0.45\linewidth}
\raggedright