Blog Archives

Working around untrusted certificate errors in Express JS


A few very common fatal errors thrown by the request module for express while trying to access data from self-signed web servers are Error: DEPTH_ZERO_SELF_SIGNED_CERT and UNABLE_TO_VERIFY_LEAF_SIGNATURE

This is because of¬†https://github.com/nodejs/node-v0.x-archive/pull/4023 which mandates NodeJS to validate a server’s certificate by default, which needless to say is how things should be in a production environment.

However, more often than none we tend to use self-signed SSL certificates in our development environments or even within internal networks.

Thankfully for such brain-wracking moments, two particular flags come to our rescue. Enter strictSSL and rejectUnauthorized. The way I personally like to use these flags, is to set defaults within my development environments as follows to bypass SSL validation hence, saving the day! ūüôā

var request = require('request').defaults({
    strictSSL: false,
    rejectUnauthorized: false
 });

Please do note, that I do not recommend that you ever try this on your production systems without understanding the true implications of what disabling strictSSL and rejectUnauthorized means for you node server. By disabling these, you are essentially telling your server to skip validation of the requested server’s identity, which leaves your application in quite a vulnerable position.

Rebooting the Bugsmith’s Blog


It’s been a long long time since I last posted in this space. I guess I had been a bit too caught up with life and had been overly focused on my job.

Recently, I realized that I have become quite dormant in the open source communities, and it has been quite some time since I made a worthwhile commit on GitHub / Pagure / BitBucket/etc. My GitHub streak now looks mostly empty which means I have been lazy for over a year now.

So, enough with the slacking around for so long. It’s time to reboot the Bugsmith and get back to the groove of things.

It’s time to draw a line and balance out all the imbalances in my current everyday life. This means fixing my office work schedule, being a bit conscious about my health, and most importantly, getting back to doing something worthwhile with my life.

So, here’s the plan:-

  1. I’ll start posting more often about anything and everything.
  2. I’m gonna start sharing as much of my everyday learning related to tech and non-tech using this blog as a medium.
  3. Finish up all of my pending work [mostly personal stuff which I have been ignoring for a long time now].
  4. Get back to contributing more pro-actively to Open Source projects which I find interesting.
  5. Get back to attending tech-meetups in my vicinity and beyond.
  6. Well basically, get my stuff together and get back to being awesome yet again. ūüėČ

Let’s see how I manage to cope up with my self-expectations! ūüôā

Using Vim to generate HTML output of code


This is an interesting bit that I learnt about from an email in a mailing list by James Pryor.

To generate html output for code within a shell script you can use:

vim myscript.sh '+syntax on' '+ set nu' '+set background=light' +TOhtml '+w myscript.html' '+qall!'
If you don’t want numbers and need a dark background you can use:
vim myscript.sh '+syntax on' '+ set nonu' '+set background=dark' +TOhtml '+w myscript.html' '+qall!'

Installing EditorConfig on Sublime Text


To install Editor Config on Sublime Text all you need to do is to follow the following steps:-
  1. Go the Preferences tab -> Package Control.
  2. Select Install Package from the drop down menu.
  3. Wait for the list to load, once it loads it will show you a list of packages.
  4. Now, type in EditorConfig and select the highlighted option.

To confirm that Editor Config is installed correctly on your Sublime Text instance you can go to Preferences -> Browse Packages. If installed correctly you should be able to see an EditorConfig directory present in the Packages directory.

That’s it! Enjoy! ūüôā

Creating scrollable Charts using Angular-Kendo


Creating Scrollable Charts:

Horizontal scrolling of Charts is not supported out of the box in Kendo UI, however it can be achieved using a bit of custom styling.

Basic steps:

  • Set overflow: auto of the <div class="chart-wrapper">;
  • Set width of the aforementioned div;
  • Set width of the <div id="chart"> to a value higher than it’s parent div width size.

Example piece of code:

Template:

<div class="parent-container">
  <div kendo-chart k-options="line" class="chart-container">
  </div>
</div>

CSS:

.parent-container {
    overflow-y: scroll; 
    width: 1000px;
}

.chart-container {
    overflow: auto; 
    width: 2000px;
}

The Greek Experience – Remo Training Days


Reps Group Photo

Reps at Greece for #remotrainingdays

