Skip to content

Instantly share code, notes, and snippets.

View stephen-masters's full-sized avatar

Stephen Masters stephen-masters

View GitHub Profile
@stephen-masters
stephen-masters / get_latest_snapshot.rb
Created February 17, 2012 09:22
Get latest snapshot artifact from Sonatype Nexus
#---------------------------------------------------------------------
#
# Parse the response from Sonatype Nexus in order to determine the
# correct URI for the most recent snapshot of an artifact.
#
# Usage:
# ruby get_latest_snapshot.rb \
# -n http://localhost:8080/nexus \
# -g uk.co.scattercode \
# -a my-artifact \
Search through the file system and list files in size reverse order.
du -akd /a/root/dir | sort -nr | less
VirtualBox Config
Set up NAT port forwarding from host port 8000 to guest port 80.
VBoxManage modifyvm "MyGuest" --natpf1 "www,tcp,,8080,,80"
@stephen-masters
stephen-masters / gist:767747
Created January 6, 2011 10:36
WebLogic - Get JMS server stats
# ----------------------------------------------------------------------
# Example of connecting to a running JMS server and getting stats.
# ----------------------------------------------------------------------
import java.lang.Thread
def get_messaging_stats():
print 'Searching for JMS connections...'
# Hard-codes the JMS server name. You will probably want to parameterize this.
@stephen-masters
stephen-masters / gist:767740
Created January 6, 2011 10:28
WebLogic - Get connection pool sizes
# --------------------------------------------------
# Use WLST to connect to running WebLogic application servers and
# output a list of database connection pools and their sizes.
#
# This can be used for health monitoring and to support tuning.
# --------------------------------------------------
import java.lang.Thread
def get_connection_pool_sizes():
bea_home=/path/to/bea
java_home=/path/to/bea/jdk160_18
domain_template=/path/to/bea/weblogic11/common/templates/domains/wls.jar
admin_server_name=my_admin_server
admin_url=t3\://myserver\:7001
admin_user=weblogic
admin_password=w3blogicpwd
admin_port=7001