«
  • Listing Large S3 Buckets with the AWS SDK for Node.js

    A number of posts here exist because I don't like redoing the same small piece of functionality over and again. When you're out there consulting you don't take the inevitable swathes of glue code with you when you leave, and you don't tend to have access to it down the line. There is always some commonplace implementation detail for an API or a third party package that you will forget to take notes on or fail to recreate for your own toolkit at the time - and you only realize a year later when you find yourself having to spend a few hours reworking from scratch the same small annoying functions and rediscovering the same small annoying pitfalls. Wait, didn't I do this last year? […]

    Read more »

  • The Cosmological Noocene

    Here is a sketch of the future, without any specific dates assigned to its milestones. The human mind is reverse engineered. It is run in software. A million variants and improvements are constructed. Molecular nanotechnology is established and becomes a mature industry, available to everyone. Anything and everything can be built efficiently given the raw materials and a spec. From an economic perspective those who thrive are those who make the most efficient use of the matter that they own, and those who gain control over the most matter: quality versus quantity shift back and forth in the degree of advantage as the ability to accurately and rapidly manipulate large masses of matter at the atomic level and lower grows. Matter is most economically efficient […]

    Read more »

  • Freedom versus Security in Devops

    I've worked with organizations in which operations support took the form of a human black box that responded to any request with "no", and in which experienced development teams were forbidden from launching a server or opening a cloud account to try something out. It could take months to request anything new. I've also worked with organizations in which every individual engineering team was responsible for managing its own devops support, all the way down to arranging technical vendors and managing cloud accounts. In the former case, there is a huge invisible ball and chain attached to progress. In the latter case there is duplication, competition, and the need for people to spend time on integrating disparate internal efforts that were performed in complete isolation […]

    Read more »

  • A Provisioning Bash Script for a WordPress 4.* Ubuntu 14.04 LAMP Server

    The bash script provided here is suitable for the initial provisioning of an Ubuntu 14.04 server, installing the bare minimum needed for a WordPress installation, including WordPress itself. It was originally intended for use with Vagrant, but will work for provisioning of real servers as well. Once the script completes, you'll find that WordPress is up and running and you can log in to begin customization. The script installs: The Apache webserver with mod_php to run PHP. The MySQL database. Monit as a process monitor to keep things running. WordPress. WP-CLI, a command line interface for WordPress Before running the script, edit the variable declarations in the first section to set the necessary usernames, passwords, and other values. The script offers the option of (a) […]

    Read more »

  • Locking Down a WordPress 4.* Blog Installation

    As is the case for Drupal, WordPress at version 4.* arrives out of the box with a great many default functions, bells, and whistles turned on. If you are a causal user then it is very possible that your blog is even now serving pages and exposing access points that you have no idea even exist. It is rarely the case that you in fact want all of this functionality to be accessible, especially given that WordPress is a prime target for automated attacks. One part of hardening any web application is to shut down or block access to every unneeded component and subsystem, thereby reducing the attack surface. A Starting Point There is a useful semi-official guide on hardening WordPress that provides a good […]

    Read more »

  • Notes on Exporting Large Movable Type Databases

    It is old news now that Movable Type fell off the map in the competition between blogging platforms. Versions 4 and 5 were the last openly available distributions, and can no longer be updated or patched easily. Version 6 is closed, an enterprise product. If forced to pick one root cause for the failure of Movable Type to compete with the likes of WordPress, it would be that Movable Type is written in Perl. The number of people capable of - and also interested in - working in Perl to produce quality plugins and the other tools of an open ecosystem for a web application is small in comparison to those who use PHP, and Perl is so different from PHP that there won't be […]

    Read more »

  • An Example Dropwizard Application with Guice for Dependency Injection

    Dependency injection is a tremendously useful design pattern. From my experience the direct benefits of this pattern are almost entirely realized as a reduction in the cost of building and maintaining good unit test coverage. Being able to swap out mocks and real instances or values very easily makes the creation of test suites a breeze in comparison to some of the alternatives. All the other benefits derived over the long time largely arise from having a far more comprehensive and maintainable set of tests, since the development team were able to do more in the time allotted. There are countless dependency injection frameworks in the Java ecosystem, but here I'll look at Guice. It is lightweight enough to drop into most application frameworks with […]

    Read more »

  • PhantomJS Has Many Uses, But Functional Testing Isn't One of Them

    PhantomJS is a comparatively lightweight headless web browser built on WebKit. When it comes to rendering and interacting with web pages it does everything that any other full-featured browser does with the exception of providing a graphical user interface. You can install it via NPM, meaning that for Node.js ecosystem developers is easy to put PhantomJS in place on build, test, and deployment servers even in more restricted environments. You control PhantomJS either directly via a Javascript API or through a WebDriver interface such as that used by Selenium. So what can you do with a web browser that has no graphical user interface? Take Screenshots PhantomJS is fully rendering pages under the hood, so the results can be exported as images. This is very […]

    Read more »

  • Run NPM Install on All Subdirectories Containing Packages

    Let us say that you have inherited an application deployment consisting of a directory tree containing multiple Node.js packages in various scattered locations. As a part of the setup you want to run npm install for each package individually, but the packages and locations have varied over time in the past and will continue to do so in the future. So you want to write a single script now that will walk through the directory tree, identify Node.js packages, and run the NPM installation where needed. Thus even if packages move around the script will not need any further update. The first tool to reach for in this sort of situation is some combination of find to identify package.json files followed by piping the resulting […]

    Read more »

  • Filenames that Alphanumerically Sort by Descending Timestamp

    The professional life of a programmer consists of an endless series of small trials that in a sane world would never exist. For example, finding oneself needing to generate filenames that sort in descending order by file modification timestamp. Why, oh why, would anyone ever be stuck with a file listing technology that doesn't allow the user to simply specify a sort by that timestamp? This does actually happen, however, I'm sad to say. It is trivial to create a filename format that sorts by ascending timestamp: anything like YYYY-MM-DD-HH-SS will work just fine. Then your file listing technology should have some simple way to reverse that list. What if it doesn't, however? Woe is you. For the sake of never again repeating the short […]

    Read more »

»