Skip to content

Instantly share code, notes, and snippets.

@digitalcraft
digitalcraft / ci.coffee
Created February 17, 2016 03:24
ci in coffee script
fs = require 'fs'
{spawn, exec} = require 'child_process'
express = require 'express'
app = express()
app.configure ->
app.use express.bodyParser()
@digitalcraft
digitalcraft / gist:10343520
Last active August 29, 2015 13:58
Fix Heartbleed on Ubuntu

How to patch Ubuntu for Heartbleed

  1. sudo apt-get update
  2. sudo apt-get install -y libssl1.0.0 openssl
  3. openssl version -a and confirm the "built on" date is >= 2014-04-07
  4. sudo lsof -n | grep ssl | grep DEL and restart all listed services.

Repeat #4 until no results are returned.

01net.com:443 - VULNERABLE
1001freefonts.com:443 - VULNERABLE
123contactform.com:443 - VULNERABLE
123rf.com:443 - VULNERABLE
18qt.com:443 - VULNERABLE
1fichier.com:443 - VULNERABLE
24tv.ua:443 - VULNERABLE
444.hu:443 - VULNERABLE
518.com.tw:443 - VULNERABLE
55188.com:443 - VULNERABLE
//
// Usage: require('./pid')("myapp");
//
var fs = require('fs');
module.exports = function(appname){
process.title = appname;
var PID_FILE = "/usr/local/var/run/"+process.title+".pid";
@digitalcraft
digitalcraft / mime types
Created July 15, 2013 02:34
mime types yay
/**
* Gets the mime type of the embedded or inline image
* @access private
* @return mime type of ext
*/
function _mime_types($ext = '') {
$mimes = array(
'ai' => 'application/postscript',
'aif' => 'audio/x-aiff',
'aifc' => 'audio/x-aiff',
module.exports = (subject = module.parent) ->
console.log 'globalist', subject.id
(require 'pkginfo') subject
{dependencies} = subject.exports
for dependency, version of dependencies then do (dependency, version) ->
console.log 'globalising', dependency
Object.defineProperty global, dependency, configurable: yes, get: ->