Skip to content

Instantly share code, notes, and snippets.

View cicorias's full-sized avatar

Shawn Cicoria cicorias

View GitHub Profile
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}

Finishing this guide you'll get:

  • A running Ghost installation
  • Amazon SES mail configuration
  • Simple ssh hardenings
  • Nginx proxy
  • Node.js configured with forever

Specification of latest running installation:

var Fiber = require('fibers')
var getResp = function (url, callback) {
var fn = Fiber(function () {
var resp = handleRequest(url);
if (resp.statusCode != 200) {
//handle success response
} else {
//handle other responses here
}
@cicorias
cicorias / BottledWater.md
Last active August 29, 2015 14:27 — forked from mikekaminskycc/BottledWater.md
Bottled Water Summary

#Bottled Water

##Summary

Bottled water takes advantage of logical decoding (available with PostgreSQL 9.4) to funnel changes made to the database to a Kakfka stream in an Avro format which can then be transformed and sent somewhere else in a stream. Until PostgreSQL 9.4, if you wanted to stream changes you had to use triggers which is unappealing because of the burden they place on the databse servers.

Bottled Water Diagram

@cicorias
cicorias / app.js
Created October 30, 2015 01:56 — forked from eugeniop/app.js
Generate SAS Token for Azure Service Bus & send to Queue
var crypto = require('crypto');
var util = require('util');
var request = require('request');
var sbNamespace = '{YOUR NAMESPACE}';
var sbEntityPath = '{YOUR QUEUE}';
var sharedAccessKey = 'LBgdFoE........lFyvW4=';
var sharedAccessKeyName = '{POLICY NAME}';
var sas = getSASToken(sbNamespace, sbEntityPath, sharedAccessKeyName, sharedAccessKey);
@cicorias
cicorias / codemesh2015.org
Created November 4, 2015 13:46 — forked from philandstuff/codemesh2015.org
Code mesh 2015 notes

Kush, an introduction to schedulers

about me

  • I work for GDS
  • Cabinet Office
  • we started by building GOV.UK
    • replaced older sites like direct gov, business link
  • we’re note just fixing websites
    • we also build and run digital services
    • working with depts across the country
    • eg: register to vote
@cicorias
cicorias / sp-w-cert-azps-1-0.ps1
Created November 17, 2015 12:44 — forked from devigned/sp-w-cert-azps-1-0.ps1
Create a service principal to auth with a certificate in Azure PowerShell 1.0
# Login to Azure PowerShell
Login-AzureRmAccount
# Create the self signed cert
$currentDate = Get-Date
$endDate = $currentDate.AddYears(1)
$notAfter = $endDate.AddYears(1)
$pwd = "P@ssW0rd1"
$thumb = (New-SelfSignedCertificate -CertStoreLocation cert:\localmachine\my -DnsName com.foo.bar -KeyExportPolicy Exportable -Provider "Microsoft Enhanced RSA and AES Cryptographic Provider" -NotAfter $notAfter).Thumbprint
$pwd = ConvertTo-SecureString -String $pwd -Force -AsPlainText
@cicorias
cicorias / gulpfile.js
Created December 2, 2015 05:05 — forked from glenasmith/gulpfile.js
Zip up your webjob files into a deployable artifact
gulp.task('webjob', function() {
var webjob = "feedFetcher.zip";
del(webjob)
return gulp.src(['parsers/*.js', 'package.json', 'feedFetcher.js'], {base: "."})
.pipe(zip(webjob))
.pipe(gulp.dest('.'));
});
@cicorias
cicorias / fix-homebrew-npm.md
Created January 29, 2016 15:08 — forked from DanHerbert/fix-homebrew-npm.md
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

Fixing npm On Mac OS X for Homebrew Users

If you just want to fix the issue quickly, scroll down to the "solution" section below.

Explanation of the issue

If you're a Homebrew user and you installed node via Homebrew, there is a major philosophical issue with the way Homebrew and NPM work together. If you install node with Homebrew and then try to do npm update npm -g, you may see an error like this:

$ npm update npm -g
@cicorias
cicorias / agent.js
Created February 18, 2016 21:27 — forked from TooTallNate/agent.js
Node.js `http.Agent` class implementations...
/**
* Module dependencies.
*/
var net = require('net');
var inherits = require('util').inherits;
var EventEmitter = require('events').EventEmitter;
/**