Skip to content

Instantly share code, notes, and snippets.

View deanlj's full-sized avatar

DeanLJ deanlj

View GitHub Profile
@deanlj
deanlj / cloudflare.js
Created January 12, 2023 08:16 — forked from ozziexsh/cloudflare.js
Deletes all records in a cloudflare dns zone. Useful for when you import a domain into cloudflare and it adds a bunch of useless dns records that you can't bulk delete
const fetch = require("node-fetch");
function baseRequest(url, options) {
return fetch(`https://api.cloudflare.com/client/v4/${url}`, {
headers: {
Authorization: "Bearer YOUR_TOKEN_HERE",
},
...options,
});
}
@deanlj
deanlj / md5.js
Created May 23, 2021 19:31 — forked from MichaelPote/md5.js
invalid reference fix and fixed add32 not being overwritten properly.
/*
* http://www.myersdaily.org/joseph/javascript/md5-text.html
*/
(function (global) {
var md5cycle = function (x, k) {
var a = x[0],
b = x[1],
c = x[2],
d = x[3];
@deanlj
deanlj / openFairSim.R
Created November 23, 2020 11:20 — forked from davidski/openFairSim.R
Sample OpenFAIR model
# for *pert functons
library('mc2d')
# given the number of loss events, calculate the sum of losses for the number of events
sample_LM <- function(N, L, ML, H, CONF){
# Calculate the aggregate loss
#
# ARGS:
# N - number of threat events to evaluate
# L - low boundary
@deanlj
deanlj / openFairSim.R
Created November 23, 2020 11:20 — forked from davidski/openFairSim.R
Sample OpenFAIR model
# for *pert functons
library('mc2d')
# given the number of loss events, calculate the sum of losses for the number of events
sample_LM <- function(N, L, ML, H, CONF){
# Calculate the aggregate loss
#
# ARGS:
# N - number of threat events to evaluate
# L - low boundary
@deanlj
deanlj / machine.js
Created August 31, 2020 08:10
Generated by XState Viz: https://xstate.js.org/viz
Machine({
id: 'SWAPI',
initial: 'idle',
context: {
user: null
},
states: {
idle: {
on: {
FETCH: 'loading'
@deanlj
deanlj / gist.js
Created April 16, 2019 16:37 — forked from nathanpeck/gist.js
export class MyEcsConstructStack extends cdk.Stack {
constructor(scope: cdk.App, id: string, props?: cdk.StackProps) {
super(scope, id, props);
const vpc = new ec2.VpcNetwork(this, 'MyVpc', {
maxAZs: 3 // Default is all AZs in region
});
const cluster = new ecs.Cluster(this, 'MyCluster', {
vpc: vpc
@deanlj
deanlj / tls-client.go
Created April 21, 2018 07:04 — forked from michaljemala/tls-client.go
SSL Client Authentication Golang sample
package main
import (
"crypto/tls"
"crypto/x509"
"flag"
"io/ioutil"
"log"
"net/http"
)
@deanlj
deanlj / client.go
Created April 21, 2018 06:59 — forked from xjdrew/client.go
golang tls client and server, require and verify certificate in double direction
package main
import (
"crypto/tls"
"crypto/x509"
"flag"
"io"
"io/ioutil"
"log"
"os"