Skip to content

Instantly share code, notes, and snippets.

esseti /
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
  • in case you have problem with categories, try python -c

Reddit discussion:

esseti / print_stk.lua
Last active July 1, 2022 18:53
Read sticky table of HA proxy from lua action
View print_stk.lua
function dump_str(o)
-- transform a table into a string for the printing.
-- found it on google
-- better to use print_r from here
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 / delay.lua
Created July 29, 2020 09:17
Rate limit in haproxy with lua
View delay.lua
requests = {}
current_min = -1
rate_limit = 150
max_wait = 29000
function rate_limit_request(txn)
-- user identifier
-- this is what i've in ha proxy to set the variable
esseti / test.csv
Last active September 12, 2019 15:03
View test.csv
name value 10 1
123 1231
esseti / base.html
Last active September 22, 2023 10:53
Clair report json to html
View base.html
<!doctype html>
<html lang="en">
<!-- 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=""
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" rel="stylesheet">
esseti / checkbox.html
Created March 30, 2018 15:27
Beautiful widget for django multiple select
View checkbox.html
{% with %}
{% for group, options, index in widget.optgroups %}
{% for option in options %}
{% with widget=option %}
{% include widget.template_name%}
{% endwith %}
{% endfor %}
{% endfor %}
{% endwith %}
esseti /
Last active February 2, 2017 16:31
Barman Notification on Slack
#this should be run in a cron task every day or week.
RESULT="$(barman check all)"
RESULT2="$(barman list-backup all)"
PAYLOAD='payload={"channel": "<SPECIFY THE CHANNEL>","username": "barman","icon_emoji": ":robot_face:","color": "info","fields": [{"title": "Check","value": "'${RESULT}'","short": False},{"title": "list backup","value": "'${RESULT2}'","short": False}],}'
curl -X POST --data "$PAYLOAD"<YOUR URL>
View gist:b04b69b73213f12af0ecb92b9c22a01d
### Keybase proof
I hereby claim:
* I am esseti on github.
* I am esseti ( on keybase.
* I have a public key whose fingerprint is 5D6C E305 DE5A 324A CB4C BD4A 7533 CEB0 E3B9 6842
To claim this, I am signing this object:
document = chino.documents.detail(document_id)
print document.content.to_json() #print content, to_json() util function of the libraries