• blog
  • projects
  • about

Building a Command Line Utility with Node

Last week DevSmash went down for what I believe was the first time since I launched it back in September. The first thing I did was check out the Nodejitsu status page, which indicated that all their services were up and running. Since I was already hanging out in the #nodejitsu channel on Freenode, I mentioned my issue and was informed that MongoHQ (which Nodejitsu provides to customers for free) had experienced some hardware failure. Fortunately, the fine folks over at MongoHQ had things fully recovered within about 20 minutes, which represented the sum total of our downtime here.

So, why the story time? Well, given that DevSmash does rely on a few external services, I thought it would be nice to have a single place to look the next time something goes down. I had also been wanting to give TJ Holowaychuk's Commander a spin, so I took the opportunity to build a "cloud status" command line utility. In case it's useful to someone else, here's a quick overview of how it works:

Read more »

Posted by jmar777 on January 21, 2013

Ad Hoc Analytics with MongoDB's Aggregation Framework

While working on some recent projects, I had the need to run some basic dashboard analytics against moderate volumes of machine generated data. Already having some experience with MongoDB (and being quite the fan of it), I decided to do some research on real-time analytics with MongoDB.

A quick search turns up dozens of articles and presentations on how this can be achieved. However, after reading through quite a few of them, it became clear that most of the existing how-tos on the subject are based on pre-Aggregation Framework techniques, relying largely on MongoDB's atomic upsert, $inc, and $set operations.

These techniques are still largely useful, and are powering several successful applications. Unfortunately, however, they tend to be lacking when it comes to the ad hoc side of things - specifically, once multiple values from distinct events have been aggregated into a single value, the ability to slice and dice the results becomes limited. Additionally, these techniques typically require pre-aggregating at multiple levels to support pre-determined aggregation durations, rely on MapReduce, or delegate some re-reducing labor to the application itself.

Given that we now have the Aggregation Framework available to us (since MongoDB 2.1), I decided to run some tests to see how feasible it is to achieve real-time, interactive, ad hoc, dashboard analytics with MongoDB.

Note that this article is intended to be platform agnostic, so all tests are implemented as MongoDB shell scripts.

Read more »

Posted by jmar777 on November 15, 2012

Rolling Your Own RSS Feed with Express and Jade

The most excellent David Walsh has graciously allowed me to author a guest post over on his blog. The topic of this guest post is: "Rolling Your Own RSS Feed with Express, Jade and Mongoose".

RSS feeds are a great way to facilitate a loyal readership. In fact, as I write this, the RSS feed in David's sidebar is touting over 11,400 subscribers. Hitting the front page of Hacker News is always nice, but for most sites that's not going to translate into a reliable source of traffic. Getting each and every post in front of thousands of intentional subscribers though (who have their own followers on Twitter, Google+, etc.)? That's a traffic generator.

Head over to the The David Walsh Blog to read the rest!

Read more »

Posted by jmar777 on October 25, 2012

Introducing Kwicks 2.0.0 - Sexy Sliding Panels for jQuery

TLDR: Kwicks 2.0.0 is out, is awesome, and you can find docs and examples here.

I'm happy to announce that after 4 long years of neglect, Kwicks 2.0.0 is out! This is a major version release, and has been rewritten from scratch to support a much wider range of user interactions. The 1.x series of Kwicks had a horrid API, and made several assumptions regarding use cases. Kwicks 2.0.0 takes a much more flexible and programmable approach, and does a better job of following jQuery convention.

Read more »

Posted by jmar777 on October 9, 2012

Password Authentication with Mongoose (Part 2): Account Locking

This post is Part 2 of a series on implementing secure username/password authentication for your Mongoose User models. In Part 1 we implemented one-way password encryption and verification using bcrypt. Here in Part 2 we'll discuss how to prevent brute-force attacks by enforcing a maximum number of failed login attempts.

Read more »

Posted by jmar777 on September 20, 2012

DevSmash Has Comments!

This is just a quick announcement that DevSmash now allows comments on blog posts (powered by Disqus)!

I did some internal battling before choosing to go this route (eventually I want to build a custom solution), but I really don't like the idea of continuing to cover security related topics without providing a way for objections, concerns, etc. to be raised.

Read more »

Posted by jmar777 on September 19, 2012

Password Authentication with Mongoose (Part 1): bcrypt

This post is Part 1 of a series on implementing username/password authentication for your Mongoose user models. In this first installment, we will discuss how to implement one-way encryption of user passwords with bcrypt, and how to subsequently use the encrypted password for login verification.

Read more »

Posted by jmar777 on September 10, 2012

Welcome to DevSmash!

Thank you for checking out the inaugural post here on DevSmash! This is somewhat of a meta-post, as I really don't have an objective at the moment beyond introducing you to the site and getting the ball rolling.

Follow the link for more info on what DevSmash is, why it was created, and who it's for!

Read more »

Posted by jmar777 on September 5, 2012