Skip to content

Instantly share code, notes, and snippets.

/* This is a Mono tool, for checking if an SSLv3
* certificate can be used for Server validation
* during an SSLv3 handshake
*
* Compile with:
* gmcs -r:Mono.Security certcheck.cs
*
* Usage:
* mono certcheck.exe /path/to/acertfile.cer
* */
var
PARALLEL_CONNECTS = 10,
http = require('http'),
sys = require('sys'),
connectionCount = 0,
messageCount = 0;
lastMessages = 0;
function addClient() {
@tessro
tessro / redis-server
Created December 16, 2009 14:20
A CentOS initscript for Redis
#!/bin/sh
#
# redis - this script starts and stops the redis-server daemon
#
# chkconfig: - 85 15
# description: Redis is a persistent key-value database
# processname: redis-server
# config: /etc/redis/redis.conf
# config: /etc/sysconfig/redis
# pidfile: /var/run/redis.pid
@apsoto
apsoto / update_cache.rake
Created August 4, 2010 20:53 — forked from mdkent/update_cache.rake
Sync Chef Cookbooks and Roles with Server
#
# Tasks to keep your repository in sync with your Chef Server
#
# Author:: Matthew Kent (<mkent@magoazul.com>)
# Copyright:: Copyright (c) 2010 Matthew Kent
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
@svdgraaf
svdgraaf / bitmovr.lua
Created October 4, 2010 14:41
nginx+lua+mod_cache+mod_proxy+RANGE
--
-- bitmovr.lua
-- simple lua webserver which starts to listen on a socket, and
-- forwards all GET calls it receives to a backend server
-- this is extremely lightweight, as it will move the bits from one
-- socket to another, without any disk i/o
--
-- Depends on md5, io, LuaSockets and Memcached.lua
--
-- Application flow:
@coolaj86
coolaj86 / cors.js
Created October 29, 2010 08:41
CORS / XHR2 middleware for Node.js
/*
Here's some documentation on XMLHttpRequest Level 1 and 2 as per the
standard and as per implementation.
XHR
http://www.w3.org/TR/XMLHttpRequest/
http://developer.apple.com/internet/webcontent/xmlhttpreq.html
http://msdn.microsoft.com/en-us/library/ms535874%28VS.85%29.aspx
XHR2
@garethr
garethr / amqpserver.feature
Created November 21, 2010 17:35
using cucumber for monitoring AMQP server
Feature: AMQP capacity
To make sure the rest of the system is in order
Our message queues must not be backed up
Scenario: Check queue status
Given I have a AMQP server on example.com
And I want to check on the fork queue
Then it should have less than 400 messages
Then it should have at least 5 consumers
Then it should have less than 50 messages per consumer
@nilcolor
nilcolor / Node.js CORS
Created February 8, 2011 15:28
Node.js cross-origin POST. You should response for OPTIONS request first. Something like this.
if (req.method === 'OPTIONS') {
console.log('!OPTIONS');
var headers = {};
// IE8 does not allow domains to be specified, just the *
// headers["Access-Control-Allow-Origin"] = req.headers.origin;
headers["Access-Control-Allow-Origin"] = "*";
headers["Access-Control-Allow-Methods"] = "POST, GET, PUT, DELETE, OPTIONS";
headers["Access-Control-Allow-Credentials"] = false;
headers["Access-Control-Max-Age"] = '86400'; // 24 hours
headers["Access-Control-Allow-Headers"] = "X-Requested-With, X-HTTP-Method-Override, Content-Type, Accept";
@140bytes
140bytes / LICENSE.txt
Created May 9, 2011 16:13
140byt.es -- Click ↑↑ fork ↑↑ to play!
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@sebastien-p
sebastien-p / LICENSE.txt
Created June 15, 2011 15:49 — forked from 140bytes/LICENSE.txt
LZW compression
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Sebastien P. https://twitter.com/#!/_sebastienp
Special thanks to @subzey (you rock) and @kbjr !
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.