Skip to content

Instantly share code, notes, and snippets.

View roidrage's full-sized avatar
🌱
Planting seeds

Mathias Meyer roidrage

🌱
Planting seeds
View GitHub Profile
@roidrage
roidrage / c.js
Created March 13, 2014 17:41 — forked from isaacs/c.js
var ip = '199.27.72.162'
var https = require('https')
https.get({
host: ip,
port: 443,
path: '/graceful-fs',
headers: {
host: 'registry.npmjs.org'
}
}, function(res) {
{
"id": 1,
"number": "1",
"status": null,
"started_at": null,
"finished_at": null,
"status_message": "Passed",
"commit": "62aae5f70ceee39123ef",
"branch": "master",
"message": "the commit message",
@roidrage
roidrage / gist:223137
Created October 31, 2009 16:19 — forked from till/gist:223136
var till = "awesome";
var mathias = "win";
var jan = "relax";
#Tasks have been added to fully maintain nginx, unicorn, redis, memcached, start resque workers and run any command on any server in the farm.
#<pre>
#cap nginx:restart # Restart Nginx.
#cap nginx:start # Start Nginx.
#cap nginx:status # Status of Nginx.
#cap nginx:stop # Stop Nginx.
#cap nginx:tail_error # Tail the Nginx error logs.
#cap unicorn:reload # reload your unicorn servers.
#cap unicorn:restart # restart your unicorn servers.
#cap unicorn:start # start your unicorn servers.
gemcutter => redis downloads spec
=================================
keys
----
downloads => global counter for all gem downloads
downloads:today => sorted set for downloads from today
downloads:rubygem:rails => counter for all rails downloads
downloads:version:rails-2.3.5 => counter for all rails 2.3.5 downloads
# Our own variable where we deploy this app to
deploy_to = "/srv/example.com"
current_path = "#{deploy_to}/current"
shared_path = "#{deploy_to}/shared"
shared_bundler_gems_path = "#{shared_path}/bundler_gems"
# See http://unicorn.bogomips.org/Sandbox.html
# Helps ensure the correct unicorn_rails is used when upgrading with USR2
Unicorn::HttpServer::START_CTX[0] = "#{shared_bundler_gems_path}/bin/unicorn_rails"
@roidrage
roidrage / server.js
Created May 22, 2011 16:54 — forked from jeffrafter/server.js
Twitter OAuth with node-oauth for node.js+express
var express = require('express');
var sys = require('sys');
var oauth = require('oauth');
var app = express.createServer();
var _twitterConsumerKey = "YOURTWITTERCONSUMERKEY";
var _twitterConsumerSecret = "YOURTWITTERCONSUMERSECRET";
function consumer() {
@roidrage
roidrage / gist:1020448
Created June 11, 2011 10:45 — forked from shripadk/gist:652819
Express authentication using Redis for session store and Couchdb for database (in coffeescript!)
###
Module dependencies
###
require.paths.unshift "#{__dirname}/lib/support/express-csrf/"
require.paths.unshift "#{__dirname}/lib/support/node_hash/lib/"
express = require 'express'
app = module.exports = express.createServer()
RedisStore = require 'connect-redis'
@roidrage
roidrage / pbc_pool_transport.py
Created June 21, 2011 07:15 — forked from jdmaturen/pbc_pool_transport.py
Riak python client PBC connection pooling
import logging
log = logging.getLogger('socrates')
from Queue import Empty, Full, Queue
from riak.transports import RiakPbcTransport
from riak.transports.transport import RiakTransport
class PbcPoolTransport(RiakTransport):
@roidrage
roidrage / index.js
Created December 17, 2012 16:18 — forked from aledbf/index.js
var program = require('commander'),
request = require('request'),
fs = require('fs'),
ursa = require('ursa');
program.on('--help', function() {
console.log(' Alternative to https://gist.github.com/fbb99b638e9da27fe24d (generate secure environment variables)');
console.log(' Example:');
console.log('');
console.log(' $ node index -r github-user/user-repo -v SECURE=value');