Skip to content

Instantly share code, notes, and snippets.

@terrancesnyder
terrancesnyder / haproxy.cfg
Created May 29, 2011 18:52
haproxy.cfg - Example HAProxy Configuration
# /etc/haproxy.cfg
global
user haproxy
group haproxy
defaults
mode http
option forwardfor
option redispatch
retries 3
@terrancesnyder
terrancesnyder / .screenrc
Created May 29, 2011 19:59
Linux Screen Configuration
# to be consistent with ubuntu screen settings
# F1 | 'help' in gnome-terminal
register n "^a^c^aA" # | Goes with the F2 definition
bindkey -k k2 process n # F2 | Create new window (and name it)
bindkey -k k3 title # F3 | Previous Window
bindkey -k k4 kill # F4 | Next Window
register r "^a:source $HOME/.screen-profiles/profile" # | Goes with F5 definition
bindkey -k k5 process r # F5 | Reload profile
bindkey -k k6 detach # F6 | Detach from this session
bindkey -k k7 copy # F7 | Enter copy/scrollback mode
@terrancesnyder
terrancesnyder / test-castro.py
Created May 29, 2011 20:43
Test Castro Recording
import time
from castro import Castro
print "Start.."
c = Castro(host = 'localhost',
display = 1,
filename = "my-cool-screencast.swf",
passwd = "/home/ubuntu/.vnc/passwd")
c.start();
@terrancesnyder
terrancesnyder / server.xml
Created May 30, 2011 17:34
Tomcat Multi-Instance Server.xml Based on Springsource
<?xml version='1.0' encoding='utf-8'?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You 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
http://www.apache.org/licenses/LICENSE-2.0
@terrancesnyder
terrancesnyder / run.sh
Created June 3, 2011 17:49
Selenium Grid Client for headless Linux
#!/bin/bash
# _____ __ _
# / ___/___ / /__ ____ (_)_ ______ ___
# \__ \/ _ \/ / _ \/ __ \/ / / / / __ `__ \
# ___/ / __/ / __/ / / / / /_/ / / / / / /
# /____/\___/_/\___/_/ /_/_/\__,_/_/ /_/ /_/
#
# Provides a shell script which can be used to create
# a new selenium rc client.
@terrancesnyder
terrancesnyder / reindex.sql
Created June 7, 2011 13:06
Oracle Reindex
EXEC dbms_stats.gather_schema_stats('<yourschema>', cascade=>TRUE);
@terrancesnyder
terrancesnyder / memoryhogs.sh
Created June 17, 2011 21:22
Get memory abuzers
ps aux --sort pmem | grep "java\|USER"
@terrancesnyder
terrancesnyder / install_selenium_rc.reg
Created June 21, 2011 14:41
install_selenium_rc.reg
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SeleniumRC1\Parameters]
"Application"="C:\\windows\\system32\\cmd.exe"
"AppDirectory"="C:\\opt\\selenium-grid-1.0.8"
"AppParameters"="/c \"C:\\opt\\selenium-grid-1.0.8\\rc.bat\""
@terrancesnyder
terrancesnyder / force_index_example.sql
Created June 24, 2011 13:23
oracle force index scan
SELECT /*+ INDEX(patients sex_index) use sex_index because there are few male patients */ name, height, weight
FROM patients
WHERE sex = 'm';
@terrancesnyder
terrancesnyder / gist:1044831
Created June 24, 2011 14:05
XML xpath to ignore namespaces
//*[name()='HelloWorld']