Skip to content

Instantly share code, notes, and snippets.

View JeremyMcCormick's full-sized avatar
:octocat:

Jeremy McCormick JeremyMcCormick

:octocat:
View GitHub Profile
@JeremyMcCormick
JeremyMcCormick / simple.java
Last active August 29, 2015 14:27
jndi example
public SomeConstructor(){
this.dataSource = initDatasource("jdbc/mysqldb01");
}
private static DataSource initDatasource(String jndi){
try {
javax.naming.Context ctx = new InitialContext();
// relative to standard JNDI root for J2EE app
javax.naming.Context envCtx = (javax.naming.Context) ctx.lookup( "java:comp/env" );
return (DataSource) envCtx.lookup( jndi );
@JeremyMcCormick
JeremyMcCormick / schema.sql
Last active August 29, 2015 14:27 — forked from brianv0/init.sql
MySQL Datacat Schema
--drop table ContainerSearch;
drop table VerDatasetMetaString ;
drop table VerDatasetMetaNumber ;
drop table VerDatasetMetaTimestamp ;
drop table DatasetGroupMetaString ;
drop table DatasetGroupMetaNumber ;
drop table DatasetGroupMetaTimestamp ;
@JeremyMcCormick
JeremyMcCormick / jupyterhub_aws.md
Created May 16, 2019 16:21 — forked from widdowquinn/jupyterhub_aws.md
Set up JupyterHub on AWS

JupyterHub on AWS

EC2 Setup

  • Log in to AWS
  • Go to a sensible region
  • Start a new instance with Ubuntu Trusty (14.04) - compute-optimised instances have a high vCPU:memory ratio, and the lowest-cost CPU time. c4.2xlarge is a decent choice.
  • Set security group (firewall) to have ports 22, 80, and 443 open (SSH, HTTP, HTTPS)
  • If you want a static IP address (for long-running instances) then select Elastic IP for this VM
  • If you want to use HTTPS, you'll probably need a paid certificate, or to use Amazon's Route 53 to get a non-Amazon domain (to avoid region blocking).