Announcement

Collapse
No announcement yet.

Take the Test

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Take the Test

    Saw this article:

    http://www.linuxforum.com/content.ph...-Administrator

    Essentially, the idea here is that if you know nothing about linux, here is a test you can give to prospective applicants to test their ability to do the job. Notice that no answers are given, so I suppose you could type just about anything and pass.

    Now I think that a person's adaptability to a new environment, and willingness and ability to learn are far better indicators of job performance, than having memorized a list of commands. But some suit right out of mba school, who knows as much about computers as there is to know about business ethics, will look at this and think it's a great idea. So, in the interest of promoting the future employability of our readers here, and of undermining what is a fundamentally stupid idea, as well as perhaps testing and increasing our own knowledge, here is a list of the test questions. I have already provided possible answers to the first ten (well, nine of the first ten questions that make sense). Maybe others would like to take on some of these.

    This is intended for fun, so answers need not be totally serious. Remeber, this test is intended to be given by those who know nothing about what they are testing for.

    1) What is the 1st line of a perl script?
    #!/usr/bin/perl

    2) What is the 1st line of a bash script?
    #!/bin/sh

    3) What is the command that finds the location of an executable within your path on a server (ie. perl or grep)
    which command-name

    4) How do you enable php4 for a directory within a site that requires php5 for all other directories - on a cPanel server?
    rtfm

    5) How do you determine the hardware of a running system?
    lshw

    6) Update the locate database
    sudo updatedb

    7) Exclude /home/sites from the locate database
    sudo updatedb --prunepaths /home/sites

    8) Find all of the processes started by “httpd” particular user and kill them in a one liner.
    sudo kill 'ps -U httpd -u httpd -o pid --no-headers'

    9) List all of the open files in use by root
    lsof -u root

    10) Display a list of files that are in a particular directory which are owned by USER and have the permissions of “–rw --- ---“
    ls -l | grep username | grep "-rw------"

    11) Where does cPanel log httpd errors?

    12) Setup a key from from Server A to Server B.

    13) Use chkconfig to stop a service from starting

    14) On the test server, (as a bash one liner)
    a) Schedule the following task to run hourly
    b) List all users IP’s that experienced a fav icon not found error,
    c) Sort the data by IP Address,
    d) Count the number of time each IP was affected,
    e) Put that report into a file
    f) & email the report to hosting@LinuxForum.com.

    15) rsync the following directory _____ to the following directory______. (excluding all .tar files)

    16) using netstat, report back how many tcp connections are in `LISTEN` state

    17) dig the mx records of LinuxForum.com

    18) List the iptables rules w/ line numbers

    19) Drop line 10 of an iptables rule

    20) Blacklist an IP

    21) Change DNS locally on the server to use Google's 8.8.8.8 server

    22) Schedule the server to restart at 2am by command line

    23) Determine if a service is running

    24) Stop a service

    25) Add a database for a new website

    26) Create a one-liner that does the following task.
    A) Generate a report of all IP addresses that appear in access log file from today.
    B) Count the number of times an IP appears in the report.
    C) Determine what is the 5th most active IP address,
    D) Return the second set of 3 digits. ie. ***.168.***.***
    Have at it.
    We only have to look at ourselves to see how intelligent life might develop into something we wouldn't want to meet. -- Stephen Hawking

    #2
    Re: Take the Test

    Hi doctordruid

    I hereby resign from Kubuntu forms because all I could do is:

    How do you determine the hardware of a running system?

    lshw

    It said that I should only run the command if I had blue tights, a cape, and a symbol with an S( or in this case an L) on my chest!

    woodsorelylackingsmoke

    Comment


      #3
      Re: Take the Test

      Hmm, my black robe and incense worked just fine. Don't know what to tell you.
      We only have to look at ourselves to see how intelligent life might develop into something we wouldn't want to meet. -- Stephen Hawking

      Comment


        #4
        Re: Take the Test

        lol
        woodsmoke

        Comment


          #5
          Re: Take the Test

          Comment


            #6
            Re: Take the Test

            Geez. I scored somewhere south of 50%. Do me a favor and take this down before my boss sees it?
            linux since slack 2. kde since beta 1. kubuntu since hardy.

            Comment


              #7
              Re: Take the Test

              Originally posted by doctordruidphd
              2) What is the 1st line of a bash script?
              #!/bin/sh
              If this script is intended for BASH then you must be joking. On *buntu systems /bin/sh is DASH, an interpreter which tries to be compatible with traditional sh. Even on systems where /bin/sh is linked to BASH, invoking BASH as sh causes it to disable its advanced functionality in an attempt to be more compatible with traditional sh.

              I'm not even going to bother with the test. I don't know most of that stuff and would need hours (if not days) to read all the documentation.
              Welcome newbies!
              Verify the ISO
              Kubuntu's documentation

              Comment


                #8
                Re: Take the Test

                Originally posted by SteveRiley
                Any answer has a 25% chance of being chosen randomly. There are two answers that have 25%. Your chance of choosing one of those is 50%. Your chance of choosing "B", which is 50%, is only 25%.
                "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
                – John F. Kennedy, February 26, 1962.

                Comment


                  #9
                  Re: Take the Test

                  Originally posted by GreyGeek
                  Any answer has a 25% chance of being chosen randomly. There are two answers that have 25%. Your chance of choosing one of those is 50%. Your chance of choosing "B", which is 50%, is only 25%.
                  Man gg, you are scary sometimes
                  Welcome newbies!
                  Verify the ISO
                  Kubuntu's documentation

                  Comment


                    #10
                    Re: Take the Test

                    Originally posted by Telengard
                    ....
                    On *buntu systems /bin/sh is DASH, an interpreter which tries to be compatible with traditional sh. ....
                    Exactly...
                    ~$ vdir /bin/dash
                    -rwxr-xr-x 1 root root 101608 2010-04-01 18:29 /bin/dash
                    ~$ vdir /bin/sh
                    lrwxrwxrwx 1 root root 4 2010-05-08 09:51 /bin/sh -> dash
                    ~$ vdir /bin/bash
                    -rwxr-xr-x 1 root root 934336 2010-04-18 21:16 /bin/bash
                    ~$
                    and dash is BSD's command interpreter.

                    My scripts have
                    #!/bin/bash
                    on their first line.
                    BASH(1) BASH(1)

                    NAME
                    bash - GNU Bourne-Again SHell
                    SYNOPSIS
                    bash [options] [file]
                    COPYRIGHT
                    Bash is Copyright (C) 1989-2009 by the Free Software Foundation, Inc.
                    DESCRIPTION
                    Bash is an sh-compatible command language interpreter that executes commands read from the standard input or from a file. Bash also incorporates useful features from the Korn and C shells (ksh and csh).

                    "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
                    – John F. Kennedy, February 26, 1962.

                    Comment


                      #11
                      Re: Take the Test

                      10) Display a list of files that are in a particular directory which are owned by USER and have the permissions of “–rw --- ---“
                      ls -l | grep username | grep "-rw------"
                      This will fail. What is the correct syntax (I know. Do you?)
                      Windows no longer obstructs my view.
                      Using Kubuntu Linux since March 23, 2007.
                      "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                      Comment


                        #12
                        Re: Take the Test

                        Originally posted by GreyGeek
                        Any answer has a 25% chance of being chosen randomly.
                        Source, along with a lively (and lengthy) discussion. Another analysis here.

                        Answers to the actual question "what is the chance you will be correct?" range from 0% to 100%, with fascinating reasoning on both sides. Ultimately, the question's self-referential nature makes any answer indeterminate.

                        Good defense for the 100%-but-actually-not answer:

                        Most people are reading this question as if it were worded as follows: "If you choose [one of the possible answers below] to this question at random..." But that's NOT what the question says. It says "If you choose AN ANSWER".

                        Note that nothing in the question says that your answer is limited to choices (A)-(D). It is only our training in multiple choice questions on tests that makes us assume we must pick one of them. Note that in actual tests, the instructions explicitly state such a restriction. But this question does not. (A)-(D) are actually meaningless camouflage. They are hiding the fact that "choose an answer" is actually a very odd locution. One normally says "find an answer."

                        So when you randomly choose some response to the question, actually ANY random response, your mere act of choosing that response MAKES IT the CORRECT answer to the question. You could randomly choose "ZEBRA" as your response, and the fact that you chose it as the answer to the question makes YOUR answer to the question the CORRECT answer to the question.

                        So if ANY answer YOU CHOOSE is the correct answer, why is "100% the BEST answer? It's BEST (as in most satisfying, as this is only an aesthetic judgment) because it is the least "non sequitur" of an answer. Why? Because it addresses the second half of the question, "what is the chance you will be correct." Since whatever you choose IS the correct answer, the chances of you being correct are 100%.

                        Of course, you shouldn't answer 100% after working out the logic as I have. Why? Because then your answer was NOT chosen at random as the question explicitly demands. So instead, to get the best answer, "100%", but have it be a random answer, you should pick one other answer, say "zebra", and then flip a coin to see which one is your random choice of an answer.
                        And a good defense for the 0%-but-actually-not answer:

                        Lots of people tweeted me about this, asking what the right answer is, and commenting that their brains were melting, exploding, or otherwise acting in an unpleasant or uncomfortable manner.

                        One person tweeted that either you got the right answer or you didn't, so it was fifty/fifty. Clearly not very helpful, but having said that, in this case there is a trick answer relying on this idea. The original question didn't say that we pick an answer uniformly at random - we could choose answer B half the time, answer C the other half of the time, and answers A and D not at all. Then the right answer is 50%, and that works.

                        Similar "uneven" choices can be made to work in the other cases, and it's interesting (and difficult) to explore the possibilities. I'll leave it as an exercise for the interested reader to find distributions that make any given answer "right." There's even a way to make three of the options right all at the same time, although that really doesn't sound right at all!

                        It works, although some people feel that it's cheating, and somehow wrong, not to choose among the options with equal probabilities.

                        So here's another answer.

                        Since none of the options seem to work, then none of them can be right. Since you will choose one of them, you will never get the right answer.

                        Hence the probability of being right is 0. That option doesn't appear, so if you pick randomly you won't get it, and so your chance of being right is 0%, and so it's consistent.

                        So that's another possible answer.

                        Of course, the problem was supposed to be mind-bending, and we can now prevent this second answer by changing the options. We can instead [add the option E: none of the above].

                        Now the second suggested solution - the 0% solution - doesn't work, because if we choose uniformly at random there is a non-zero chance that we pick that. So we're back to the non-uniform choice idea, and the many possibilities afforded by it.

                        But underneath all this is another question: Why should the question have a "right" answer at all?

                        So many of the tweets I got were indignant that there didn't seem to be a single, clear, correct answer. But life's not like that. Some questions don't have answers, and it's especially difficult when things are self-referential.

                        We can create impossible situations. People call them paradoxes, but the term is abused and overused. In some cases it's better simply to say that it's ill-posed, undefined, or otherwise impossible.

                        Questions like that are great for exploring the limits of logic and the recesses of reason. And they make my brain hurt. That's their job.

                        Comment


                          #13
                          Re: Take the Test

                          ls -l | grep username | grep "-rw------"

                          This will fail. What is the correct syntax (I know. Do you?)
                          Sorry:

                          ls -l | grep username | grep -e -rw-------



                          We only have to look at ourselves to see how intelligent life might develop into something we wouldn't want to meet. -- Stephen Hawking

                          Comment


                            #14
                            Re: Take the Test

                            Well, cool. That isn't the solution I had, but then, that's the joy of Linux -- many times there is more than one way to do a task!

                            My solution was:

                            ls -l | grep paul | grep '\-rw-------'
                            Windows no longer obstructs my view.
                            Using Kubuntu Linux since March 23, 2007.
                            "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                            Comment


                              #15
                              Re: Take the Test

                              Originally posted by SteveRiley
                              ....
                              Source, along with a lively (and lengthy) discussion. Another analysis here.
                              .....
                              One person in the comment section applied the Bayesian formula in logical over kill to come to the answer of 25%. Others applied lots of hand-waving, word play, assumption shifting and sillygisms to justify theirs.

                              The question itself cannot be taken independently of the supplied answers. There is no justification beyond sophistry for doing that since multiple choice questions are a common element in environment, and to do so would be to invite the "trick ending" and render essentially all problems as philosophical masturbation. (That's why I always read the last chapter of any scifi book that I am interested in reading. If it has a "poof, the magic dragon" ending I drop it back on the shelf.)

                              If one disconnects the statement of the problem from the supplied choices of the answer, the result reduces to a restatement of the "Liar Paradox", which Kurt Godel used, in 1931, to derive the first of his two theorems on incompleteness. Those two theorems establish that not only is a consistent system of axioms, whose theorems can be listed sequentially, NOT capable of proving all truths about the relations of the natural numbers, there will always be statements in the system about itself that may be, or are, true but are unprovable by the system.

                              Think about that. Math is the Queen of the sciences. Physics has been enhanced by using Math. Chemistry was enhanced by using Physics. Biology was enhanced by using Chemistry. Psychology was .... well, that may be carrying it too far ... Psychology is too political to be considered a science, IMO. It is no wonder that within the sub-sciences, and Math itself, we find ourselves unable to prove things we believe to be true and will never be able to prove them, but we accept them as true with no other basis that our faith in their apparent "truth". This last couple of weeks I've enjoyed listening to NOVA on PBS as it presents the String Theory in an attempt to create a GUT (Grand Unified Theory) of everything, explainable by one or more system of equations, from which all previous laws of Physics can be derived as special cases. Among other nicities it requires a multi-dimensional universe, or multiple simultaneous universes representing every possible outcome of every possible event in everyone's life. Oh, and it can't be falsified because to test it we would have to "step out" of our universe.



                              "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
                              – John F. Kennedy, February 26, 1962.

                              Comment

                              Working...
                              X