Index ¦ Archives ¦ RSS

Moved

New content will be available at https://medium.com/@jimjh


Building Elastic Clusters

(Authors: James Lim, Adam Gray)

One of the main advantages of using a cloud provider, such as Amazon Web Services (AWS), is the ability to launch new instances on demand. However, it also means giving up control over physical machines and their retirement schedules; the cloud provider may terminate or …


dragon - an OSS File System for Hadoop

OSS is Aliyun’s offering of a distributed, highly available storage service. dragon allows YARN applications (incl. MapReduce jobs) to read and write data to OSS through the HDFS API. This allows you to swap filesystems without modifying your YARN application, MapReduce job, Pig script, Hive script etc.

The source …


Stripe CTF 2014, Level 3 - Instant Code Search

The task was to write, in Scala:

  • an indexer that scans a bunch of input files, and
  • a searcher that takes a query string and returns a list of lines containing it

It can be solved using the following:

In the indexer, tokenize each document, and create an inverted index …


Stripe CTF 2014, Level 2 - Defending against a DDOS attack

If your service comes under a major DDOS attack, what would you do?

In the third level of Stripe’s CTF, participants were tasked to build a proxy to defend a couple of backend servers against a DDOS attack. The proxy needed to do the following:

  • distribute requests across a …

Stripe CTF 2014, Level 1

This is the second installment of a series on Stripe's CTF 2014. You may wish to start from level 0.

Level 1

Level 1 proposed a crypto-currency named Gitcoin that used Git's SHA1 hashes. The player was provided with a git repository and asked to create a commit with a …


Stripe CTF 2014, Level 0

I participated in a week-long CTF hosted by Stripe in Jan 2014. This series of blog posts will cover some of the problems and their solutions.

Level 0

The first level was a breeze, and mainly served as an introduction/tutorial for participating in the CTF. We were given the …


How to Create a Websocket Server in Ruby

This is a short tutorial on creating a websocket server in Ruby using James Coglan's websocket driver. The complete example is available on github.

About Websocket Driver

The websocket-driver gem decouples the websocket protocol from the I/O layer, providing drivers that handle the websocket procotol (handshakes, upgrades etc) on …


Thoughts from Reading Code - Foreman and Pipes

Using Pipes for Cheap IPC

A UNIX pipe is a unidirectional interprocess communication channel with a read end and a write end. You have probably used pipes in the command line. For example,

$ git ls-files | xargs grep foo

This executes both commands concurrently and creates a pipe for interprocess communication …


Thoughts from Reading Code - Foreman

I read a lot of open source code in my free time to make myself a better engineer. Here are some of my notes from reading foreman's cli.rb.

Code Style - Raising Exceptions with a Bang

You might occasionally encounter code that looks like this:

def start(process=nil)
  raise …

© James Lim. Built using Pelican. Theme by Giulio Fidente on github.