Categories
Python

Installing IPython Notebook on OS X

If you do not know what is IPython Notebook, please checkout the link here – http://ipython.org/notebook.html. IPython is an awesome tool that allows you to combine Python codes with rich text to create meaningful & interactive contents.

Here’s a quick demonstration:

In this post, I am going to share what I did to setup IPython Notebook on my OS X. These are the commands I used. Homebrew was used to install libraries/dependencies. Pip was used to install Python packages.

If you use the same commands and everything works fine, you will have a working installation of IPython Notebook. You can launch the notebook web server using the following command:

This will launch the server and open your default web browser 🙂 Please note that the notebook will use your current directory as the root while displaying the files and directories. I created a dedicated directory inside my Google Drive to store my notebooks. So I created an alias for always starting the notebook server pointed to that directory. I put this in my .zshrc:

Now from any place, I can issue this command to run the server:

I am currently playing with both IPython and the IPython Notebook. Both are awesome 🙂

Categories
Javascript Personal

Tessel: Review

Tessel is a micro controller that runs JavaScript. It is NodeJS compatible – that means you can take advantages of npm and all the NodeJS awesomeness with it. The key attraction for me was the built in Wifi, makes it very easy to connect to the internet. Tessel has a good collection of modules which you can connect to the board to extend it’s functionality. The modules are listed here: https://tessel.io/modules. Each module has a dedicated npm package. You just have to install the package and require it to interact with the module. Cool, no?

I ordered a Tessel from their website on June 14. I got the board at hand today, July 20. They shipped via DHL global mail.

Here’s the tessel main board:
Tessel Main Board

I also purchased a GPRS module to interact with mobile networks. Here’s a photo of the module connected to the main board:
Tessel with GPRS Module

Setting It Up

Setting up was easy. I already has NodeJS installed. I installed the tessel command line tool.

After tessel is installed, I tried listing the devices:

Then I copied the example blinking codes and tried them out. All worked fine. So my tessel was working! Then I tried listing the available wifi networks:

I connected to my home wifi:

It connected to the Wifi just like that! Awesome!

Then I tested out the instructions on the “Tweet” section which uses the recently connected WiFi to send out a tweet.

The WiFi is working excellent!

The GPRS Module

Now I connected the GPRS module and tested out the sample codes. I used a spare Banglalink SIM to send out the SMS. It turns out that you don’t need to type the number in international format. The 017******** format works too 🙂

tesla

Just a quick note: If you follow the official example (it sends a text on gprs.ready event), and then kill the process by hitting Ctrl + C, you might have issues controlling the GPRS module without restarting it. So I think for testing, we can use the Tessel REPL from the command line:

Categories
PHP

Moving Your PHP Projects to Vagrant

If you have read my last blog post, I have chosen to use one Linux box to locally develop web applications. In the last post, I discussed how I setup the Python/Django environment. In this one, I’m going to talk about PHP.

As usual, I installed the LAMP server:

I have all my PHP projects in “~/Sites”, I wanted to serve them from there. So removed the www directory.

Then I added my ~/Sites directory as a synced folder to be mounted as /var/www in the linux guest box. www-data is the user and group permission on these directories so Apache has no issues handling them.

My updated vagrant file:

Upgraded PHP to PHP 5.5 and installed PHPMyAdmin:

Updated my /etc/hosts to update the local dev domains to the IP address of the vagrant box 🙂