Pros and Cons of Hosting your own Nameservers

Benefits of hosting your Nameservers

  • Ease of changing hosting providers: Having your own nameservers make it easy when you are changing your hosting providers for two reasons:
    • Zero downtime in switching
    • Minimal change on Domain Register (change Nameserver and Hostname reords only)
    • Other nameserver changes can be done easily with your own nameserver, even scripted
  • Vanity Name Servers: Your clients may, particularly if you are in reseller business, check your Domain records including your name servers in a bid to identify your genuineness and commitment.
  • Ease of managing nameserver: You can easily script it or use User interface of your choice.

Disadvantages of hosting your own nameservers

  • Need Knowledge: You need to understand DNS well and be conversant in managing nameservers.  Messing up DNS records while client is shouting is not a good experience to have
  • Responsible for Security: You need to ensure that the Nameserver Software is always updated and protect it against all DNS attack vectors
  • Responsible for performance: If you are using the server for other purposes, most likely you are, then your nameserver performance is dependent on the load of the system. When your system is overloaded, havinbg the namserver also slow down adds to the load and more importantly aggravates the problem. You need to ensure performance of your namservers
  • Responsible for redundancy: There should be at least two namservers for redundancy and failover. Unless you have multiple servers that you can use, you are removing redundancy by pointing both the nameseerver IP at the same server.

Domain name registrars nowadays provide free DNS services to better retain their clients by:

  • making it harder to switch
  • giving better value for money

I have done both and I find using Domain registrars service gives less headache but is harder to configure and boring when you have large number of domains.

Chrome: How to view YouTube at 3x Speed

When viewing a YouTube video you may want to quickly skip through introductory section or boring/repetitive parts. The following solution will allow you to toggle between high speed and normal viewing. 3x speed-up is not offered by YouTube. With little practice you can understand even at that high speed, you need to be a bit focussed. May help increase your power of concentration.

Drag this link to your bookmarks toolbar: 3x

The bookmarklet is a toggle. Click once to view the video at 3x speed, click again to switch to normal mode.

Grails: Validating User Domain class

Grails provides support for validating fields. Here is a typical User class with field validation. It ensure that email address & url is of proper format, login is unique and password is not openly displayed.

package com.taragana

class User {
    String login
    String password
    String email
    String url
    static constraints = {
        login unique: true
        password password: true
        email email: true
        url url: true

    }
}

Script to kill all GradleDaemon processes – gkill

GradleDaemon sometimes redundantly runs in the background and Grails gives erroneous responses. The simplest solution is to kill all the errant GradleDaemon processes and run the app again. Below is a simple script which will run all the errant GradleDaemon processes. The same can be used for killing any processes like say Firefox. Just substitute GradleDaemon with firefox.

# Kills all GradleDaemon processes without mercy
ps -Aeo pid,command|awk '{$1=$1;print}'|grep -v grep|grep GradleDaemon|xargs kill -9

Bash: How to trim leading, following spaces from text

Many Linux/Unix commands are shown formatted like ps -ef for instance. As such it becomes difficult to process them subsequently in the pipeline, like for instance passing it to xargs kill for killing the filtered errant processes. The command below, when part of a bash / sh pipeline will remove the leading and following spaces as well as convert multiple spaces to a single space inside string:
awk '{$1=$1;print}'
or shorter:
awk '{$1=$1};1'

Do you have such handy commands / snippets you would like to share? Please share in the comments below.

How to incrementally mirror FTP site regularly

Daily Business Data, like NAV, is often made available via FTP servers which stores and makes available the data for limited time duration (like a week). We need to not only download the data for the day but also want to ensure that the historical data remains intact. Today I will show you how you can download and mirror the data from an ftp server without losing access to old data and how you can schedule it via cron to run periodically. Only changes are downloaded.

wget -m --retry-connrefused --password='password' ftp://login@address/ -o log

login -> Login
password -> Password
address -> IP Address or Hostname of the FTP server
log -> Log file name

Save the above in a file named mirror-data and make it executable:

chmod 755 mirror-data

Run crontab -e to edit the cron (scheduler) and add the following line after making necessary changes:

0 2 * * 1-5 /path/mirror-data

This runs the executable every week day at 2am.

How to use dd (Linux copy tool) with progress indicator

/dev/sdcdd, the ubiquitous copy tool of Unix/Linux, now comes in with a decent built-in progress indicator.

You can run it by the command-line option: status=progress

Example:

dd status=progress if=/dev/sda of=/dev/sdb

Notice how I didn’t add the bs option and used the default. In my experiences the default works best.

Tested on: Ubuntu

Top 15 Countries by Coders

I have analyzed the data from HackerRank (December 7 2016) to find out the Top 15 countries in the world by cumulative ranking as well as by the number of Institutions in Top 50.

In order to figure out which colleges have the best coders, HackerRank hosted a major University Rankings Competition. Over 5,500 students from 126 schools from around the world participated in the event.

