Skip to content

Instantly share code, notes, and snippets.

View ohall's full-sized avatar
🚀

Oakley Hall ohall

🚀
View GitHub Profile
@ohall
ohall / add-ca.java
Created June 25, 2024 12:52
Adding a self signed cert to Java KeyStore
import javax.net.ssl.*;
import java.io.*;
import java.security.KeyStore;
public class TrustSelfSignedCert {
  public static void main(String[] args) throws Exception {
  FileInputStream is = new FileInputStream("path/to/self-signed-cert.crt");
  // Create a KeyStore containing our trusted CAs
  KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());
  ks.load(null, null);
  ks.setCertificateEntry("selfsigned", CertificateFactory.getInstance("X.509").generateCertificate(is));
@ohall
ohall / node-ca.js
Created June 25, 2024 12:46
node ca
const https = require('https');
const fs = require('fs');
const options = {
  hostname: 'example.com',
  port: 443,
  path: '/',
  method: 'GET',
  ca: fs.readFileSync('path/to/self-signed-cert.pem')
};
@ohall
ohall / README.md
Created September 7, 2016 13:52
Simplest Redux Example

A super simple redux example, originally posted by Dan Abramov

Usage:

node simple-redux.js
@ohall
ohall / replace.sh
Last active February 4, 2016 15:40
Recursive string replace on all files below pwd using Perl
perl -pi -w -e 's/<out>/<in>/g;' ./**/*.*

fully assembled Expedit standing desk An Expedit standing desk.

This is a tall desk; shorter people may want to consider cutting two 1x4 units into 1x2 units (since a top and bottom panel are needed for each 1x2 unit) to replace the 2x2 units and adding legs or casters, but I'm not sure if the internal construction of the Kallax units would support that. Or, you know, stand on a platform. Don't forget your anti-fatigue mat!

Parts Needed

  • 2x 1x4 Kallax Unit - 1x5 Expedit units can be used for a wider desk
  • 2x 2x2 Kallax Unit - 2x2 Expedit units must be used if and only if using 1x5 Expedit units
  • 4x 1x2 flat braces, e.g. these
  • 2x 2x2 flat braces, e.g. these
@ohall
ohall / webpack.md
Last active September 16, 2015 15:19
Webpack intro

webpack takes modules with dependencies and generates static assets representing those modules.

Source code here

Egghead tutorial here

Circus allows for distinct versioned Webpack components to link to one another at runtime, using independent builds and release schedules.

@ohall
ohall / .gitignore
Last active August 29, 2015 14:18 — forked from octocat/.gitignore
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@ohall
ohall / upgrade-npm.sh
Created March 26, 2015 14:01
Update NPM to latest version
npm --version #2.1.11
npm install -g npm@latest
npm --version #2.7.3
# if npm ERR! UNABLE_TO_VERIFY_LEAF_SIGNATURE
npm config set strict-ssl false
@ohall
ohall / herenow.sh
Created March 14, 2015 12:51
Make sure you're in script's actual working directory, not the dir you called it from.
# Make sure you're in script's actual working directory, not the dir you called it from.
# See: http://stackoverflow.com/a/16349776/741892
cd ${0%/*}
@ohall
ohall / symlinking.sh
Created March 12, 2015 17:27
a pattern for creating symlinks in bash
#!/bin/bash
function symlink() {
SRC=$1
DST=$2
# Remove old dest.
rm -f "$DST"
# Symlink
ln -s "$SRC" "$DST"
}