Blog

Moving a process running under strace to a screen session

Published: November 10, 2018

Tags:

Today I was in a scenario where I started running a process under strace with the hopes of capturing diagnostic information about an error. However, instead of hitting the error, the process began to run succesfully.

It would likely take at least an hour to complete, and I was nervous that I’d lose my SSH connection, causing the process to wind up failing. I was also nervous that if I stopped the process to restart in a screen session, it wouldn’t be safe to re-run as it would have partially imported some data at that point.

Here, I’ll walk through my findings about moving a process running under strace to a screen session.

cURL error 77 with PHP-FPM after yum update

Published: November 5, 2018

Tags:

Recently a client reported that checkout was broken on their ecommerce website.

After some quick investigation, I found that the application code responsible for speaking with the payment gateway was logging the following error:

CURL Connection error:  (77)

Here, I’ll outline my approach to solving this problem.

Backing up Sublime Text Configuration Files without Shooting Yourself in the Foot

Published: October 29, 2018

Tags:

As a developer, it’s common practice to backup your system settings to a remote git repository. Conventionally, these repositories are given the name “dotfiles”.

I’ve long had such a repository containing a ~/.zshrc file. Recently, however, I decided to backup settings for a few additional tools, including Sublime Text.

CSV Color Highlighting in Sublime Text with rainbow_csv

Published: October 23, 2018

Tags:

If you’re a developer, I’d be willing to wage a bet on the following…

At least for my self, I know these two statements are true.

Magento Gift Card Statuses

Published: October 18, 2018

Tags:

Recently, I fielded a request to generate a detailed gift card usage report.

If you navigate to Marketing > Gift Card Accounts in the admin panel of a Magento 2 site you’ll the following grid…

Screenshot of the gift card accounts grid in the Magento 2 admin panel

While this is helpful, unfortunately it was lacking some information the client desired such as the date the gift card was used.

In the process of looking at this I became interested in the “Status” column that displayed in the grid. It lists four options…

The meaning of these statuses is not exactly clear, nor is it documented anywhere, as far as I can tell. As such, I decided to do a little investigation. Here, I’ll detail my findings…

Profiling jekyll build with ruby‑prof

Published: October 8, 2018

Tags:

As this site has grown, the time it takes for the jekyll build command to complete has continued to increase.

Currently the site has 143 posts and it takes 9.7 seconds for jekyll build to complete with a warm cache on a beefy 2014 MacBook Pro (2.2 GHz Intel Core i7, 16 GB RAM).

Recently I became interested in exploring options for speeding up the build.

Googling “jekyll build profile” lead me to jekyll build’s --profile flag.

The output looks like this:

$ bundle exec jekyll build --profile

Filename                                                                          | Count |    Bytes |  Time
----------------------------------------------------------------------------------+-------+----------+------
_layouts/main.html                                                                |   176 | 4043.23K | 1.282
_posts/2013-12-02-non-sucky-youtube-embed.html                                    |     1 |   14.00K | 0.285
_layouts/blog-single.html                                                         |   145 | 1633.02K | 0.269
sitemap.xml                                                                       |     1 |   20.50K | 0.115
tags/index.html                                                                   |     1 |   74.14K | 0.073
_includes/bio.html                                                                |   146 |  134.56K | 0.071
feed.xml                                                                          |     1 |  115.65K | 0.054
...

I didn’t find this to be particularly useful, as it gave me virtually no information on what jekyll build was actually doing that was taking so long.

Here I’ll show you how to use ruby-prof to get a more useful profile of your jekyll build.