After exploring Haskell for some time, I find myself often adopting functional concepts in my daily work. The exposure to functional programming has even affected the set of tools and frameworks I use. For example, having to parse a custom data format I first tend to search for a Parsec clone implemented in the currently used language. This time it was for JavaScript, but a quick Google search did not reveal any relevant projects. Therefore following is the initial attempt to a probably first general purpose parser library for JavaScript, ‘p4js’.
Full Post »
Archive for Tools
Monadic parser in JavaScript
JSON, XML, performance
JSON is far better than XML! Less code to transfer – faster parsing – happy user. Right ? Hold that thought for a minute…
D/DoS Testing Network Applications
If you Google for “denial of service tools” or look in the “VoIP flooding tools“, you’ll find that all of these tools have a very similar pattern. Any engineer worth a dime hates writing the same code over and over again. So we are going to refactor these tools to abstract away the common boiler-plate code and end up with something that’s reusable, yet more powerful.
GeoIP tracking with Google APIs
If you want to track visitors to know where they are coming from, the normal un*x’ish way of doing this is to grab maxmind‘s geoiplookup (or apt-get/rpmfind) and then run it against the web server logs. That’s so not Web 2.0. *ugh*
JS3
You know about LAMP and I’m sure you know about RoR, not to mention countless other web application frameworks. I would like to introduce you to JS3 (since we are on an acronym roll here) which is turning out to be my favorite way to build applications. I’ve built apps for a long time now with MFC/ATL, Swing and WEBRick, mainly because I like to visualize things in order to understand. And when your prototypes start looking like the real meal deal and the lines start getting blurrier, you know you’ve hit home run.
http://www.pcapr.net
Wow, time sure flies when you are writing code.
Lots to blog about, but this one will be short. We just launched http://www.pcapr.net, a place to upload, view, edit, comment and yes, transform pcap’s. All you need is a browser. Registration is currently by invite only, but we hope to open that up soon.
Ruby XDR parser
XDR, as specified in rfc-4506, forms the underpinnings of Mount, NFS, NFS4 and a host of other protocols. Broadly all of this can be grouped under Sun RPC for implementing Remote Procedure Calls.
The XDR is truly an IDL (Interface Definition Language) for a Sun RPC service. On most *nix operating systems you will find a set of .x files located in:
/usr/include/rpcsvc/
that specify how to talk to these services.
Full Post »
Ruby FSM
CHSM is a pretty nifty way to model finite state machines in Java or C++. It uses a DSL (Domain Specific Language) with embedded code blocks which is then compiled into the actual source. This FSM in Ruby is an attempt to model something very similar as a DSL.
Ruby TUN/TAP interface
The universal TUN/TAP drivers have been shipping with the Linux kernel for a while now. vtun builds on this to set up point-to-point tunnels that essentially encapsulate Ethernet frames over a TCP connection. Here’s the Ruby code to setup a tap interface so we can start receiving raw Ethernet frames that are being written to this interface.
Widespread DH Implementation Weakness: Conspiracy or Ignorance?
While developing an implementation of IKE for our platform, I noticed an astonishing behavior in the servers I was testing against: Not a single IKE implementation, which included products from the biggest names in network infrastructure, were validating the Diffie-Hellman public keys that I sent. A consequence of this is that any deployment of these servers will allow the disclosure of secret information when a peer is in collusion with a passive attacker.
