Skip to content

Instantly share code, notes, and snippets.

View vchoi's full-sized avatar

Vitor Choi Feitosa vchoi

View GitHub Profile
@vchoi
vchoi / zabbix_verisign_dnssec_test.sh
Last active November 1, 2018 17:20
Zabbix test script to check domains for DNSSEC errors using verisign dnssec debugger.
#!/bin/sh
TESTDOMAIN="$1"
if test -z "$TESTDOMAIN" ; then
cat << EOF
Usage: $0 test.domain.
EOF
exit 1
fi
@vchoi
vchoi / if_vs_exception_benchmark.py
Last active September 6, 2018 16:53
exception handling faster than if comparison?
#!/usr/bin/python3
#
# Someone said that this is actually faster than using an if statement
# https://twitter.com/flibitijibibo/status/1037011978600898560
#
# output:
# Running each function 100000000 times.
# isEqual_if(n=1.1,m=1.1), total 15.401655944995582, each 1.5401655944995582e-07.
# isEqual_if(n=1.1,m=0.1), total 15.192942995985504, each 1.5192942995985504e-07.
# isEqual_exception(n=1.1,m=1.1), total 41.77682093999465, each 4.177682093999465e-07.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = "Adrien Pujol - http://www.crashdump.fr/"
__copyright__ = "Copyright 2013, Adrien Pujol"
__license__ = "Mozilla Public License"
__version__ = "0.3"
__email__ = "adrien.pujol@crashdump.fr"
__status__ = "Development"
__doc__ = "Check a TLS certificate validity."