Wednesday, November 30, 2016

SSH Keys in Docker (via Habitus)

Using Private SSH Keys in a Docker image (using Habitus)

Habitus is a standalone build flow tool for Docker. Among other things it allows to securely share your shh keys to your docker imagas via a temporary web server. You can find more details in this blog post

Here I share some of the issues I run into when using the tool:

  • Intallation:

When you go to the downloads, the downloaded file seems to be a text file …. It’s actually an excutable, but you need to change it’s permissions and make it available system-wide (or I suppose you could also copy it into every project)

mv ~/Downloads/habitus_darwin_amd64-2 /usr/local/bin/habitus
cd /usr/local/bin/
chmod +x habitus
  • Issues related to Docker for Mac(native)

The latest version of Habitus supports Docker for Mac but you need to use a Linux socket to connect with no TLS. This is documented in this issue and not anywhere in the documentation

Additionally, the host needs to be set to you active private ip (any enX)

ipconfig getifaddr en0

After verifying your ip, you can invoke habitus as follows

sudo habitus --build host=$(ipconfig getifaddr en0) --host unix:///var/run/docker.sock --binding=

How to use your secrets within your Dockerfile is given in this example

Finally - the tar that comes with mac won’t work, so you’ll need to get the gnu version

brew install gnu-tar

Thursday, May 21, 2015

Getting py2app working in Yosemite

So things did not work out of the box form me. The first trouble was when importing cv2 (opencv) libraries. For me I was able to get past this problem using hombrews python instead of the Mac's built-in version. 

Then I run into two other errors, 

  • File "/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/macholib-1.6-py2.7.egg/macholib/",  line 49, in locate loader=loader.filename) TypeError: dyld_find() got an unexpected keyword argument 'loader'

The problem was with macholib back to the definition of dyld_find() in
def dyld_find(name, executable_path=None, env=None, loader_path=None):

          Changing line 49 in macOGraph from loader=loader.filename) to loader_path=loader.filename) fixed the problem

  • "ValueError: New Mach-O header is too large to relocate in…" Recompiling pygtk did the trick:
    brew install pygtk -headerpad_max_install_names

Evernote helps you remember everything and get organized effortlessly. Download Evernote.

Wednesday, January 1, 2014

3-d Reconstruction Resources

When getting 3-d out of your multi-view imagery, there is some great open source tools that will provide a great starting point.

Monday, January 7, 2013

Figure Settings Matplotlib

From Evernote:

Figure Settings Matplotlib

In Lion, all figure settings live inside

You can modify such file, however it will be overwritten on the next python update. 
Instead to have your user-defined changes in a save place, write your changes to this location

Friday, December 7, 2012

Permanently add path to python Mac Os

From Evernote:

Permanently add path to python Mac Os

We could add the PYTHONPATH variable to our .profile file in our home directory. 
An alternative is to create a user.pth file inside /Library/Python/2.7/site-packages, where python automatically looks inside all .pth files and adds the to the systems PATH

Monday, April 2, 2012

Installing Modules In Python

From Evernote:

Installing Modules In Python

A miscellaneous command that I always seem to forget….An easy way to install modules in Python is through pip

easy_install pip  (if not installed already)
pip install numpy
pip install matplotlib

Tuesday, April 12, 2011

Adding new file type to Xcode

This will help you get color syntax on .txx files:

Create a file
/Users/isa/Library/Application Support/Apple/Developer Tools/Specifications/TXX.pbfilespec
/Library/Application Support/Apple/Developer Tools/Specifications/TXX.pbfilespec

containing the following

            Identifier = sourcecode.cpp.tpp;
            BasedOn = sourcecode.cpp.cpp;
            Extensions = (txx);
            ComputerLanguage = c;
            AppliesToBuildRules = yes;
            IncludeInIndex = NO;
            CanSetIncludeInIndex = NO;

You may need to re-add sources or regenerate project file