Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Suresh Raju Pilli psrdotcom

🎯
Focusing
View GitHub Profile
@psrdotcom
psrdotcom / json2csv.py
Created Oct 5, 2020
Convert JSON object array to CSV File
View json2csv.py
import json
import csv
# Read JSON File
with open('users.json') as json_file:
data = json.load(json_file)
user_data = data['users']
# Prepare CSV file
@psrdotcom
psrdotcom / GeoLocationTest.html
Created Jan 6, 2020
Geo Location Test using Leaflet JavaScript
View GeoLocationTest.html
<!DOCTYPE HTML>
<HTML>
<HEAD>
<TITLE>PSR Geo Location Test</TITLE>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.6.0/dist/leaflet.css"
integrity="sha512-xwE/Az9zrjBIphAcBb3F6JVqxf46+CDLwfLMHloNu6KEQCAWi6HcDUbeOfBIptF7tcCzusKFjFw2yuvEpDL9wQ=="
crossorigin=""/>
<script src="https://unpkg.com/leaflet@1.6.0/dist/leaflet.js"
integrity="sha512-gZwIG9x3wUXg2hdXF6+rVkLF/0Vi9U8D2Ntg4Ga5I5BZpVkVxlJWbSQtXPSiUTtC0TjtGOmxa1AJPuV0CPthew=="
crossorigin=""></script>
@psrdotcom
psrdotcom / truecryptMountUnmount.bat
Created Aug 8, 2019
Truecrypt Mount and Unmount in Windows Batch file
View truecryptMountUnmount.bat
@echo off
set TrueSource=E:\ProgramFiles\TrueCrypt\truecrypt
set Source=E:\ProgramFiles\TrueCrypt\test
set Drive=P:
set KeyFile=E:\ProgramFiles\TrueCrypt\keyfile1
set Password=abcd1234ABCD!@#$
set BrowserPath="C:\Program Files (x86)\Internet Explorer\iexplore.exe"
set WebSite=ELS
set URL="http://localhost:86"
@psrdotcom
psrdotcom / PostgreConnectionTest.java
Last active Jul 23, 2019
Postgre SQL Connection Testing with Java
View PostgreConnectionTest.java
/*
* This Java source file was to test the database connection.
*/
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
@psrdotcom
psrdotcom / CommandInjectionExample.java
Created Apr 5, 2017
Java command injection example
View CommandInjectionExample.java
/*
* Assuming user has folder "Important" -> C:/Important
* The folder has confidential data
* In this example, we are trying to show the command injection attack
*/
public class CommandInjectionExample {
public static void main(String[] args) {
evalScript();
}
@psrdotcom
psrdotcom / ConvertCurrencyToEnglish.txt
Created Mar 31, 2017
Conver Number to Textual (English) representation - Microsoft Excel Macro - (Supports only Rupees and Euros)
View ConvertCurrencyToEnglish.txt
Function ConvertRupeesToEnglish(ByVal MyNumber)
Dim Temp
Dim Rupees, Paise
Dim DecimalPlace, Count
ReDim Place(9) As String
Place(2) = " Thousand "
Place(3) = " lakh "
Place(4) = " Crore "
@psrdotcom
psrdotcom / deleteAllUserObjects.sql
Last active Mar 2, 2017
Oracle DB: Delete all user objects (Tables, Views, Procedures, Functions, Sequences, Types, Packages)
View deleteAllUserObjects.sql
BEGIN
FOR record IN (SELECT object_name, object_type
FROM user_objects
WHERE object_type IN
('TABLE',
'VIEW',
'PROCEDURE',
'FUNCTION',
'SEQUENCE',
'TYPE',
View dos2unixfolder.bat
for /f "tokens=* delims=" %%a in ('dir . /s /b') do (
"dos2unix.exe" %%a
)