Category Archives: Open Source

Installing NumPy and SciPy on Mac OSX 10.8 (Mountain Lion)

I am playing with ExpEyes, which is awesome tool for anyone who wants to learn electronics (and physics).

ExpEyes comes with software (written in python) for GNU/Linux and Windows. I intend to run it on Mac OSX, because it can (provided all dependencies are met).

It is generally easy to install python packages on OSX using easy_install or pip, however, installing NumPy and SciPy turned out to be pain on OSX (10.8.2, latest version the time of posting).

In my case, I am using python binary installed via homebrew, so I can’t take advantage of numpy (which comes installed with mountain-lion).

I have XCode 6 installed, which comes with gcc-4.2.1 (llvm build). I figured out, I can build numpy and scipy from source.

Following is what I did to build numpy and scipy. SciPy requires gfortran, so that has to be installed (I used homebrew to do that):

$ git clone https://github.com/numpy/numpy.git
$ git clone https://github.com/scipy/scipy.git
$ cd numpy
$ python setup.py build && python setup.py install
$ brew install gfortran
$ cd ../scipy
$ python setup.py build && python setup.py install

BTW! In case, you are wondering, why didn’t I use Scipy Superpack script, which indeed makes job easier?

I didn’t, because I want to install gnu/unix packages using homebrew, and I already have git and other things. Super Spicypack downloads (gfortran, etc.), builds and installs packages directly to system, making it harder to remove those later? Homebrew makes job easier.

Mac OSX (10.8) Mountain Lion: Fixing Apache, PHP, Subversion, User Sites, Virtual Hosts Directories

While Mountain Lion (OSX 10.8) has brought many enhancements and fixes (mostly performance), it has also caused frustration to old users.

You might have noticed following issues in Mountain Lion:

  1. Web Sharing Preferences Panel has been removed, i.e. you need to launch apache manually or write some launch-agent script or hack to bring web-sharing preferences panel back
  2. User Sites (per-user web directories) is disabled, i.e. http://localhost/~username doesn’t work by default, and you need to modify apache config file to enable it
  3. PHP extension for Apache is disabled by default i.e. you need to enable it by modified apache config (httpd.conf)
  4. Subversion is not installed by default, either you can install using homebrew or by install XCode command line tools

You can fix these issues (1-4) by following these two links:

Whenever I upgrade to newer version of OSX, I end up with broken development-setup i.e. custom permissions on directories are messed up, configuration files are overwritten/removed, etc.

I think, I have found a way to keep default directory permissions, so future upgrades don’t break things.

My development setup requires my virtual hosts to use directories within my home-directory (and outside of ~/Sites or /Library/WebServer/Documents directories).

