Skip to content

Instantly share code, notes, and snippets.


Viktor Manyushin vmanyushin

View GitHub Profile
View cors-nginx.conf
# Slightly tighter CORS config for nginx
# A modification of to include a white-list of URLs
# Despite the W3C guidance suggesting that a list of origins can be passed as part of
# Access-Control-Allow-Origin headers, several browsers (well, at least Firefox)
# don't seem to play nicely with this.
def hrun(start, width, padding=0):
return [None] * padding + range(start, start+width) + [None] * padding
def vrun(start, width, height, padding=0):
return [hrun(s, width, padding)
for s in range(start, start+width*height, width)]
layout = [
View sample.rb
port = 10051
s = 'zabbix-server', port
pp s.send('host', 'key', 'value')
# => {"response"=>"success",
# "info"=>"Processed 1 Failed 0 Total 1 Seconds spent 0.000042"}
pp'host') {
send 'key', 'value'