Skip to content

Posts

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.

Dealing with Maya 2017 and PySide2

Maya 2017 was released today and with it comes a big change; PySide (and PyQt4) no longer works with Maya.

This guide explains how to deal with that and make your Python and PySide/PyQt scripts compatible with Maya 2017 as well as older Maya versions.

This guide is also applicable to e.g. Nuke or any other Python-enabled DCC app which uses Qt.

Installing Qt.py (advanced methods)

Qt.py can be installed in many ways, depending on your needs. This post aims to outline some common approaches:

  • Install using pip
  • Install into an application's custom Python build
  • Vendoring
  • Make Qt.py available using sys.path and site.addsitedir