Skip to content

Instantly share code, notes, and snippets.

@vincentbernat
vincentbernat / gist:1180393
Created August 30, 2011 07:34
stunnel configuration for SSL benchmark
pid = /var/run/stunnel.pid
socket = a:SO_REUSEADDR=1
socket = l:TCP_NODELAY=1
socket = r:TCP_NODELAY=1
debug = 2
[ssl_frontend]
client = no
key = /WOO/server1024.key
cert = /WOO/server1024.crt
@danvega
danvega / webtail.js
Created April 24, 2012 02:37
NodeJs Tail to browser window
var http = require('http');
var spawn = require('child_process').spawn;
http.createServer(function(request,response){
response.writeHead(200,{
'Content-Type' : 'text/plain'
});
var directory = 'C:\\ColdFusion9\\logs\\';
@rraptorr
rraptorr / stunnel-4.53-xforwarded-for.diff
Created June 25, 2012 17:50
X-Forwarded-For stunnel 4.53 patch
diff --git a/doc/stunnel.8 b/doc/stunnel.8
index 589d968..f56f5c0 100644
--- a/doc/stunnel.8
+++ b/doc/stunnel.8
@@ -693,6 +693,10 @@ This options has been renamed to \fInone\fR.
.RE
.RS 4
.RE
+.IP "\fBxforwardedfor\fR = yes | no" 4
+.IX Item "xforwardedfor = yes | no"
@mapopa
mapopa / thin_init.sh
Created October 24, 2012 09:06
start thin in user rvm with env , solves /usr/bin/env: ruby_noexec_wrapper: No such file or directory
#!/bin/sh
### BEGIN INIT INFO
# Provides: thin
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: S 0 1 6
# Short-Description: thin initscript
# Description: thin
### END INIT INFO
@sdrew
sdrew / golang-upstart.conf
Created May 20, 2014 23:18
Upstart script for Go service
description "Description goes here"
author "Your Name"
start on (local-filesystems and net-device-up)
stop on runlevel [!2345]
respawn
exec /path/to/compiled/binary -flag value -flag2 value2
@douglasjarquin
douglasjarquin / mongos.init
Created June 12, 2013 23:00
A mongos init script for Amazon Linux
#!/bin/bash
# mongos - Startup script for mongos
# chkconfig: 35 85 15
# description: Mongo is a scalable, document-oriented database.
# processname: mongos
# config: /etc/mongos.conf
# pidfile: /var/run/mongo/mongos.pid
@Slauta
Slauta / src\Acme\UserBundle\Entity\UserRepository.php
Created July 25, 2012 09:21
DataTable server side for Symfony 2 Doctrine
<?php
namespace Acme\UserBundle\Entity;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\Query\Expr;
/**
* UserRepository
*
@ChadSikorra
ChadSikorra / DataTable.php
Created October 15, 2012 03:26
Symfony2 Doctrine DataTables.js (Related Entity Enabled)
<?php
/**
* Recognizes mData sent from DataTables where dotted notations represent a related
* entity. For example, defining the following in DataTables...
*
* "aoColumns": [
* { "mData": "id" },
* { "mData": "description" },
* { "mData": "customer.first_name" },
* { "mData": "customer.last_name" }
@imminent
imminent / ObjectGraph.java
Last active October 23, 2017 07:39
Dagger `ObjectGraph` utility to hide the mess of injecting the different Android classes. Note this is inspired by https://github.com/pyricau/CleanAndroidCode/blob/master/cleanandroidcode/src/main/java/info/piwai/cleanandroidcode/base/GraphRetriever.java
import javax.annotation.Nonnull;
import android.app.Activity;
import android.app.Service;
import android.support.v4.app.Fragment;
import android.content.Context;
/**
* <p>Retrieves the {@link dagger.ObjectGraph} and injects dependencies.</p>
* @author Dandré Allison
@elsewhat
elsewhat / trello_burndown.gs
Created December 12, 2013 14:03
Google apps script for generating daily burndown chart from trello tasks. Sends it by email (set up a trigger)
//TODO in this script
//1. Add board id in url used in TrelloAPI method (line xx
//2. Add your email in sendChartsByEmail
//3. Add your Trello keys from https://trello.com/1/appKey/generate to authorizeTrello
//4. Setup daily trigger in script editor that runs TrelloAPI()
//5. Run once in google apps script editor to authorize trello for access
//6. Lookup values and aggValues are hardcoded to the labels I use in Trello
//
//In the Trello board use scrum for trello syntax (http://scrumfortrello.com/)
//Example title: <name of task> (estimate hours) [work delivered in hours]