Thursday, January 29, 2015

Getting Docker to work on OS X

Chris Jones has an excellent resource on getting started with Docker on MAC OS X. You can access it here:
http://viget.com/extend/how-to-use-docker-on-os-x-the-missing-guide

My only deviation in the above guide is to install boot2docker from here:
https://github.com/boot2docker/osx-installer/releases

Everything else should work fine for you.

Accessing insecure private repos:

I have had some issues accessing insecure docker registries. The error is usually something like this:
laptop-rmenezes:$ docker push dockerregistry.dynprod.roger-menezes.net:7001/minions_ubuntubase-x86_64-20140910-ebs

2014/11/07 16:06:17 Error: Invalid registry endpoint https://dockerregistry.dynprod.roger-menezes.net:7001/v1/: Get https://dockerregistry.dynprod.roger-menezes.net:7001/v1/_ping: tls: oversized record received with length 20527. If this private registry supports only HTTP or HTTPS with an unknown CA certificate, please add `--insecure-registry dockerregistry.dynprod.roger-menezes.net:7001` to the daemon's arguments. In the case of HTTPS, if you have access to the registry's CA certificate, no need for the flag; simply place the CA certificate at /etc/docker/certs.d/dockerregistry.dynprod.roger-menezes.net:7001/ca.crt

The fix over there is change the following file inside the boot2docker vm:
/var/lib/boot2docker/profile

boot2docker ssh
sudo vi /var/lib/boot2docker/profile

You need to add the following line to this fine:
EXTRA_ARGS="  --insecure-registry dockerregistry.eu-west-1.dyntest.roger-menezes.net:7001 --insecure-registry dockerregistry.dynprod.roger-menezes.net:7001  "

The above is an example that you can add multiple registries the above format.

Then you just need to do:
boot2docker up
boot2docker down

=============

Running a Docker command:
sudo docker run -v /mnt/data:/data -e "ENVIRONMENT=prod" -m 39g  d34ca1989ab7 /apps/python/bin/JobRunner.py  --config params.email=rmenezes@chakde.com

-v is used to mount a Machine directory onto a docker directory.
-e is used to pass environment variables.
-m tells how much memory to use
d34ca1989ab7 is the image id
the rest is the command





Thursday, October 16, 2014

Scala Http Client

I have started using scalaj for writing REST client side calls in Scala. The Clever Cloud team has a convenient tool to generate Scala case classes from json.

Monday, July 14, 2014

Alternative for Fiddler on Mac OS


I miss Fiddler2 very much on Mac OS but there is a decent alternative to it. Open up Chrome and type:
chrome://net-internals in the address bar. Go to Events in the drop down box.

Thursday, September 26, 2013

No Visio on Macs :-(

Started working on Macs recently and got to know that there's no Visio on Mac :-(. Visio is my favorite tool for all things drawn - UML diagrams, architecture diagrams, everything. The flexibility and the breath of what's possible in Visio is enormous. I stumbled for sometime to realize a block diagram in Skitch but then finally gave up. OmniGraffle is a good alternative. Still a learning curve but very close to Visio.

Friday, August 16, 2013

Signing PDF docs using Adobe Reader


Adobe Reader now provides a way to place your handwritten signature on PDF docs. This has saved me a ton of time (avoind the following workflow....print doc => sign => scan)
  1. Create a signature using Penultimate iPad app.
  2. Save it as a photo and email it to you.
  3. Open PDF in Adobe Reader X
  4. Click on the Signature icon...This opens up a tab on the right side
  5. Click on Place Signature - this will give you the option of either scribbling a signature or opening an image
  6. Import your Penultimate Signature....
  7. Now place your signature wherever you want in the document.

Wednesday, June 26, 2013

Friday, June 14, 2013

Sending books to your Kindle

Found this article that introduced me to the SendToKindle desktop app from Amazon. This is the effective way of having your non Amazon books synced to your Kindle cloud account, so that all of your devices can have them, rather than side loading them. There are versions for PC and Mac.

Additionally, you can use Calibre to convert PDF docs to .mobi before sending them to your Kindle account.