Author Archives: Sanju

About Sanju

I’m Sanjunath.S from Mumbai, India. I like web technologies, traveling & history. I have 7+ years experience in web technologies like HTML 5, CSS 3, JavaScript, Bootstrap and PHP.

15 Aug

How to start Angularjs 4 with Angular CLI

rsz_screenshot_2017-08-15_165615

Angular CLI is a command line interface to use Angularjs. We can create any type of Angular apps easily with the help of Angular CLI.

How to start Installation?
Here we are going to use Node.js command prompt.

Start Node.js command prompt & Follow these commands in Node.js command prompt.

install angular cli

> npm install -g @angular/cli

for latest version :

> npm install -g @angular/cli@latest

 

Angular CLI makes it easy to create a new application.

Angular CLI - create a new app

> ng new hello-world
> cd hello-world

Angular CLI - new app created

 

Check the version you have installed :

> ng --version

or

> ng -v

“ng –version” or “ng –v” command will show installed version details like this :

Angular CLI - version

@angular-cli: 1.3.0
node: 8.2.1
@angular/common: 4.3.4

 

How to run our new app in a web browser
Easily start running our new app in ‘webpack-dev-server server’. It is only for development with live reload.

Angular CLI ng serve

> ng serve

Angular CLI ng serve-compiled

angular cli app in a web browser:

run angular cli app in a web browser

The app will automatically reload if you are changing something in any file. “http://localhost:4200” this is a default angular cli app URL. Open this URL in any browser. The app will start working.

How to change angular cli server port number or host instead of “localhost:4200”
We can configure it manually in our “angular-cli.json” file, which is locating in our project directory.

"serve": {
            "port": 5500,
            "host" : "112.168.0.100"       
}

Restart the server. It will serve in the new port or host as per update.
Example, http://112.168.0.100:5500


” Angular is running in the development mode. Call enableProdMode() to enable the production mode. ” It is a default console message.
We can update environment to production mode.
change production: false to true in environments/environment.ts

export const environment = {
	production: true
};

 

Project’s unit testing.
‘hello-world\src\app’ folder have app.component.spec.ts file. That file has unit test configurations.

Angular CLI - test

Test Debug page :

Angular CLI - test debug

> ng test

 

Create compiled and minified application :
Compiled and minified application will get generated in a new ‘dist’ directory by default. “ng serve” is not required to run “ng > build”.

> ng build

Build compiled and minified version for production :

 compiled and minified application in dist folder

> ng build --target=production

or

> ng build --prod


How to generate Angular components in CLI

Angular CLI create component

> ng g component sample-component-name

It will generate new component folder “sample-component-name” with all related files in the src\app directory.

How to stop running node server
Node.js command prompt – Press -C twice or type ‘exit’ to stop node server.
Node.js – Press -D

"[WDS] Disconnected!"

This message will come to browser console if ‘webpack-dev-server’ is not working or stopped running server manually.

24 Oct

The Ruins of Belapur Fort

cbd belapur fort

Belapur Fort is a fort near the township of Belapur in Navi Mumbai (New Bombay), Maharashtra, India. The fort was built by the Siddis of Janjira. In 1733, the Marathas wrested control of the Belapur Fort from the Portuguese.  After the victory, the fort was renamed as Belapur Fort. In the early 19th century, the fort was captured by the British. After the British gained supremacy in the region, with the expansion of the Bombay Presidency, the strategic importance of the fort declined, and it fell into disuse.

navi-mumbai-municipal-corporation

Navi Mumbai Municipal Corporation building

Once there were three watchtowers related to fort in the area. One watch tower is located opposite to Navi Mumbai Municipal Corporation building. It is fully restored like a modern building and tower  is surrounded by a small garden. It’s hidden by vegetation even it’s locating next to a busy traffic junction. Fort is in ruined condition, but the traffic junction remains the name, Killa junction.  Killa means, Fort in Marathi language.

watchtower-near-navi-mumbai-municipal-corporation

