Skip to content

Instantly share code, notes, and snippets.

@rythie
rythie / hello_world.yml
Last active February 28, 2022 18:38
Ansible hello world example
# To run this, name this file hello_world.yml and run the following in the same directory
# ansible-playbook hello_world.yml -i 'local,' --connection=local
- hosts:
- local
tasks:
- name: Create a directory
file: path=hello_world state=directory
@rythie
rythie / hb_test.py
Last active August 29, 2015 13:58 — forked from tahajahangir/hb_test.py
Don't error with no args
#!/usr/bin/env python2
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
# Modifed to send heartbeat requests for both TLS v1.1 and v1.2
import sys
import struct
import socket
@rythie
rythie / gist:4556150
Last active December 11, 2015 05:58
Birthdays in the next 7 days
WHERE DATEDIFF(
DATE(CONCAT(YEAR(DATE_ADD(NOW(), INTERVAL 7 DAY)),"-",MONTH(DATE(dob)),"-",DAY(DATE(dob)))),
DATE(NOW())
)
BETWEEN 0 AND 7
@rythie
rythie / cache_test_case.php
Created December 10, 2012 21:47
ezSQL cache test case
<?php
// Standard ezSQL Libs
include_once "shared/ez_sql_core.php";
include_once "mysql/ez_sql_mysql.php";
// Initialise singleton
$db = new ezSQL_mysql('db_user', 'db_pass', 'db_name');
// Cache expiry