Tuesday, September 25, 2012

ssh into a remote host without password

Other than the regular password based login, one can use the public/private key based login to get into a remote server.

This is a two step process.

On the local host

  1. ssh-keygen   // follow the prompts, enter nothing for the pass phrase. This will create a id_rsa.pub file in your .ssh folder. 

On the remote server

  1. Log into the remote server. 
  2. Create a .ssh folder if not already present. 
  3. chmod 700 .ssh
  4. cd .ssh
  5. vim authorized_keys
  6. Copy paste the contents of the id_rsa_pub file into the above file. 
  7. save the authorized_keys file 
  8. chmod 700 authorized_keys
  9. exit and try to login again, you will not be prompted for a password. 




Thursday, July 12, 2012

Web app security

OWASP   AppSecLive appseclive.org

HTTP response:  HTTP version, status code, short human readable message.

HTTP messages:
1xx info only
2xx sucess
3xx redirects.
4xx client side errors
5xx server errors

Cookies
  • Upon logout or browser is done, have the cookie set to a date in the past and the browser will delete the cookie.
  • Set the cookie to 'Secure'  -- it will be sent over https and 'HTTP-only" so javascript can't get to the cookie.
BurpSuite ; web app scanner, only $250/yr good deal
WebGoat:  awesome tool with tutorails

Tuesday, August 10, 2010

You know you don't have a chance in IT if:

1. If you can't type without looking at the keyboard.
2. You are in your forties and doing development work, i.e. not architecture or management.

Monday, April 05, 2010

Firefox shortcuts

Cmd-R Rfresh
Cmd-K Search box on top right
Cmd-L Select the address bar
Cmd-W Close a tab
Shift-cmd-W Close a window
Alt-Cmd-> next tab
Fun-up Top of page

IntelliJ IDEA shortcuts

IDEA Shortcuts
Open any file: Shift-command-N
Next tab in the editor: Ctrl -> or <-
Close current tab; Cmd-F4
Var name completion: Ctrl-Shift-space
Optimize imports Fn-Alt-Entr
Join two lines and remove spacing, Shift-CTRL-J
Find in path: ^Ctrl-F
Change svn version num: Verions Control -> subversion -> show working copies format

Give more ram In the file : /Applications/IntelliJ Idea//bin/idea.vmoptions , enter values like the following
-Xmx768m
-XX:MaxPermSize=150m

/Applications/IntelliJ IDEA 9.0.2 CE.app/Contents/Info.plist is another file that has the VMOptions key value that you can tweak.

This is a good post: http://jots.mypopescu.com/post/1416523856/mac-os-x-intellij-idea-jvm-configuration

There's not enough memory to perform the requested operation
Intellij "Please increase Xmx setting and shutdown IDEA for change to take effect"

Friday, March 26, 2010

Developer Interview Questions

1. How is Polymorphism implemented in Java ?
Through interface and abstract class.
2. How do interface help implement polymorphism

3. What component in Axis webservices actually turns XML into objects?

4. How do you convert XML to java in REST
Manually process the XML, there is also the Jersey's framework (JAX-RS)

5. You have 3 tables Company (id, name), Employee(id, title), Person (id, firstName, lastName).
a) Write a query to output title, firstName, lastName of all employees in a given company_id
b) Write names of all companies where there are no employees.

6. What are three major collections in Java?
Map, List, and Set
7. What are the implementations of each, Map, Set and List

8. What's the difference between TreeMap and HashMap?

9. What two methods the class needs to implement for Collections and Why
equals() and hashCode()

10. A class has a synchronized static methodA and synchronize methodB. When two separate threads X, and Y calls these two methods at the same time what happens.
Thread X will get the Class lock on the class and Y will get the instance Lock and both will execute.

12. When you have a synchronized method that calls external methods what can go wrong?
The external method may make a call to the original synchronize method, creating a deadlock.