Old Watchtower opposite to Navi Mumbai Municipal Corporation building

Ruins under vegetation

Ruins under vegetation

belapur fort watch tower

Inside Watchtower near Navi Mumbai Municipal Corporation

Second watch tower was a part of fort,  which is located inside the ruins of fort. We will get a clear view of Panvel Creek from the top of the watch tower. Once this creek area was an important place of sea route trading. And this watch tower was helpful for preventing  attack from sea. That was the actual reason behind the fort.  Nothing is remaining there, except the partially destroyed  watch tower and foundation of fort under the vegetation.

cidco guest house road

cidco guest house road

belapur fort surrounding by a small forest

Third watch tower was located in an abandoned place near by creek and nothing is remaining now.

History :

Fort was built in 1560–1570 by the Siddis, after they took control of the area from the Portuguese. It is located atop a hillock, near the mouth of the Panvel Creek. In 1682, the fort was recaptured by the Portuguese, who had managed to annex the regions controlled by the Siddis, near Belapur (at that time known as Shabaz).

The ruins of belapur fort and watchtower

The ruins of belapur fort and watchtower

In 1733, the Marathas, led by Chimnaji Appa, wrested control of the fort from the Portuguese. He had made a vow that if it were to be successfully recaptured from the Portuguese, he would place a garland of beli leaves in a nearby Amruthaishwar temple, and after the victory, the fort was named as Belapur Fort. The Marathas ruled the area until 23rd June 1817, when it was captured by Captain Charles Gray of the British East India Company. The British partially destroyed the fort under their policy of razing any Maratha stronghold in the area.

Top of Belapur fort

Top of Belapur fort

During its active days, the fort stationed four companies each of 180 men and 14 guns ranging from 4-12 pounds (2-5 kg) in weight. An underground tunnel is also supposed to exist, which many locals believe that it connects to Gharapuri Island, the site of the Elephanta Caves.

Inside the cbd belapur fort

Inside view of Belapur fort’s watch tower

Present :

The remaining parts of the fort are situated on the top of a small hill near panvel creek and CIDCO guest house.  Ruins are under vegetation. The fort is surrounded by several residential complexes. So it’s little difficulty to find out the fort and watchtower. There is narrow walk way to reach the fort and you have to find the way through bushes. CIDCO’s plans are underway to renovate the fort which is in danger of being lost to encroachments.

Panvel creek

Panvel creek

How to reach :

10 min walkable distance from Belapur – Uran road in between Navi Mumbai Municipal Corporation building and Panvel creek.

Reference:
https://en.wikipedia.org/wiki/Belapur_Fort
 

30 Apr

How to redirect url with or without www in htaccess

redirect url with or without www in htaccess

