Full-stack web applications developer

Welcome to my blog

As I discover new things in my field and solve troublesome problems, I will attempt to document my finds here.

cannot run C compiled programs

On February 23, 2019, by Arthur Pemberton, 0 Comments

Are you trying pip install pycrpto or otherwise trying to configure an application and you run into the following errors?

checking whether we are cross compiling‚Ķ configure: error: in `/tmp/pip-install-2eizv0ma/pycrypto’:

configure: error: cannot run C compiled programs.

You may run into an issue that originates from improved security practices, and your only hint is in the first line of the error: “/tmp/pip-install-2eizv0ma/pycrypto”

Run the following: mount | grep tmp

If you see the option noexce in the mount point for your “/tmp” path, then that’s the issue — no execution of any file residing on that partition is allowed.

In my case, I was trying to install a Python package via pip which required some compilation of C code, so I was able get around the issue by set the TMPDIR environment variable:

TMPDIR=/path/to/alternate/tmp pip install pycrypto

Full page screenshots with Python and Selenium

On December 18, 2017, by Arthur Pemberton, 6 Comments

Currently, none of the major Selenium drivers (browsers) support the ability to easily take a screenshot of an entire web page. The following function takes multiple screenshots through the viewport and scrolls between screenshots, then stitches the resulting images into a single PNG.

Read More

Calling openssl genrsa from Python

On September 28, 2017, by Arthur Pemberton, 0 Comments

I have been writing some automation code a few dozen websites, and I wanted to generate SSL keys, and I couldn’t get the `subprocess` call to work properly, so I thought I would post the final solution. The argument to `communicate()` is critical.
Read More