Meet your Life Partner

Search Your World

Showing posts with label Techinal Guidelines. Show all posts
Showing posts with label Techinal Guidelines. Show all posts

Wednesday, June 9, 2010

How can I install a package directly from Internet? Can I use a proxy?

 RPM can be used to install and update directly from the network. You don't need to download the package and then installs it, RPM can do it for you. It supports both HTTP and FTP protocols. To install/upgrade from a FTP server, the syntax is:
rpm -Uvh ftp://user:pass@ftpserver/directory/package.rpm
You can exclude user/pass credentials and login as anonymous/ftp user if you want. The following command will connect using a Proxy Server and then lists the contents of the package "remote-package.rpm":
rpm -qpl --ftpproxy proxyserver --ftpport port ftp://ftpserver/dir/remote-package.rpm
Where "proxyserver" can be the hostname or IP address of your Proxy Server as well as "port" is the listening port on that server. The same rules apply to HTTP protocol, so the following command uses a Proxy Server to query the required packages for "remote-package.rpm" installation:
rpm -qpR --httpproxy proxyserver --httpport port http://webserver/dir/remote-package.rpm

How can I list what files will be installed by a RPM package?

This is usefull when you have to verify the contents of a package, execute the following on the shell to see the contents of the installed package "cpp":

rpm -ql cpp


The "-l" parameter stands for list. And here's the output:


# rpm -ql cpp
/lib/cpp
/usr/bin/cpp
/usr/lib/gcc-lib
/usr/lib/gcc-lib/i386-redhat-linux
/usr/lib/gcc-lib/i386-redhat-linux/3.3.2
/usr/lib/gcc-lib/i386-redhat-linux/3.3.2/cc1
/usr/share/info/cpp.info.gz
/usr/share/info/cppinternals.info.gz
/usr/share/man/man1/cpp.1.gz

To do the same for a package file(ex: cpp-3.3.2-1.i386.rpm) add the parameter "-p" indicating a RPM package:

rpm -qpl cpp-3.3.2-1.i386.rpm

Sunday, May 9, 2010

Webhosting Interview Questions


1. What is Web Hosting?
Web hosting is the act of renting space and bandwidth through a company so that you may publish your web site online. 

2. What is Virtual Hosting?
Also known as shared hosting, this form of web hosting should suffice for most everyone. Virtual hosting simple refers to the fact that your site is on one server, and that this server hosts mulitple sites. You are virtually shared - your site will not be the only one on this specific server. Very few sites would actually need the power of a dedicated server, so this option provides to be a reliable and cheap solution.

3. What is a Domain Name?
A domain name is a word along with a TLD that uniquely identifies your website.

4. What is uptime?
Uptime is the percentage of time that a web site is working. For example, if some host has an uptime average of 99.86%, this means that your site will be down for a total about 1 hour each month. We monitor uptime of customer websites of many web hosts and we display this data on the host's details page. Some hosts also offer "uptime guarantees" but this is not as valuable as it might appear

5. How do I upload my site?
he main method of uploading files to your site's account is by using FTP. When you sign up with a host, you will probably get an FTP account that lets you access files in your account (usually ftp.yoursitename.com, your main account name and password). Then you can use a built-in Windows or Internet Explorer FTP client, or some other software that supports FTP such as CuteFTP, WS_FTP, or Total Commander, to transfer files from your hard drive to your account. If you don't get an FTP account or if you prefer a Web interface, you can use your account control panel's File Manager instead.

6. What is full-service web hosting?
"Full-service" can refer to a variety of services offered in addition to providing web space, transfer, and emails for a web site. For example, it could be 24/7 toll free phone support, web design services, or web site content maintenance services.

7. What is domain parking?
Domain parking lets you cheaply reserve a domain name for future use and display an "under construction" default page on it. You can register a domain and not park it anywhere but then your site will simply be inaccessible until you get a web host. Some registrar let you park your domain for free.

8. Can I run my own software on my site?
This depends on a web host and a plan. Most plans will allow running scripts in languages such as Perl or PHP. Some plans will also allow you to compile program in C/C++ and run them. Some Unix plans will also allow you to run "cron" which enables you to automatically execute programs or scripts at a specific time and date. However to get a full control over all aspects of your server, you will need a dedicated or co-located server instead of a shared plan.

9. What is the difference between UNIX hosting and Windows hosting?
If you need to support Microsoft products such as ASP, MS Access, or VBScript, then Windows hosting would be better. Furthermore, if you are comfortable with IIS and do not have the time to understand how UNIX works, Windows hosting would again be a better choice.

