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 | |
set -eu | |
trap 'echo "$NAME: Failed at line $LINENO" >&2' ERR | |
NAME=${0##*/} | |
print_help() { | |
echo "Usage: $NAME <opts> <args>" >&2 | |
exit 1 | |
} |
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
"""AutoGhost X-Chat2 Module | |
NB: This module assumes SASL Authentication. It does not perform any auth; | |
merely ghost on connect *after* successful SASL authentication (and likely | |
before any other module can perform manual service auth). | |
""" | |
import xchat # pylint: disable=F0401 | |
__module_name__ = "AutoGhost" |
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 | |
# | |
# blk_ra.sh - Script performing read-ahead on bitcoin's blockfiles | |
# | |
# In order to speed up data loading, this script performs read-ahead | |
# operations on the next block to be read by the bitcoin node. | |
# | |
# The expected setup for this speed-up to be effective is: | |
# | |
# - Blockchain index and chainstate database on SSD |
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
# Copyright(C) 2017 by Abe developers. | |
# test_chain.py: test Abe Chain code with static data | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU Affero General Public License as | |
# published by the Free Software Foundation, either version 3 of the | |
# License, or (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, but |
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
#!/usr/bin/env python | |
import timeit | |
import locale | |
locale.setlocale(locale.LC_ALL, '') # Default user locale | |
#locale.setlocale(locale.LC_ALL, 'en_US') # ... or force it with this | |
runcnt=10000000 | |
result = timeit.timeit( |
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
#!/usr/bin/env python | |
# | |
# Convert CSV to TSV, properly handling intra-field commas, newlines and | |
# quoted double-quotes, as per rfc4180 section 2. Also convert TSV separators | |
# to C-style escapes. | |
# | |
from __future__ import print_function | |
import sys, 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
[thomas_guyot@localhost ~]$ bash --version | |
GNU bash, version 3.2.25(1)-release (x86_64-redhat-linux-gnu) | |
Copyright (C) 2005 Free Software Foundation, Inc. | |
[thomas_guyot@localhost ~]$ trap 'echo Argh' ERR | |
[thomas_guyot@localhost ~]$ variable=0 | |
[thomas_guyot@localhost ~]$ ((variable++)) | |
[thomas_guyot@localhost ~]$ echo $? | |
1 | |
[thomas_guyot@localhost ~]$ echo $variable | |
1 |
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
<?php | |
# Template php nagios check | |
# | |
# Meant to work along with nagios's check_http. In addition to the | |
# returned string which is a standard nagios result, the script returns | |
# 403 and 503 errors on WARNING and CRITICAL respectively to make | |
# check_http return an equivalent status. The HTTP status printed by | |
# check_http is also the script result. | |
# | |
# Author: Thomas Guyot-Sionnest <[email protected]> |
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 | |
# Send all command output to STDERR while allowing us to write to STDOUT | |
# using fd 3 | |
exec 3>&1 1>&2 | |
set -eu | |
trap "echo -e 'Status: 500 Internal Server Error\n' >&3; exit 0" ERR |
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
{ | |
"inputs":{ | |
"bucket":"webaccesslogs", | |
"index":"ts_int", | |
"start":1338712811, | |
"end":1338712814, | |
"timeout":60000 | |
}, | |
"query":[ | |
{ |
NewerOlder