Skip to content

Instantly share code, notes, and snippets.

@esseti
esseti / base.html
Last active September 22, 2023 10:53
Clair report json to html
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport">
<!-- Bootstrap CSS -->
<link crossorigin="anonymous" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" rel="stylesheet">
@esseti
esseti / test.csv
Last active September 12, 2019 15:03
name value
1.2.3.4 10
3.3.3.3 1
123 1231
@esseti
esseti / delay.lua
Created July 29, 2020 09:17
Rate limit in haproxy with lua
requests = {}
current_min = -1
rate_limit = 150
max_wait = 29000
burst=0
function rate_limit_request(txn)
math.randomseed(os.time())
-- user identifier
-- this is what i've in ha proxy to set the variable
@esseti
esseti / print_stk.lua
Last active November 20, 2024 20:27
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) .. ','
@esseti
esseti / Readme.md
Last active June 20, 2023 10:12
Payee to split categories YNAB
  • you need to have python (3)
  • install the requirements pip install -r requirements.txt
  • change the settings split.yaml accordingly to your needs
    • you either specify category: percentage or category. In the first case the percentage is used, otherwise the amount is splitted evenly among categories.
  • create a transaction with the payee of your choice (note: the script check if the string is contained, so if your payee is vacation and you have a transaction such as italy vacation this is matched)
  • run python split.py
  • in case you have problem with categories, try python split.py -c

Reddit discussion: https://www.reddit.com/r/ynab/comments/14e3t64/solution_script_to_automate_payee_to_split/