Friday, January 20, 2017

Remove Yeoman Generator

To remove a Yeoman generator that is installed in your system, you need the npm module name of your Yeoman generator.

Do this:

yo --list

This will list out all the generator that are installed. Get the name of the generator that you want to remove. Prefix it with 'generator-'. This is your node module that needs to be removed.

Next,

npm uninstall -g <node module>

Then,

npm cache clear

This should uninstall your Yeoman generator.

Wednesday, September 23, 2015

Setting up infrastructure for a new development

When I setup a new software system, I will need the following:

  1. Database Server
  2. Application Server
  3. Code Repository Server
  4. A laptop / desktop for development
  5. Build System
    1. Build System Host Server
    2. Build System Test Server


Which means, at a minimum, we will need 5 servers. For a new developer with very limited requirements, this is probably too much cost.

So, how can we reduce cost?

1. Combine Database Server and Application Server into one.

2. Use Github (git) or Sourceforge (SVN) for Code Repository.

3. Use your laptop to run Build Host and Test.

This would be a good starting point. As you go along, you can divide your servers into different machines.

If you don't have heavy requirement, it is a good idea to use cheap CPUs - like Raspberry Pi.

Thursday, February 26, 2015

Apache Tomcat in AWS Ubuntu instance

I am trying to setup a new website for myself.


  1. Decided to use aws Free-tier. I still have not figured out the domain name and where to register it. I am thinking GoDaddy for this.
  2. Created a Ubuntu linux instance in free-tier. I created a new key pair and downloaded it while creating the Ubuntu EC2 instance.
  3. Configured Seucrity Groups in http://aws.amazon.com to allow SSH from computers that I usually use.
  4. Putty-ed into the instance and installed apache. sudo apt-get install apache2
  5. Changed Security Group to allow HTTP connection from "Anywhere". Anywhere was one of the options - other options was to restrict it to my IP, and use Subnet mask.
  6. Apache was running while the installation was complete. In case, I had to start it, I would have used sudo apache2 start.
  7. Gave the Public DNS of my instance in my browser, I got the apache's index.html. This index.html is located in this directory /var/www/html/. /var/www/html/ is the default Document Root. If you need to change the Document Root, use /etc/apache2/sites-available/000-default.conf file. 


Thursday, January 22, 2015

US T Shirt sizes for references

I found a great guide on deciding the T-shirt sizes and pant sizes. Hope that helps you too:

For men

 
 
XXS
 
XS
 
S
 
M
 
L
 
XL
 
2XL
 
3XL
 
Chest (inches)
 
29-31
 
30-32
 
34-36
 
38-40
 
42-44
 
46-48
 
48-50
 
50-52
 
Waist (inches)
 
27-29
 
28-30
 
30-32
 
32-33
 
33-34
 
36-38
 
40-42
 
44-48
 

Source: https://www.americanapparel.net/sizing/default.asp?chart=mu.shirts&c=

For Women:

 
 
XXS
 
XS
 
S
 
M
 
L
 
XL
 
2XL
 
 
 
Size
 
00
 
0
 
0-2
 
4-6
 
8-10
 
12-14
 
16-18
 
 
 
Chest (inches)
 
26-28
 
28-30
 
30-32
 
32-34
 
36-38
 
40-42
 
44-46
 
 
 
Waist (inches)
 
20-22
 
23-24
 
25-26
 
27-28
 
30-32
 
33-35
 
36-38
 
 
 

https://www.americanapparel.net/sizing/default.asp?chart=womens.shirts

Sunday, October 5, 2014

Install Ruby on Rails in Ubuntu EC2 instance

This is a good list of steps that I followed to install Ruby on Rails.

https://www.digitalocean.com/community/tutorials/how-to-install-ruby-on-rails-on-ubuntu-12-04-lts-precise-pangolin-with-rvm

Saturday, April 12, 2014

All about Hashing

Hash Table (or Map) is such an important data structure that we use in our daily programming. It is very important that we understand what goes on behind the scenes in a Hash Table (or a Map)

This is a video from IIT that I stumbled upon. These are both great videos:

Dictionaries:


Hashing:




Learn and have fun.

Tuesday, February 4, 2014

Using default WorkManager in your weblogic server


In one of the projects that I work on, we extensively use Weblogic Server. It is great. I thought I would share with all a tip that I learnt today.

If you want to execute a Thread in Weblogic Server, the best idea will be to use a Work object instead of a Thread . Work objects are managed by WorkManagers.  WorkManagers are configured to a great extent. Read about it here.

There are many different types of WorkManagers - Default, Global, Application-level WorkManagers. The default WorkManager, not surprisingly, is used for all internal Weblogic tasks. For most of our needs, the default WorkManager is good enough. Here, I will quickly discuss how to schedule a Work using the default WorkManager.

There are two places you need to change:

First is in your web.xml:
Add a resource-reference to default WorkManager.

  <resource-ref>
    <res-ref-name>wm/MyWorkManager</res-ref-name>
    <res-type>commonj.work.WorkManager</res-type>
    <res-auth>Container</res-auth>
    <res-sharing-scope>Shareable</res-sharing-scope>
  </resource-ref>
  
This lets your application refer to default WorkManager. To use it in your code:

InitialContext ic = new InitialContext();
WorkManager wm = (WorkManager) ic.lookup("java:comp/env/wm/default");
wm.schedule(new TestWork());

This should use the default WorkManager to start a Work object.

I should thank this article for helping me understand how I should configure. There are a few modifications I made to suit my needs.