Skip to content

Instantly share code, notes, and snippets.

View sandeepkunkunuru's full-sized avatar

Sandeep Kunkunuru sandeepkunkunuru

View GitHub Profile
@sandeepkunkunuru
sandeepkunkunuru / Catalina.sh
Last active December 12, 2015 05:58
Setting up Remote JVM monitoring using JConsole(or VisualVM) for Tomcat
# Uncomment the following line to make the umask available when using the
# org.apache.catalina.security.SecurityListener
#JAVA_OPTS="$JAVA_OPTS -Dorg.apache.catalina.security.SecurityListener.UMASK=`umask`"
#-----------Add below lines for remote JVM monitoring-------
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9010 -Dcom.sun.management.jmxremote.local.only=false"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false "
#----------Add above lines for remote JVM monitoring-------
@sandeepkunkunuru
sandeepkunkunuru / ThreadIllustration.java
Last active December 20, 2015 12:39
Java Multi-Threaded Programming : Simple Illustration using join, wait, notify
package me.tingri.design.threads;
import java.util.LinkedList;
import java.util.Queue;
public class ThreadIllustration {
/**
* @param args
*/
public static void main(String[] args) {
@sandeepkunkunuru
sandeepkunkunuru / PlotExercise.m
Created August 1, 2013 17:04
Plot Big O functions
hold off;
close;
N = 1000;
X = 1:N;
size(X)
hold on;
axis([1 50 1 50 ]);
xlabel ("x");
@sandeepkunkunuru
sandeepkunkunuru / source_code_stats.sh
Created August 1, 2013 17:30
Generate statistics on a SVN repository.
# Based on http://www.statsvn.org/
# Versions of the project are 5,6,7
# seq would generate 5,6,7
for i in $(seq 5 7); do
rm -rf report-Version-$i
mkdir report-Version-$i
cd Version-$i
@sandeepkunkunuru
sandeepkunkunuru / SOAPClient.java
Last active September 5, 2019 09:56
WebService - Document(SOAP) mode invocation - https - Example - from Scratch - Without referencing any library specific or generated classes e.g. classes of axis, axis2, cxf etc.
import java.io.BufferedOutputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.security.Security;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
@sandeepkunkunuru
sandeepkunkunuru / Webservice.sh
Last active December 25, 2015 19:59
Invoking Webservice from command line . Here SOAP request is to be specified in a file named request.xml
curl -X POST -H "Content-Type: text/xml;charset=UTF-8" -H "SOAPAction: \"https://.../clientLogin\"" -d @request.xml https://.../service.asmx
@sandeepkunkunuru
sandeepkunkunuru / Webservice-Testing-Notes
Last active December 25, 2015 19:59
Webservice testing tools
Option 1
--------
1) Download the WSDL file.
2) Create a new Dynamic Web project in eclipse
3) Right click on WSDL file and choose Webservices --> Test With Web Services Explorer
Option 2
--------
1) Download SOAPUI - http://sourceforge.net/projects/soapui/?source=pdlp
2) Create a project using the WSDL url
@sandeepkunkunuru
sandeepkunkunuru / site.pp
Created November 1, 2013 19:31
VoltDB puppet manifest
import "templates"
import "nodes"
Exec { path => [ "/bin/", "/sbin/" , "/usr/bin/", "/usr/sbin/" , "/root/voltdb/bin"] }
package { 'ntp':
ensure => '4.2.4p8-3.el6',
}
package { 'java-1.7.0-openjdk':
@sandeepkunkunuru
sandeepkunkunuru / WebsitePing.sh
Last active August 29, 2015 14:02
Ping Website
#!/bin/sh
rm -f response.html
wget $1 -o response.html
grep -qs "401 Unauthorized" response.html
OUT=$?
if [ $OUT -eq 0 ];then
echo "$1 is up"
exit 0
else
@sandeepkunkunuru
sandeepkunkunuru / Tag-Without-JS.html
Created June 6, 2014 20:38
Tagging when the device does not support javascript
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript">
alert("javascript is supported");
</script>
<noscript>
<style>