Skip to content

Instantly share code, notes, and snippets.

View mwarner1's full-sized avatar

Matt Warner mwarner1

View GitHub Profile
@mwarner1
mwarner1 / gist:4e6c9a06638302328e54aa7aca1c5477
Last active February 19, 2019 21:24
Null shared secret allows brute force success with tacacs-plus library
'use strict';
const net = require('net');
const crypto = require('crypto');
const tacacs = require('tacacs-plus');
const AuthResult = Object.freeze({
Success: 'Success',
Failure: 'Failure'
});
@mwarner1
mwarner1 / CopyFiles.js
Last active July 27, 2018 22:45
Copying files to S3rver for serverless-offline testing using serverless-s3-local
'use strict';
// Matt Warner, July 2018
// Use at your own risk, no warranties, no guarantees, etc.
// Code to copy local files into the format used by serverless-s3-local (which uses S3rver)
const {promisify} = require('util');
const fs = require('fs');
const readFileAsync = promisify(fs.readFile);
const readDirAsync = promisify(fs.readdir);
@mwarner1
mwarner1 / koa-router-wildcard.js
Last active July 16, 2018 20:38
koa-router with embedded wildcards
/**
* Adaptation of the koa-mount boilerplate example expanded to include wildcards.
* Unfortunately, there are a number of bugs with wildcard matching and koa-router.
* Below is a workaround which consists of using regular expressions to "match all except"
* instead of a plain wildcard.
*
* Use at your own risk.
* --Matt Warner, July 2018
*
* Original note: