Category Archives: Web Development

Docker Global Mentor Week 2016 – Kanpur

Docker Mentor Week 2016 - Kanpur

I have not been blogging quite often but you must have guessed from my posts that I love Docker. It’s beautiful piece of technology which comes with a lot of great tooling for developers, devops and infrastructure administrators.

I am Docker Kanpur Meetup Group organiser. We are organising Docker Global Mentor Week in Kanpur on November 18, 2016.

If you are from Kanpur or around (Lucknow, Unnao, etc.), please do join the meetup group, and participate in this and future events. It’s lot of learning, and fun to be at meetups.

For your convenience, I am embedding event information below even though it’s available on meetup page. RSVP is must, and we only have space for 20 people. Please confirm it on meetup page.

I look forward to meeting you at the event. Let’s make it fun and successful.


Join us for our Kanpur edition of the Docker Global Mentor Week!

Docker Global Mentor Week is your opportunity to #learndocker. Right now, Docker is working on self paced online labs that will be available through LearnDot. One lab will be for beginners and one lab will be for intermediate users. Docker mentors will be on hand at this event to help you as you work through the self paced materials.

Are you an advanced user? We strongly encourage Docker users of all skill levels to attend! We need a network of mentors who understand the Docker platform to answer any questions that newcomers may have. Click here to sign up as a mentor.

Agenda: November 18, 2016

  • 16:00 – Doors Open
  • 16:15 – Welcome message, presentation of Docker & snacks
  • 16:30 to 18:30 – Select and work through self-paced lab
  • 18:30 – Socializing

As we get closer to the event, we will share more information including materials on how to prepare for the training.

Pre-Event Set-up

At the training, you will need to bring your own computer. Before you go to a mentoring event, there are some steps you should do some preparation to get your work environment ready. This will help get ready for the tutorial, and also save on bandwidth at the event venue. Here are the steps:

Set-up Docker on your machine

For Linux users, we need you to install Docker engine and Docker compose. Make sure you have Docker compose version 1.6 or higher by running docker-compose version from the command prompt.

For Mac users, install Docker for Mac or if you have an older Mac, Docker Toolbox.

For Windows users, if you have Windows 10 pro install Docker for Windows, otherwise install Docker Toolbox.

If you are a Docker for Windows user and want to try the new Windows containers, you need to have fully updated your machine. To prepare to use Windows containers,

Go through the setup steps in the Windows Container lab.

In Powershell run
docker pull microsoft/windowsservercore:latest
This will take awhile, but it is essential you do this before going to the venue. The Windows base image is a 3 gig download.

If you’re new to Docker, pre-pull the docker images for the very basic tutorial
  • docker pull hello-world
  • docker pull alpine
  • docker pull seqvence/static-site
To run the application and participate in the rest of the training, pre-pull these images
  • docker pull microsoft/dotnet:1.0.0-preview1
  • docker pull node:5.11.0-slim
  • docker pull python:2.7-alpine
  • docker pull redis:alpine
  • docker pull postgres:9.4
For the orchestration part, you will want to pre-build the demo app by running the following steps
  • git clone git://github.com/jpetazzo/orchestration-workshop
  • cd orchestration-workshop/dockercoins
  • docker-compose build

Venue:

Allies Interactive
18/179, 3rd Floor
Above Karur Vyasya Bank,
Next to Hotel Geet or Akashdeep,
The Mall (Phoobagh), Kanpur-01
Phone: +91 512 2351352

ICT Simulation App

During my time (2003-2004) at Tata Interactive, I built ICT design and cost simulation tool (in Adobe Flash) for BECTA.

Though the original website has been decommissioned, however, I found the app (SWF) on web.archive.org.

I converted this Flash app (SWF) to HTML5 using Google’s Swiffy, and the output looks good (except the file size is large due to embedded images).

The original app can be seen below (requires Adobe Flash Player):

Get Adobe Flash Player.!– [if !IE]>–>

Toptal

I recently came to know about Toptal. I am impressed and happy to see that some of the top developers of world are contributing and making difference through Toptal’s platform. I want to be among them for only one reason:

  • I want to work on (and contribute to some of) the best, useful and challenging projects with possibility to collaborate with some of the top/best developers/designers of the world.

NodeSchool

NodeSchool is a fully community driven effort and is 100% open source. This means that anyone can use the NodeSchool materials and/or host an event.

I have set up NodeSchool Kanpur chapter, and I hope to organise (with help of like minded people) a couple of workshops on Node.js (and web-development ecosystem around it).

I am looking for mentors and co-organisers, if you are interested, let’s have a conversion.

Phabricator

Phabricator (pronounced like the word fabricator) is a suite of web applications which make it easier to build software, particularly when working with teams. Phabricator is largely based on Facebook’s internal tools.

It has been more than three years since I have been using Phabricator (self-hosted) at work. It is one of the open-source projects which has inspired me a lot. I have seen it grow over these years; every day it gets better. Thanks to hundreds of open-source developers for their contribution.

