Hello, I'm Alex

A misleading blog about engineering

High-performance Cross-domain Events Tracking — December 17, 2015

High-performance Cross-domain Events Tracking

Tracking events in a web page is something very ordinary now-a-days. There’s rarely a page that won’t drop that sneaky pixel every time you buy a pair of headphones or click on that glowing call to action that will change your life. And why wouldn’t you do it? It helps you understand your visitors, how they react to your content, and why your page might not be as effective as you expected… it helps you improve your visitor’s experience. As the traffic in your website grows – or websites if you have a third party library – you might want to track all these relevant events without deteriorating the user’s experience.
Continue reading

EC2 CLI for SSH connections — July 12, 2015

EC2 CLI for SSH connections

If you have read my previous posts, somehow, I always end up bringing up AWS. Although it is not the only service I use nor am I in any way related to it, I do use it very often. Often enough that I might spend a few hours putting something together that can save me a few keystrokes every day. And that’s exactly what I did with EC2 CLI.
If you have ever tried Elastic Beanstalk, an AWS service that bundles together a bunch of other AWS services to create a very easy to use (yet flexible) platform to deploy your web apps, you probably stumbled upon their eb tools. This command line interface, among other tools, allows you to easily SSH into one of your Elastic Beanstalk instances by using eb ssh and selecting an instance.

$ eb ssh
Select an instance to ssh into
1) i-96133799
2) i-5931e053
(default is 1): 1

Continue reading

Running Arbitrary Functions in AWS Lambda (Node.js) — June 27, 2015

Running Arbitrary Functions in AWS Lambda (Node.js)

AWS Lambda is an interesting service released by Amazon last year. It allows you to run some piece of code without having to worry about the underlying infrastructure or how it will scale, you code starts running after an event, and you get billed for the runtime only. Although I have not used it in any production environment yet, the concept is really amusing.

This weekend, I’ve been playing around with Lambda and Node.js. Testing it with node streams to create a “map-reduce” pipeline, and running arbitrary functions in a distributed environment without much work. I’ll focus on the latter one for now…

Arbitrary Functions in AWS Lambda

My goal here was to be able to “lambda-fy” a function in a way that you can run it locally, but with the option of running it remotely in AWS Lambda without really changing the original function. I did not look into making anything production-ready, as it was mainly a fun research.

By the end of this post, you’ll be able run your function func(args) in AWS Lambda by calling func.lambda(args).
Continue reading

Cron with AWS Data Pipeline and AWS ECS — June 21, 2015

Cron with AWS Data Pipeline and AWS ECS

For the past few years, I have been using Amazon Web Services for the underlying infrastructure in several projects. Many of its services make my life much easier and allow me to focus on the quality of my products.  But when it comes to cronjobs, there’s nothing out of the box that allows you to manage your tasks.

I was looking into a way of avoiding having to set up and manage a cron replacement system (e.g. chronos), and easily set up tasks from AWS console itself. Here’s how I brought up Amazon’s Data Pipeline and their, recently released, EC2 Container Service together to create a cron service.

Continue reading