Skip to content

Instantly share code, notes, and snippets.

View tvjames's full-sized avatar
🇦🇺

Thomas James tvjames

🇦🇺
View GitHub Profile
@tvjames
tvjames / gist:3116218
Created July 15, 2012 10:38
fabric apply_mono_webapp task
@task
def apply_nginx_role(hostname=''):
if (hostname == ''):
hostname = env.host.partition('.')[0]
# requires backports
system.install('nginx', 'squeeze-backports')
@task
def apply_nginx_reload():
system.run_or_sudo('nginx -s reload')
@tvjames
tvjames / gist:3116339
Created July 15, 2012 11:28
templates/apps/nginx.conf
upstream %(appname)s {
%(appname_upstream)s}
server {
listen 80;
listen [::]:80;
root %(app_folder_static)s;
index index.html index.htm;
@tvjames
tvjames / gist:3116342
Created July 15, 2012 11:28
templates/apps/supervisord.conf
[program:%(appname)s]
numprocs=%(numbackend)s
process_name=%(appname)s-%(baseport)s-%%(process_num)04d
command=%(app_folder_bin)s/daemon
user=%(app_owner)s
stderr_logfile = %(app_folder_logs)s/%(appname)s-stderr.log
stdout_logfile = %(app_folder_logs)s/%(appname)s-stdout.log
directory=%(app_folder)s
environment=PATH="%(mono_bin)s:$PATH",PORT="$((%(baseport)s+%%(process_num)d))"
@tvjames
tvjames / gist:3116345
Created July 15, 2012 11:30
templates/apps/daemon
#!/bin/bash -e
CMD="echo $PORT"
PORT=`eval $CMD`
echo "Starting on port: $PORT"
exec %(mono_xsp4)s --nonstop --port $PORT --root %(app_folder_root)s
@tvjames
tvjames / RavenDB_OutOfMemory_TestCase.linq
Created January 28, 2013 07:35
RavenDB_OutOfMemory_TestCase.linq
<Query Kind="Program">
<NuGetReference>RavenDB.Client</NuGetReference>
<Namespace>Newtonsoft.Json</Namespace>
<Namespace>Raven.Client</Namespace>
<Namespace>Raven.Client.Document</Namespace>
<Namespace>Raven.Client.Indexes</Namespace>
</Query>
void Main()
{
@tvjames
tvjames / Vagrantfile
Last active March 5, 2021 01:31
Oracle 11g Init Script
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "ORCL_11gR211203_v1"
@tvjames
tvjames / Vagrantfile
Last active August 11, 2022 14:27
Prepare a Windows Server 2008 R2 instance for use with vagrant-windows.
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.

Keybase proof

I hereby claim:

  • I am tvjames on github.
  • I am thomasvjames (https://keybase.io/thomasvjames) on keybase.
  • I have a public key whose fingerprint is 679C 3A99 DEDC E761 AB79 60C2 435A D067 7AA5 5117

To claim this, I am signing this object:

(*
This gist runs a 3 in memory node EventStore cluster
and a client that send messages to the cluster
To use the web interface, copy EventStore web folders.
You can found them in the server distribution at http://geteventstore.com/downloads/.
Then connect to http://localhost:2113/
You can view the cluster status at:
http://localhost:2113/web/gossip.htm
Verifying myself: My Bitcoin username is +tvjames. https://onename.io/tvjames