-
Connecting to the MtGox market data feed using Perl
For a recent project I needed some realistic market data for an electronic exchange. Seeing how MtGox provides free and open access to theirs (thank you!) I chose them. However none of the examples floating around the internet seemed to work, so I whipped one up using Net::Async::WebSocket::Client. Enjoy: use IO::Async::Loop; use Net::Async::WebSocket::Client; my $client…
-
Lightning talk at Cluj.PM
-
Non-buffered processor in Perl
Lets say that you have the following problem: you want to write a script which processes the output of a program and writes out the modified somewere, with as little buffering as possible. One concrete example (for which I needed the script) is log rotation: you want to save the output of a program (which…
-
Processing clipboard data in Perl
-
Sending an X-Face email with Perl+GMail
In the latest Software Freedom Law Show Bradley mentioned the X-Face email header and challenged listeners to send them an email containing the X-Face header. So here is the small Perl script I’ve whipped together to send them an email trough GMail: use strict; use warnings; use Net::SMTP::TLS; my ($from, $password) = (‘…@gmail.com’, ‘MySuperSecretPassword’); my…
-
Solving mathematical puzzles with brute-force and Perl
After talking a lot about optimizations and selecting the right algorithm, here is a little brute-force code. This particular one gives the answer to the following puzzle from Richard Wiseman’s Blog (one well worth following BTW): Can you make the number 24 with the number 5, 5, 5, and 1 (again, you cannot join the…
-
Unshortifying Cisco “Go” links
-
Parsing pcap files with Perl
Recently I was reading the blogpost on the BrekingPoint labs log about parsing pcap files with Perl and I immediately said to myself: it is impossible that there isn’t a module on CPAN, because Perl is great. Turns out I was right, there is Net::TcpDumpLog which can be combined with the NetPacket family of modules…
-
In praise of Regexp::Assemble
…and of the Perl modules in general. I had the following problem: Given a list of 16 character alphanumeric IDs, find all the lines from a large-ish (~6GB) logfile which contain at least one of the IDs. The naive approach was to construct a big regular expression like W(QID1E|QID2E|QID3E…)W and match it against every line…
-
Carving out files with Perl