Last week Mozilla brought together 40 Mozilla Reps from all over the world at Athens for week-long training exercise called Reps Training Days. The idea was to gather the most pro-active Mozillians under the ReMo programme in a single place and train them about leading the Webmaker initiative in their respective communities.
The training event was structured as follows:-
  • The Reps spend the first day observing a Hive Athens Pop-Up event.
  • Then the next 2 days are dedicated to developing local strategy and teaching skills; and finally
  • The Reps apply the lessons they have on a one day event teaching webmaking to a group of 100 students at the British Council.

The outcome from this event was phenomenal, with over 40 events being planned for the next 3 months to build local Webmaker mentor team and prototype events for the summer campaign, code-named Remix Party. The vibrancy of the geographical locations for which events were planned speak for themselves. From Taiwan to Indonesia, India to Mauritius, Kenya, Uganda, Romania, UK, France, Argentina, Brazil, Mexico, Canada + beyond, we had events being planned everywhere.

It was an amazing example of Hive + Webmaker Reps, with the local community stepping up to host the event. The energy levels of everyone at the event spoke for themselves.

Here are the links for some of the most awesome things from the event:-

Oops! Almost forgot – we also made our own Harlem Shake Video: https://www.youtube.com/embed/tn4Evp8BN1U

From Netscape To Firefox: The Story Of Mozilla Firefox


Introduction

The history of Mozilla, upon which Firefox was built, extends all the way back to 1994, when the name was first established as a branding for the ‚Äúmosaic killer,‚ÄĚ Netscape Navigator. Mozilla as a modern day institution found its beginnings in 1998, when Netscape decided to release the source code of its dying browser to the open source community. Even later still, the browser that would become Firefox did not come into existence until 2002. In a sense, Firefox 1.0 came out in 2004 after 10 years of laying its foundations.

Origins

The origins of Firefox can be traced directly to Netscape, a compan­y whose Web browser, Netscape Navigator, was the dominant browser before Microsoft developed Internet Explorer. The internal company name for the browser was Mozilla. Eventually, Netscape released the source code for Navigator under an open source license, meaning anyone could see and use the code. A non­profit group was set up to direct the development of browsers using this code. This group became the Mozilla Foundation in 2003.

However, Firefox is not the browser the Mozilla group would have released if everything had gone as planned. Like Netscape Navigator before it, the Mozilla software was becoming bigger and bigger as more features were added in ¬≠¬≠ a problem in software development known as “feature creep” or “bloat”.

Around this time, the Firefox project was started as an experimental branch of the Mozilla project by Dave Hyatt, Joe Hewitt, Chanial and Blake Ross. Instead of accepting the feature creep, Blake Ross, (a computer enthusiast who first started helping out the Mozilla project as a hobby when he was 14) decided to start developing his own Mozilla­ based browser, focusing on a streamlined and simple version. Software developer Dave Hyatt also played a major role. Ross was joined by Ben Goodger in 2003, and development progressed rapidly from that point.

They believed that the commercial requirements of Netscape’s sponsorship and developer¬≠ driven feature creep compromised the utility of the Mozilla browser. To combat this perceived software bloat[1] of the Mozilla Suite [2] they created a stand¬≠alone browser, with which they intended to replace the Mozilla Suite. On April 3, 2003, the Mozilla Organization announced that they planned to change their focus from the Mozilla Suite to Firefox and Thunderbird.

Although the Mozilla Foundation had intended to make the Mozilla Suite obsolete and replace it with Firefox, the Foundation continued to maintain the suite until April 12, 2006 because it had many corporate users and was bundled with other software. The Mozilla community (as opposed to the Foundation) continues to release new versions of the suite, using the product name SeaMonkey to avoid confusion with the original Mozilla Suite.

On February 5, 2004, business and IT consulting company AMS categorized Mozilla Firefox (then known as Firebird) as a “Tier 1” (“Best of Breed”) open source product, considering it technically strong and virtually risk¬≠-free.

Naming

Phoenix:

The project which became Firefox started as an experimental branch of the Mozilla Suite called m/b (or mozilla/browser), underwent several name changes. After it had been sufficiently developed, binaries (experimental versions) for public testing appeared in September 2002 under the name Phoenix. The Phoenix name was kept until April 14, 2003, when it was changed because of a trademark dispute with the BIOS manufacturer, Phoenix Technologies (which produces a BIOS­ based browser called Phoenix FirstWare Connect).

