Skip to content

Instantly share code, notes, and snippets.

@diablodale
diablodale / keybase.md
Created December 5, 2016 05:50
keybase.md

Keybase proof

I hereby claim:

  • I am diablodale on github.
  • I am dalep (https://keybase.io/dalep) on keybase.
  • I have a public key whose fingerprint is 04CA 708F 5721 295C 42C4 C8F2 C145 15BE 9A79 11F9

To claim this, I am signing this object:

@diablodale
diablodale / crs-conf-edit.php
Last active July 3, 2017 14:33
ModSecurity OWASP ModSecurity Core Rule Set 3.x config file command line tool editor
#!/usr/bin/env php
<?php
// ModSecurity OWASP ModSecurity Core Rule Set 3.x config file command line tool editor
// https://github.com/SpiderLabs/owasp-modsecurity-crs
//
// The key or rule_id must already exist in the file. It can be active or non-active (commented-out).
//
// Usage to set a key value, e.g. to set SecGeoLookupDB to the value: util/geo-location/GeoIP.dat
// crs-conf-edit crs-setup.conf SecGeoLookupDB util/geo-location/GeoIP.dat
@diablodale
diablodale / ssh.BAT
Created January 25, 2020 15:34
Basic shim to call WSL executable with same name as this BAT file
@echo off
::
:: Basic shim to call WSL executable with same name as this BAT file
::
:: Copyright (c) 2020 Dale Phurrough with MIT License:
:: Permission is hereby granted, free of charge, to any person obtaining a copy
:: of this software and associated documentation files (the "Software"), to deal
:: in the Software without restriction, including without limitation the rights
:: to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
:: copies of the Software, and to permit persons to whom the Software is
@diablodale
diablodale / version-vcpkg.cmake
Created May 7, 2020 15:52
cmake helper function to require a specific semver or newer of any vcpkg installed package
# cmake helper function to require a specific semver or newer
# of any vcpkg installed package
# Example: include("version-vcpkg.cmake")
# confirm_vcpkg_version(packagename 2.1.0)
#
cmake_minimum_required(VERSION 3.15)
function(confirm_vcpkg_version)
if ((NOT ARGV0) OR (NOT ARGV1))
@diablodale
diablodale / ocv_alloc_fragit.cpp
Created December 16, 2020 21:19
OpenCV allocator fragmentation tester
#include <Windows.h>
#include <psapi.h>
#include <thread>
#include <utility>
#include <vector>
#include <stdlib.h>
#include <string.h>
#include <iostream>
#include <malloc.h>
#include <cassert>