Friday, November 25, 2011

Unix Assignment2- Solutions

UNIX

1. Create a tree structure named ‘training’ in which there are 3 subdirectories – ‘level 1’,’ level2’ and ‘cep’. Each one is again further divided into 3. The ‘level 1’ is divided into ‘sdp’, ‘re’ and ‘se’. From the subdirectory ‘se’ how can one reach the home directory in one step and also how to navigate to the subdirectory ‘sdp’ in one step? Give the commands, which do the above actions?

Ans : To navigate from 'se' to home directory,in one step,the command is : cd

To navigate from 'se' to 'sdp',in one step,the command is : cd ../b

2. How will you copy a directory structure dir1 to dir2 ? (with all the subdirectories)

Ans : cp –R dir1 dir2

3. How can you find out if you have the permission to send a message?

Ans : ls -l ( To check access permissions)

4. Find the space occupied ( in Bytes) by the /home directory including all its subdirectories.

Ans : du -s -b

5. What is the command for printing the current time in 24-hour format?

Ans : date +%T

6. What is the command for printing the year, month, and date with a horizontal tab between the fields?

Ans : date +%Y%t%B%t%e

7. Create the following files: chapa, chapb, chapc, chapd, chape, chapA, chapB, chapC, chapD, chapE, chap01, chap02, chap03, chap04, chap05, chap11, chap12, chap13, chap14, and chap15.

Ans :The general syntax is :

cat > filename

Type the contents of file

Press Ctrl+D

cat > chapa

Type the contents of file

Ctrl+D

Cat > chapb

Type the contents of file

Ctrl+D

Cat > chapc

Type the contents of file

Cat > chapd

Type the contents of file

Ctrl+D

Cat > chape

Type the contents of file

Ctrl+D

Cat > chapA

Type the contents of file

Ctrl+D

Cat > chapB

Type the contents of file

Ctrl+D

Cat > chapC

Type the contents of file

Ctrl+D

Cat > chapD

Type the contents of file

Ctrl+D

Cat > chapE

Type the contents of file

Ctrl+D

Cat > chap01

Type the contents of file

Ctrl+D

Cat > chap02

Type the contents of file

Ctrl+D

Cat > chap03

Type the contents of file

Ctrl+D

Cat > chap04

Type the contents of file

Ctrl+D

Cat > chap05

Type the contents of file

Ctrl+D

Cat > chap11

Type the contents of file

Ctrl+D

Cat > chap12

Type the contents of file

Ctrl+D

Cat > chap13

Type the contents of file

Ctrl+D

Cat > chap14

Type the contents of file

Ctrl+D

Cat> chap15

Type the contents of file

Ctrl+D

8. With reference to question 7, What is the command for listing all files ending in small letters?

Ans : find –name “*[a-z].*”

9. With reference to question 7, What is the command for listing all files ending in capitals?

Ans : find –name “*[A-Z].*”

10. With reference to question 7, What is the command for listing all files whose last but one character is 0?

Ans : find –name “*0?.*”

11. With reference to question 7, What is the command for listing all files which end in small letters but not ‘a’ and ‘c’?

Ans: find –name “*[b d-z].*”

12. In an organisation one wants to know how many programmers are there. The employee data is stored in a file called ‘personnel’ with one record per employee. Every record has field for designation. How can grep be used for this purpose?

Ans : grep -c "programmers" personnel

13. In the organisation mentioned in question 12 how can sed be used to print only the records of all employees who are programmers.

Ans : sed -n /programmers/p personnel

14. In the organisation mentioned in question 12 how can sed be used to change the designation ‘programmer’ to ‘software professional’ every where in the ‘personnel’ file

Ans : sed 's/programmer/software professional/g' personnel

15. Find out about the sleep command and start five jobs in the background, each one sleeping for 10 minutes.

Ans :sleep 10m & sleep 10m & sleep 10m & sleep 10m & sleep 10m &

16. How do you get the status of all the processes running on the system? i.e. using what option?

Ans : ps -e

Unix Assignment1- Solutions

UNIX ASSIGNMENT

Question 1: Write a command to list all the files inside a folder i.e. if there is a folder inside a folder then it should list all files inside the sub-folder which is inside the folder to be listed.

