Port Sweeper Using Python

A port scanner/sweeper is a software application designed to probe a server or host for open ports. This is often used by administrators to verify security policies of their networks and by attackers to identify running services on a host with the view to compromise it. A portscan can be defined as an attack that sends client requests to a range of server port addresses on a host, with the goal of finding an active port and exploiting a known vulnerability of that service, although the majority of uses of a port scan are not attacks and are simple probes to determine services available on a remote machine. 

So, Here’s a python code nugget that does the port sweep on any give host.

Read More

XML Unmarshalling in Java: JAXB vs STax vs Woodstox

What is XML Unmarshalling?

Marshalling is the process of transforming the memory representation of an object to a data format suitable for storage or transmission, and it is typically used when data must be moved between different parts of a computer program or from one program to another. Marshalling is similar to serialization and is used to communicate to remote objects with an object, in this case a serialized object. It simplifies complex communication, using custom/complex objects to communicate instead of primitives. The opposite, or reverse, of marshalling is called unmarshalling (or demarshalling, similar to deserialization). 

Read More

Memory Leaks - Spend Your Memory Wisely !

n computer science, a memory leak is a particular kind of unintentional memory consumption by a computer program where the program fails to release memory when no longer needed. When a memory leak occurs, memory is not physically lost from the computer, but rather becomes claimed but ignored due to program logic flaws. When we are allocating memory using new or malloc and then failing to deallocate the memory after its use within the application’s life span, then the memory allocated earlier will become unusable for the application, there by making it a leak in the memory.

Read More

Sorting Huge Files Using Java

Howdy all. In this post, I will share some of my monkey coding work that can concurrently sort very huge files in relatively less time.

Goal: Sort an extremely large text file using java.

How it works:

  1. Take the target text file
  2. Split it into multiple say ‘n’ small chunks
  3. Feed each chunk of these files to each of the 'n’ asynchronous threads for sorting
  4. Merge the sorted files into one (TBI) 
Read More