Want to see how to develop elegant and sophisticated software, even with a poor programming languages like PHP? Look at Phabricator’s source-code and tools (built using PHP), you would be awestruck.

Want to play with Phabricator without installing? Have a look at PhorePlay (Phabricator hosting service), which offers free Phabricator hosting (with multiple instances) up to five users.  I think, that’s good enough for most of us (small teams).

Phabricator’s core team is working to launch Phacility (Phabricator Hosting). I think, it has potential to become something like Github (useful and essential service) one day.

What I am up to?

This is how my 2014 passed, or what I am up to:

  • riding my motorcycle a lot
  • hacking electronics and IoT using OSHW
  • dockerising things (apps, services)
  • playing with Apache Mesos, and ecosystem around it
  • hacking projects using Javascript (framework, toolchain, node.js, ES6 way of doing things) and web-standards (HTML5, CSS3, components, etc)
  • got Google’s Widevine certification (as required in one of projects). Personally, I like non DRM’d content 🙂
  • built a Chromecast app using dash.js, modular Widevine DRM with node.js based proxy service for licensing, and Java for content encryption and packaging
  • been reading a lot of stuff through hackernews
  • helped and built stuff: QRizq, Diziana, 99doodles, IndieReign and other projects
  • not having meetings (waste of time)
  • not interviewing candidates who are not worth anyone’s time. [should do another post: sad and bad state of technical education in India]
  • bunch of other things I can’t recall

Did you notice that I have been mostly playing (or having fun)? On other side of it, I have also been thinking what’s nex; I think, I have figured that out.

At present, I am still involved with couple of projects mentioned above. I have also taken up a couple of interesting consulting assignments around technologies mentioned above along-with my old love (flash/actionscript).

HTML5 and CSS3 Resources

It is an age of information overload, it is very hard to keep myself focused while searching and learning about anything. I am often lost in jungle of thousands of links/pages talking about same thing.

Following is a list, which I refer when I am reading about HTML5/CSS3:

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 [email protected]
 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.

Amazon S3 RequestTimeTooSkewed Error

Recently, we have started noticing “RequestTimeTooSkewed” erro while making requests to Amazon S3. The official FAQs suggests following:

Amazon S3 requires all machines making requests be within 15 minutes of an Amazon S3 webserver’s clock

Reading documentation and various blog posts made me believe, this is problem with the date/time settings on machine (which makes request). However, in our case, it turned out to be something else.

We use boto (Python library) for AWS stuff. Boto caches the connection objects (for S3, EC2, SQS, etc.), and tries to reuse those in later calls.

Imagine a simple use-case:

  1. Read data from S3
  2. Process data on EC2-instance/your-server
  3. Store processed-data on S3

In our case, #2 takes longer than 15 minutes (allowed limit by S3) sometimes, hence,  we were noticing ‘RequestTimeTooSkewed’ error.

Anyway, we fixed it by explicitly creating a different/fresh S3(http) connection before sending request to S3. This might sound inefficient, perhaps it is.

This is how we do now, a stripped down version of code from our class:

s3_connection = boto.connect_s3(aws_access_key_id="aws_access_key_id",aws_secret_access_key="aws_secret_access_key")
output_bucket = s3_connection.get_bucket("output_bucket")
key = output_bucket.new_key(key_name)
key.set_contents_from_filename(file_path, file_headers, True, None, 10, file_policy)

I am Python and boto noob; I am sure there would be a better way of doing this, so please share if you know one.

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)

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:

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.

Don’t live with broken windows

Most of us have heard about “Don’t live with broken windows” or “Broken Window Theory” in software world, through books (Pragmatic Programmers by Andy Hunt and Dave Thomas, The Tipping Point by Malcolm Gladwell) and other sources (wikipedia, blogs, articles, etc).

Like many others, I have also experienced that Broken Window Theory applies to many business and personal-life (and many others) other than software-development.

Over the time I have read books and articles, as listed below to learn more and apply in day to day life. You might following links useful.

Another Common Early Start-up Mistake

In most common early start-up mistakes, Mark Suster talks about very interesting and insightful points. However, I feel like adding one more point, quite known but often taken granted, more specific to software or web start-ups.

If you are a software or web start-up, it’s really important to use the experience of founders (if they are come from technical background) or your core team to have following in order, as soon as possible.

Guidelines and best-practices: code, documentation (wiki), version-control (branching/tagging – when and how?), bug-tracking, testing (unit-tests, functional-tests), deployment, performance objectives and related stuff.

I would not go crazy (get distracted too much) about these initially but have these in place and encourage(mandatory – certain cases) everyone to contribute, follow, discuss and document. It’s lot easier to adapt things at an earlier stage rather than later.

I strongally recommend you to read Martin Fowler‘s article Technical Debt to learn more about the importance of having things in order.