Manticore:

The foundations of Phoenix progressed along an entirely different development mindset from its parent Mozilla. Instead of focusing on large application suites developed by large development teams headed by senior programmers, Phoenix centered around a small, core development team concentrated exclusively on the web browsing aspect of the Mozilla Suite. The ideas for these small volunteer projects had manifested themselves earlier with David Hyatt and Ben Goodger’s Manticore browser, built on Netscape and Internet Explorer using C# and .NET. However, where Manticore looked to offer basic browsing functions in a lean form factor, Blake Ross and David Hyatt’s Phoenix looked to innovate on the browsing experience, focusing on security and utility as the pillars of the new browser. Unconstrained by the business¬≠ minded Netscape, Ross and Hyatt could develop a browser “completely focused on the end user.”

Firebird:

In April, 2003, Mozilla announced it would call its new browser “Firebird”¬≠¬≠a mythical creature sometimes considered synonymous with the phoenix, an immortal bird that regenerates itself through self¬≠immolation, to avoid the Phoenix conflict. The new name, Firebird, met with mixed reactions, particularly as the Firebird database server already carried the name. It provoked an intense response from the Firebird free database software project. In response, the Mozilla Foundation stated that the browser should always bear the name Mozilla Firebird to avoid confusion with the database software.
Confusingly enough, the sponsor of the Firebird database development group, went by the name of IBPhoenix (no relationship to Phoenix Technologies, which presented the initial trademark challenge to Mozilla). Formed in 1984 by InterBase Software and acquired by Borland Software in 1991, the group had launched the Firebird free database open­ source project in 2000.

Firefox:

Continuing pressure from the Firebird community forced another change, and on February 9, 2004 the project was renamed Mozilla Firefox (or Firefox for short). The name “Firefox” (a reference to the red panda [3]) was chosen for its similarity to “Firebird”, but also for its uniqueness in the computing industry. To ensure that no further name changes would be necessary, the Mozilla Foundation began the process of registering Firefox as a trademark with the United States Patent and Trademark Office in December 2003. This trademark process led to a delay of several months in the release of Firefox 0.8 when the foundation discovered that Firefox had already been registered as a trademark in the UK for Charlton Company software. The situation was resolved when the foundation was given a license to use Charlton’s European trademark.

Versions

The Firefox project went through many versions before 1.0 was released on November 9, 2004. After a series of stability and security fixes, the Mozilla Foundation released its first major update, Firefox version 1.5, on November 29, 2005. Version 2.0 was released on October 24,2006. Firefox 3.0 was released on June 17, 2008, with Version 3.5 and Version 3.6 released on June 30, 2009 and January 21, 2010 respectively. Version 4.0 was released on March 22, 2011. With Version 5.0 onwards the rapid release cycle was realized which envisions a new major version release every six weeks on Tuesday. Firefox 10, was released on January 31, 2012. The latest version, Firefox 10.0.2 was released on February 16, 2012

Key Terms

  1. Software bloat is a process whereby successive versions of a computer program include an increasing proportion of unnecessary features that are not used by end users, or generally use more system resources than necessary, while offering little or no benefit to its users.
  2. Mozilla Suite: Codenamed, internally referred to, and continued by the community as SeaMonkey, which integrated features such as IRC, mail and news, and WYSIWYG HTML editing into one software suite.
  3. A Firefox is another name for the red panda, a red­-furred, endangered mammal related to the giant panda and found in the Himalayas, China and Myanmar.

References

  1. http://en.wikipedia.org/wiki/Firefox
  2. http://en.wikipedia.org/wiki/History_of_Firefox
  3. http://www.foxkeh.com/downloads/history/history­original.pdf
  4. http://news.cnet.com/2100­1032_3­1000146.html
  5. http://web.archive.org/web/20070914035447/http://www.ibphoenix.com/main.nfs?a=ibphoenix&page=ibp_Mozilla0
  6. http://news.cnet.com/2100­7344­5156101.html
  7. http://www.zytrax.com/tech/web/firefox­history.html
  8. http://computer.howstuffworks.com/internet/basics/firefox1.htm
  9. http://www­cs­faculty.stanford.edu/~eroberts/cs201/projects/firefox­market­dynamics/
  10. http://www.andrewturnbull.net/mozilla/historyfx.html
%d bloggers like this: