Skip to content

Instantly share code, notes, and snippets.

View 0xTheProDev's full-sized avatar

👨🏻‍💻 TheProDev 🇮🇳 0xTheProDev

View GitHub Profile
@0xTheProDev
0xTheProDev / README
Created December 24, 2024 08:15 — forked from bob-the-builder-v/README
Scan un-authorized access to device
## Note: Tested on Linux only as of now.
How to use?
1. There should be an alert.mp3 file in your directory for the sound to be played.
2. Use a python virtualenv to install requirements.
3. Just run the system_honeypot.py file.
@0xTheProDev
0xTheProDev / LargeArray-III.ts
Created August 14, 2021 11:19
Slice functionality
class LeafNode<T> {
...
slice(_startIndex: number, _length: number) : T {
return this.#data;
}
}
class NetworkNode<T> {
...
slice(startIndex: number, length: number): T {
@0xTheProDev
0xTheProDev / LargeArray-II.ts
Last active November 7, 2023 14:44
Search functionality
class LeafNode<T> {
...
at(_index: number): T {
return this.#data;
}
}
class NetworkNode<T> {
...
at(index: number): T {
@0xTheProDev
0xTheProDev / LargeArray-I.ts
Last active November 7, 2023 14:44
Class definitions
type TNode<T> = LeafNode<T> | NetworkNode<T>;
class LeafNode<T> {
#data: T;
constructor(data: T) {
this.#data = data;
}
get data(): T {
@0xTheProDev
0xTheProDev / Cords.ts
Created August 12, 2021 19:04
Store large string in a Tree like structure and perform traversal and retrieval.
/**
Large string has been broken into Cords, a Tree like data structure that can only have a Leaf Node or an Internal Node
Sample Cord:
Simple:
-> Leaf <length=5> "ABCDE"
Complex:
-> Internal <length=10>
-> Left: Internal <length=4>
@0xTheProDev
0xTheProDev / image-add-intensity.c
Created December 1, 2018 03:18
Read a 24-bit Bitmap image from a user given path and store into 2-D matrix and add a constant intensity value to each pixel and save to a image path given by user.
/*
# Intensity Addition Problem
## Problem Statement
Read a 24-bit Bitmap image from a user given path and store into 2-D matrix and add a constant intensity value to each pixel and save to a image path given by user.
## Constraint
1. Input file will definitely exist and have valid 24-bit Bitmap image.
@0xTheProDev
0xTheProDev / ExcelParser.py
Created September 26, 2017 08:28
A Parser for Excel Sheet Formulas in Python 3
#========================================================================
# Description: Tokenise an Excel formula using an implementation of
# E. W. Bachtal's algorithm, found here:
#
# http://ewbi.blogs.com/develops/2004/12/excel_formula_p.html
#
# Tested with Python v2.5 (win32)
# Author: Robin Macharg
# Copyright: Algorithm (c) E. W. Bachtal, this implementation (c) R. Macharg
#
@0xTheProDev
0xTheProDev / SheetRefTree.py
Last active April 8, 2020 12:50
Expression Tree for Spreadsheet in order to create referenced cells and cell formulae
# Module: Expression Tree for Spreadsheet
# @function: tree
# @param table: A set of reference and their formula/rules
# @param @optional debug: Prints table (Given) and values (Evalutated) iff True
# @returns Evalutated table
def tree(table = {}, debug = False):
class Node(object):
def __init__(self, key = None, value = None):
@0xTheProDev
0xTheProDev / prime_gen.c
Created April 7, 2017 09:36
A program that checks for primality of a number using Sieve of Eratosthenes
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*
* USAGE: create(<SIZE OF SIEVE>)
* RETURN TYPE: CHAR* (STRING)
* THIS METHOD CREATES DYNAMIC MEMORY ALLOCATION
* IN HEAP WHERE THE SIEVE HAS TO BE IMPLEMENTED
* LOOPS THROUGH ALL NUMBER UPTO N
@0xTheProDev
0xTheProDev / fast_io.c
Last active April 7, 2017 09:20
Fast I/O operation in C
#include <stdio.h>
#define get getchar_unlocked
/*
* USAGE: scand(<ADDRESS OF INTEGER VARIABLE>)
* RETURN TYPE: VOID
* THIS METHOD READS CHARACTER FROM CONSOLE
* CHECKS WHETHER IT BELONGS TO NUMBER OR NOT
* IF IT IS A NUMBER KEEP ADDING UNTIL A NON-NUMERIC
* CHARACTER IS FOUND. PUT THE INTEGER FORMED IN GIVEN