View print_stk.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) .. ',' |
View delay.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
View test.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name | value | |
---|---|---|
1.2.3.4 | 10 | |
3.3.3.3 | 1 | |
123 | 1231 |
View base.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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"> |
View gist:08497731d0cacc5e063a6ff8ce342a27
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test |
View checkbox.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% with id=widget.attrs.id %} | |
{% for group, options, index in widget.optgroups %} | |
{% for option in options %} | |
{% with widget=option %} | |
{% include widget.template_name%} | |
{% endwith %} | |
{% endfor %} | |
{% endfor %} | |
{% endwith %} |
View barman_slack_notification.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#this should be run in a cron task every day or week. | |
#fill in CHANNEL and WEBHOOK URL | |
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" https://hooks.slack.com/services/<YOUR URL> |
View gist:b04b69b73213f12af0ecb92b9c22a01d
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am esseti on github. | |
* I am esseti (https://keybase.io/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: |
View Chino_py_05_document_read.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document = chino.documents.detail(document_id) | |
print document.content.to_json() #print content, to_json() util function of the libraries |
View Chino_py_04_document_create.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
content = { | |
"physician_id": "testId", | |
"patient_birth_date": "1937-06-19", | |
"observation": "The patient was ok.", | |
"visit_date": "2015-02-19T16:39:47.807000" | |
} | |
document = chino.documents.create(schema_id, content) | |
document_id = document._id |
NewerOlder