Skip to content

Instantly share code, notes, and snippets.

@runcom
runcom / post.js
Last active December 12, 2015 09:49
/**
* Created by Antonio Murdaca.
* Date: 10/02/13
* Time: 22.00
*/
var mongoose = require('mongoose')
,Schema = mongoose.Schema;
var postSchema = new Schema({
title: String,
var config = module.exports = {};
config.port = 61337;
config.secret = '076ee61d63aa10a125ea872411e433b9';
config.mongo = {};
config.mongo.uri = process.env.MONGO_URI || 'localhost';
config.mongo.port = 27017; //optional
config.mongo.user = 'user'; //optional
config.mongo.pass = 'pass'; //optional
config.mongo.db = 'blog';
@runcom
runcom / cp.js
Created March 12, 2013 11:52
childp
var spawn = require('child_process').spawn;
// Spawn the child with a "ls -la" command
var child = spawn('google-chrome');
// When child exits:
child.on('exit', function(code) {
console.log('child process terminated with code ' + code);
});
@runcom
runcom / master.vim
Last active August 29, 2015 14:00 — forked from gmccreight/master.vim
" copy all this into a vim buffer, save it, then...
" source the file by typing :so %
" Now the vim buffer acts like a specialized application for mastering vim
" There are two queues, Study and Known. Depending how confident you feel
" about the item you are currently learning, you can move it down several
" positions, all the way to the end of the Study queue, or to the Known
" queue.
" type ,, (that's comma comma)
#!/usr/bin/env escript
% -*- erlang-indent-level: 4;indent-tabs-mode: nil -*-
% ex: ts=4 sw=4 et
-export([main/1]).
create_xml_snippet(L) ->
PlaceHolders = [
"@ind_clifor@",
"@cod_clifor@",
"@ind_gest_ivacassa@",
@runcom
runcom / update-vagrant
Last active June 1, 2017 10:11
Shell script to upgrade your vagrant to the latest version
#!/bin/sh
ONLINE_VERSION=$(curl -s https://www.vagrantup.com/downloads.html) | grep -i 'x86_64.deb' | sed 's/.*\/vagrant_\(.*\)_x86_64\.deb.*/\1/i'
SYSTEM_VERSION=$(vagrant --version) | sed 's/^vagrant \(.*\)$/\1/i'
VAGRANT_CHECK=$(command -v vagrant >/dev/null 2>&1)
#if [ "$VAGRANT_CHECK" = 1 ]; then
#novagrant
#else
// Run executes the job and blocks until the job completes.
// If the job fails it returns an error
func (job *Job) Run() (err error) {
if job.Eng.IsShutdown() && !job.GetenvBool("overrideShutdown") {
return fmt.Errorf("engine is shutdown")
}
// FIXME: this is a temporary workaround to avoid Engine.Shutdown
// waiting 5 seconds for server/api.ServeApi to complete (which it never will)
// everytime the daemon is cleanly restarted.
// The permanent fix is to implement Job.Stop and Job.OnStop so that
==================
WARNING: DATA RACE
Write by goroutine 82:
github.com/docker/docker/registry.(*httpsRequestModifier).ModifyRequest()
/go/src/github.com/docker/docker/registry/registry.go:129 +0x192c
github.com/docker/docker/pkg/transport.(*transport).RoundTrip()
/go/src/github.com/docker/docker/pkg/transport/transport.go:55 +0x185
github.com/docker/docker/pkg/transport.(*transport).RoundTrip()
/go/src/github.com/docker/docker/pkg/transport/transport.go:61 +0x2e0
github.com/docker/docker/registry.(*authTransport).RoundTrip()
@runcom
runcom / gist:c8be5b347dfc1deddba3
Created May 24, 2015 20:31
race stats native driver 1
==================
WARNING: DATA RACE
Write by goroutine 32:
runtime.mapassign1()
/usr/local/go/src/runtime/hashmap.go:383 +0x0
github.com/docker/docker/daemon/execdriver/native.(*driver).Run()
/go/src/github.com/docker/docker/daemon/execdriver/native/driver.go:142 +0x7cb
github.com/docker/docker/daemon.(*Daemon).Run()
/go/src/github.com/docker/docker/daemon/daemon.go:1033 +0xe1
github.com/docker/docker/daemon.(*containerMonitor).Start()
@runcom
runcom / gist:5791bd0befbe8f0c7d3b
Created May 24, 2015 20:32
race stats native driver 2
==================
WARNING: DATA RACE
Write by goroutine 96:
runtime.mapdelete()
/usr/local/go/src/runtime/hashmap.go:495 +0x0
github.com/docker/libcontainer/cgroups.RemovePaths()
/go/src/github.com/docker/docker/vendor/src/github.com/docker/libcontainer/cgroups/utils.go:230 +0x1f6
github.com/docker/libcontainer/cgroups/fs.(*Manager).Destroy()
/go/src/github.com/docker/docker/vendor/src/github.com/docker/libcontainer/cgroups/fs/apply_raw.go:127 +0x5e
github.com/docker/libcontainer.(*linuxContainer).Destroy()