Skip to content

Instantly share code, notes, and snippets.

View DrPep's full-sized avatar

Nigel Pepper DrPep

View GitHub Profile
@DrPep
DrPep / app.e2e-spec.ts
Created October 22, 2021 23:18 — forked from firxworx/app.e2e-spec.ts
NestJS Integration/E2E Testing Example with TypeORM, Postgres, JWT
import { Test, TestingModule } from '@nestjs/testing'
import { INestApplication, LoggerService } from '@nestjs/common'
import * as request from 'supertest'
import { AppModule } from './../src/app.module'
class TestLogger implements LoggerService {
log(message: string) {}
error(message: string, trace: string) {}
warn(message: string) {}
debug(message: string) {}
@DrPep
DrPep / zsh-elapsed-time.md
Created July 25, 2021 17:05 — forked from knadh/zsh-elapsed-time.md
Elapsed and execution time for commands in ZSH

Elapsed and execution time display for commands in ZSH

Append this to your ~/.zshrc file.

function preexec() {
 timer=$(($(date +%s%0N)/1000000))
@DrPep
DrPep / GenerateDataKeyPairConversion.js
Created January 26, 2021 23:33 — forked from mlmitch/GenerateDataKeyPairConversion.js
Convert AWS KMS GenerateDataKeyPair Output to PEM in NodeJS
const AWS = require('aws-sdk')
const Crypto = require('crypto')
AWS.config.region = 'us-east-1'
var kms = new AWS.KMS()
keyArn = 'Put AWS KMS Key ARN Here'
// Set the KeyPairSpec to the type of key you want to generate.
@DrPep
DrPep / jwtRS256.sh
Created December 1, 2020 17:27 — forked from ygotthilf/jwtRS256.sh
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
https://mirror1.malwaredomains.com/files/justdomains
http://sysctl.org/cameleon/hosts
https://zeustracker.abuse.ch/blocklist.php?download=domainblocklist
https://s3.amazonaws.com/lists.disconnect.me/simple_tracking.txt
https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt
https://hosts-file.net/ad_servers.txt
@DrPep
DrPep / Knex-Migrations-Seeding.md
Created June 10, 2020 00:15 — forked from NigelEarle/Knex-Migrations-Seeding.md
Migration and seeding instructions using Knex.js!

Migrations & Seeding

What are migrations??

Migrations are a way to make database changes or updates, like creating or dropping tables, as well as updating a table with new columns with constraints via generated scripts. We can build these scripts via the command line using knex command line tool.

To learn more about migrations, check out this article on the different types of database migrations!

Creating/Dropping Tables

@DrPep
DrPep / install-nvm-zsh.txt
Created January 5, 2020 01:41 — forked from mike-casas/install-nvm-zsh.txt
install nvm on mac with zsh shell
After install zsh
- brew update
- brew install nvm
- mkdir ~/.nvm
after in your ~/.zshrc or in .bash_profile if your use bash shell:
export NVM_DIR=~/.nvm
source $(brew --prefix nvm)/nvm.sh
@DrPep
DrPep / snippet.yaml
Created September 4, 2019 23:13
Kubernetes SFTP Host Keys example
kind: Deployment
...
spec:
template:
spec:
#secrets and config
volumes:
...
- name: sftp-host-keys
secret:
@DrPep
DrPep / generate.js
Created August 7, 2019 22:15
Documentation for Kubernetes Javascript Client Functions
const request = require('request-promise-native')
const fs = require('fs')
const util = require('util')
const log_file = fs.createWriteStream(__dirname + '/kubernetes-client-functions.md', { flags: 'w' })
log = function (d) {
//
log_file.write(util.format(d) + '\n')
}
@DrPep
DrPep / codecept.conf.js
Last active March 18, 2019 00:02
End 2 End tests for VueJS using Webpack Dev Server - start server, wait for response, continue
const { spawn } = require('child_process')
const waitOn = require('wait-on')
let subProcess
exports.config = {
tests: './test/tests/*_test.js',
output: './output',
helpers: {
Puppeteer: {
url: 'http://localhost:8080',