Permanently show hidden folders in MacOS

Even when I copied an old filesystem, the Library directories were hidden in the finder. To show them, use:

chflags nohidden ./Library

Find Mac Library prefs files

Recently got a new laptop and needed to copy some prefs and config files over. Command to search for the files:

find ./Library -name '*searchterm*'

You can then pipe this to copy script or similar.

I’ve also used rsync in the past but filtering with just rsync is a bit tricky.

Docker Compose LAMP demo project

Project showing a basic LAMP set-up using a networked multi-container configuration.


version: '2'
     image: phpmyadmin/phpmyadmin
       - mysql:db
       - mysql

    image: k0st/alpine-mariadb
      - ./data/mysql:/var/lib/mysql
      - MYSQL_DATABASE=mydb
      - MYSQL_USER=myuser
      - MYSQL_PASSWORD=mypass 

    image: nginx:stable-alpine
      - "81:80"
      - ./nginx/log:/var/log/nginx
      - ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
      - ./nginx/files:/var/www/nginx:ro
      - php


worker_processes  1;
events {
  worker_connections  1024;
http {
  sendfile  off;
  server {
    listen 80;
    location / {
      proxy_pass  http://php;
      proxy_set_header Host $host;
      proxy_redirect     off;

The nginx config is simplified but that should work for testing — basically all it’s doing is proxying the php app. Maps to port 81 to avoid conflicts on the host. (Note this is just a rough demo, would need to be fleshed out for any use more than that.)

Regarding linking, you can see that if you run: docker-compose exec mysql ping -c2 nginx to ping from the mysql container to the nginx container, you will succeed even though there are no links specified between these containers. Docker Compose will maintain those links in the default network for you.

If you like, you can fetch a working version from this repo and run docker-compose up, and (assuming you don’t have anything running on port 81) see results on http://localhost:81/ (or whatever your corresponding hostname/IP is).

For more info on Docker Compose networking see:

By default Compose sets up a single network for your app. Each container for a service joins the default network and is both reachable by other containers on that network, and discoverable by them at a hostname identical to the container name.

Links allow you to define extra aliases by which a service is reachable from another service. They are not required to enable services to communicate Рby default, any service can reach any other service at that service’s name.

Docker remove only exited containers

To remove just the containers that have exited as opposed to all (ps -aq) you can do:

docker rm $(docker ps -a | grep Exit | cut -d ' ' -f 1)

Connect to Docker for Mac Alpine Host

The new Docker for Mac (mid-2016) doesn’t work the same way as previous versions or the native linux version. To interact with the Docker Host VM, instead of SSH, you can use:

screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty

and login with root user. No password should be required.

You can also get networking, etc info about the host by querying a container host-networked like so:

docker run --rm --privileged --net=host alpine ifconfig

Install MariaDB via Yum, Apt, etc.

To get the latest MariaDB for your distribution (Yum, Apt, etc.), use:

It will generate a config entry like:

name = MariaDB
baseurl =

which you can install by saving to /etc/yum.repos.d/mariadb.repo and run: yum install MariaDB-server MariaDB-client

« Previous Entries