Skip to content

Instantly share code, notes, and snippets.

View rajendarreddyj's full-sized avatar
💭
I may be slow to respond.

Rajendarreddy Jagapathi rajendarreddyj

💭
I may be slow to respond.
View GitHub Profile
@rajendarreddyj
rajendarreddyj / beans.xml
Created October 21, 2015 18:56
Add beans.xml to META-INF or WEB-INF to enable Contexts and Dependency Injection(CDI) for the Java EE Platform. This will avoid NullPointerException while injecting.
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
</beans>
@rajendarreddyj
rajendarreddyj / AES.java
Created April 5, 2016 03:53 — forked from dweymouth/AES.java
A Java class to perform password-based AES encryption and decryption
/*
* ----------------------------------------------------------------------------
* "THE BEER-WARE LICENSE" (Revision 42):
* <dweymouth@gmail.com> wrote this file. As long as you retain this notice you
* can do whatever you want with this stuff. If we meet some day, and you think
* this stuff is worth it, you can buy me a beer in return. D. Weymouth 4/2014
* ----------------------------------------------------------------------------
*/
import java.io.*;
package com.rajendarreddyj.weblogic.decryptor;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import sun.misc.BASE64Decoder;
import javax.crypto.*;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.PBEKeySpec;
import javax.crypto.spec.PBEParameterSpec;
import javax.crypto.spec.SecretKeySpec;
@rajendarreddyj
rajendarreddyj / checkBrowserVersion.jsp
Last active January 22, 2017 15:31
check Browser Version
<%
boolean showPopup = false;
try {
String userAgent = request.getHeader("user-agent");
String browserVersion = "UNKNOWNVERSION";
String majorVersion = "1";
int validVersion = 1;
String user = userAgent.toLowerCase();
if (userAgent != null) {
@rajendarreddyj
rajendarreddyj / gitflow-breakdown.md
Created March 6, 2017 00:15 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
git commit --allow-empty -m "Initial commit"
git checkout -b develop master

Connect to the remote repository

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
package com.example.jersey;
import javax.net.ssl.*;
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.core.Configuration;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.security.cert.CertificateException;
@rajendarreddyj
rajendarreddyj / vdi-file-compacting.md
Last active January 25, 2018 19:07 — forked from kuznero/vdi-file-compacting.md
How to compact VirtualBox's VDI file size?

Source: StackOverflow

1. Run defrag in the guest (Windows only)

2. Nullify free space:

With a Linux Guest run this:

sudo dd if=/dev/zero | pv | sudo dd of=/bigemptyfile bs=4096k
sudo rm -rf /bigemptyfile
@rajendarreddyj
rajendarreddyj / README.md
Created March 13, 2018 19:55 — forked from hofmannsven/README.md
My simply Git Cheatsheet
@rajendarreddyj
rajendarreddyj / index.html
Created April 6, 2018 15:57 — forked from davidwkeith/index.html
Link directly to custom protocol handlers for mobile, without worrying if the user has your App installed.Licensed under the WFTPL http://www.wtfpl.net/txt/copying/
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>App Redirection</title>
</head>
<body>
<!--
NOTE: This was a great hack in days gone by, but now both Apple and Google have improved their support for custom
protocol handlers.