Cumulative Coder Rank of Top 15 Countries

India is the clear leader with cumulative score of 2901.04, more than double of US with cumulative rank of 1113.22. Russia is a distant third with less than 1/2 of US rank. But how does it fare in the total number of Institutions in the Top 50?

Country Sum – Rank
India 2901.74
US 1113.22
Russia 668.07
Romania 412.35
Canada 398.8
China 387.18
Vietnam 321.99
Ukraine 255.83
Sweden 231.23
Czech Republic 188.67
Turkey 157.56
Kazakhstan 138.87
Poland 130.34
Belgium 125.91
South Korea 124.65

Note: The score / rank of a College is weighted average and hence can be summed to get cumulative scores.

Top 15 Countries by Total Count of Institutions in Top 50

22 Institutions in India rank in the Top 50. US, second placed, is by contrast can boast of only 8 Institutions, almost 1/3 of India.

Country Count – Rank
India 22
US 8
Romania 3
Canada 2
Russia 2
Belgium 1
Bosnia & Herzegovina 1
China 1
Czech Republic 1
Estonia 1
Kazakhstan 1
Mexico 1
Poland 1
South Korea 1
Sweden 1

No wonder India is the top destination for outsourcing across the world. It produces very large number of Top Coders according to HackerRank data.

Within India the top 2 Institutions are IIT, Indore followed by IIT, Kanpur.

Java: The Most Popular Programming Language Today

Several research independently confirms Java as the most popular programing language today and as such can be considered the safest bet for someone looking to make a career in programming or looking for a career change. Let’s look in details below.

The TIOBE Index

The TIOBE Index for February 2017 indicates Java is the most popular programming language today. Java’s popularity is almost double that of the next contender C.

The TIOBE Programming Community index is an indicator of the popularity of programming languages. The index is updated once a month. The ratings are based on the number of skilled engineers world-wide, courses and third party vendors. Popular search engines such as Google, Bing, Yahoo!, Wikipedia, Amazon, YouTube and Baidu are used to calculate the ratings. It is important to note that the TIOBE index is not about the best programming language or the language in which most lines of code have been written.

PYPL PopularitY of Programming Language

The PYPL PopularitY of Programming Language Index is created by analyzing how often language tutorials are searched on Google.

The more a language tutorial is searched, the more popular the language is assumed to be. It is a leading indicator. The raw data comes from Google Trends.

If you believe in collective wisdom, the PYPL Popularity of Programming Language index can help you decide which language to study, or which one to use in a new software project.

PYPL too indicates Java as the leading programming language.

CodingDojo

CodingDojo diligently compiled job data from indeed in 2016 which shows Java is the top in-demand programming language, unless you consider SQL as programming language.http://www.inc.com/larry-kim/10-most-popular-programming-languages-today.html

Inc.com

Inc.com does not cite sources but states Java as the most popular programming language. Larry Kim, Founder and CTO of WordStreaam, gives a nice summary:

Java is top pick as one of the most popular programming languages, used for building server-side applications to video games and mobile apps. It’s also the core foundation for developing Android apps, making it a favorite of many programmers. With its WORA mantra (write once, run anywhere), it’s designed to be portable and run happily across multiple software platforms.

So if you are searching for a programming language to learn to build your career then look no further and start coding in Java.

Footnote: Glassdoor data indicates Software Architect is the highest paying job in this field, followed closely by Software Development Manager.

Key differences between Understanding and Learning (Memorization)

Many Educational Institutes, even today, do not focus on understanding. Their tests can be easily passed with memorization. This weakens the foundation of the students and adversely affects his future performance in professional engagements. Let’s look at the key differences between understanding and memorization and why understanding should be the priority for all students.

Memorization is simple. We all know that by repeated reading of any subject matter we can remember it by heart and be able to regurgitate (repeat information without analyzing or comprehending it) on demand, even matching similar sounding questions with the answer you have learned. And that is pretty much all you need to get through in most school systems and even most colleges.

Understanding, on the other hand, is knowing the underlying ideas and concepts so well that you can then explain them in your own words, even if you do not remember any of the terminology used. It allows you to develop insights that comes from inductive or deductive reasoning on the concepts.

You know you have understood something well when you can apply it to real life situations and clearly explain it to a layman with ease.

With understanding your can identify the similarities and differences between similar sounding ideas on your own.

Understanding is the key to advancing knowledge and discovering new knowledge.

Understanding is what is useful in real life, learning alone takes us nowhere.

Today computers can store much more facts than you will ever learn and can regurgitate it faster, even for complex queries (like Google). Instead of focusing your energies on memorization, which is anyways a losing and pointless battle, why not focus on understanding the topic at hand?

You will find that when you understand any topic, you tend to remember the key words and phrases too, thereby serving both the purposes of your exams as well as much bigger purpose of excelling real life and profession.