Answer 1: ls –R

Question 2: Search all the files which contains a particular string, say “include” within a folder.

Answer 2: for i in *.*; do grep -l include $i; done

Question 3: Rename all the files within a folder with suffix “Unix_” i.e. suppose a folder has two files a.txt and b.pdf than they both should be renamed from a single command to Unix_a.txt and Unix_b.pdf

Answer 3: for i in *.*; do mv $i Unix_$i; done ;

Question 4: Rename all files within a folder with the first word of their content(remember all the files should be text files. For example if a.txt contains “Unix is an OS” in its first line then a.txt should be renamed to Unix.txt

Answer 4 : for i in *.txt; do j= "$(head -1 $i | cut -f1-d" ").txt"; mv "$i" "$j"; done

Question 5 : Suppose you have a C project in a folder called “project”, it contains .c and .h files, it also contains some other .txt files and .pdf files. Write a Linux command that will count the number of lines of your text files. That means total line count of every file. (remember you have to count the lines in .txt files only)

Answer 5 : wc -l *.txt

Question 6 : Rename all files which contain the sub-string 'foo', replacing it with 'bar' within a given folder.

Answer 6 :for i in ./*foo*; do mv "$i" "${i//foo/bar}";done

Question 7 : Show the most commonly used commands from “history”. [hint: remember the history command, use cut, and sort it.

Answer 7 : history |cut -f6- -d" " | sort

Wednesday, November 23, 2011

TCS ASPIRE Communication Assignment for group 6,7 and 8

Remember the basic rules of writing.
Use proper punctuations.
Watch out for the spelling &
Use CAPITAL LETTERS wherever appropriate!

1. I returned back from my home on 2'o clock at Wednesday.
I returned from my home at 2'o clock on Wednesday.

2. Myself Divya, I am coming from Chennai.
I am Divya and I come from Chennai.

3. We all of us visited many places last year.
We visited many places last year
.
4. I have earned many friends in my college here.

I have made many friends in my college.

5. English is been spoken across the world.
English is spoken across the world.

6. When I was in my tenth class,I use to go to play cricket.
When I was in the tenth standard, I used to play cricket.

7. Most directors do not mind to give chance to new actors.
Most directors do not mind giving a chance to new actors.

8. If I were a Prime Minister of this country,I changed the education systems first.
If I were the Prime Minister of this country, I would have changed the education system.

9. The best part I liked about the movie were the action scenes.
The best part I liked about the movie was the action scenes.

10. My most saddest moment was when I did not got through the interview.
My saddest moment is when I did not get through the interview.

11. In the schools the English should be taught by qualified teachers.
In schools, English should be taught by qualified teachers.

12. After our discussion,I am understanding you better now.
After our discussion, I understand you better.

13. He can be able to sing very well.
He can sing very well.

14. We are having many beautiful beaches in city.
We have many beautiful beaches in the city.

15. An interesting incident happened with me in starting.
In the beginning, an interesting incident happened to me.

16. I went to library to get as many informations as possible.
I went to a library to get as much information as possible.

17. I can't cope up with a lot of stress.
I can't cope with a lot of stress.

18. I'm not speaking to nobody in this class.
I'm not speaking to anybody in this class.

19. In this days youth are addicted at social networking.
In these days the youth are addicted to social networking.

20. Its a big relief that I did not screw up my lab exams.
It's a big relief that I did not make a mess of my lab exams.

Tuesday, November 22, 2011

TCS Salary Hike April 2012 – An Estimate



This study has been prepared on the famous Newton’s Algorithm - Newton–Raphson Method along with Linear Interpolation, Current IT Market Scenario and Macro Level Challenges which IT Companies normally suffer with.

The study takes into consideration that most of us would be placed in Band B or Band C. As, people hardly get Band A in TCS with 3 Years Experience. The study fails for Band D because TCS has an unusual process of decreasing the salary rather than increasing it. So by means if you happen to have a Band D (unfortunately) your experience would have increased with a negative hike in salary. It’s weird but TRUE.

The graphs and tables below show a comparative study of estimated salary hike in April 2012 across different TCS Bands for people having 3 Years Experience:

Ø Moving from Band B to Band B

Description

Salary (Lakhs)

Band

%Hike

Joined TCS

3.15

C

7.93

Hike After Recession

3.40

C

17.64

Apr’10

4.00

B

18

Apr’11

4.72

B

13

Apr’12

5.33


The analysis found that there would be an estimated salary %Hike of around 13% with final salary falling around 5.33 Lpa.

Ø Moving from Band C to Band C

Description

Salary (Lakhs)

Band

%Hike

Joined TCS

3.15

C

7.93

Hike After Recession

3.40

C

17.64

Apr’10

4.00

C

8.75

Apr’11

4.35

C

11.44

Apr’12

4.84










The analysis found that there would be an estimated salary %Hike of around 11.44% with final salary falling around 4.84 Lpa.

And finally the Blockbuster:

Ø Moving from Band C to Band B

Description

Salary (Lakhs)

Band

%Hike

Joined TCS

3.15

C

7.93

Hike After Recession

3.40

C

17.64

Apr’10

4.00

C

8.75

Apr’11

4.35

C

22.52

Apr’12

5.33









A whooping estimated salary %Hike of around 22.52% with final salary falling around 5.33 Lpa. Even the graph has Skyrocketed.

Please note this is a salary estimate and has to be kept in the bracket of ± 2% Deviation. So if you happen to get a salary hike in TCS more than the ones which are mentioned above than that’s Great!! What needs to be seen is Can an Organization with 2.4 Lakhs (as on Q2-11) Workforce keep its Employees Happy??

If by any means the salary hike is less than what is mentioned above then start preparing your resumes, get those posted on job portals or get yourselves a reference for a company because you are not getting the correct price of the invaluable talent you carry.

In the end, I happen to remember the Royal Stag tagline It's Your Life Make It Large.

Please feel free to drop in your valuable comments. The highly anticipated post Realizing Your Potential While Experiencing Uncertainty would be out soon.

Sunday, November 20, 2011

Online Shopping Portal -Case Study -Solutions

After learning all the technologies within the first 4 weeks, participants are expected to develop the below given casestudy in week 5.

Scenario: Online Shopping Portal

XYZ.com wants to create an online shopping portal for managing its registered customers and their shopping.

The customers need to register themselves first before they do shopping using the shopping portal. However, everyone, whether registered or not, can view the various products along with the prices listed in the portal.

The registered customers, after logging in, are allowed to place order for one or more products from the products listed in the portal. Once the order is placed, the customer gets a reference order number and the order status should be “order in process”.

The customers can track their order using the given reference number.

The management of XYZ.com should be able to modify the order status of a particular reference order number to “shipped” once the products are shipped to the shipping address entered by the customer at the time of placing the order.

Can you help XYZ.com to realize their dream of having an online shopping portal?

Steps to be followed

  1. Create the interface for the XYZ.com shopping portal using HTML/XHTML and CSS.
  2. Implement the client side validations using JavaScript.
  3. Create the tables using MySQL.
  4. Implement the functionality using the server side scripting language, PHP.
  5. Integrate all the above tasks and make the XYZ.com shopping portal functional.

Note: Please zip your casestudy files and upload it here. You can submit only one file.


Solution
Download The Zip file Here Download

Wednesday, November 16, 2011

Proud to be a TCSer



Proud to be a TCSer

Ø    You will feel proud that you are a part of an organization that brought India among top global business countries.
Ø    Will feel respect that other person will have it for you once you say that  “You are working for TCS “
Ø    Power of signature, which has hardly any significance few months back but can now fetch Lakhs from any bank.
Ø    Power of Official email ID -> It is said that whenever you send mail from TCS email id you are not representing yourself, you are also representing TCS. so once it is misused and sent to client , it may terminate the project and can cause loss for TCS ,in terms of million of dollars.
Ø    Feeling that life is not all about getting pass in ILP,but u will feel life is all bout going one step forward every time.
Ø    Lastly, you will feel its a perfect time to share your responsibility in a family where ours parent has invested Lakhs and that too with such a love n patience n suffering. Now its our turn to make them happy!
·         One of the most appreciative work of TCS is that, they have the collaboration with book24*7.com.Every possible book of every category is available in e-book format and is totally free for TCSers and non TCSers have to pay a minimum of 400$ per category of the book , to become the member of this site. The book24*7 site has a very good user interface which will make you to learn more and more. You can access it , once you join the TCS
·         There are 3 kinds of people in TCS.
1.      One who believes in buttering. They may get good performance rating and better variable pay. But buttering will not ensure on site project, no matter how much u do !
2.      Getting on site project is totally performance oriented.
3.      One who think that as they get into TCS, so with this every responsibility is over. So they stay at same post and will only be promoted on basis of experience but not merit.
4.      One who has a habit of continuous learning but sadly only 10-15 % falls into this category. But for them TCS has such a variety of opportunity one can’t even imagine of…
·         No matter how intelligent or how dumb you are …! The only thing matters in ILP is the average performance of your batch (i.e.,) around 30 – 40 and based on which the stream is allocated to the whole batch.
·         Nothing will happen even if you fail in Exams during ILP. All you need to have is positive attitude and a proper behavior. Your ILP days will be extended and they set up less than 35 / 100 to take retest. TCS thinks thrice before throwing a TCSer out !
·         Those who are not interested in some specific stream , suppose Java and got Java as a stream can change his project other than Java after ILP , provided other project is there or wait for project on bench and join as soon as possible
·         If any one wish to do higher studies after two years, TCS will give you leave for two years without pay, with One year bond and No Sponsorship.
TCS has 20 holiday resorts in India, almost at all famous hill stations and few in South East Asian Countries. Charges are as low as Rs.200 per day in India and around Rs.1100 outside India. One can book it any time.
·         TCS has Insurance tie up with Medical Assistance, India Group. It covers complete medical expenses.Rs.50,000 for general treatment and upto 5 Lakhs / Year for majors. It includes cashless treatment at Aiims,Fortis,Gangaram,Escort. Rs.2000 is charged from an employee per year and Rs.6000 for parent, which is optional.
·         Common training is conducted in classroom & labs, whereas in stream training you will be provided with cubicles. Each consist of 4 members

·         There are project assignments given and there will be regular team meetings, conference & so !
·         There is no Pre – ILP test conducted but there are three tests during training, EC1, EC2 and EC3. Each test is conducted in a interval of 10 days!

·         TCS has tie up with Indian Airlines! When you are coming back from abroad, you are allowed to bring 25% extra with respect to other passengers.

·         Getting foreign project is almost every one’s dream! If you are put up in a project abroad, you will be given free lodging, food + your actual salary, every month.
·         TCS has a policy , “If you clear all IT (Income Tax) Certification , we will pay you full amount”

·         ILP is 55 working days for the year 2010.
·         From a TCSer: Please make your profiles in Linkedin . Came to know the importance of this site from HR.Now every company started to search your profile in LinkedIn. They see your networking strengths and how many recommendations you have @ work. Promotions in thae company are concerned with these things only!*Linkedin is the only social networking site which we can access from TCS .
·         TCS has a site Ultimatix and all study materials can be accessed online only
·         Laptops are allowed only in Hostel , restricted in Office
·         From HR Head, Chennai ILP: First day for Fresher @ TCS … Majority came with parents and siblings. It seems TCS turned like a Kindergarten School but that shows even their parents feel PROUD and don’t want to miss to see you entering into TCS first time!
·         Every year TCS Celebrates a Family Day where each employee can bring up to four family members and make them visit the whole TCS Campus and their cubicle where they use to work. At this particular day free transport service and free food is provided by the company plus a picnic organized by company at some theme park or a similar place. Everything is free of cost!
·         After one year in TCS , you can take leave up to one continuous year but you will not get paid by TCS during this time but you will remain as TCS employee!
·         TCS has started posting Job Openings in it’s internal portal for it’s employee to show their talent. There are 2000 + vacancies in UK and Europe. If u have capability for TCS Project any where in the world you can apply for it and you will be shifted. ** Applicable after One Year , since you have joined TCS
(Source : TCS 2010 FB Group.Special thanks to Aditya Shandilya)