Normally every website domain is accessible with or without www (mydomain.com or www.mydomain.com). We will get the same pages & there will be no difference. But Google will consider it as duplicated content and it will affect your Search Engine Optimization ranking. So we should define a preferred domain method with the help of htaccess. It will redirect the access to either with or without www. Alternatively, add canonical URL ( <link rel=”canonical” href=”http://www.mydomain.com” /> ) in your page head and don’t forget to choose a preferred domain in Google Webmaster Tools.

Here i’m going to show you how to define a preferred domain method in htaccess.

Redirect mydomain.com to www.mydomain.com:

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.mydomain.com$ [NC]
RewriteRule ^(.*)$ http://www.mydomain.com/$1 [L,R=301]

Redirect www.mydomain.com to example.com:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.mydomain.com$ [NC]
RewriteRule ^(.*)$ http://www.mydomain.com/$1 [L,R=301]

Redirect IP to www.example.com:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^12\.34\.56\.789$
RewriteRule ^(.*)$ http://www.mydomain.com/$1 [L,R=301]

 

17 Feb

Freedom 251 – World’s Cheapest Smartphone from India

freedom_251

Indian company Ringing bells has launched digital India’s most ambitious project, freedom 251 as a part of Make in India. This phone is India’s cheapest smartphone (251 INR or $4), might be the cheapest smartphone in the world.

‘Freedom 251’ launch is in line with Indian Prime Minister Narendra Modi’s vision for “empowering India to the last person, transforming India’s growth story”.

cheapest smartphone in the world

How To Buy or Book Freedom 251 Smartphone at 251 INR or $4 :-

Company started a dedicated website for Freedom 251. Bookings started from February 18, 6:00am onwards, and the window will remain open up to February 21, 8:00pm. The company has also said that it will complete all deliveries before June 30. Click here for Freedom 251 Smartphone Booking page – Buy at your own risk.

freedom251

Freedom 251 Smartphone Specifications :-

  • Price is the main thing, 251 INR (4 USD)
  • 4″ WVGA IPS Display
  • 1.3Ghz Quadcore Processor
  • 1GB / 8GB memory
  • 3.2 / 0.3 Camera
  • 1450 mAh Battery
  • Dual Sim
  • 3G
  • Android 5.1 Lollipop
  • 1 year warranty
  • 650+ Service centres

How is the Freedom 251 is so cheap?

We will not get a branded smartphone battery in this price. We don’t know, how they are selling for 251 INR. Might be the central government is giving some subsidy as a project of Make in India. If you have any query, you can contact them from this link http://freedom251.com/contact_us

26 Jan

Why Google Loves SSL Certified Websites – HTTPS Everywhere

SSL secure website

Security is a top priority for Google. That’s why Google Loves SSL Certified Websites or HTTPS. So it’s very helpful to get high rank in SEO (Search Engine Optimization). Now the impact is fewer than 1% of global queries, but it will change in future. It’s called HTTPS Everywhere: Every websites will be switch to HTTPS to keep everyone safe on the web. Check out this post Top 4 Basic Search Engine Optimization Tips for some basic tips of SEO.

For websites that deal with personal data, or transactions via the Internet, it is necessary to take measures for security of the web application. Processing transactions should be handled securely on the web. Meaning that we need to be able to transmit information between the web site and the web browser in a way that makes it difficult for other the server to intercept and read. To deal with such situations where we need security, we need a SSL or Secure Sockets Layer to take care of this.

What is SSL (Secure Sockets Layer) ? SSL is a a protocol much like the standard HTTP, but is a secure protocol that can receive and transfer data over the Internet. An encrypted SSL connection requires that the encrypted data to be passed to and from the web server and the web browser and to be decrypted at the receiving end. A SSL certificate is used to authenticate a web site.

What are SSL certificates ? The certificate contains the server’s public key, which is used by the browser to identify and authenticate the server and encrypt the information from the server using SSL. SSL certificates are much like any identification proof that once authenticated, permits the flow of encrypted information through the HTTPS.

fb ssl

There are three different types of SSL certificates you could use. Generally your web hosting companies may provide SSL certification for your website. Some may provide it as a free service, although it may not be any more secure than the standard HTTP.

Shared SSL : As the name suggests, multiple domain names share the same IP address making it easier for the host to managed single shared SSL over different servers. This is a comparatively cheaper method, as single SSL needed to encrypt an array of web sites.

Dedicated SSL : Dedicated SSL, much like dedicated hosting has SSL certification specifically for your root domain space. An HTTPS connection is verfied through a designated IP address. It is the most secure method but comes at a price.

Wildcard SSL : Wildcard SSL certifications will have multiple sub-domains for your website.

02 Dec

5 Must Have Free WordPress Plugins for Every Blogger

Must Have Free WordPress Plugins

WordPress is the most popular open source platform of running blog & website. Here, it’s a list of 5 Must Have Free WordPress Plugins for Every Blogger that based on my personal experiences. Each one of these essential WordPress plugins that should be installed on every new WordPress site before you do anything else.

 

WordPress SEO By Yoast

WordPress SEO By Yoast
WordPress out of the box is already technically quite a good platform for SEO. But that doesn’t mean you can’t improve it further! You can improve your WordPress SEO: Write better content and have a fully optimized WordPress site using Yoast SEO plugin.

https://wordpress.org/plugins/wordpress-seo/

 

W3 Total Cache

W3 Total Cache
W3 Total Cache improves the user experience of your site by increasing server performance, reducing the download times and providing transparent content delivery network (CDN) integration. The only WordPress Performance Optimization (WPO) framework; designed to improve user experience and page speed.

https://wordpress.org/plugins/w3-total-cache/

 

Disqus Comment System

Disqus Comment System
The Disqus comment system replaces your WordPress comment system with your comments hosted and powered by Disqus.

https://wordpress.org/plugins/disqus-comment-system/

 

BackUpWordPress

BackUpWordPress
Simple to use automated backups of your WordPress-powered website. BackUpWordPress will back up your entire site including your database and all your files on a schedule that suits you.

https://wordpress.org/plugins/backupwordpress/

 

Contact Form 7

Contact Form 7
Contact Form 7 can manage multiple contact forms, plus you can customize the form and the mail contents flexibly with simple markup. The form supports Ajax-powered submitting, CAPTCHA, Akismet spam filtering and so on.

https://wordpress.org/plugins/contact-form-7/

 

24 Sep

Top 4 Basic Search Engine Optimization Tips

Basic Search Engine Optimization tips

We all know that ranking highly on the search engines to get targeted traffic. It’s very important for every website, if we are selling products or services online. In order to get high ranking on search engines, you need to understand how to optimize your website or blog. So that the search engines can easily find your web pages or blog posts. Here are some Basic Search Engine Optimization tips, which you can use to optimize your website or blog.

 

1. Targeting the right keywords

SEO keywords

Keywords are the fuel for targeted traffic and they form the basis of highly optimized web pages. As you know, users are using keywords to find what they are looking for online. So basically you need to be thinking like a real user who is searching for information on the web. There are many great keyword research tool that you can use to uncover all these important keywords. Google Keyword Planner is a great research tool, it will help you to find the right keywords.

 

2. Content is King in SEO ( Search Engine Optimization )

Content is King in SEO

If you are selling your products or services online, you need to create unique and interesting content that is related to your products or services. The search engines love unique and fresh content so if you can provide them with good and fresh content, they will give your website a high ranking. Try your best to create interesting information or content that people want to read and willing to give you their opinions by commenting on your blog. The more people comment on your blog the better because this can give your blog a lot of fresh and unique information.

 

3. On-site optimization

Website On-site Code Optimization

Meta Title & Meta Description – These things must be unique throughout your website, don’t repeat on multiple pages and keep it as, most relevant to the page content & keywords. As well as this, page titles should be in sentence form and not just a list of keywords as this could be seen as irrelevant keyword stuffing, which may negatively impact on your wider optimization efforts. Many people get this wrong and fail to realize just how important a page’s title can be in increasing the relevancy of your website to the keywords you wish it to appear for.

 

4. Build quality back-links

Social Media Optimization

A back-link is basically a link from other website/blog to your website. It is like a vote. The more votes or links you get from other website to your website, the better. The search engines especially Google will give website that has many quality back-links a high authority. Google trusts websites that have high authority and hence will rank them highly on their search results or front page.

There are many ways to get good quality back-links & website traffic. E.g: You can submit your unique content to high-traffic website or blog like hubpages.com, tumblr.com and blogger.com Social media websites ( plus.google.com, facebook.com and twitter.com ) also will provide you good quality back-links and a lot of targeted traffic.

Make sure your website don’t have any code error, broken links & spelling mistakes. Validate your website using W3C Markup Validation Service Keep your website alive & active on social media. These are the Basic Search Engine Optimization tips for website to get high ranking and good traffic. Google Search Engine Optimization Starter Guide is providing lot of Basic Search Engine Optimization tips. Google Webmaster Tools and Google Analytics helps you to understand your visitors and improve your website’s Search Engine Optimization.

 

28 Jun

Elephanta Caves – The ancient cave city of lord Shiva

shiva thrimurthi elephanta cave

Three-headed (Trimurti) sculpture of the Lord Mahadeva

Elephanta (Gharapuri – the city of caves) is one of an island in Arabian sea, about 10 kilometres to the east of the Metropolis city of Mumbai (the commercial capital of India). The ancient cave city of lord Shiva is a UNESCO World Heritage Site since 1987 and maintained by the Archaeological Survey of India. All caves are carved from single stone – in between 5th A.D and 8th A.D. Gharapuri was the old name of the island. There was a single stone elephant sculpture in the entrance of the island, when Portuguese navigators came to this island, hence the new name Elephanta was derived. Presently, the elephant statue is housed at Jijamata Garden in Mumbai.

Elephant statue of Elephanta island at Jijamata Garden

Elephant statue of Elephanta island at Jijamata Garden

History:

Ancient history of Elephanta caves is a mystery. The Elephanta caves are “of unknown date and attribution”. The date of the caves is different according to different Archaeology specialists. There were some inscriptions about the ancient cave city of lord Shiva, which is missing since Portuguese ruling.  Different dynasties ruled this island, the Konkan Mauryas, Chalukyas of Badami, Rashtrakutas, Kalyani Chalukyas, Yadavas of Deogiri, Gujarat Sultanate, Portuguese, Marathas and Britain. Once it was the capital city of Konkan Mauryas and there was a major port from 2nd B.C. The Kailashnath temple at Ellora and Badami caves has many similarities to Elephanta caves. The Kailashnath temple at Ellora was built by Rashtrakutas and Badami caves built by Chalukyas of Badami. Rashtrakutas were strongly influenced by Lord Shiva,hence contributed for these caves.

Elephanta cave 1 in 1972 and 2015

There are two groups of caves in Elephanta Island. All caves were painted (fresco painting) in the past, now only traces are visible.1st group contains five caves and 2nd group contains two caves. All caves are carved from solid basalt rock, like caves at Ellora and Ajantha. Brahmanical worship had happened, until Portuguese rule began in 1534. They used this island as a watchtower and installed cannons, targeted to see from the top of a hill. There are two British-era cannons at the top. Portuguese army did shooting practice hence there is maximum damage to all sculptures in the caves except Trimurti sculpture in cave 1. Hinduism was declining on Elephanta Island under Portuguese rule. All caves were abandoned and were under vegetation from 16th AD to 20th AD. The annual festival of Shiva – Maha Shivaratri only survived to this day.

Charles II of England married daughter of King John IV of Portugal. Portuguese left the island  in 1661, since Mumbai which included elephanta island was a part of the dowry.

Nataraja Cosmic dancer

Nataraja – The Cosmic Dancer

1st cave (Great Cave) is a brilliant example of glorious ancient Hindu civilization. World famous for its carving techniques. There are many forms of Lord Shiva in 1st cave. On the south wall of 1st cave, there is an unforgettable three-headed (Trimurti) sculpture of the Lord Mahadeva, representing three essential functions: Aghora (the destroyer – most powerful in the universe) on left side, Vamadeva (master of joy and beauty) on right side and Tatpurusha (preserver of positive and negative principles of existence) in the center. Famous sculptures of Elephanta caves are Trimurti, Ravana shaking the Kailash (same sculpture like cave 16, Kailashnath Temple, Ellora), Shiva-Parvati on Kailash, Ardhanarishvara (half men and half woman), Kalyanasundara (Wedding of Shiva), Shiva Linga, Nataraja (The Cosmic Dancer), Yogishvara (Master of Yoga)and Kartikeya and Ganesha.

Ardhanarishvara (half men and half woman)

Ardhanarishvara (half man and half woman)

Cave 2, 3, 4 and 5 are broken, small and unfinished. Cave 6 and 7 are located in the eastern side of the island. These Buddhist caves are hidden from visitors. Cave 6 and 7 need more excavation. Cave 6 was converted into a church by Portuguese during their ruling of Elephanta Island.

Elephanta cave 5

Ruins of Elephanta cave 5

Presently, ASI and UNESCO are doing maintenance of the caves properly. The Underwater Archaeology Wing of the Archaeological Survey of India (ASI) has discovered remains of bricks from which houses were built, stonewalls, Roman Amphoras (pots used to transport a variety of things like olive, dry fruits and spices), coins and broken parts of vessels from shores of elephanta island. Even the sand on the shore, at the north and the east of the Mora bundar, is full of small potsherds. The Roman artefacts date backs to the 4th to 6th centuries. This discovery shows that Elephanta Island was a major port and was trading with the late Roman Empire. Locals believe there was an underground tunnel from Belapur fort to Elephanta Island.

Interior of Elephanta cave 1 in 1880 and 2015

People:
There are 1000+ populations living in 3 villages in Elephanta Island, namely Shent bundar, Mora bundar and Raj bundar. Local’s earning mainly depends on cave’s tourism.

How to Reach:

The island is easily accessible by ferry from Mumbai City. Typically every 20 minutes a boat leaves from Gateway of India to Elephanta Island. Ferry Cost is Rs.130/person (Return ticket). It will take 1 hour for one side traveling. 30 min walkable distance from Elephanta Island boat jetty to the caves.

Ferry timings:
Gateway to Elephanta: 9 am – 2 pm
Elephanta to Gateway: 12 noon – 5:30 pm

Elephanta island view from boat

Elephanta island – a view from boat

Quick Facts:

Country: India
State: Maharashtra
District: Raigad
Coordinates: 18.96 N 72.93 E
Local languages: Hindi and Marathi
Best Time to Visit: September to March
Closed on:  Monday
Nearest Airport: Mumbai Airport

Reference:
https://en.wikipedia.org/wiki/Elephanta_Caves
http://asi.nic.in/asi_underw_fieldwork.asp
http://www.oldindianphotos.in

17 Jun

Canonical url trailing slash missing for homepage – WordPress & Yoast

wordpress canonical trailing slash

When you install WordPress in a sub directory Example: ‘blog’, the canonical link should be: www.example.com/blog/. But Canonical url trailing slash will be missing for homepage. Yoast will show the home page canonical tag, without having a trailing slash like this : www.example.com/blog

All pages will show the canonical URLs as having a trailing slash except the home page. Yoast WordPress SEO plugin gives canonical url and sitemap url as www.example.com/blog which is incorrect. So the problem is, Google will index home page (www.example.com/blog/) without a trailing slash. The SEO plugin should put the trailing slash in the canonical url and in the sitemap when the site is in a subdirectory.

Solution:

There is no need for editing .htaccess file. You can fix this issiue from WordPress admin panel.
Wordpress admin panel -> Plugins -> Editor. Select WordPress SEO from the right top of the page. Find and select the file “wordpress-seo/frontend/class-frontend.php” from the right side of files list.

In that file, find this code: ” $canonical = home_url();
Update that code like this : ” $canonical = home_url(‘/’);

Done !!

Canonical url trailing slash will be showing for home page (www.example.com/blog/)

05 Jun

Nikita Buyanov’s cute laptops for crazy girls

make up laptop for crazy girls

Nikita Buyanov is an industrial designer, project leader of Contract Wars, working title Russia 2028 and numerous other interactive/ad/game projects. Now he uncovered few outstanding laptop concepts.

This Russian was commissioned to design a series of conceptual, female-oriented laptops for HP/Intel. Nikita Buyanov’s ideas will rock our world. These are some examples of cute laptops for crazy girls.

HP-MakeUp

make up laptop for crazy girls

HP-Perfume

perfume laptop for crazy girls

HP-Nobag

hp nobag laptop for crazy girls

HP-Mama

hp mama laptop for crazy girls

HP-Chameleon

 hp chameleon laptop for crazy girls

HP-Fitness

hp fitness laptop for crazy girls