Skip to content

Instantly share code, notes, and snippets.

@raja-reddy
raja-reddy / update-centos-7.sh
Created September 21, 2017 09:31 — forked from jbeda/update-centos-7.sh
Install prev kubeadm versions
kubeadm init --use-kubernetes-version=v1.5.6
@raja-reddy
raja-reddy / NettyExampleServer.java
Created September 4, 2017 07:21 — forked from vlaadbrain/NettyExampleServer.java
Netty Example Server
import java.net.InetSocketAddress;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
package example;
import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.codec.LengthFieldBasedFrameDecoder;
import io.netty.handler.codec.LengthFieldPrepender;
import io.netty.handler.codec.string.StringDecoder;
import io.netty.handler.codec.string.StringEncoder;
import io.netty.util.CharsetUtil;
import scala.xml._
import scala.collection.mutable.{Map, HashMap}
/**
* The XML2JSON object will transform the XML data in scala.xml.Node to
* the string in JSON format.
*/
object XML2JSON {
sealed trait JSONObject
import scala.xml._
import scala.util.parsing.json.JSON
/**
* The XML2JSON object will transform a string in json format to
* a NodeSeq object.
*/
object JSON2XML {
def apply(input:String):NodeSeq = {
/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
import com.jcraft.jsch.*;
import java.awt.*;
import javax.swing.*;
import java.net.*;
public class StreamForwarding{
public static void main(String[] arg){
int port;
/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
import com.jcraft.jsch.*;
import java.awt.*;
import javax.swing.*;
import java.io.*;
import java.util.zip.GZIPInputStream;
public class Shell{
public static void main(String[] arg){
// The following code is from http://www.academicpub.org/PaperInfo.aspx?PaperID=14496 .
import java.math.BigInteger;
import java.security.*;
import java.security.spec.*;
import javax.crypto.KeyAgreement;
public class ECCKeyAgreement {
public static void main(String[] args) throws Exception {
KeyPairGenerator kpg;
kpg = KeyPairGenerator.getInstance("EC","SunEC");
@raja-reddy
raja-reddy / AES.java
Created August 22, 2017 10:46 — forked from ymnk/AES.java
JSch examples
/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
/**
* This program will demonstrate how to use "aes128-cbc".
*
*/
import com.jcraft.jsch.*;
import java.awt.*;
import javax.swing.*;
public class AES{