server posts

Goodbye Dreamhost, hello Digital Ocean

My server, and with it my blog, a client site, and other web properties, was down for four days. I put in a support ticket and didn’t get a response until the fourth day. I’ve been with Dreamhost since 2009, and using DreamCompute since 2017, but I don’t think the product gets nearly the focus that their shared / managed stuff does. I use Digital Ocean at work, and it has been a much more polished and solid product for unmanaged VPS. That is where my site is now hosted.

Continue reading post "Goodbye Dreamhost, hello Digital Ocean"

Annoying bot and Cloudflare free rate limiting

Some German bot(s) seemed to take interest in one of Cogneato’s sites, Rockin Houston. The aging site is fairly inefficient with a lot of data, and the bot was causing high load on our DB server. I have implemented a PHP blocker for certain IPs, but I wanted something more broadly applicable. I made a rate limiting rule on Cloudflare that should block this type of behavior and prevent it from even hitting our server once the rule triggers.

Continue reading post "Annoying bot and Cloudflare free rate limiting"

JS: ES Modules and Node bare specifiers via response rewrite

I’ve been playing with JS lately, including ES modules and building with Rollup, Babel, and Terser, along with other accessories. One thing I’m disappointed with of ES modules in the Nodejs ecosystem is dealing with third party imports. Using the “bare” specifiers that Node expects works fine in that environment and thus tools running in it (possibly needing helpers), but they don’t work at all directly in the browser. This is discussed in this post by Jake Archibold, for instance.

Import maps are one solution in the works, but that requires explicitly mapping every dependency, which could get complicated fast when dependencies have dependencies. It also is only in draft stage and only works in Blink based browsers currently.

I eventually gave in to the idea of having server code rewrite the paths in the js file responses to point to a symlinked node_modules folder, similar to what is mentioned in this post by the Polymer project. I created a PHP test server for one of my projects that does this.

Continue reading post "JS: ES Modules and Node bare specifiers via response rewrite"

Looking at Apache logs with command line tools

In my web development career, I have countless times needed to look at Apache logs to figure out or find out about problems with sites, monitor activity, or for various other purposes. I’ve used command line tools to help with this, often looking for strings and counting occurrences. Since I recently needed to create a command string to count unique IP’s connected to a given string in the logs, I thought I’d post about it and a few related useful commands.

Continue reading post "Looking at Apache logs with command line tools"