Skip to content

Posts

Vendoring Qt.py

How do you know a user doesn't have the wrong version of Qt.py when running your application?
– Simple, you bundle Qt.py with your application. Here's a short write-up on how you could go about doing just that.

Docker cleanup

Quick and easy way to remove all containers (and their volumes) as well as all images:

# Remove containers and their volumes
docker stop $(docker ps -a -q)
docker rm -v $(docker ps -a -q)

# Remove images
docker rmi -f $(docker images -q)

# Remove unused images
docker system prune --all

Combine filters, 'xargs etc:

# Stop all containers of a certain name
docker stop $(docker ps -q --filter name=mycontainer)

# Run containers based on folder/file names (use '%' where you want to insert the value corresponding to the file/folder name)
touch c1 c2 c3
ls | xargs -I % docker run --rm --name % hello-world:latest

Bash on Ubuntu on Windows

This is a quick intro to – and some personal notes on working with – Bash in Windows 10 (Anniversary Update or Insider build requred). This will be updated on a sporadic basis.

A treasure trove of learning Python videos

Here's a fantastic resource for anyone who wish they could learn from a Python professional rather than reading a book: Corey Schafer's Python Tutorials

Among Cory's other playlists there are playlists covering how to set up a Python developer environment, object oriented programming with Python and general programming terms which also apply to Python.

All in all, a fantastic starting point for anyone wanting to get into Python as well as wrapping your head around certain concepts which take you from beginner to intermediate Python developer.

Testing and sandboxing with Docker

A quick way to enter an interactive docker container:

docker run --rm --interactive --tty -v /localfolder:/containerfolder centos:7

On Windows, use forward slashes for the directory mapping.

For a more complex setup, have a look at sandbox-docker.