Skip to content

Instantly share code, notes, and snippets.

View ITSecMedia's full-sized avatar
🃏
If anything is worth doing, do it with all your heart. --Buddha

Norman Eckstein ITSecMedia

🃏
If anything is worth doing, do it with all your heart. --Buddha
View GitHub Profile
@ITSecMedia
ITSecMedia / ConstrainedTypesExamples.fsx
Created May 25, 2019 19:59 — forked from swlaschin/ConstrainedTypesExamples.fsx
Examples of creating constrained types in F#
// General hints on defining types with constraints or invariants
//
// Just as in C#, use a private constructor
// and expose "factory" methods that enforce the constraints
//
// In F#, only classes can have private constructors with public members.
//
// If you want to use the record and DU types, the whole type becomes
// private, which means that you also need to provide:
// * a constructor function ("create").
@ITSecMedia
ITSecMedia / gist:9cb8cf6279471531129a0a90f9556680
Created December 15, 2017 10:04 — forked from msmuenchen/gist:9318327
KeePass v2.x (KDBX v3.x) file format
Convention: Byte array notation as it would appear in a hexeditor.
= Layout=
KDBX files, the keepass database files, are layout as follows:
1) Bytes 0-3: Primary identifier, common across all kdbx versions:
private static $sigByte1=[0x03,0xD9,0xA2,0x9A];
2) Bytes 4-7: Secondary identifier. Byte 4 can be used to identify the file version (0x67 is latest, 0x66 is the KeePass 2 pre-release format and 0x55 is KeePass 1)
@ITSecMedia
ITSecMedia / google-disavow.txt
Created September 22, 2017 18:20
Google Disavow List for SPAM Domain
### 2017-09-16 == START ###
domain:81.231.146.222
domain:add-pages.com
domain:ads.earth
domain:advertise.academy
domain:advertise.boutique
domain:advertise.capital
domain:advertise.center
domain:advertise.clothing
function copyToClipboard( text ){
var copyDiv = document.createElement('div');
copyDiv.contentEditable = true;
document.body.appendChild(copyDiv);
copyDiv.innerHTML = text;
copyDiv.unselectable = "off";
copyDiv.focus();
document.execCommand('SelectAll');
document.execCommand("Copy", false, null);
document.body.removeChild(copyDiv);
@ITSecMedia
ITSecMedia / main.go
Created February 11, 2017 19:54 — forked from dmitshur/main.go
Server for HTTPS protocol. Redirects to canonical hosts, reverse proxies requests to internal backing servers.
// Server for HTTPS protocol. Redirects to canonical hosts, reverse proxies requests to internal backing servers.
package main
import (
"crypto/tls"
"flag"
"log"
"net/http"
"net/http/httputil"
"time"
Import-Module -Name D:\Temp\ACME-posh\ACMEPowerShell.psd1
$domain = "mydomain.com"
$certificiatePassword = "abcd1234"
$email = "letsencrypt@mydomain.com"
$vault = "D:\Vault\{0}\{1}" -f $domain, [guid]::NewGuid()
mkdir $vault
cd $vault
Initialize-ACMEVault -BaseURI https://acme-v01.api.letsencrypt.org/
New-ACMERegistration -Contacts mailto:$email