Skip to content

Instantly share code, notes, and snippets.

View thiyagaraj's full-sized avatar

Thiyagaraj Krishna thiyagaraj

View GitHub Profile
@thiyagaraj
thiyagaraj / xsd-any-snippet.xsd
Created May 7, 2012 16:49
wildcard snippet in xsds
<xs:element name="Something">
<xs:complexType mixed="true">
<xs:sequence>
<xs:any processContents="lax" maxOccurs="unbounded"/>
</xs:sequence>
<xs:anyAttribute processContents="lax"/>
</xs:complexType>
</xs:element>
@thiyagaraj
thiyagaraj / dp-gui-console.xsl
Created March 28, 2012 18:18
WebSphere DataPower Config nodes to get input from console setting
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:dp="http://www.datapower.com/extensions" xmlns:dpconfig="http://www.datapower.com/param/config" extension-element-prefixes="dp" exclude-result-prefixes="dp dpconfig">
<!--
This param can be set via the DataPower GUI in the console, and it will come as input to the transformation
-->
<xsl:param name="dpconfig:paramName"/>
<dp:param name="dpconfig:paramName">
<display>Param name value</display>
<description>Param Name Description can go here</description>
</dp:param>
@thiyagaraj
thiyagaraj / print-part-page.js
Created February 27, 2012 19:45
Print part of a webpage based on id
var printPage = function(id){
var html="<html><head><title>Print page</title>";
html+="</head><body>"
html+= document.getElementById(id).innerHTML;
html+="</body></html>";
var printWin = window.open('','','left=0,top=0,width=1,height=1,toolbar=0,scrollbars=0,status =0');
printWin.document.write(html);
printWin.document.close();
printWin.focus();
printWin.print();
@thiyagaraj
thiyagaraj / Datapower-heartbeat.js
Created February 23, 2012 17:36
DataPower Bookmarklet to prevent WebGUI from timing out
javascript:void function(){
window.setInterval("window.mainFrame.setActionScreenSubmit('displayLog', 'displayLog')", 300000);
document.bgColor='green';alert('Do NOT use this (GREEN) window, it will autorefresh and you may lose your changes\n\nPressing OK will automatically open a new window, continue working in that :)');
window.open(window.location)
}()
@thiyagaraj
thiyagaraj / patch_window.console.js
Created February 15, 2012 21:25
Fix errors if window.console is not available
if (!window.console) {
window.console = {};
window.console.log = function(){};
}
@thiyagaraj
thiyagaraj / port_forward.sh
Created November 14, 2011 22:33
SSH port forwarding script to access servers beyond firewalls, but accessible via "jump" servers. Run this script on the "jump" server
#!/bin/sh
#RUN this script to establish connection SSH Forwarding to HOSTNAME_HERE"
port=`netstat -an | grep 65321 | grep LISTEN | tr -s " " | cut -d" " -f 4 | cut -d"." -f 2`
if [[ $port -ne 65321 ]]
then
echo "Please Enter JUMP_SERVER Password:"
`ssh -gL 65321:HOSTNAME_HERE:22 0`
else
echo "HOSTNAME_HERE Redirect is already running on port 65321"
fi