Skip to content

Instantly share code, notes, and snippets.

kennwhite

Block or report user

Report or block kennwhite

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kennwhite
kennwhite / chicken_shrimp_korma_mortal_v1.md
Last active Apr 17, 2019
Restaurant style chicken/prawn korma - mere mortal version (v. 1)
View chicken_shrimp_korma_mortal_v1.md

Kenn's Chicken/King Prawn Coconut Curry (Korma)

Ingredients

  • 2 cups red or yellow onions, well peeled, loosely chopped
  • 6 cloves peeled garlic, finely grated
  • 2" peeled ginger root, finely grated
  • Optional: 1 medium serrano green pepper, seeded & cored, finely minced (leave out for no heat, use half pepper for medium, full for spicy)
  • 14 oz plain greek yogurt (2% or whole milk, eg FAGE 5%)
  • large can (~14 oz) unsweetened coconut milk (ideally containing no guar gum; well blended if it does)
  • 3 TB cashew butter
@kennwhite
kennwhite / Linux_setup_baseline_ChromeOS.md
Last active Sep 20, 2018
Dev environment setup for native Linux apps (VMs & containers) in ChromeOS Stable
View Linux_setup_baseline_ChromeOS.md

Notes for setting up a dev environment in Chrome Linux (Crostini VMs & containers) on Chromebooks

Once Linux Apps has been enabled in System menu, open a browser window

Open a CROSH window: ctrl-shift-T

crosh>

Enter built-in ChromeOS Linux VM termina, based on Gentoo

View .crostini-setup
These scripts set up Crostini on my Pixelbook
@kennwhite
kennwhite / enable_auth_mongodb.sh
Last active Sep 16, 2018
Enable Authentication for new install of MongoDB
View enable_auth_mongodb.sh
#!/bin/bash
sudo sed -i-`date -u|tr ' ' '_'`.bak 's/^#security:*/security:\n authorization: enabled/' /etc/mongod.conf
_mpwd=$(head -c 32 /dev/urandom 2>&1 | sha1sum | head -c 14 )
echo "db.createUser({user:'dba',pwd:'$_mpwd',roles:['root']})"|mongo admin 2>&1>/dev/null
sudo service mongod restart && sleep 5
@kennwhite
kennwhite / mongo_debian_9_install.sh
Last active Mar 20, 2019
Install MongoDB 4.x Enterprise on Debian 9
View mongo_debian_9_install.sh
#!/bin/bash
# To completely purge all remnants of Mongo (repo conf, pkgs, apt cache, DB files, pgp keys):
# sudo service mongod stop ; sudo apt-get purge -y mongodb-enterprise* ; sudo rm -rf /etc/apt/sources.list.d/mongodb* ; sudo rm -rf /var/lib/mongodb ; sudo apt-get clean; sudo apt-get autoclean ; sudo apt-get -y autoremove ; sudo apt-key del 9DA31620334BD75D9DCB49F368818C72E52529D4 ; sudo rm -rf /etc/mongod* ; sudo rm -rf /var/log/mongo ; sudo rm -rf /etc/apt/sources.list.d/mongodb-enterprise.list /etc/systemd/system/multi-user.target.wants/mongod.service
echo Installing MongoDB 4.x Enterprise edition...
echo
sudo apt-get install -y gnupg2 libcurl3
sudo apt-key adv --keyserver hkps://keyserver.ubuntu.com:443 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4
@kennwhite
kennwhite / nginx-boringssl-build-script-debian.sh
Created Sep 2, 2018 — forked from neilstuartcraig/nginx-boringssl-build-script-debian.sh
This builds NGINX from source with BoringSSL for Debian (alike?) systems with systemd (e.g. Debian Jessie)
View nginx-boringssl-build-script-debian.sh
#!/bin/bash
LATESTNGINX="1.11.10"
BUILDROOT="/tmp/boring-nginx"
# Pre-req
sudo apt-get update
sudo apt-get upgrade -y
# Install deps
View how-to-generate-and-use-private-keys-with-openssl-tool.md

How to Generate & Use Private Keys using OpenSSL's Command Line Tool

These commands generate and use private keys in unencrypted binary (not Base64 “PEM”) PKCS#8 format. The PKCS#8 format is used here because it is the most interoperable format when dealing with software that isn't based on OpenSSL.

OpenSSL has a variety of commands that can be used to operate on private key files, some of which are specific to RSA (e.g. openssl rsa and openssl genrsa) or which have other limitations. Here we always use

@kennwhite
kennwhite / crostini_self-signed_certs.sh
Last active Sep 1, 2018
Create valid self-signed certificates with SAN to use in a Chrome OS VM container that are trustable by Chrome & Firefox
View crostini_self-signed_certs.sh
#!/bin/bash
# This should be executed in a folder in your Linux Files namespace
# You can move these later, but you'll need to reference the files in nginx/apache later
# I chose: /home/kenn/nginx_tmp but /etc/nginx/xxx or /etc/ssl/xxx is probably better
# Just make sure to verify/chown to nginx-readable perms
# Generate RSA signing keys for RSA certs
# openssl genrsa -out rootCA.key 4096
# openssl genrsa -out server.key 4096
@kennwhite
kennwhite / self_signed_ca_san_chrome_safe_cert.sh
Last active Jun 22, 2018
Self-signed localhost ("linuxhost") CA cert w/ SAN attributes to make Chrome & FF happy
View self_signed_ca_san_chrome_safe_cert.sh
#!/bin/bash
# Gen CA root key
openssl genrsa -out server_rootCA.key 4096
# Gen self-signed root CA cert
openssl req -x509 -new -key server_rootCA.key -sha256 -days 3650 \
-subj '/O=Cert-O-Matic/OU=You get a cert and YOU get a cert/C=US/CN=Certs R Us' \
-out server_rootCA.pem
@kennwhite
kennwhite / test_ciphers_with_certs.sh
Created May 15, 2018
Test advertised ciphersuites from a TLS-enabled server
View test_ciphers_with_certs.sh
#!/usr/bin/env bash
#
# By Romeo Ninov: https://superuser.com/a/224263
#
# OpenSSL requires the port number.
SERVER=$1
DELAY=1
ciphers=$(openssl ciphers 'ALL:eNULL' | sed -e 's/:/ /g')
You can’t perform that action at this time.