Skip to content

Instantly share code, notes, and snippets.

@terrancesnyder
terrancesnyder / install-selenium-grid-service.bat
Created May 27, 2011 20:42
selenium grid console on windows as service
# create server
cmd /c sc create SeleniumGrid binPath= "cmd /c ant -f \"C:\opt\selenium-grid-1.0.8\build.xml\" launch-hub " DisplayName= "Selenium Grid Server"
# create client
cmd /c sc create SeleniumGridClient binPath= "cmd /c ant -f \"C:\opt\selenium-grid-1.0.8\build.xml\" -Dport=4545 -Denvironment=*chrome launch-remote-control " DisplayName= "Selenium Grid Client"
# This doesn't work, want to create a tc7 server... sigh...
cmd /c sc create Tomcat binPath= "C:\opt\tomcat7\srvany.exe" start= "auto" DisplayName= "Apache Tomcat Server"
# Save this as tomcat-service.reg
@terrancesnyder
terrancesnyder / selenium-grid.sh
Created May 27, 2011 21:40
selenium autostart
#! /bin/sh
# Licensed to the Apache Software Foundation (ASF).
### BEGIN INIT INFO
# Provides: selenium-grid
# Required-Start: $network $syslog $remote_fs
# Required-Stop: $network $syslog
# Default-Start:
# Default-Stop:
# Short-Description: Selenium Grid Server
@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 / run.vbs
Created June 4, 2011 15:53
VBScript + Batch to run windows in background
================ run.vbs ================
REM 0 = hide window, 1 = show window (useful for debugging)
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run """" & "run.bat" & """" & sargs, 0, False
Set WshShell = Nothing
================ run.bat ================
REM Batch script to start VirtualBox instance of ReviewBoard in headless mode
@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"