Getting the slug name for Digital Ocean’s images with doctl

Email this to someoneShare on Google+Share on FacebookTweet about this on TwitterShare on LinkedIn

Problem

You would like to get a list of the available images in Digital Ocean, in order to be able to use them in creating your Terraform IAC script.

Solution

By installing the command line tool doctl, (instructions here), according to the documentation (after authenticating) you can run:

But the available images are not listed. In order to be list all the images you have to add the –public option (as described here) :

Stopping a blocking query in postgresql

Email this to someoneShare on Google+Share on FacebookTweet about this on TwitterShare on LinkedIn

Problem

You run a query in PostgreSQL that takes a lot of time to finish (maybe because of an error) and you want to stop/kill it as it is blocking other queries in db.

Solution

You will need to find the pid for the query, either by using a GUI program like Pgadmin or by issuing the following to an SQL prompt:

make a note of the pid of the query that you want to stop/kill and issue the following:

Some useful docker commands

Email this to someoneShare on Google+Share on FacebookTweet about this on TwitterShare on LinkedIn

Having started to use docker recently, some of the commands that are needed are a bit difficult to remember. I’m sure that this will change the more that I use it, but as a quick reminder/look up for this initial phase, I’m just going to list some of them here.

List current images:

List currrent running containers:

Saving the state of a container by using the id from above command:

Starting a container with port forwarding:

Sharing a directory from the host system (/home/user/Prog) inside the container (Prog):