Skip to content

Instantly share code, notes, and snippets.

View cicorias's full-sized avatar

Shawn Cicoria cicorias

View GitHub Profile
@cicorias
cicorias / makeSH256Cert.cmd
Created November 7, 2014 17:44
Make a self signed SH256 certificate...
makecert -pe -n "CN=ppistablet" -a sha256 -sky Exchange -eku 1.3.6.1.5.5.7.3.3 -ic c:\ppis\CA.cer -iv c:\ppis\CA.pvk -sp "Microsoft RSA SChannel Cryptographic Provider" -sy 12 -cy end -sv c:\ppis\ppistablet.pvk c:\ppis\ppistablet.cer
pvk2pfx -pvk c:\ppis\ppistablet.pvk -spc c:\ppis\ppistablet.cer -pfx c:\ppis\ppistablet.pfx -pi xxxxx
@cicorias
cicorias / gist:604286f96c833f246a37
Created February 9, 2015 21:15
Example of Azure Resource Manager Providers for a Subscription
{
"value": [
{
"id": "/subscriptions/<subscriptionId>/providers/Microsoft.Batch",
"namespace": "Microsoft.Batch",
"resourceTypes": [
{
"resourceType": "batchAccounts",
"locations": [
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}
@cicorias
cicorias / OneDriveNameChec.ps1
Created April 18, 2015 22:03
Run this from your OneDrive path - and it will report all files that exceed 250 characters - which on OneDrive if > 255 no sync - happens on Mac OS X too
Get-ChildItem -r * |? {$_.GetType().Name -match "File" } |? {$_.fullname.length -ge 250} | `
%{ Write-Host $_.fullname.length.ToString() "|" $_.fullname}
@cicorias
cicorias / gist:973120ebdb1dd75603a0
Created May 26, 2015 15:06
Disabling Headers in Azure Web Apps / Web Sites - or IIS for that matter
<configuration>
<system.webServer>
<security>
<requestFiltering removeServerHeader="true"/>
</security>
<httpProtocol>
<customHeaders>
<remove name="X-Powered-By" />
<remove name="X-Cache" />
</customHeaders>

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