RSSAmplifier

Blog

The other side of the moon

/bb|[^b]{2}/ Never stop Grokking

tech.bluesmoon.infoRSS feed ↗25 posts

Latest posts

Ansible: Extracting multiple attributes from a list of dicts

I've been writing a bunch of ansible playbooks, and in one case I had to transform a list of dicts to extract two attributes from each dict and create a new list of dicts. i.e., given a list like this: entities: - id: 123 label: Label 1 type: foo status: enabled - id: 234 label: Label 2 type: foo status: enabled - id: 345 label: Label 3 type: bar status: enabled I need to transform it into this:…

Fixing a system without enough RAM for a text editor

Someone on quora asked why people still use editors like emacs and vim when more modern alternatives exist. There were so many great answers that I didn't need to answer the original question. I couldn't possibly add more to the question of why emacs or vim. Instead, I was reminded of an experience where even emacs/vim weren't options. Sometime in the mid to late '90s, I visited my sister at…

On Migrating Character Encodings

Several discussions I've had with friends and colleagues recently reminded me of an incident we faced several years ago at Yahoo! Now Yahoo! as a company was made up of many different local offices around the world, each responsible for content in their locale. Since there was a lot of user generated content, this meant users in a particular locale could easily enter content (blog posts,…

When users interact

When looking at the Core Web Vitals, we often try optimizing each independently of the others, but that's not how users experience the web. A user's web experience is made up of many metrics, and it's important to look at these metrics together for each experience. Real User Measurement (RUM) allows us to do that by collecting operational metrics in conjunction with user actions, the combination…

Uploading a file using SFTP through Julia's LibCURL

The problem A colleague was recently tasked with using SFTP to upload an automated report to a customer's server. The code that generates the data runs in Julia 1.6, but there were no restrictions on where the upload code had to run. Unfortunately our command line curl wasn't build with sftp support so we couldn't use that, and our system doesn't have sftp installed, so we couldn't use that…

The metrics game

A recent tweet by Punit Sethi about a Wordpress plugin that reduces Largest Contentful Paint (LCP) without actually improving user experience led to a discussion about faking/gaming metrics. Core Web Vitals Google recently started using the LCP and other Core Web Vitals (aka CWV) as a signal for ranking search results. Google's goal in using CWV as a ranking signal is to make the web better for…

Safely passing secrets to a RUN command in a Dockerfile

There may be cases where you need to pass in secrets to a RUN command in a Dockerfile , and it's very important that these secrets not be leaked into the environment or the image. In particular, these secrets should not be stored in the image (either on disk or in the environment, not even in intermediate layers), they should not show up when using docker history . While working this topic, I…

Recovering from Big Sur upgrade snafu

Apple recently pushed out a new release of MacOS called Big Sur. Unfortunately, the upgrade process is problematic. Specifically, the upgrader does not check for the required disk space before starting the upgrade, and if the target system doesn't have enough disk space (35GB or so), then the upgrade fails partway through, leaving your system in a mostly unusable state. This is what happened to…

Understanding Emotion for Happy Users

How does your site make your users feel? Introduction So you’ve come here for a post about performance, but here I am talking about emotion… what gives? I hope that if you haven’t already, then as this post progresses, you’ll see that performance and emotion are closely intertwined. While we may be web builders, our goal is to run a business that provides services or products to real people. The…

Implementing Spearman's Rank Correlation in SQL

