Skip to content

Instantly share code, notes, and snippets.

View tizzo's full-sized avatar
💭
:shipit: 🚀 📦

Howard Tyson tizzo

💭
:shipit: 🚀 📦
View GitHub Profile
@tizzo
tizzo / .gitignore
Last active November 3, 2022 17:28
Create CSVs of Datadog resource 🔪🐶
.env
node_modules
.DS_Store
@tizzo
tizzo / Dockerfile
Last active January 23, 2020 16:37
Test dropped requests during a rolling kubernetes deployment.
FROM node:alpine
WORKDIR /app
COPY server.js .
CMD node /app/server.js
@tizzo
tizzo / download.ts
Last active October 15, 2019 13:57
download_m3u8
#! /usr/bin/env ts-node --transpile-only
import { createWriteStream, readFileSync, writeFileSync } from "fs";
import { basename, extname } from "path";
import { createHash } from "crypto";
const s3Url =
"https://example-video-player-debugging-temporary.s3.amazonaws.com";
const fetch = require("node-fetch");
async function getPlaylist() {
@tizzo
tizzo / package.json
Last active May 30, 2019 13:24
Parse LDIF files and produce a CSV of group membership
{
"name": "ldif-parse",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"dependencies": {
"ldif": "^0.5.1"
}
}
'use strict';
const should = require('should');
const DiC = require('../../lib/DependencyInjectionContainer');
/**
* @class Service class test fixture.
*/
class Foo {
constructor() {
const net = require('net');
const https = require('https');
const filePath = '/tmp/kanye';
const server = net.createServer(async (stream) => {
stream.end(await getKanyeQuote() + '\n');
});
server.listen(filePath, () => {
@tizzo
tizzo / csv-dump.js
Last active February 22, 2019 18:11
Crawl over a ldif file and make a csv of users with a column for each group they're a member of.
'use strict'
const fs = require('fs');
const os = require('os');
const file = fs.readFileSync('./dump.txt', 'utf8').split(os.EOL);
const people = [];
const groups = new Set();
var current_person = false;
@tizzo
tizzo / crypto.php
Last active March 1, 2018 14:52
PHP Asymmetric Crypto examples
<?php
/****************************
* Generate a new key pair. *
****************************/
$privateKey = openssl_pkey_new(array(
'private_key_bits' => 2048, // Size of Key.
'private_key_type' => OPENSSL_KEYTYPE_RSA,
@tizzo
tizzo / deploy_hosted_app.js
Created January 12, 2018 21:27
Programatic Cloudmine Deploys
const fs = require('fs');
var request = require('request');
request = request.defaults({jar: true});
// The appid from the hosted app.
const appid = 'XXX';
const body = {
email: 'someone@somewhere.com',
password: 'XXX',
}
const headers = {
#! /usr/bin/env bash
echo 'Installing dependencies php and git...'
echo ''
echo ''
echo ''
pkg install -y php70 git php70-json php70-ctype php70-phar php70-iconv php70-openssl
echo ''
echo ''