Skip to content

Instantly share code, notes, and snippets.

@ehazlett
ehazlett / newrelic_tomcat6_elasticbeanstalk.txt
Created February 21, 2012 03:11
New Relic Tomcat6 ElasticBeanstalk
-javaagent:/var/lib/tomcat6/webapps/ROOT/WEB-INF/lib/newrelic.jar
from fabric.api import run, sudo, env
from fabric.operations import put
def clone_shigoto(username=None):
sudo('chmod -R 777 /opt')
sudo('apt-get install git-core python-setuptools libxml2-dev libxslt-dev')
sudo('easy_install pip')
sudo('pip install virtualenv')
sudo('virtualenv --no-site-packages /opt/ve/shigoto')
run('cd /opt ; rm -rf shigoto ; git clone https://{0}@github.com/lillyoi/shigoto.git'.format(username))
@ehazlett
ehazlett / gist:1953611
Created March 1, 2012 22:12
Node.js eval
Pros
-----
* async programming, fast
* MongoDB JSON to Node win -- avoid middle translation layers
* Regex allowed in URL routes (Flask doesn't allow regex)
* Node plugins for just about everything (MongoDB, redis, etc.)
* node cluster makes scaling relatively painless
* node specific async features (socket.io, event emitters, etc.) are nice -- the WSGI layer doesn't allow sockets, etc.
* Wide usage -- 37Signals, eBay, Heroku, rdio, yahoo (https://github.com/joyent/node/wiki/Projects,-Applications,-and-Companies-Using-Node)
* Re-use existing third-party JS utils (validation, etc.)
@ehazlett
ehazlett / coiapi_flask_limit3offset0.txt
Created March 9, 2012 15:59
coiapi flask (limit 3, offset 0)
[
{
"_id": "NCT00003926",
"arm_group": [
{
"arm_group_label": "Solid/brain tumor patients (1-18 years)",
"arm_group_type": "Experimental",
"description": "Patients with solid tumor or brain tumor in the 1-18 years old stratum."
},
{
@ehazlett
ehazlett / uwsgi_supervisor_flask.conf
Created March 11, 2012 15:55
uWSGI supervisor config (Flask)
[program:appname]
command=/usr/local/bin/uwsgi
--uid=www-data
--gid=www-data
-s /tmp/uwsgi_appname.sock
-H /opt/ve/appname
-p 4
-b 8192
-M
--no-orphans
@ehazlett
ehazlett / uwsgi_supervisor_django.conf
Created March 11, 2012 15:57
uWSGI supervisor config (Django)
[program:appname]
command=/usr/local/bin/uwsgi
--uid=www-data
--gid=www-data
-s /tmp/uwsgi_appname.sock
-H /opt/ve/appname
-p 4
-b 8192
-M
--no-orphans
@ehazlett
ehazlett / cc_exhibit_spec.md
Created March 30, 2012 20:13
ClinicalCollections Exhibit Spec

ClinicalCollections Exhibit Spec

Specification for Clinical Trial exhibit data

Fields

id : text (nct_id)
alt_link : text (url to ct.gov trial)
@ehazlett
ehazlett / django_py27_openshift.md
Created April 27, 2012 18:59
Django on Python 2.7 OpenShift

Runtime Configuration

Create a new OpenShift app:

  • rhc-create-app -a <app_name> -t diy-0.1

Login to the application host using the credentials from the above command. It will look like ssh://c8812345:123214@<app_name>-username.rhcloud.com:

  • ssh c8812345:123214@<app_name>-username.rhcloud.com
@ehazlett
ehazlett / gist:2760369
Created May 21, 2012 02:48
TextMate 2 .tm_properties

This is all based on the [alpha release][1].

Properties

From the built-in help system:

For many settings TextMate will look for a .tm_properties file in the current folder and in any parent folders (up to the user’s home folder).

These are simple setting = value listings where the value is a format string in which other variables can be referenced.

This is a quick start for getting ThinkUp running on OpenShift.

Create the OpenShift app

rhc app create -a thinkup -t php-5.3

Add the MySQL cartridge

rhc app cartridge add -a thinkup -c mysql-5.1