Latest stories

Iterate over set for resource using count and index in Terraform

Even in Terraform 0.12 you cannot use iteration with resources, so you may still have to resort to using count to create multiple resources.
However you cannot iterate over a set (unlike a list) normally because it has no indices. Luckily Terraform will convert sets to lists without modifying the order of items, which allows you to use count and index as you would with a list.

CentOS/RHEL 6 Python PIP error, SyntaxError: invalid syntax {str(c.version) for c in all_candidates}

If you’re attempting to upgrade the version of PIP on CentOS or RHEL 6 from the default 7.1.0 to a newer version, as of April 14th 2018 when PIP 10.0.0 was released you will run into issues since EL6 ships with Python 2.6 as standard. Since you cannot upgrade the default version of Python because it will break in-built tooling such as Yum, you’ll need to version lock PIP when you...

Setup remote interpreter (virtualenv) in VM or container for PyCharm

If you are developing with a virtual machine or container, any modules installed by PIP will either be installed globally or potentially in a virtualenv location outside of the project root. Therefore you will need to tell PyCharm that the imported modules you’re using are located remotely, not locally. First you will need to go into Preferences/Settings and to the Project specific...

Allow connection to PostgreSQL server outside localhost

If PostgreSQL is set to only listen and allow connections from localhost (127.0.0.1) then you can change the configuration to allow other or all IP addresses to connect. First we will need to make sure PostgreSQL is listening for connections outside of local networking in the main configuration, which should be located somewhere such as /etc/postgresql/9.x/main/postgresql.conf (where 9.x is...

How to reset/change expired MySQL 5.6 password in Homestead

MySQL 5.6 introduced password expiration, so the password on your Homestead Virtual Machine may expire at some point. SQLSTATE[HY000] [1862] Your password has expired. To log in you must change it using a client that supports expired passwords. To change this you will need to log into MySQL running on Homestead in order to change your password to fix the expiry vagrant ssh mysql -u homestead ...

No such file or directory for SSH authorized_keys in Homestead Vagrant VM

When configuring your Homestead VM you may encounter an SSH key issue when booting the Homestead Vagrant VM up
/home/vagrant/.ssh/authorized_keys
==> default: : No such file or directory
This can be fixed by nesting your mounted directory a level deeper under /home/vagrant/ as that is where the SSH keys of the box itself are stored and mounting your folders directory there can cause issues

Port forward http 80 and https 443 to 8080 or 8443 for Vagrant on Mac OS X

Assuming you have a Vagrantfile setup to forward port 8080 and/or 8443 to the default http and https ports on the web server running in the Vagrant Virtual Machine guest, you can forward these ports to the normally reserved ports on your Mac OS X host Create a port forwarding rule for both http and https ports that forwards 80 to 8080 and 443 to 8443 on your Mac (thanks to Abe Tobing for his...

MySQL Workbench client with Vagrant MySQL on Virtual Machine

If you prefer to use a client for MySQL such as Workbench, you can connect to the MySQL service in your Vagrant Virtual Machine by using SSH tunnelling. Run “vagrant ssh-config” to get the information you need to configure your client correctly. vagrant ssh-config Host default HostName 127.0.0.1 User vagrant Port 2222 UserKnownHostsFile /dev/null StrictHostKeyChecking no...

Upload Behat screenshot to Imgur on scenario step failure

Being able to save a screenshot from Behat via one of it’s drivers is very useful to find out what went wrong, especially on headless browsers such as PhantomJS. Previously I’ve saved these to the filesystem as per a handy UCSF guide and updated myself for Behat 3. However if you do not have easy access to the filesystem where Behat is being run, such as your Continuous Integration...