Articles

Windows Notes

Articles
How to change the user to admin through command prompt ? net localgroup Administrators "ACCOUNT-NAME" /add If suppose your user name is ngdeveloper then the actual command would be, net localgroup Administrators "ngdeveloper" /add How to remove the user from adminstrator access in windows 10? net localgroup Administrators "ngdeveloper" /delete How to test whether you are admin or not ? Windows -> Run -> netplwiz will show you the users with their user type/access.

How to add canonical link to all routers in Angular 7?

Angular, Articles
How to add canonical link to all routers in Angular 7? When I was trying to find a snippet on how to add canonical link to all routers in Angular 7, I was able to find out lot of snippets in stackoverflow, github and few other blogs. But When I tested all the snippets from both stackoverflow and github, below snippet is the one which is working properly without any issues in all the use cases. Few issues I observed with other snippets: When ever navigation is happened it is keep on adding the canonical link tags, this below snippet just keeps only one canonical link tag. Duplicate canonical link tags added due to above point 1, this below snippet uses update method which always removes and adds the canonical link tag, so this helps to keep only one canonical link tag. No update/remove to...
Letsencrypt commands for beginners

Letsencrypt commands for beginners

Articles, Tools
Letsencrypt commands for beginners ./certbot-auto certificates: This commands lists down all the letsencrypt certificates (both active and expired) with exact path details where the certificate exists. ./certbot-auto certonly -a standalone: This command helps to create a new ssl certificate, if you want to create for more than one domain then enter the domain names with comma. ./letsencrypt-auto renew: This command renews all your existing letsencrypt certificates. This blog explain in detail about the letsencrypt certificate renewal process and stuffs. ./certbot-auto delete: This will list down the certificates installed and asks the prompt for certificate deletion. cd /letsencrypt/letsencrypt: Default path in centos/AWS machines, once the letsencrypt is installed. ./let...
How to create a Simple RabbitMQ listener in Spring boot ?

How to create a Simple RabbitMQ listener in Spring boot ?

Articles, Spring Boot
How to create a Simple RabbitMQ listener in Spring boot ?   We are going to create a simple rabbitmq listener in the same spring boot project, but general usecase would be to use rabbitmq is between different microservices / different spring boot projects. This is to make a understanding of how to use rabbitmq and what are all things we need to do for a rabbitmq connectivity.   Prerequisite: [xml] <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-amqp</artifactId> </dependency> [/xml] Step 1: Declare a queue name in application.properties file Create (or) automatically enable spring boot project to create the queue when not exist in rabbitmq. Add the below entries in your applicat...

Developers Repeated Mistakes

Articles, Errors and solutions, Hibernate, Java
In this post we are going to discuss about the repeated mistakes of developers during design/implementation/planning etc. This is just a sudden thought process, so this post will grow on my day to day experience and research wise only. Feel free to comment your repeated mistakes to add it to this master list. In Hibernate/Databases: While creating/planning a column for description, we forget to define the length of values it can hold or even forget to think such scenarios. So always think about the value length for each and every column to design a proper optimistic design approaches: Bad: Here it can hold only till the default size of 255 length, where as, this field may get the value of length more than 255 as well, in that case this fails and all these type of issues can ...

Tomcat 7, 8, 9 Default Administrator Password

Articles
Tomcat 7,8,9 Default Administrator Password By default you can see the below content in tomcat-users.xml file under (apache-tomcat-7.0.88\conf) By default nothing is configured so add your own username and password for manager-gui roles to get the access for Manager App & Host Managers. [xml] <?xml version='1.0' encoding='utf-8'?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/...

Arraylist to Array Using ToArray() in java

Articles, Java
Syntax: <T> T[] toArray(T[] a) Eg : String[] y = x.toArray(new String[0]); T - the runtime type of the array to contain the collection Parameters: a - the array into which the elements of this list are to be stored, if it is big enough; otherwise, a new array of the same runtime type is allocated for this purpose. Returns: an array containing the elements of this list Throws: ArrayStoreException - if the runtime type of the specified array is not a supertype of the runtime type of every element in this list NullPointerException - if the specified array is null Returns an array containing all of the elements in this list in proper sequence (from first to last element); the runtime type of the returned array is that of the specified array. Size of Array created is eq

Generate angular + Java code using yeoman & Jhipster

Angular, Articles, Java, Tutorials
Generate angular + Java code using yeoman & Jhipster Ensure you have installed yeoman (yo when dealing with npm and yarn) and jhipster (generator-jhipster when dealing with npm and yarn). If not installed, have a quick look at,     Step 1: Run yo jhipster     It will ask around 10 to 15 questions, you can provide the sample values as per the above screenshot and proceed to step 2:   Step 2: Angular 5 & Java Codes are generated   Yeoman generating the java source code:     yeoman generating the angular source code:     Both client (angular 5 - as on march 1st ) and server applications are successfully generated.     Step 3: Run mvnw to run the server application I ran mvnw (in...

100 Things to Know in Angular 4/5/6

Angular, Articles
100 Things to Know in Angular 4 I started writing this post with the intention to keep important and crispy factor about angular in one place. But I am not able to write all the 100 things about angular same time, so I am publishing the post with the information I have handy now and I will make sure this post get updated often till we reach 100 things, if possible 200 things ;) If you guys have something to tell about angular 4, of course it's very small and basic feel free to mention it in the comments section to help all angular developers and newbies. 1. Directives will not and should not have templates. 2. Directives will not have all the lifecycle hooks like components other ngOnInit and ngOnDestroy, because there is no view with directives. 3. *ngIf, *ngFor are structural di...

Spring Boot Tutorials

Articles, Spring Boot
Spring Boot Tutorials: 1. Spring Boot - Is it a Brand New Framework ? Spring boot is not a brand new framework, just like mvc/web/rest/jpa add-ons, it's just a additional kit from spring to reduce the development headaches with spring framework. 2. How to configure spring boot in Maven ? Spring boot provides single dependency entry for pom.xml configuration, <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.5.10.RELEASE</version> </parent> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> </dependencies> Here this downloads all the dependencies re...