- Ubuntu 16.04.3 x64
- 2 GB Memory / 60 GB Disk
- 200 GB block storage volume
get ip-address
from digital ocean
import * as mongoose from 'mongoose'; | |
export let Schema = mongoose.Schema; | |
export let ObjectId = mongoose.Schema.Types.ObjectId; | |
export let Mixed = mongoose.Schema.Types.Mixed; | |
export interface IHeroModel extends mongoose.Document { | |
name: string; | |
power: string; |
'use strict'; | |
/* eslint-disable consistent-this */ | |
let middlewareManagerHash = []; | |
/** | |
* Composes single-argument functions from right to left. The rightmost | |
* function can take multiple arguments as it provides the signature for | |
* the resulting composite function. | |
* |
var Middleware = function() {}; | |
Middleware.prototype.use = function(fn) { | |
var self = this; | |
this.go = (function(stack) { | |
return function(next) { | |
stack.call(self, function() { | |
fn.call(self, next.bind(self)); | |
}); |
#!/bin/sh -x | |
#This script removes Mono from an OS X System. It must be run as root | |
rm -r /Library/Frameworks/Mono.framework | |
rm -r /Library/Receipts/MonoFramework-* | |
for dir in /usr/bin /usr/share/man/man1 /usr/share/man/man3 /usr/share/man/man5; do | |
(cd ${dir}; |
Enhanced NGINX logstash parser: | |
NGINX log format: | |
log_format enhanced '$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent $request_length "$http_referer" "$http_user_agent" $request_time $upstream_response_time'; | |
access_log /var/log/nginx/access.log enhanced; | |
error_log /var/log/nginx/error.log; | |
logstash pattern (/opt/logstash/pattern/nginx): |
docker run -d --name es elasticsearch
docker run -d --name logstash --link es:elasticsearch logstash -v /tmp/logstash.conf:/config-dir/logstash.conf logstash logstash -f /config-dir/logstash.conf
docker run --link es:elasticsearch -d kibana
LOGSTASH_ADDRESS=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' logstash)
// Based off example code from Hal Robertson | |
// https://github.com/halrobertson/test-restify-passport-facebook | |
// See discussion: https://groups.google.com/forum/?fromgroups#!topic/passportjs/zCz0nXB_gao | |
var restify = require('restify') | |
// config vars | |
var FB_LOGIN_PATH = '/api/facebook_login' | |
var FB_CALLBACK_PATH = '/api/facebook_callback' | |
var FB_APPID = '<<YOUR APPID HERE>>' |
$ brew update && brew doctor # Repeat, until you've done *all* the Dr. has ordered! | |
$ brew install postgresql # You'll need postgres to do this... you may also need to 'initdb' as well. Google it. | |
$ brew install elixir | |
$ mix local.hex # Answer y to any Qs | |
$ createuser -d postgres # create the default 'postgres' user that Chris McCord seems to like -- I don't create mine w/a pw... | |
# Use the latest Phoenix from here: http://www.phoenixframework.org/docs/installation -- currently this is 1.0.3 | |
# ** Answer y to any Qs ** | |
$ mix archive.install https://github.com/phoenixframework/phoenix/releases/download/v1.0.3/phoenix_new-1.0.3.ez |
'use strict'; | |
////////////////////////////////// | |
// How to use? | |
// 1. Create `sequelize-schema-file-generator.js` in your app root | |
// 2. Make sure you've ran the `sequelize init` before (It should create `config`,`seeders`,`migrations` folders). | |
// 3. Update `DATABASE_DSN` below to match your connection string (works with any database adapter that Sequelize supports) | |
// 4. Run it with `node sequelize-schema-file-generator.js` | |
// 5. Review the generated migrations inside of the `migrations` folder. | |
////////////////////////////////// |