Skip to content

Instantly share code, notes, and snippets.

View psrdotcom's full-sized avatar
🎯
Focusing

Suresh Raju Pilli psrdotcom

🎯
Focusing
View GitHub Profile
@psrdotcom
psrdotcom / Auction.sol
Created December 14, 2021 18:46
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.17+commit.bdeb9e52.js&optimize=false&runs=200&gist=
pragma solidity ^0.4.17;
contract Auction {
// Data
//Structure to hold details of the item
struct Item {
uint itemId; // id of the item
uint[] itemTokens; //tokens bid in favor of the item
}
@psrdotcom
psrdotcom / Auction.sol
Created December 14, 2021 18:30
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.17+commit.bdeb9e52.js&optimize=false&runs=200&gist=
pragma solidity ^0.4.17;
contract Auction {
// Data
//Structure to hold details of the item
struct Item {
uint itemId; // id of the item
uint[] itemTokens; //tokens bid in favor of the item
}
@psrdotcom
psrdotcom / json2csv.py
Created October 5, 2020 19:49
Convert JSON object array to CSV File
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 January 6, 2020 12:12
Geo Location Test using Leaflet JavaScript
<!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 August 8, 2019 03:24
Truecrypt Mount and Unmount in Windows Batch file
@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 July 23, 2019 06:53
Postgre SQL Connection Testing with 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 April 5, 2017 06:46
Java command injection example
/*
* 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 March 31, 2017 09:21
Conver Number to Textual (English) representation - Microsoft Excel Macro - (Supports only Rupees and Euros)
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 June 25, 2023 15:09
Oracle DB: Delete all user objects (Tables, Views, Procedures, Functions, Sequences, Types, Packages)
BEGIN
FOR record IN (SELECT object_name, object_type
FROM user_objects
WHERE object_type IN
('TABLE',
'VIEW',
'PROCEDURE',
'FUNCTION',
'SEQUENCE',
'TYPE',
for /f "tokens=* delims=" %%a in ('dir . /s /b') do (
"dos2unix.exe" %%a
)