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
@mavaddat
mavaddat / updateJDK.ps1
Last active August 4, 2021 00:24
Automated update of JDK path for AdoptOpenJDK triggered by update in Chocolatey. PowerShell directives are provided to the VBS Windows Script Host as encoded commands so as to avoid a shell screen popping up on trigger.
# This contains two lines (#4, #7) which will be run as an encoded PowerShell command inside a Visual Basic Script (VBScript) scheduled task below.
# Check if 'updateJDK.vbs' is already running in another process; if so, let's quit and just let that finish the task
Get-Process -Name '*WScript*' | foreach{if($_.CommandLine -imatch 'updateJDK.vbs' -and $_.Id -ne $PID){ exit } }
# We will update the %JAVA_HOME% path upon observing discrepency between the newest available JDK (local directory) and the %JAVA_HOME%
$jdk = Get-ChildItem (Resolve-Path 'C:\Program Files\AdoptOpenJDK\') -Depth 0 -Directory | Sort-Object -Property LastWriteTime -Descending | Select-Object -First 1; if(($null -ne ([System.Environment]::GetEnvironmentVariable('JAVA_HOME'))) -and ($env:JAVA_HOME -ne $jdk)) { [System.Environment]::SetEnvironmentVariable('JAVA_HOME',$($jdk.FullName),[System.EnvironmentVariableTarget]::User) }
# Whenever we change the script (i.e., the above line of PowerShell commands), we generate the new encoded command
@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

@rajendarreddyj
rajendarreddyj / prettyprint.html
Last active January 24, 2021 16:46
prettify xml/html/json/sql
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Pretty print or minify text in XML, JSON, CSS and SQL formats</title>
<meta name="keywords" content="pretty, print, minify, text, xml, json, css, sql, formats, formatter, beautify" />
<meta name="description" content="Pretty print or minify text in XML, JSON, CSS and SQL formats" />
<style type="text/css">
#cssxOutput {
@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) {
@ferventcoder
ferventcoder / NonAdmin.cmd
Last active February 11, 2024 03:15
Installing Software as a Non-Administrator Using Chocolatey
:: Pick one of these two files (cmd or ps1)
:: Set directory for installation - Chocolatey does not lock
:: down the directory if not the default
SET INSTALLDIR=c:\ProgramData\chocoportable
setx ChocolateyInstall %INSTALLDIR%
:: All install options - offline, proxy, etc at
:: https://chocolatey.org/install
@powershell -NoProfile -ExecutionPolicy Bypass -Command "(iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))) >$null 2>&1" && SET PATH="%PATH%;%INSTALLDIR%\bin"
@NickSeagull
NickSeagull / ubuntu-bloat-removal.sh
Last active May 2, 2024 13:30
Updated Jan 22nd, 2024 - Simple command to remove all "bloatware" from ubuntu
sudo apt-get remove \
aisleriot \
brltty \
duplicity \
empathy \
empathy-common \
example-content \
gnome-accessibility-themes \
gnome-contacts \
gnome-mahjongg \
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;
@staltz
staltz / introrx.md
Last active May 2, 2024 12:31
The introduction to Reactive Programming you've been missing
@gsingh93
gsingh93 / heartbleed.py
Last active August 29, 2015 13:58
OpenSSL Heartbleed Exploit
#!/usr/bin/python2
import sys
import select
import socket
import struct
port = 443
TLS_ALERT = 21
@sh1n0b1
sh1n0b1 / ssltest.py
Created April 8, 2014 07:53
Python Heartbleed (CVE-2014-0160) Proof of Concept
#!/usr/bin/python
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
import sys
import struct
import socket
import time
import select