GliderJan Varho

Posts in category Internet:

When AWS Services Don't Like Each Other

  • aws
  • CodeCommit
  • S3
  • CloudFront
  • KMS
  • serverless

When my web host had a brief outage I decided to move my site to AWS. Since I'd been working with various AWS services recently, I decided that some automation would be nice as well.

There is CodeBuild and CodeCommit which ought to handle storing and building the site code, and S3 where I can serve a static site like I decided on easily. Since they are all on AWS, surely they will play nice with each other...

Yeah, no.

The first problem I ran into was that CodeCommit only has triggers for triggering a Lambda or sending a notification to SNS. So I wrote a lambda to do that.

Then I ran into problems between CodeBuild and S3. Clearly CodeBuild is meant to produce a JAR or something. It supports pushing them to S3, but only to a non-root prefix. I could not push to the root, which I had set up to serve the site. Ok, no big deal, I can set up an origin in CloudFront that uses that prefix instead.

And I get a bunch of permissions errors.

Some googling reveals that they are due to KMS. I try to work around that in CloudFront and/or add more permissions to the IAM roles involved, but no luck. As far as I can tell, CloudFront only allows serving encrypted data from S3 over signed requests, rather than publicly.

Eventually I wrote the S3 push into the buildspec.yml file using:

aws s3 cp output s3://my-bucket-name/prefix/ --recursive

And leave the artifact definition empty.

This is clearly not the use case they intended. Presumably the recommended process would involve CodePipeline, but that is totally overkill for something that I would trigger every few months.

Encrypted Google Search for Chrome

  • browser
  • Chrome
  • Chromium
  • encryption
  • Firefox
  • privacy
  • search

I recently moved to Chromium - the open source version of Google's Chrome browser - after I grew tired with Firefox crashing and bloating my system.

Chrome defaults to searching with auto suggestions through the omnibar (location/search bar) using an unencrypted connection, but it is easy to use Google's encrypted search instead. This seems like a good idea with open WiFi connections being very common. Simply Manage search from Preferences and Add a search engine with these details:

The 'en' part of the URL can be changed to use another language. The keyword is very useful for non-default search engines to be able to search e.g. Wikipedia from the omnibar using 'wiki topic' and so on.

As a side effect search suggestions are no longer offered, which I consider a feature. They in effect send Google every character you write to the location bar. (The 'prediction service' option in Under the Hood preferences is related and should probably be disabled by anyone caring about privacy.)

Disabling the WordPress Maintenance Lock

  • help
  • lock
  • maintenance
  • update
  • WordPress

I just got bitten by the automatic maintenance lock with WordPress updates. My internet connection failed in the middle of a plugin update and left the blog in maintenance mode. Google answers to disabling it were unhelpful, so here goes:

Just delete the .maintenance file is the WordPress directory.

Additionally, if the update is left in a messy state, you might need to delete the upgrade directory to try it again.

Speed Up Firefox 3 Places

  • Firefox
  • browser
  • speed

I've been using Firefox 3 since the first beta and it's a very good and quite stable browser. However, there's one "enhancement" that bugs me a lot. And that is the history+bookmarks combination that they call "Places".

Someone on a modern computer will probably not mind the performance impact and can see the uses, but if you are on a low spec laptop (yeah, I am) it's a whole different situation. To put it in more technical terms, places "can have a non-trivial impact on the browser's performance."

For me, Firefox with the default settings will have a lag from a fraction of a second to several seconds every time I edit the location. Clearly, that's unacceptable. There's no option to change places behavior through the menus, but you can do it from about:config and here's how:

  1. Decrease from the default 1000.
  2. Decrease from 12. 0 will give the best performance, but no rich results.
  3. Increase from 100. This is the wait between chunks.

My values of choice are 100, 3 and 300, respectively. You should test to find the best for your setup. That should take care of the location bar lag. Another reason for FireFox not responding is the background frecency calculations performed to keep places up to date.

By increasing places.frecency.updateIdleTime from 60000 (1 minute) you can ensure that these background calculations only start when you are not on your computer, instead of causing lack of response when reading long blog posts.

These changes are enough for my computer. With these my Firefox is actually quite responsive until I start other large applications. Of course, there's little to do on that front.