13. How do you deal with developers that don't want to do certain things, due to philosophical issues like "enter time"?

14. Given a binary tree, print out all the nodes at a given level n. For example at level 0, there is the root node, at level one there may be two, so print value of both. Note that this may be a unbalanced binary tree.

15. What tool do you use for code coverage, and for continuous integration.

16. Are you familiar with TDD?

17. What are some of the best practices for code review.

18. What was the most challenging problem you solved that you are proud of? What was your role.

19. What's the difference between abstract class and interface? When would you use one vs. the other?

20. What's the importance of equals() and hashCode() method?

21. Which type EJB do not have a home interface.

22. What interface must all classes needed persistence via Hibernate implement?

23. In Struts: What object containing request params gets passed to the Action.

24. In Spring: name the file that contains the bean wiring.

25. Is Servlet spec part of J2SE or J2EE?

26. Which Java 1.5 feature allows one to make type-safe collections?

27.

Sunday, March 07, 2010

Questions A Programmer Interviewee Should Ask

1. What is your development cycle/process?
2. What type of computers are developers given, are they free to choose MacOS?, Linux?
3. What do you use for source code control system?
4. Do you have build engineer?

Thursday, January 21, 2010

Tata Communications Data Center expansion in Pune

Tata Communications is continuing its datacenter expansion in India with a new datacenter located in Pune. The new facility is Tata's largest facility in the country at 55,000 net square feet. Tata has already invested Rs125 crore (approximately $27.1m) in its new Pune datacenter and intends to build out the facility over the next three years to an expected investment of Rs500 crore (approximately $108.4m) based on market demand. The new facility will offer colocation, managed hosting and storage and a suite of complementary services, including managed security services and CDN services.

Tata Communications has been in expansion mode, with a 3-year $2bn plan announced in 2008 to expand the company's global information technology infrastructure and broadband capacity. Tata Communications' 3-year expansion plans include increasing its global datacenter presence by adding approximately 500,000 gross square feet of datacenter space.

In February 2009, Tata Communications expanded one of its datacenters in Mumbai, India, and leased space from Digital Realty Trust to expand in London. This was followed by opening a new datacenter in Kolkata in July 2009 and now a new datacenter in Pune. Tata plans to essentially double its datacenter footprint in India by the end of 2011.

Tata is also building a $180m datacenter in Singapore, called the Tata Communications Exchange, which is located in the Tai Seng district (near Paya Lebar) in the central-eastern part of Singapore. The 165,000-gross-square-foot facility will provide a range of services, including datacenter colocation, managed hosting and disaster recovery and business continuity for customers. Tata Communications expects to add about 50 jobs to staff the datacenter when the facility is completed in early 2010. Tata is also opening facilities in 2010 in Chennai, India, and Johannesburg, South Africa.

About Pune

Pune is the eighth largest city and India and the second largest city in the state of Maharashtra after Mumbai. Pune is known for its educational facilities, having more than a hundred educational institutes and nine universities. Pune is emerging as a prominent location for IT and manufacturing companies to expand with its well-educated workforce. Major IT firms in Pune include Infosys, Wipro, Satyam Computer Services, TCS, Cognizant and IBM.

T1R take

T1R expects to continue to see more datacenter expansion in India by Tata and other companies as T1R continues to see a multi-tenant datacenter supply/demand imbalance in India, especially in the large cities of Mumbai, Delhi, Kolkata, Bangalore, Chennai, Ahmedabad and Hyderabad.

With its continued datacenter expansion and the growing reach of Tata's global transmission network, T1R thinks Tata is well positioned, especially in India. With India's rapidly developing market economy, India holds the promise of considerable datacenter market growth over the next 5-10 years. However, navigating the government and regulatory landscape in India makes entry by Western datacenter firms challenging. For Western firms looking for a presence in India, Tata Communications would make a good partner to help navigate the complexities of doing business in the region.

Labels: