«
  • Using n as a Tool to Provision Node.js

    When provisioning servers with a tool like Chef, you really don't want to find yourself in the position of building Node.js from source. It takes a long time, especially if you're working with something like an AWS instance where there usually isn't a great deal of computational horsepower under the hood. Unfortunately the standard situation for Node.js on any given Linux platform is that packages in the default repositories are ancient releases and tools like the Node.js cookbook for Chef can have issues when it comes to installing a recent binary distribution. There are many ways around this issue, but one of the easier approaches is to use the n tool as a basis for your provisioning setup. The tool must be built from source, but ...

    Read more »

  • An Object Stream Wrapper for the Clarinet JSON Parser

    Streams are a powerful tool in any language that supports them well. Once you wrap your head around how to create your own implementations you start to see that a majority of tasks can be broken down into streams that pipe to one another in sequence: each stream accepts the output of the prior as input, performs its processing, and passes on modified data as input to the next stream in sequence. Why use streams versus some other paradigm, however? For me, it is that the stream infrastructure provides the necessary throttling and buffering needed to pipe the output of a fast process into the input of a slow process with a single line of code. Throttling and buffering are a pain to manage yourself, and an application may consist of a ...

    Read more »

  • Irresolvable Email Deliverability Issues With Digital Ocean

    The short summary to this post is as follows: Do not run mail servers on Digital Ocean if you are doing anything particularly important with email. Large and growing swathes of Digital Ocean IP addresses are blacklisted as bulk spam senders by mail providers such as Google. Large and growing swathes of Digital Ocean IP addresses are blacklisted by MIPSpace. Digital Ocean, Google, and MIPSpace will not resolve these issues for small organizations. Digital Ocean Overview Digital Ocean is a cheap, useful provider of cloud virtual servers, and I moved some of my sites there last year from Amazon EC2 in order to cut costs and try it out. I wasn't using much of the AWS infrastructure, so why pay for it? In Digital Ocean a virtual server ...

    Read more »

  • Running Nginx as a Non-Root User

    There are times when you may find yourself wanting to launch Nginx as a non-root user. Perhaps you are running an automated test suite against a local instance of a web application, for example, and the whole process - including starting up and shutting down Nginx - is operated by a bash script. The simple approach in this sort of situation is to set up the local environment so that you can sudo without password entry: To enable password-free sudo access for any command for a specific user in Ubuntu create the file /etc/sudoers.d/username with the following contents: What if you cannot do this, however? Your test automation script might be running on build system servers under a user that by design does not have sudo rights. ...

    Read more »

  • Parallel Local Selenium Tests via SauceLabs, BrowserStack, and TestingBot

    Automated end to end tests against a running instance of your web application are a necessary part of the development process. It is arguably more efficient to lean more in favor of end to end testing than unit testing. Both have their place, but automated end to end tests generally provide greater code coverage for less effort, and further liberate dedicated QA people from much of the drudgery inherent in their work, allowing them to focus on higher value activities. Ultimately, comprehensive automated end to end testing is required if heading down the road towards continuous integration and then continuous deployment of a web application. The standard for running automated end to end tests these days is to use Selenium. The open and ...

    Read more »

  • Setting Up Interactive Brokers Trader Workstation on Ubuntu 13.04

    Trader Workstation(TWS) is a Java desktop trading platform for use with an Interactive Brokers account. I think that this is one of the better options out there for straightforward non-professional trading: the software has more features than any one individual is ever likely to even look at, let alone use, is frequently updated, and the commissions are low. I've used it for some years on Windows, but the time comes to make the move to Linux. Here, then, is a recipe for setting up TWS on a new desktop machine running Ubuntu 13.04. This uses the January 6th 2014 build 943.1c of TWS, but I would expect it to work for future updates for a while yet: Interactive Brokers makes few changes to the fundamental structure of this ...

    Read more »

  • Pondering Non-Negotiated and Acausal Trade

    Of late I have been pondering whether there may be viable business models in providing support for some of the more abstruse forms of exchange that can exist between sentient entities, with a focus on trade that is not widely accepted as being trade at this time. Some thinking out loud will happen in this post on the way to perhaps nowhere in particular. For the purposes of clarifying my own thoughts, I'm going to create a taxonomy for a few broad types of trade. When I talk about trade I mean the dictionary definition, or at least that is where I'm starting: a trade is an exchange that occurs between any arbitrary number of entities. Typically trade refers to property transfers these days, whether that is currency for groceries or ...

    Read more »

  • Setting Up Sublime Text 3 for Javascript Development

    Sublime Text has been my IDE of preference for the past year or so after tiring of Eclipse: there is little of the feature set of a heavyweight IDE like Eclipse that I actually use on a regular basis nowadays. I like to have basic forms of code navigation, such as search and definition lookup, syntax highlighting, automatic linting, a bare minimum of code completion, and a few formatting helpers such as whitespace management, but beyond that I don't even tend to integrate version control into my development environment. I prefer to manage Git from the command line, for example, and keep that distinct from the IDE. I've been using Sublime Text 2, but the time has come to move on up to Sublime Text 3. I'm a late adopter and it has taken ...

    Read more »

  • Considering Speed and Slowness in AngularJS

    AngularJS is a Javascript framework used as the basis for single-page applications that largely run in the client, usually exchanging information with the server via REST or REST-like APIs. Like most of its sibling frameworks it is fast in modern browsers: this is an age of machines with a great deal of memory and processing power. If you are building an application that never displays more than a modest amount of data to the user all at once, and will not be used on mobile devices or tablets, then you rarely have to pay all that much attention to performance on the client. To a first approximation everything just works and just works fast enough for the matter at hand. The Basics: What Chews Up Time Under the hood only a few line ...

    Read more »

  • AngularJS Headless End to End Testing With Protractor and Selenium

    For those of you who are already somewhat familiar with Protractor and Selenium and want to skip right to the end, you might take a look at my Vagrant VM for headless browser testing in Ubuntu, and Chef cookbook for the same. These set up a standalone server that can be used to run end to end tests of AngularJS sites in Chrome, Firefox, or PhantomJS, and address some of the issues that you will run into along the way. What is an End to End Test? An end to end test runs against the front-end of a fully functional application. In the case of a web application, this implies driving a browser that loads pages, runs Javascript, interacts with the DOM, fills and submits forms, and so forth. The web application is served from a machine with a ...

    Read more »

»