Skip to content

Instantly share code, notes, and snippets.

View walkeran's full-sized avatar

Andy Walker walkeran

View GitHub Profile
@esseti
esseti / print_stk.lua
Last active July 1, 2022 18:53
Read sticky table of HA proxy from lua action
function dump_str(o)
-- transform a table into a string for the printing.
-- found it on google
-- better to use print_r from here http://www.arpalert.org/haproxy-scripts.html
if type(o) == 'table' then
local s = '{ '
for k,v in pairs(o) do
if type(k) ~= 'number' then k = '"'..k..'"' end
s = s .. '['..k..'] = ' .. dump_str(v) .. ','
@bastman
bastman / README.md
Last active May 11, 2023 07:55
parse erb templates from command line (standalone, cli, json)

Goal

  • provide cli command to render erb template
  • template params (bindings) to be provided using json format
  • use inputs from file (template.erb, params.json)
  • use inputs from cli options / parameters
  • render output to stdout OR to file

Why ?