10. How do I track how many hits my website gets?
There are a few things that need to be cleared in terms of terminology: * Hits - this simply refers to the number of 'elements' loaded on your site. If one page has five images in it, viewing that page once adds 6 hits (one page + five images). * Impressions - the number of times all the pages on your site are seen (also simply called pageviews). Impressions are sometimes referred to as 'hits' which can cause confusion * Uniques - the number of people that visited your site

Linux admin interview questions

1. How do you take a single line of input from the user in a shell script?

   2. Write a script to convert all DOS style backslashes to UNIX style slashes in a list of files.

   3. Write a regular expression (or sed script) to replace all occurrences of the letter ‘f’, followed by any number of characters, followed by the letter ‘a’, followed by one or more numeric          characters, followed by the letter ‘n’, and replace what’s found with the string “UNIX”.

   4. Write a script to list all the differences between two directories.

   5. Write a program in any language you choose, to reverse a file.

   6. What are the fields of the password file?

   7. What does a plus at the beginning of a line in the password file signify?

   8. Using the man pages, find the correct ioctl to send console output to an arbitrary pty.

   9. What is an MX record?

  10. What is the prom command on a Sun that shows the SCSI devices?

  11. What is the factory default SCSI target for /dev/sd0?

  12. Where is that value controlled?

  13. What happens to a child process that dies and has no parent process to wait for it and what’s bad about this?

  14. What’s wrong with sendmail? What would you fix?

  15. What command do you run to check file system consistency?

  16. What’s wrong with running shutdown on a network?

  17. What can be wrong with setuid scripts?

  18. What value does spawn return?

  19. Write a script to send mail from three other machines on the network to root at the machine you’re on. Use a ‘here doc’, but include in the mail message the name of the machine the mail is sent from and the disk utilization statistics on each machine?

  20. Why can’t root just cd to someone’s home directory and run a program called a.out sitting there by typing “a.out”, and why is this good?

  21. What is the difference between UDP and TCP?

  22. What is DNS?

  23. What does nslookup do?

  24. How do you create a swapfile?

  25. How would you check the route table on a workstation/server?

  26. How do you find which ypmaster you are bound to?

  27. How do you fix a problem where a printer will cutoff anything over 1MB?

  28. What is the largest file system size in solaris? SunOS?

  29. What are the different RAID levels?

  30. Advantages/disadvantages of script vs compiled program.

  31. Name a replacement for PHP/Perl/MySQL/Linux/Apache and show main differences.

  32. Why have you choosen such a combination of products?

  33. Differences between two last MySQL versions. Which one would you choose and when/why?

  34. Main differences between Apache 1.x and 2.x. Why is 2.x not so popular? Which one would you choose and when/why?

  35. Which Linux distros do you have experience with?

  36. Which distro you prefer? Why?

  37. Which tool would you use to update Debian / Slackware / RedHat / Mandrake / SuSE ?

  38. You’re asked to write an Apache module. What would you do?

  39. Which tool do you prefer for Apache log reports?

  40. Your portfolio. (even a PHP guest book may work well)

  41. What does ‘route’ command do?

  42. Differences between ipchains and iptables.

  43. What’s eth0, ppp0, wlan0, ttyS0, etc.

  44. What are different directories in / for?

  45. Partitioning scheme for new webserver. Why ?

Perl interview questions

 1. What arguments do you frequently use for the Perl interpreter and what do they mean?


   2. What does the command ‘use strict’ do and why should you use it?

   3. What do the symbols $ @ and % mean when prefixing a variable?

   4. What elements of the Perl language could you use to structure your code to allow for maximum re-use and maximum readability?

   5. What are the characteristics of a project that is well suited to Perl?

   6. Why do you program in Perl?

   7. Explain the difference between my and local.

   8. Explain the difference between use and require.

   9. What’s your favorite module and why?

  10. What is a hash?

  11. Write a simple (common) regular expression to match an IP address, e-mail address, city-state-zipcode combination.

  12. What purpose does each of the following serve: -w, strict, -T ?

  13. What is the difference between for & foreach, exec & system?

  14. Where do you go for Perl help?

  15. Name an instance where you used a CPAN module.

  16. How do you open a file for writing?

  17. How would you replace a char in string and how do you store the number of replacements?

  18. When would you not use Perl for a project?