Tuesday, June 30, 2009

Opening RDP session through HTML

a href="javascript:void(0)" language="VBS" onclick="LaunchRDP('your-server-name')

script language="VBScript"
Sub LaunchRDP(strServerName)
Set oShell = CreateObject("WScript.Shell")
oShell.run "mstsc /v:" & strServerName
Set oShell = Nothing
End Sub
script

Datapower IP Change

xi50# configure terminal
Global configuration mode

xi50(config)# test hardware
[success] Backtrace file does not exist.
[success] MAC address of interface 'eth0' is 00:0a:4b:80:de:28.
[warning] Physical link on interface 'eth0' is down.
[success] Statistics for interface 'eth0' show no errors.
[success] MAC address of interface 'eth1' is 00:1b:21:0d:e3:ae.
[warning] Physical link on interface 'eth1' is down.
[success] Statistics for interface 'eth1' show no errors.
[success] MAC address of interface 'eth2' is 00:1b:21:0d:e3:af.
[warning] Physical link on interface 'eth2' is down.
[success] Statistics for interface 'eth2' show no errors.
[success] MAC address of interface 'mgt0' is 00:0a:4b:80:de:2c.
[success] Physical link on interface 'mgt0' is up.
[success] Statistics for interface 'mgt0' show no errors.
[success] Expected number of interfaces: 4 - Found: 4.
[success] The fan 'chassis-1' is ok.
[success] The fan 'chassis-2' is ok.
[success] The fan 'chassis-3' is ok.
[success] The fan 'chassis-4' is ok.
[success] The fan 'chassis-5' is ok.
[success] The fan 'chassis-6' is ok.
[success] The fan 'chassis-7' is ok.
[success] The fan 'chassis-8' is ok.
[success] Status of temperature reading 'Temperature CPU1' is ok.
[success] Status of temperature reading 'Temperature CPU2' is ok.
[success] Status of temperature reading 'Temperature System 1' is ok.
[success] Status of voltage reading 'Voltage +12' is ok.
[success] Status of voltage reading 'Voltage +3.3' is ok.
[success] Status of voltage reading 'Voltage +5' is ok.
[success] Battery status is OK.
[success] CPUs OK
[success] Status of crypto 'hardware2' is fully operational.

xi50(config)# int mgt0
Interface configuration mode (mgt0 )

xi50(config-if[eth4])# ip address your-ip-address/24
Operation succeeded

xi50(config-if[eth4])# ip default-gateway your-gateway-ip-address
Operation succeeded

xi50(config-if[eth4])# exit

xi50(config)# web-mgmt your-ip-address 9090
Web management: successfully started
xi50(config)# ssh your-ip-address

% Pending

SSH service listener enabled

xi50(config)# write memory
Overwrite previously saved configuration? [y/n]: y
Configuration saved successfully.
xi50(config)#

Monday, June 29, 2009

Windows CPL commands

appwiz.cpl - Add or Remove programs
services.msc - Services Panel
compmgmt.msc - Computer Management
hdwwiz.cpl - Add Hardware Wizard
sysdm.cpl - System

Monday, June 22, 2009

SSL URL Validation through Java

import java.io.BufferedInputStream;
import java.io.InputStream;
import java.net.URLConnection;

public class SSLConnection {

public void runTest( String url )
{
java.net.URL endpoint;
try
{
endpoint = new java.net.URL(url);
URLConnection connection = endpoint.openConnection();
InputStream in = new BufferedInputStream( connection.getInputStream() );

byte[] bytes = new byte[500];
int n = in.read(bytes, 0, 500 );

for ( int i = 0; i <>
System.out.print( new Character( (char) bytes[i] ) );
}

in.close();
}
catch (Exception e)
{
e.printStackTrace();
}
}
public static void main( String[] args )
{
SSLConnection test = new SSLConnection();

System.out.println("Connect without proxy - Non secure" );
test.runTest("http://your_url_goes_here");

System.out.println("Connect without proxy - Secure" );
test.runTest("https://your_url_goes_here");
System.setProperty("http.proxyHost", "your_proxy_name");
System.setProperty("http.proxyPort", "your_proxy_port");
System.out.println("Connect with proxy - Non secure" );
test.runTest("http://your_url_goes_here");
System.out.println("Connect with proxy - Secure" );
test.runTest("https://your_url_goes_here");
}
}

Friday, June 19, 2009

IP Subnet Calculator

http://www.subnet-calculator.com

Thursday, June 4, 2009

WebSphere 6.1 - JMX SOAP Connection Example

import java.util.Properties;
import com.ibm.websphere.management.AdminClient;
import com.ibm.websphere.management.AdminClientFactory;

public class JMXTest {

public static void main(String[] args) {
JMXTest jmxtest = new JMXTest();
jmxtest.execute();
}

public void execute() {
try {
Properties connectProps = new Properties(); 
connectProps.setProperty(AdminClient.CONNECTOR_TYPE, AdminClient.CONNECTOR_TYPE_SOAP); 
connectProps.setProperty(AdminClient.CONNECTOR_HOST, "{hostname}"); 
connectProps.setProperty(AdminClient.CONNECTOR_PORT, "{8879 or your-soap-port"); 
connectProps.setProperty(AdminClient.CONNECTOR_SECURITY_ENABLED, "true");
connectProps.setProperty(AdminClient.USERNAME, "{username}");
connectProps.setProperty(AdminClient.PASSWORD, "{password}");
connectProps.setProperty("javax.net.ssl.trustStore", "/opt/IBM/WebSphere/AppServer/profiles/Dmgr01/etc/DummyClientTrustFile.jks");
connectProps.setProperty("javax.net.ssl.keyStore", "/opt/IBM/WebSphere/AppServer/profiles/Dmgr01/etc/DummyClientKeyFile.jks");

AdminClient adminClient = null; 
try 
adminClient = AdminClientFactory.createAdminClient(connectProps); 
System.out.println("Connected Successfully");
catch (Exception e) 
System.out.println("Exception creating admin client: " + e); 
e.printStackTrace();
}
} catch (Exception e) {
e.printStackTrace();
}
}