Skip to content

Instantly share code, notes, and snippets.

View sujayy1983's full-sized avatar

Sujayyendhiren Ramarao srinivasamurthi sujayy1983

View GitHub Profile
@sujayy1983
sujayy1983 / DemoAnsible.py
Created March 29, 2015 02:06
+ System information and interface information. + This demo script is to obtain target information. + Any remote execution client can deploy this script and obtain info.
__author__='''Sujayyendhiren Srinivasamurthi'''
___email__='''sujayy1983@gmail.com'''
__description__= '''Demo script. Obtain target host's system information. '''
import platform
import logging
import netifaces
import socket
import json
import re
@sujayy1983
sujayy1983 / Radix.py
Last active August 29, 2015 14:15
Radix sorting: A non-comparitive sorting
"""
@Author: Sujayyendhiren Ramarao Srinivasamurthi
@Description: Radix sort my own way.
"""
def radixsort( inArr ):
"""
:param inArr: Input array for sorting
:return: Result is a dict of arrays indexable from 0-9.
"""
@sujayy1983
sujayy1983 / NodesOfDepthInList.py
Created February 1, 2015 02:21
Make a list of lists where each list comprises nodes in the same depth. Sample binary tree is created for achieveing the above.
"""
@Author: Sujayyendhiren Ramarao Srinivasamurthi
@Description: - Build a sample binary tree
- List of lists where each list has elements at a particular depth
"""
#Build balanced/unbalanced binary tree for experiment
#Build list of lists
class Node():
@sujayy1983
sujayy1983 / permutations.py
Created February 1, 2015 00:38
Permutations of string.
"""
@Author: Sujayyendhiren Ramarao Srinivasamurthi
@Description: Permutations of given string
"""
import re
def insert ( word, idx, char ):
first = word[0:idx]
last = word[idx:len(word)]
return first + char + last
@sujayy1983
sujayy1983 / ThreePowerNProblem.py
Created January 31, 2015 16:51
Memoization is easy and troublefree in python.
"""
@Author: Sujayyendhiren
@Description: Exponential problems are easyily memoized in Python.
"""
def stairsUp( countN , dictCalculations):
if( countN < 0):
return 0
elif (countN == 0 ):
@sujayy1983
sujayy1983 / GCD.py
Created January 31, 2015 14:31
GCD the Euclidean way.
"""
@Author: Sujayyendhiren Ramarao srinivasamurthi
@Description: GCD of numbers the Euclidean way
"""
def gcd_calculate( first , second ):
if( first > second ):
#Swap values
first , second = second, first
@sujayy1983
sujayy1983 / magic-call.py
Created January 31, 2015 14:30
Using magic function __call__()
"""
@Author: Sujayyendhiren Ramarao Srinivasamurthi
@Description: An Example of magic function __call__()
"""
class testCls:
def __init__(self):
self.a = 5
def __call__(self, *args, **kwargs):
@sujayy1983
sujayy1983 / Regular-Expressions.py
Created January 31, 2015 14:24
Examples of Regular expression. Combined examples from across the internet and some of them are modified to explore different behaviors.
import re
"""
http://www.diveinto.org/python3/regular-expressions.html
"""
"""
Example 1:
Important points: Use raw string 'r' and \b tells the word boundary
"""
@sujayy1983
sujayy1983 / Goldeneye.py
Created January 31, 2015 01:41
Such files need to be created to integrate with toolintegrator.py. This framework maybe extended to integrate multiple client tools into a single GUI application.
#--------------------------------------------------------------------------------#
# Author: Sujayyendhiren Ramarao Srinivasamurthi #
# Email: sujayy1983@gmail.com #
# Book for wxPython: 'wxPython in Action' Noel Rappin and Robin Dunn #
#--------------------------------------------------------------------------------#
import wx
import random
import os
import Description
@sujayy1983
sujayy1983 / toolIntegrator.py
Last active August 29, 2015 14:14
A tool to integrate various attack tools. Example: Slowloris, RUDY, Tor's hammer etc.A sample work which maynot be enough all by itself. But just a glimpse of the attempt.
#--------------------------------------------------------------------------------#
# Author: Sujayyendhiren Ramarao Srinivasamurthi #
# Email: sujayy1983@gmail.com #
# Book for wxPython: 'wxPython in Action' Noel Rappin and Robin Dunn #
#--------------------------------------------------------------------------------#
import wx
import random
import TorsHammer
import Goldeneye