Skip to content

Instantly share code, notes, and snippets.

View ancms2600's full-sized avatar
💭
Toot! Toot!

Bobby Johnson ancms2600

💭
Toot! Toot!
View GitHub Profile
@ancms2600
ancms2600 / statistical_analysis__d3.txt
Created September 7, 2021 03:47
Statistical Analysis with D3.js
note taking terminology:
data array = list = set = range (programming; ie. Ruby)
value: normally means number, but practically could be any type you can compare two of with eq, gt, lt operators
ordered set: sorted list
There are many kinds of Averages in the field of Statistics:
- Mean:
Arithmetic average. Is the most common, and the one you are used to; ie. [1,2,4] is 2.3~
Remember as: "Mean" is what most people "mean" when they say "average".
- Median:
@ancms2600
ancms2600 / intelligence_analysis_notes.txt
Created September 7, 2021 03:36
Intelligence Analysis
notes on the field of intelligence analysis
summary: it appears there is a mature science being applied by police, military, and intelligence organizations
and that these tactics, techniques, and procedures have a direct correlation to
the emerging modern $190B industry of information security / cyber security ...
yet most cybersec/infosec professionals are aware of its existence, certainly not practicing it, much less sworn to it.
this is of concern as many groups are learning costly/painful lessings reinventing-the-wheel with regard to ethics.
but there is also a race to introduce AI/ML in this space, but so few commercial vendors are aware of the academic body of work
on information/intelligence analysis that already exists from the pre-9/11 intelligence community.
mount -v -t btrfs -o recovery,noatime /dev/sda1 /mnt/example
@ancms2600
ancms2600 / tcpsocketservice.go
Created June 23, 2020 01:42
Listening service, upon tcp connection, launches a process (once per connection) and pipes stdin/out/err back and forth. Used to make hosting simple netcat/telnet services easier (ie. during CTF competitions)
package main
import (
"bufio"
"fmt"
"net"
"os"
"io"
"os/exec"
"time"
@ancms2600
ancms2600 / iterator-loop.js
Created April 22, 2020 18:05
Iterator Loop
Utils.iteratorLoop = () => {
const buf = [];
let next, done = false;
const push = e => {
buf.push(e);
if (null != next) next();
};
const loop = async function* () {
while (true) {
yield* buf.splice(0);
@ancms2600
ancms2600 / streaming-cross-join-walker.js
Created February 19, 2020 21:06
Efficient Cell Array data structure walker. (No functions. No recursion.)
// The following is useful when building a
// streaming cartesian product (ie. cross join)
// e.g., Imagine walking a two-dimensional matrix
// having one [column] dimension given and fixed at initialization,
// and one dimension of varying, perhaps infinite, lengths [determined by each row].
// A set of nested for...loop would normally accomplish this,
// if it weren't for the number of loop statements required varying by invocation.
const size = 3; // matrix size variable
const len = [3,2,3]; // the length of each list in the matrix (notice they can vary)
@ancms2600
ancms2600 / port-scanner.js
Created October 3, 2019 22:53
Simple TCP Port Scanner in Node.JS
(async () => {
const net = require('net');
const dns = require('dns');
const fs = require('fs');
const [,,host,portmin,portmax] = process.argv;
let a = Date.now();
const ipv4 = await new Promise((ok,fail) =>
@ancms2600
ancms2600 / app-model-alpha2.js
Last active August 11, 2019 23:05
Schemaless GraphQL (in JavaScript)
const { Utils } = require('../../../../shared/public/components/utils');
const SharedCache = require('../../../../shared/models/sharedCache');
require('../../../../shared/public/components/flatten');
const uuidv4 = require('uuid/v4');
const makeId = prefix => (prefix||'') + uuidv4().replace(/-/g,'');
const sgql = require('../../../../shared/models/sgql');
const _ = require('lodash');
const MODELS = ['User'];
@ancms2600
ancms2600 / jq.js
Created April 22, 2019 03:46
jq implemented in NodeJS
const vm = require('vm');
const fp = require('lodash/fp');
const _ = require('lodash');
/**
* Successfully mimics jq C implementation in pure Node.JS
* by utilizing the Functional Programming (FP) version of Lodash library, which is
* critical for jq-like syntax.
*
* Documentation: https://github.com/lodash/lodash/wiki/FP-Guide
@ancms2600
ancms2600 / serializer.js
Created March 24, 2019 04:29
[Compact JSON] Serializer - Inspired by Kibana's table params stored in URI hash
/*
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION