Skip to content

Instantly share code, notes, and snippets.

@arslanm
arslanm / haproxy-1.6.7-backup_state_file.patch
Last active May 29, 2018 17:31
HAProxy patch against 1.6.7 to control the backup flag of a server using state file, and have the ability to save global server-state-file
# This patch lets you:
# - put server/backend in backup mode, or active mode; "backup" parameter for server isn't needed in the configuration file.
# - save global server state to 'server-state-file' (absolute path required)
# see the UI here: http://i.imgur.com/n2O5V6P.png
# Instructions
$ wget http://www.haproxy.org/download/1.6/src/haproxy-1.6.7.tar.gz
$ tar xf haproxy-1.6.7.tar.gz
$ cd haproxy-1.6.7
#!/usr/bin/env python2.7
#
# This script cancels long running searches on Elasticsearch.
# Tested on 5.6 but should work with all versions above 5.1 (which introduced Task API).
# Search task duration in seconds to be cancelled
LIMIT = 30
# Timeout for cancel requests in seconds
TIMEOUT = 5