Posts

How to use Boot2Docker on OSX From Behind a Proxy

SSH into the Boot2Docker shell boot2docker ssh Create/edit the profile sudo vi /var/lib/boot2docker/profile Add the proxy environment variables to it (if your proxy doesn't require a password leave out the 'user:pass@'  export https_proxy=http://user:pass@proxy.host.com:port export http_proxy=http://user:pass@proxy.host.com:port save and close the file Restart the docker daemon and exit boot2docker sudo /etc/init.d/docker restart exit

Connect to a running Docker container on CoreOS using nsenter

Image
With version 0.9 , Docker has dropped LXC and moved to using their own libcontainer driver instead. This means that LXC is now optional and lxc-attach is no longer available on the latest CoreOS build. I suppose I could install the LXC driver, etc. but I don't want to. Using 'docker attach' just seems to kill the container and hang. I'm not sure if it's a bug or if I'm doing something wrong. However I did find that this hack works (for now)-  'docker ps' to get the container ID 'docker inspect --format '{{.State.Pid}}'  $CONTAINERID ' to get the PID 'sudo nsenter --target $PID  --mount --uts --ipc --net --pid' drops you into a console on the running container.

WolframAlpha Programming Cloud

Image
WolframAlpha released it's programming cloud last month. Here are my attempts at playing with it. You can list the largest cities in any country, for example, by issuing the following command - CityData[Large, "India" ] Which by itself isn't particularly useful, but the CityData also contains geoLocation data so you can then map the largest cities on a country Shape by using the Graphics command - Graphics[{Gray, CountryData["India", "Polygon"], PointSize[Large], Red, Tooltip[Point[Reverse[CityData[#,"Coordinates"]]],CityData[#,"Name"]] &/@CityData[{Large,"India"}]}] In the example above, I've imported the India Shapefile using the CountryData directive, colored it Gray, applied large red dots to indicate the large cities within the map and used the Tooltip directive to pop-up city names on mouse-over. Then I went one better and applied population densities to the dots using -  Graphics[{Gr