Skip to content

Instantly share code, notes, and snippets.

View bwells's full-sized avatar

Brad Wells bwells

View GitHub Profile
@bwells
bwells / logstash.conf
Created September 8, 2014 21:52
Logstash config
input {
stdin {
codec => multiline {
'negate' => true
'pattern' => '^\['
'what' => 'previous'
}
}
}
# in this case there's no way to access arg1 and arg2 as a list
def function(arg1, arg2):
print arg1, arg2
# alternatively you can do this
def function2(*args):
print args[0], args[1]
# you can also mix and match
def function3(arg1, *args):
@bwells
bwells / gist:3740518
Created September 18, 2012 00:02
full featured fabfile
from __future__ import with_statement
from fabric.api import abort, run, cd, env, sudo
from time import sleep
from contextlib import contextmanager
import boto
import re
import os
APP = '/var/www/ERP/Application'
LOAD_BALANCER = 'PortalSSL'
var response = prompt("Do you like me?");
if (response === "yes") {
console.log("I like you too!");
}
public void getCalculatedQuote(){
Socket serverInteract = null;
PrintWriter out = null;
BufferedReader in = null;
String rslt = "";
try{
serverInteract = new Socket("web7.apl.jhu.edu", 20025);
out = new PrintWriter(serverInteract.getOutputStream(), true);
in = new BufferedReader(new InputStreamReader(serverInteract.getInputStream()));
@bwells
bwells / gist:1202034
Created September 7, 2011 22:46
webserver config
=== upstart config file ===
description "uWSGI Emperor"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
env BINPATH=/usr/bin/uwsgi
@bwells
bwells / gist:785421
Created January 19, 2011 00:03
this is my sample
booooO!