I am using following technique to setup my virtual-hosts:

  • Enable User Sites  (i.e. fix #2 problem above)
  • Create symbolic-links(symlinks) of your project folder(s) inside ~/Sites directory
  • Enable FollowSymLinks and SymLinksIfOwnerMatch options in virtual-host configuration.

In my case, I have a project inside ~/projects/myproject . I create a symlink of this directory inside ~/Sites, like this using Terminal (command-prompt)

$ ln -s ~/projects/myproject ~/Sites/myproject

I have following virtual-host configuration for this project:

<VirtualHost *:80>
 DocumentRoot "/Users/myusername/Sites/myproject/trunk/web"
 ServerName  myproject
 ServerAdmin myusername@localhost
 Options Indexes MultiViews Includes +FollowSymlinks +SymLinksIfOwnerMatch
 CustomLog "/private/var/log/apache2/myproject_access.log" common
 ErrorLog "/private/var/log/apache2/myproject_error.log"
</VirtualHost>

I use it on my development machine (i.e. my laptop), so I don’t really bother about security at Apache level, and I take care of security at firewall/other levels.

If you are going to use above technique/configuration, please understand everything (by reading documentation) before you use it.

This set up works for me and solves some problems for me – I don’t have to change default directory permissions, and I don’t have to keep my projects within ~/Sites or /Library/WebServer/Documents directory.

RIP, Kenneth Gonsalves “KG” (1953 — 2012)

Kenneth Gonsalves(Image Courtesy: Linux Bangalore (foss.in))

Kenneth Gonsalves, a champion in Indian (NRC)FOSS, Python and Django community passed away on August 3, 2012. Kenneth’s presence would be hugely missed in the community.

In 2008, Tarun Dua introduced me to Kenneth. I interacted with him at various occasions about NRCFOSS and general stuff. I was very inspired to see his contributions, specially some of his open-source projects.

While checking out NRCFOSS website today, I came to know about this sad news.

May his soul rest in peace.

Installing Riak on Mac OSX

I am evaluating various nosql solutions for our existing/new projects. Bluesmoon recommended about Riak which is an awesome nosql datastore/database (and lot more).  I couldn’t wait to check it out.

As usual, I relied on Homebrew – the best package manage for OSX – to install applications/libraries. While installing, I got an error:

$ brew install riak
$ ...
$ Error: Failed executing: make all rel

After searching for a while, I figured out that there are known issues. With the help of Adam‘s comment on github, I was able to install Riak finally.

We make brew ignore Riak’s dependencies while building it.

Following commands should build and install Riak:

$ brew update
$ brew install erlang
$ brew install --HEAD --ignore-dependencies riak -v

Thoughts: Open Standards and Technology for Movie Rental Business

I have been thinking about open-standards for movie-rental business. I searched to find about such standards but I couldn’t locate. Do you know of any?

Basically, a set of specifications/protocols which can be implemented by different players in movie-rental chain. Players include studios, distributor, application-developers, portals, et. al.

Rough thoughts:

  • A studio/distributor implements this specification/protocol and exposes API  for metadata/streaming(or playback)/file-access from their own server
  • Third party developers use the API to to pull metadata and play the content
  • Third party developers can charge the user and split the revenue with content owner
  • Or, studios/distributors can enable payment-gatway APIs as part of their offering
  • Content is always played directly from studio/distributor’s server
  • Studio/distributor have total control over their assets and also charge based on subscription/per-access
This would solve many problems (billing, stats, etc.), however, there would be concerns:
  • someone (end-user, third-party developer) might try to cache/save streams as file and distribute
  • and other concerns?
Once we have specifications and protocols in place – a stack using open-source technologies can be built as template, and made available so that everyone in chain can use/customize it to build their part.
I wanted to talk about it on twitter but 140 chars were too short to express my thoughts. Anyway, it’s good to have a blog post in place.
Please share your views.

Development Setup – Updated

I posted about our proposed development setup, during these years a few things have changed a bit. More or less, this is what we have:

  • GNU/Linux (Ubuntu) and Windows(some) boxes for developers
  • Eclipse (PDT) IDE with loads some plugins
  • Version Control: Subversion, GIT, GIT-SVN
  • Browsers
    • Firefox
    • Chrome
    • Opera
    • Safari
    • OperaMini (Simulator)
    • FirefoxMobile (Simulator)
  • Plugins for browsers:
    • Firebug (with loads of plugins – YSlow, etc.)
    • Web Developers Tools (firefox)
    • Others (developer’s preference)
  • Developers also use WINE to run some windows software on GNU/Linux

Testing:

  • Windows Box with different browsers (versions, vendors)
  • Windows Box with different Mobile Emulators/Simulators
  • Selenium Plugin for Firefox

Development Servers/Applications:

  • Apache HTTPD
  • Mysql Server
  • Trac
  • MediaWiki
  • PHPMyAdmin
  • ReviewBoard (limited usage)
  • Hudson (limited usage)

Virtualization with VMware vSphere (ESXi) Hypervisor

One of our servers, collocated in our office, crashed couple of weeks back. We took this opportunity to virtualize most of the stuff, earlier only some intances were virtualized.

Installing and setting up VMware vSphere Hypervisor is a straight forward process, even the process of creating virtual-machines.

Most of time, I spent was figuring out:

  • Storage devices and configuration
  • How many virtual machines, do we need?
  • Which operating systems, do we need?
  • Network configuration

I am not going to cover details of installation and network configuration. I might write more posts in future to cover specifics. Meanwhile, I would love to answer the comments, if I know or share anything I know.

Anyway, this is what we have now:

  • IBM x3250 M2
    • Intel Xeon (Quadcore) x64
    • 4 GB memory
    • 3TB+ storage connected to LSI RAID and SATA controller
  • Host: VMware vSphere Hypervisor – which runs out of  1.5 TB datastore, directly connected to SATA controller (different from LSI)
  • Guest VMs:
    • OpenVPN Access Server for VPN
    • Ubuntu 10.10 Server as Development sandbox
    • Zentyal(eBox) as Internet Gateway (filtering, IDs, proxy)
    • Ubuntu 10.04 LTS Server for SVN, Mails, Local Staging WebServer
    • Windows 2008 Server for ActiveDirectory, FileServer, Windows-Specific-Software (access-control-management-gui, etc.)
    • Others: Project Specific VMs

We are very happy with the improved performance and stability, and the way hardware is properly used. Thanks to VM templates, clones and snapshots, we would be able to provision above infrastructure with minimal downtime.

I would soon replace Windows Server with Zentyal (eBox), which I believe, can handle most of things. However, we would need another Windows XP box to run some software (proprietary), which only runs on windows, to manage various other devices (EPBX, Access-Control-System, etc.).

We now have relatively more scalable infrastructure, more virtual machines can be created to take care of email-server, svn-server, etc.

We are yet to invest in a sophisticated storage device such as DAS or NAS or SAN, hence we are relying on some cheap tricks here:

  • 1.5 TB disk as datastore for VMware vSphere, which stores
    • Guest Operating System VMs
    • Guest Operating System VMs Paging files
    • Virtual Disks (non critical data – programs and configs) required by host virtual-machines
  • 1.5 TB disk via Raw Device Mapping (RDM) shared among virtual machines
  • 500 GB disk via Raw Device Mapping (RDM) shared among virtual machines
  • 1.5 TB USB/Firewire – Backup storage
    • Rsync is used to backup critical data and configs from all virtual machines on daily, weekly and monthly basis.

Things I didn’t like:

  • VMware vSphere client requires Microsoft Windows
  • VMware vSphere client doesn’t allow creating RDMs from GUI, one has to use these instructions

Finally, I could execute some of things I planned more than two years back.

CalDAV and SyncML Resources

One of our projects requires a calendar application with bi-directional synchronization with any other calendar applications/services such as Microsoft Outlook, Mozilla Thunderbird, Google Calendar, Yahoo! Calendar, iPhone, Nokia or others.

We can export iCalendar file, that would be readonly i.e. client applications can not write back to source calendar

I started looking at CalDAV, which is an extension to WebDAV, and SyncML, which is gaining traction because most of the mobile devices use it for synchronization of data. I yet to find where CalDAV fits when it comes to mobile devices.

I found out some interesting links, which I am still going through. I thought, it would be nice to share these links:

Agilo: Scrum plugin for Trac

We use Trac as project collaboration space[1] within our company. We have been trying out agile-methodology (specially Scrum) for projects, but recently we went more formal with the approach using a software to manage the whole process.

I evaluated some software for agile project management and found good ones including ThoughtWorksMingle, but it’s not open-source and I believe, we can’t afford it (licensing, subscription).

We found ‘Agilo‘, a plugin for Trac, is easy to setup and was intuitive enough to get us started, considering our (no) experience with formal agile-methodology.

Do you want to get started with Scrum and don’t want to invest time learning a complicated software? You don’t need a software to do Scrum. However, if you like managing projects using a software and you are comfortable with Trac, try Agilo.

You might want to check Scrum in five minutes [PDF]

BTW! This is yet another post to spread the word about the software and tools, we find useful and have been using.

[1] project management, bug tracking, documentation, wiki and version-control browser

DeltaCopy: Backup software utility for windows

We have one Windows server, which is there for many reasons. Taking backup on windows can be pain, one has to rely on third-party software. We use DeltaCopy, which relies on rsync (an awesome piece of open-source software), statically linked Cygwin libraries/binaries.

It is easy to setup and doesn’t conflict with any existing Cygwin installation.

DeltaCopy has saved us from many disasters(disk failure, etc.), some of those happened during last one month. Had we not taken daily, weekly and monthly backup snapshots, we would have lost months of work.

Thanks to DeltaCopy and developers/company/community behind it. This post is my way of thanking them, by spreading some words.

Using DeltaCopy is very intuitive, however, feel free to leave comments, if you need any help setting it up.

Ideas: FlashDevelop on OSX and GNU/Linux

FlashDevelop is an open-source IDE for Flash Platform development (ActionScript, MXML, HAXE, etc.) on Windows platform. I have extensively used it in past, and still, painfully, use it via windows virtual-machine on OSX host.

Couple of years back, I looked at FlashDevelop code to figure out, if we can port it for other operating-systems, such as Mac OSX and GNU/Linux.

I posted on Flash Develop forum about my experiments:

I have been trying to run FlashDevelop under OSX. In last couple of years, whenever I got sometime, I tried these:-

  1. Run FlashDeveloper with DotGNU: FlashDevelop was running but due to a lot of native (Win32) API calls, lots of components were failing (screenshot: http://pic.im/5Xk)
  2. Run Flash Developer with Mono: I tried to compile FlashDevelop using MonoDevelop and run using Mono for OSX. Most of the problems is one component/library i.e. DockPanelSuite (http://sourceforge.net/projects/dockpanelsuite/), an opensource code that uses a lot of PInvoke calls (Win32 API).

I am really excited about the possibilities, if we can port this one library we can get very closer to run FlashDevelop on OSX using Mono.

Note: pics.im seems to be dead, so I have uploaded new screen-shots
Flash Develop on OSX - ScreenshotFlash Develop on OSX

Some Ideas:

MonoDevelop is good enough and works well on OSX, I guess also GNU/Linux. However, I am yet to look at licensing and possibilities of forking the project (MonoDevelop)?

BTW! I have been lazy to write about such experiments on the blog, but while commenting on Jesse Warden’s post, I thought, it makes sense to post it here, so it lives.

Please let me know, if you have any ideas about making this happen? I would be happy to collaborate, contribute and donate in whatever capacity I can.

Eclipse Plugins

Some Eclipse plugins, I use (with Eclipse Classic SDK), are:

There are bunch of plugins for network monitoring and debugging, don’t remember their names. BTW! I have got two separate installations (32bit Carbon and 64bit Cocoa) of Eclipse. I hope, Adobe would port Flex/Flash Builder to work with 64bit and Cocoa.

Beautiful Plogger

Plogger is an open-source photo gallery system built using PHP. It successfully maintains the simplicity while providing so many features, it’s just beautiful piece of work.

Withing five minutes, I got Plogger running on my machine. In another hour, I created a new theme with different visualization (CoverFlow) to display thumbnails.

Having worked many different photo gallery management software/scripts, I find, Plogger is the most beautiful. I might be ignorant about other better systems, please share if you know.

I bet, web designers would find it very handy because they can easily customize and deliver solutions without dealing with complex programming required behind file upload/management.

Open Source Media Framework (OSMF)

A few days back, Adobe announced Open Source Media Framework (OSMF), which was known as Strobe earlier.

A few minutes back, I received an email confirming that Open Source Media Framework website is up with all the information, specification, developer-documentation, source (Subversion repository), downloads (binary and source) and bug-database.

Open Source Media Framework (OSMF) has an interesting list of features and goals. I like it’s plug-in architecture, that would allow a lot of extensibility and various amazing plug-ins from different providers in coming time.

If you are a developer spending a lot of time developing various work-flows around online media-players (audio, video, images – players), I strongly recommend you to check out Open Source Media Framework (OSMF). I am sure, you would find it worth start using it and also contribute back whatever you can.

Following are the reasons, I am going to use OSMF and give up my existing frameworks:

  • It’s open-source
  • It would solve core issues (video playback, delivery and workarounds for various limitations in Flash Player, etc)
  • It would adopt various standards (playback, cdn, advertising, etc)
  • Larger developer base, that means bug fixes and various features would be available very often
  • I love open-source and see myself contributing to OSMF in future, beyond my current projects.

OpenFiler – an opensource NAS

We wanted to have a scalable storage system. So I went ahead and checked out the cost of buying NAS from various vendors (NetApp, Dell, etc). I figured out, it was going out our of budget. Then I started learning, what it takes to build a NAS for a small teams like ours.

I started evaluating various FOSS NAS options for our office. I checked out FreeNAS and OpenFiler, finally decided on OpenFiler.
I chose OpenFiler for simple reasons – stability and production-quality. Whereas, FreeNAS has a lot more features, than OpenFiler, but doesn’t look that stable. Perhaps, in future I might go for FreeNAS for it’s various cool features (UPNP, iTunes streaming, etc).

We are using an old server based on Intel’s Server Entry Board, Pentium 4 processor, one Gigabyte memory, one IDE drive and two SATA drives. Both SATA drives are under RAID 1 configuration using OpenFiler’s software RAID. I am planning to get RAID controller card so we can use more disks.
OpenFiler boots from USB flash-drive, to make this happen it took some extra effort, Thanks to h@nnes. FreeNAS provides images for flash-devices, so it’s lot easier to boot FreeNAS from USB flash-device. BTW! Booting OpenFiler or FreeNAS from USB flash-drive would save one IDE/SATA port on motherboard, which can be used to plug-in another harddrive for better purpose (not for booting small NAS OS).

Anyway, we are using Intel NAS Performance Toolkit to benchmark our NAS server. We are also doing a lot of tests (semi)manually. The idea is to cover all cases and also come up with disaster recovery strategy.
I would post more details on our findings/benchmark-tests, so it helps you, if you plan to go for it.

Technorati tags: , ,