Wednesday, 17 September 2014

UNIX Commands Interview Questions and Answers

UNIX Commands Interview Questions and Answers

Question: How to create readonly file?
touch fileName.txt
chmod 400 fileName.txt


Question: How to get the OS in unix?
uname -a


Question: How do you know if a remote host is alive or not?
ping www.example.com
telnet www.example.com


Question: How to copy from one host to another host?
scp file.zip username@hostname:/foldername


Question: How do you find which process is taking how much CPU?
top


Question: How do you check how much space left in current drive
dh-h

Question: How to Restart Apache over the SSH?

/etc/init.d/apache2 restart


Question: How to Stop Apache over the SSH?

/etc/init.d/apache2 stop


Question: How to Start Apache over the SSH?

/etc/init.d/apache2 start


Question: How to Restart Httpd over the SSH?

service httpd restart


Question: How to Stop Httpd over the SSH?

service httpd stop


Question: How to Start Httpd over the SSH?

service httpd start


Question: Import database from sql file to mysql?

mysql –u username –p databasename tablename < sqlfilename.sql


Question: How to delete ALL files including sub directory in current directory with prompting each time?

rm –r *


Question: How to display first 7 lines of file?

head -7 fileName.txt


Question: How to display Last 7 lines of file?

head -7 fileName.txt


Question: How to reverse a string in unix?

echo "Web technology expert notes" | rev


Question: How to unzip a file in Linux?

unzip –j file.zip


Question: How to test if a zip file is corrupted in Linux?
unzip –t file.zip


Question: How to find hidden files in current directory?
ls -lrta


Question: How to check if a file is zipped in Unix?
file file.txt //file.txt: ASCII text


Question: How to check all the running processes in Unix?
ps –ef


Question: find all files in current and subdirectories which contains 'webtechnology' name?
find . -name 'webtechnology'


Question: How to make any script file executable?
chmod 755 *.sh


Question: How to kill process in unix server?
kill -9 #pid

Tuesday, 16 September 2014

Golden Rules for successful project

Golden Rules for successful project



Following are Golden rules for successful Projects.


1. Create New repository for new project.

2. Follow SDLC and STLC life cycle for your new project.

3. Always escape your output, never full trust on data in database, Its very good habit to escape your data before displaying in web page.

4. Always filter your input, when user fill data in form do sanitize your data before feeding in database.

5. Use unicode, So that you can display data on web page, specially when using multi language.

6. Use cURL in PHP, Don't use file_get_contents use CURL(Client URL).

7. Coding Convention, Its good to follow coding convention because it will increase readability, understanding and reusability.

8. Don't code when you don't need, today lot of good code snippets available on internet,just need few searches. So Its good to do little R&D before starting work. It will definitely save your precious time.

9. Put CSS in header and javascript in footer, It will increase the performance of web page.

10. Use JSON in-stead of XML, Today, million of APIs are using JSON because of its quality like fast, human readable etc.

11. Add Security check(Auth/ACL)  on every page of website and add Security check from server end also.

12. Developer should work under experienced project manager/Team Lead and He/She should do the Reviews of project weekly.