Skip to main content

Posts

Showing posts from February, 2016

Seneca - On the Shortness of Life

It is not that we have a short time to live, but that we waste a lot of it. Life is long if you know how to use it. It is a small part of life we really live [...] all the rest is not life but merely time. People are frugal in guarding their personal property; but as soon as it comes to squandering time they are most wasteful of the one thing in which it is right to be stingy. For suppose you should think that a man had had a long voyage who had been caught in a raging storm as he left harbour, and carried hither and thither and driven round and round in a circle by the rage of opposing winds? He did not have a long voyage, just a long tossing about. Putting things off is the biggest waste of life: it snatches away each day as it comes, and denies us the present by promising the future. [...] You are arranging what lies in Fortune's control, and abandoning what lies in yours. [...] The whole future lies in uncertainty: live immediately. Life&#

Testing Scalding type-safe API

I recently read Applying TDD to Scalding Development . The content of the article is interesting and still relevant but the example is implemented with the old Fields based API . Following is an updated version of the code using Scalding's type-safe API :

Accessing a Docker container running in a Docker-Machine on localhost

On Linux you can access your running Docker container on localhost or remotely by publishing the desired port. On macOS it will only give you access to the Docker container from the Docker-Machine it is running on, i.e. from docker-machine ip <machine_name> . To access it on localhost, you can use ssh port forwarding: docker-machine ssh <machine_name> -fNTL <local_port> :localhost:<machine_port> You can now access your Docker container on localhost:<local_port> . Bonus: Accessing your Docker container from a remote computer. By default, with ssh -L , the local port is bound for local use only. You can use the bind _address option to make your Docker container available publicly: docker-machine ssh <machine_name> -fNTL \*:<local_port>:<localhost>:<machine_port> You can now access your Docker container on <your_ip>:<local_port> .