In my last post, I showed how to implement Pearson's Correlation as an SQL Window function with window frame support . In this post, I'll follow up with implementing Spearman's Rank correlation co-efficient in SQL. While Pearson's correlation looks for linear relationships between two vectors (ie, you wouldn't use it for exponential relationships), Spearman's rank correlation looks for…

Implementing Pearson's CORR as a database window function

I recently needed to find the Pearson's Correlation Coefficient between two columns in a Snowflake database. Now Snowflake and PostgreSQL both support a CORR aggregate function that correlates along a GROUP BY . Snowflake additionally supports CORR as a window function, but only for use with PARTITION BY . It does not support window frames. Other databases like MySQL do not have a CORR function at…

Set your password to "password" - A tale of datacenter security

This is an old story. Old enough that the guilty parties have either learnt from their mistakes or have moved on to other things. It was 1999. I was an intern at an ERP/CRM company called Thirdware Solutions Pvt. Ltd. or TSPL for short. If you'd asked me a year earlier, I wouldn't have heard of this company, and I wouldn't have imagined ever working in this space. However the people who…

Velocity Santa Clara 2015 -- My List

At Velocity SC 2015, these are the talks that I'd really like to see if only I could be in more than one room at a time. Wednesday, May 27 09:00 Service Workers by Pat Meenan Exciting new technology currently available in Chrome 11:00 Building performant SPAs by Chris Love Since we're doing a lot of SPA work for boomerang at the moment, I'm very interested in performance best practices for SPAs…

IE throws an "Invalid Calling Object" Exception for certain iframes

On a site that uses boomerang , I found a particular JavaScript error happen very often: TypeError: Invalid calling object This only happens on Internet Explorer, primarily IE 11, but I've seen it on versions as old as 9. I searched through stack overflow for the cause of this error, and while many of the cases sounded like they could be my problem, further investigation showed that my case didn't…

jslint's suggestion will break your site: Unexpected 'in'...

I use jslint to validate my JavaScript before it goes out to production. The tool is somewhat useful, but you really have to spend some time ignoring all the false errors it flags. In some cases you can take its suggestions, while in others you can ignore them with no ill effects. In this particular case, I came across an error, where, if you follow the suggestions, your site will break. My code…

Don't guess at TimeZones in JavaScript

I spent quite some time a couple of months ago working on timezone support for mPulse and thought I should document the insanity, but never quite got around to it. Then there was this post on hacker news about reading a user's timezone in JavaScript and using that to display the right time. That post brought back a flood of horrific memories, prompting me to put my thoughts down. First, while…

Reducing checkboxes

Alex Limi has an excellent post on the overuse of checkboxes in Firefox's preferences screen. It reminded me of something Nat mentioned during his talk with Miguel de Icaza back at Linux Bangalore 2003 about Gnome. They mentioned several UI idioms including checkboxes and disabled menu items, but the gist of it was, every time you give the user a decision to make, you're making their lives harder.…

Nexus 4 — First impressions

Just got a Nexus 4. Started it up, and tried to sign in to my gmail account. I have two-factor auth set up for extra security, and you'd expect a google device to work well with google auth, but here's a list of bugs I've found within minutes of opening the package. It first asks you to sign in to your gmail account. Type in your username and password. It then tells you you need to sign in on the…

A correlation between load time and usage

We frequently see reports of website usage going up as load time goes down, or vice-versa. It seems logical. Users use a site much more if it's fast, and less if it's slow. However, consider the converse too. Is it possible that a site merely appears to be faster because users are using it more, and therefore have more of it cached? I've seen sites where the server-side cache-hit ratio is much…

Startup Lessons: What should you optimise?

In the early days, when you can't afford hardware, optimise for efficient code. Sometimes this results in unreadable code or a language that not too many developers are familiar with. This is okay. You're trying to reduce the cost of hardware. When you get large enough to hire other developers, the cost of hardware is no longer your largest expense. At this point, optimise for code readability.…

Analyzing Performance Data with Statistics

At LogNormal , we’re all about collecting and making sense of real user performance data. We collect over a billion data points a month, and there’s a lot you can tell about the web and your users if you know what to look at in your data. In this post, I’d like to go over some of the statistical methods we use to make sense of this data. You’d use these methods if you wanted to build your own Real…

iOS, Google WiFi and 2 factor auth -- clearly untested UX

So after WebPerfDays today, a bunch of us ended up at a Pizza place in Mountain View. Naturally the first thing we all did was search for wifi in the area and try to get on to a network from our mobile devices. Now Mountain View has Google Wifi, and it appears as if they now require you to sign in with your Gmail account, and that's where the problem comes in... for me at least. I have two factor…

Password reset over HTTP -- Part 3

It's been a while since my last two posts on the topic. This time it's Groupon. The password reset page is over HTTP: The reset password email that you receive contains a link that looks like this: http://groupon.com/users/password_reset/{token}?utm_source=password_reset \ &utm_medium=email&sid={sid}&user={uid}&date={YYYYmmdd} This link does a 301 to itself and then a 302 to a HTTPS version of…

Saving a PDF that doesn't allow saving form contents

Several organisations, consulates, for example, have forms that need to be filled up in PDFs. They have very smart PDFs that change as you fill out the form and generate nice 2D bar codes at the end with all the information easily scannable when you submit the form. Most of these forms can be saved after you've filled them out, which is important if it's complex and you need to work on it for a…

Password reset over HTTP -- Part 2

So it looks like I've been forgetting a lot of my passwords recently. After yesterday's issue with delicious submitting passwords in the clear , today I have a problem with livemocha.com. As before, their login page is properly secured, but the password reset page is over HTTP: This is the password reset page: And this is the URL the passwords are POSTed to, in clear text: They also include third…