Thursday, February 21, 2008

Super Good Article about Veritas Volume Manager

http://www.adminschoice.com/docs/vxvm.htm

Wednesday, February 20, 2008

Solaris - Types of file systems

Conceptually there are only 3 types of file systems:

1. Disk based file system
2. Network based file system
3. Virtual File systems.

Solaris - How to find out, How many partitions exists on a disk

Use a command called

prtvtoc

df only shows the slices that contains file systems and have been mounted. If we want to see all the partitions on a disk, we can use the 'prtvtoc' command.


~Cheers

हाउ टू तुर्ण ओं फ्लाश्बैक फेअतुरे ओं Oracle

alter database flashback on;

Thursday, February 14, 2008

Test Your Knowledge of Regular Expressions and Shell Basics

Test Your Knowledge of Regular Expressions and Shell Basics
by Emmett Dulaney


Regular expressions have set Unix-based operating systems apart from others almost since the very beginning. While other operating systems incorporate wild cards and quit there, Unix goes far beyond that. Regular expressions allow you to tweak and refine operations with tools ranging from directory searches to stream editing and everything in between. Not only do you need to know regular expressions, but you have to know some basics about the shell as well a few key commands in order to work with them. Following are 50 questions on regular expressions and shell basics at a knowledge level required for almost any intermediate-level certification exam. Good luck (answers are at the end of the article)!

1. Which of the following characters used to match any single character?

A. a dash (-)
B. an asterisk (*)
C. a question mark (?)
D. a period (.)

2. Which of the following characters is used to signify the beginning of a line?

A. %
B. $
C. ^
D. ~

3. You want to use the question mark character (?) in a regular expression search and not have it interpreted as a metacharacter. Which of the following should be used to accomplish this?

A. "\?"
B. "/?"
C. "$?"
D. "(?)"

4. How many occurrences of a character preceding an asterisk (*) must be present before it is considered a match?

A. zero
B. one
C. two
D. more than two

5. You want to find every line in a file that contains a number. Which of the following regular expressions will accomplish this?

A. -n
B. "0 1 2 3 4 5 6 7 8 9"
C. [0-9]
D. [^0-9]

6. You want to find all occurrences of "Muncie" in a file and suspect that sometimes it may appear initial-capped and other times all in lowercase. Which regular expression should you use to accomplish this?

A. [Muncie,muncie]
B. [Mm]uncie
C. -i muncie
D. {Muncie,muncie}

7. What regular expression should be used to find all lines that begin with a question mark? (Fill in the blank.)

8. Which character is used to mean that the preceding must be matched one or more times?

A. +
B. ?
C. &
D. @

9. You want to find all matches for two distinctly different values. Which character is used to signify that you want to match two values?

A. back slash (\)
B. forward slash (/)
C. pipe (|)
D. ampersand (&)

10.Which of the following should be used to find "Sam" and "Samantha" in a file?

A. Sam(antha)*
B. Sam[antaha]
C. Sam|antha
D. Sam\(antha\)\?

11. Which of the following can be used to find any white space, including spaces and tabs?

A. [white]
B. ""
C. [[:space:]]
D. [[tab|space]]

12. Which of the following characters is used to signify the end of a line?

A. %
B. $
C. ^
D. ~

13. What set of characters will be matched if the expression is [1-9A-D]?

A. 123456789ABCDabcd
B. 123456789ABCD
C. 19ADad
D. 19AD

14. Which of the following matches will be found to file\.html? (choose all that apply):
A. file.htmlll
B. file.html
C. file.htm
D. file

15. Which of the following regular expressions should be used to find lines that do not contain numbers?
A. -n
B. "\0 \1 \2 \3 \4 \5 \6 \7 \8 \9"
C. [0-9]
D. [^0-9]

16. On the command line, what does encompassing a string within single quotes accomplish?

A. It turns off the special significance of everything within the quotes.
B. It turns off the special significance of everything within the quotes except for a few very special characters.
C. It executes the command within.
D. It sets a variable value.

17. You want to perform a test on a string to make sure that the length of it is not zero before using it. Which test should be done to accomplish this?

A. [[ string ]]
B. [[ -z string ]]
C. [[ -n string ]]
D. [[ -a string ]]

18. You are writing a shell script that includes a number of choices within a case statement. What is used to end the case statement?

A. done
B. fi
C. end
D. esac

19. Which of the following can be checked to see how many positional parameters were used to call a script?

A. $#
B. $$
C. $!
D. $?

20. Which switch should be used with grep to print all lines in a file that do not match the search criteria given?

A. -i
B. -v
C. -c
D. -n

21. You are writing a simple shell script that will prompt the user and require them to enter a string variable. What command will you need to use within the script to input the user's string?

A. input
B. enter
C. read
D. record

22. What is the stream number associated with standard error?

A. 3
B. 2
C. 1
D. 0

23. Which of the following regular expressions would indicate that the search item preceding it must be found at least 5 times?

A. (5)
B. 5x
C. {5,}
D. [5+]

24. Which of the following should be used to test if two strings are equal?

A. string1 = string2
B. string1 –eq string2
C. string1 –a string2
D. string1 –o string2

25. Which of the following would be the result of the command echo 1{2,3,4}5 (choose all that apply)?

A. 15
B. 125
C. 135
D. 145
E. 12345
F. 12,3,45
G. 1{2,3,4}5

26. On the command line, what does encompassing a string within double quotes accomplish?

A. It turns off the special significance of everything within the quotes.
B. It turns off the special significance of everything within the quotes except for a few very special characters.
C. It executes the command within.
D. It sets a variable value.

27. Which of the following can be used to see the arguments given when the shell script was invoked?

A. $#
B. $?
C. $0
D. $*

28. You are including a while loop in a shell script. What is used to end the while loop?

A. done
B. fi
C. end
D. esac

29. What regular expression can be used to find all lines that end with a period? (Fill in the blank.)

30. Which switch should be used with grep to ignore case as you look for matches in a file?

A. -i
B. -v
C. -c
D. -n

31. Which of the following is a synonym for [^[:alnum:]] ?

A. \W
B. \w
C. \a
D. \A

32. Within the Bash shell, what is the tilde (~) translated to by default?

A. the PATH
B. the present working directory
C. the user's home directory
D. the TMP directory

33. With a simple command given at a prompt, how does Bash process it?

A. from right to left
B. from left to right
C. in alphabetic order
D. in ASCII order

34. Which of the following Bash built-in commands can be used within a shell script to parse positional variables?

A. shear
B. parse
C. trim
D. getopts

35. The typeset command exists in Bash for compatibility with Korn shell scripts. What command, however, is more favored for use with Bash?

A. slot
B. state
C. declare
D. proclaim

36. On the command line, what does encompassing a string within backticks accomplish?

A. It turns off the special significance of everything within the backticks.
B. It turns off the special significance of everything within the backticks except for a few very special characters.
C. It executes the command within.
D. It sets a variable value.

37. Which of the following can be used within a shell script to see the name with which the shell is being executed?

A. $#
B. $?
C. $0
D. $*

38. You are tweaking a shell script by adding an until loop. What needs to be used to end the until loop?

A. done
B. fi
C. end
D. esac

39. Which of the following should be used to test if the value of two integers is the same?

A. integer1 = integer2
B. integer1 –eq integer2
C. integer1 –a integer2
D. integer1 –o integer2

40. Which switch should be used with grep to count all lines in a file that match the search criteria?

A. -i
B. -v
C. -c
D. -n

41. What is the file descriptor/stream number for standard input? (Fill in the blank.)

42. Which of the following utilities processes most quickly?

A. grep
B. egrep
C. fgrep

43. Which of the following regular expressions means the search criteria preceding it must be found at least seven times, but not more than ten times?

A. {7,,10}
B. {7,10}
C. {7>10}
D. {7,!10}

44. Which of the following regular expressions can be used to find all blank lines in a file?

A.""
B. ^$
C. ^" "$
D. [ ]

45. In a shell script, you have nested one loop within another (both using the syntax for – do – done). What can be used to exit the first loop without exiting the second once a specific condition is met?

A. enod
B. end
C. break
D. rof

46. Which option can be used with test to see if a file exists and is a regular file?

A. -r
B. -e
C. -a
D. -f

47. What is the stream number associated with standard output?

A. 3
B. 2
C. 1
D. 0

48. Which of the following can be used to see the exit code of the last command or shell executed?

A. $#
B. $?
C. $0
D. $*

49. Which test on a string can be used to make sure that the length of it is zero?

A. [[ string ]]
B. [[ -z string ]]
C. [[ -n string ]]
D. [[ -a string ]]

50. If the value of ALT is set to the string "MPC", what will the command echo '$ALT' return?

A. $MPC
B. MPC
C. ALT
D. $ALT

Answers

1. A period (.) is used to match any single character. Answer: D.

2. The circumflex (^) is used to signify the beginning of a line. Answer: C.

3. You must use the backslash (\) with the metacharacter – "\?". Answer: A.

4. The asterisk (*) will match zero or more occurrences of the character(s) preceding it. Answer: A.

5. The expression [0-9] will find a match for any number between 0 and 9 (all numbers). Answer: C.

6. The expression [Mm]uncie will find both "Muncie" and "muncie" . Answer: B.

7. The regular expression to use is : ^\?

8. The plus sign (+) is used to indicate that the preceding must be matched one or more times. Answer: A.

9. A pipe (|) is used to separate multiple values being searched for. Answer: C.

10. Using the expression Sam\(antha\)\? will always match "Sam" and it can be followed by zero or one (?) occurrences of "antha" . Answer: D.

11. The expression [[:space:]] can be used to find any white space, including spaces and tabs. Answer: C.

12. The dollar sign ($) is used to signify the end of a line. Answer: B.

13. Anything within the character set 123456789ABCD will be matched the expression [1-9A-D]. Answer: B.

14. The question mark (?) will match zero or one occurrence of the "l", meaning that both file.htm and file.html will be found. Answer: B&C.

15. The expression [^0-9] will find a match to everything except the number set 0 to 9. Answer: D.

16. Single quotes are used to turn off the special significance of everything within the quotes. Answer: A.

17. The syntax [[ -n string ]] is used to see if the string has a length greater than zero. Answer: C.

18. The case statement ends with esac. Answer: D.

19. The value of $# can be checked to see how many positional parameters were used to call a script. Answer: A.

20. The –v switch is used to print all lines of a file that do not match the search criteria given. Answer: B.

21. The read command is used to accept a value and assign it to a variable. Answer: C.

22. Standard error is stream 2. Answer: B.

23. The expression {5,} means the preceding must be found at least five times. Answer: C.

24. To test and see if two string values are the same, the equal sign (=) is used. Answer: A.

25. The command will echo "1" and "5" with each number specified between the braces in the middle: 125, 135, and 145. Answer: B&C&D.

26. Double quotes turn off the special significance of everything within the quotes except for a few very special characters that remain (such as single quotes, the dollar sign, and back slash). Answer: B.

27. The variable $* can be used to see the arguments given when the shell script was invoked. Answer: D.

28. A while loop ends with done (while – do – done). Answer: A.

29. The regular expression to use is: \.$

30. The –i option is used to ignore case. Answer: A.

31. \W is a synonym for [^[:alnum:]]. Answer: A.

32. The tilde, by default, translates to the home directory of the user. Answer: C.

33. Simple commands are executed from left to right. Answer: B.

34. The command getopts is a Bash built-in that can be used within a shell script to parse positional variables. Answer: D.

35. The declare command is used to proclaim what type of variable it is so it can be handled accordingly. Answer: C.

36. A command can be placed within backticks and that command is then executed, with the value of execution becoming the resulting string/value. Answer: C.

37. The positional variable $0 holds the name with which the script was summoned. Answer: C.

38. An until loop ends with done (until – do – done). Answer: A.

39. A test can be done to see if the values of two integers are the same using the –eq parameter. Answer: B.

40. The –c switch is used to count lines that match the search criteria. Answer: C.

41. The file descriptor/stream number for standard input is 0.

42. The fgrep utility does not have the same regular expression set as the other two, and is thus able to execute the fastest. Answer: C.

43. The regular expressions {7,10} means the search criteria preceding it must be found at least seven times, but not more than ten times. Answer: B.

44. To find the blank lines, look for the beginning (^) and end ($) with nothing between them (^$). Answer: B.

45. The break statement can be used to exit a nested loop. Answer: C.

46. The –f option is used to see if a file exists and is a regular file. Answer: D.

47. Standard output is stream 1. Answer: C.

48. The value of $? is equal to the exit code returned by the last command executed. Answer: B.

49. The test [[ -z string ]] will verify that the length of the string is zero. Answer: B.50. Because the single quotes override the special meaning of the dollar sign,the string give ($ALT) is literally returned. Answer: D.

50. The original Ethernet standard, first published in 1980 by the consortium of DEC, Intel, and Xerox, specified a speed of 10 Mbps. Answer: C.

Emmett Dulaney is the author of the several books on Linux/Unix and certification as well as a columnist for UnixReview.com. Emmett's blog can be found at: http://edulaney.blogspot.com, and he can be reached (and welcomes your comments) at: edulaney@insightbb.com.

Test Your Knowledge of Users and Groups by Emmett Dulaney :

Test Your Knowledge of Users and Groups by Emmett Dulaney :

If there is one thing that all administrators deal with on a regular basis, it is users and groups. If there is
one topic that you should know inside and out, it is users and groups.
That said, following are 50 questions
intended to test your knowledge of user and group fundamentals at an intermediate level.

Good luck (answers are at the end of the article)!

1. What is the default UID number assigned to the first user added to a system on most systems?

A. 1
B. 100
C. 1000
D. 10000



2. Which command can be used at the command line to change your active GID to a new one?

A. chgroup
B. group
C. newgrp
D. switch


3. Which field of the /etc/passwd file identifies the user’s primary group ID?

A. 1
B. 3
C. 4
D. 5
E. 6
F. 7

4. NIS entries are automatically added to your system. What character precedes entries in /etc/passwd for which
this is done?

A. +
B. !
C. ?
D. %

5. How many fields does the /etc/shadow file consist of?

A. 7
B. 9
C. 12
D. 15

6. Which command can be used to see a user’s password aging information?

A. useradd -l
B. passwd -l
C. chage -l
D. usermod -l

7. If the passwords are stored in /etc/shadow instead of /etc/passwd, what single letter is found in the second column
of /etc/passwd entries? __________ (Fill in the blank.)

8. Who owns the /etc/group file?

A. root
B. bin
C. daemon
D. nobody

9. Which tool can be used to create a user account with default values?

A. pwck
B. useradd
C. usermod
D. chfn

10. Which module can PAM use to enforce strong passwords (choose the best answer)?

A. pam_strong
B. pam_usersec
C. pam_pwcheck
D. pam_cracker

11. Instead of logging in as root regularly, you have advised all administrators to use sudo. Which files logs
all sudo commands?

A. /tmp/sudo/log
B. /var/sudolog
C. /etc/sudo/log
D. /var/log/messages

12. The root user, on every system, always has the same UID. What is its value?

A. 0
B. 1
C. 10
D. 100

13. Within the member list field of the /etc/group file, what character is used to separate members?

A. a colon (:)
B. a comma (,)
C. a period (.)
D. a pipe (|)

14. By default, what utility is used to hash the passwords that appear in /etc/shadow?

A. hash
B. encode
C. pgp
D. crypt

15. Which file can be used to limit which users can use sudo?

A. /etc/sudo
B. /etc/sudoers
C. /etc/sudo/accept
D. /etc/accept

16. In Ubuntu, which utility can be used to add a new user to the system?

A. makeuser
B. newuser
C. adduser
D. usermake

17. Which command is used to change an NIS user’s password?

A. nispasswd
B. yppasswd
C. passwd -nis
D. gpasswd

18. How many fields are there in the /etc/group file?

A. 4
B. 5
C. 6
D. 7

19. Which field of the /etc/passwd file identifies the home directory for the user?

A. 1
B. 3
C. 4
D. 5
E. 6
F. 7

20. If you want to run su and not only become the other user, but also run their login shell, which option should
you specify?

A. -
B. -l
C. -r
D. -s

21. What character is used as a delimiter between fields in the /etc/passwd file? __________ (Fill in the blank.)



22. In the /etc/shadow file, dates are specified for when the password was set/changed and the absolute last date
that it can be used. This is expressed as a number of days since when?

A. January 1, 1970
B. December 31, 1969
C. December 25, 1968
D. November 30, 1967

23. Which PAM module examines the home directory of the user for files/directories that have dangerous permissions and
issues a warning if there are any there?

A. pam_env.so
B. pam_homecheck.so
C. pam_securetty.so
D. pam_unix2.so

24. In the following /etc/shadow entry, which value indicates the number of days after a password has expired that
the account is disabled and cannot be used?

edulaney:PcaQWn6d1la5.:13000:0:1:2:3:14000:

A. 0
B. 1
C. 2
D. 3

25. Which field of the /etc/passwd file holds the UID?

A. 1
B. 3
C. 4
D. 5
E. 6
F. 7

26. What is the default GID number assigned to the first group added to a system on most systems?

A. 1
B. 100
C. 1000
D. 10000

27. Which command can be used to add a new user to an existing group?

A. groupadd -g
B. groupmod -g
C. useradd -g
D. usermod -g

28. For security reasons, you want to prevent the use of finger and the values that are returned to it from /etc/passwd. Which port should be blocked at the firewall?

A. 49
B. 59
C. 69
D. 79

29. What character should be added to an account entry to disable it? __________ (Fill in the blank.)

30. Which command can be used to add an existing user to an existing group?

A. groupadd -g
B. groupmod -g
C. useradd -g
D. usermod -g

31. If you want to run su and not only become root, but also use root’s environmental variables. Which option should you specify?

A. -
B.-c
C. -r
D. -s

32. Which of the following files holds the default password aging information for newly created accounts?

A. /etc/inittab
B. /etc/defaults/passwd
C. /etc/defaults/aging
D. /etc/login.defs

33. Which PAM module verifies that the username name given is valid (exists in passwd and shadow)?

A. pam_env.so
B. pam_homecheck.so
C. pam_securetty.so
D. pam_unix2.so

34. Which field of the /etc/passwd file identifies the default shell to use when the user logs in?

A. 1
B. 3
C. 4
D. 5
E. 6
F. 7

35. In the following /etc/shadow entry, which value indicates the maximum number of days the password can be used before it must be changed?

edulaney:PcaQWn6d1la5.:13000:0:1:2:3:14000:

A. 0
B. 1
C. 2
D. 3

36. Which command is used to convert passwords from /etc/password entries into /etc/shadow entries?

A. pwconv
B. pwunconv
C. convert
D. unshadow

37. The root user, on every system, always has the same group ID (GID) value. What is that value?

A. 0
B. 1
C.10
D. 100

38. Which tool can be used to change CGOS values?

A.pwck
B. useradd
C. usermod
D. chfn

39. Which command is used to change an LDAP password?

A. passwdldap
B. lpasswd
C. ldappaswd
D. yp

40. Which of the following system accounts has a default GID of 1?

A. bin
B. mail
C. uucp
D. named

41. Which field of the /etc/passwd file holds the login name?

A. 1
B. 3
C. 4
D. 5
E. 6
F. 7

42. Which of the following files holds default values assigned to newly created user accounts?

A. /etc/default/useradd
B. /etc/users/default
C. /etc/useradd/users
D. /etc/default

43. Which command-line utility can be used in Ubuntu to remove a group?

A. ungroup
B. group_rm
C. rmgroup
D. delgroup

44. Within which directory does su reside by default?

A. /bin
B. /etc
C. /usr
D. /var

45. Which PAM module verifies that the root user is allowed access from the current terminal?

A. pam_env.so
B. pam_homecheck.so
C. pam_securetty.so
D. pam_unix2.so

46. In the following /etc/shadow entry, which value indicates the minimum number of days the password has to be used
before it can be changed?

edulaney:PcaQWn6d1la5.:13000:0:1:2:3:14000:

A. 0
B. 1
C. 2
D. 3

47. Which tool can be used to check the integrity of the passwd and shadow files?

A. pwck
B. useradd
C. usermod
D. chfn

48. Which command is used to convert passwords from /etc/shadow entries into /etc/passwd entries?

A. arsort()
B. rev()
C. trosa()
D. zsort()

49. Which field of the /etc/passwd file is known as the GCOS field?

A. 1
B. 3
C. 4
D. 5
E. 6
F. 7

50. Which of the following system accounts has a default UID of 10?

A. bin
B. mail
C. uucp
D. named




Answers

1. The default user ID number on most systems is 1000, and the numbers then increment by one from there with each newly
added user. Answer: C.

2. The newgrp command can be used at the command line to change your active GID to a new one.
Answer: C.

3. The fourth field of /etc/passwd identifies the GID.
Answer: C.

4. The plus sign (“+”) precedes entries in /etc/passwd for which NIS inserts values. Answer: A.

5. There are nine fields in the /etc/shadow file.
Answer: B.

6. The chage –l command can be used to see a user’s password aging information (for example, chage –l edulaney).
Answer: C.

7. An “x” in the second column of /etc/passwd indicates that the password values are being stored in /etc/shadow.

8. The root user, by default, owns the /etc/group file.
Answer: A.

9. The useradd tool can be used to create a user account with default values.
Answer: B.

10. PAM can use the pam_pwcheck module to enforce strong passwords.
Answer: C.

11. The /var/log/messages file logs all sudo commands.
Answer: D.

12. The UID number for root is always 0.
Answer: A.

13. Within the member list field of the /etc/group file, a comma is used to separate members.
Answer: B.

14. The crypt utility is used to hash the passwords that appear in /etc/shadow.
Answer: D.

15. The /etc/sudoers file can be used to limit which users can use sudo.
Answer: B.

16. The adduser utility can be used to add a new user to the system.
Answer: C.

17. The yppasswd command is used to change an NIS user’s password.
Answer: B.

18. The /etc/group file consists of four fields.
Answer: A.

19. The sixth field of /etc/passwd identifies the user’s home directory.
Answer: E.

20. To run su and not only become the other user, but also run their login shell, specify the -l (login) option.
Answer: B.

21. Answer: The colon (“:”) is used as a delimiter between fields in the /etc/passwd file.

22. Values are expressed as the number of days since January 1, 1970.
Answer: A.

23. The pam_homecheck.so module performs this function.
Answer: B.

24. The seventh field of an /etc/shadow entry – holding a “3” in this case – indicates the number of days after the
password expires before the account is disabled.
Answer: D.

25. The third field of /etc/passwd holds the UID.
Answer: B.

26. The first group added to most systems begins at 100 and increments from there with each newly added group.
Answer: B.

27. The useradd –g command can be used to add a new user to an existing group.
Answer: C.

28. The finger port to block is 79.
Answer: D.

29. Answer: An asterisk (“*”) character should be added to an account entry to disable it.

30. The usermod –g command can be used to add an existing user to an existing group.
Answer: D.

31. Using just the dash (su -), you not only become root, but also use root’s environmental variables.
Answer: A.

32. The /etc/login.defs file holds the default password aging information for newly created accounts.
Answer: D.

33. The pam_unix2.so module performs this function.
Answer: D.

34. The seventh field holds the login shell path. If no value is given, the default shell is assigned.
Answer: F.

35. The fifth field of an /etc/shadow entry – holding a “1” in this case – indicates the maximum number of days the
password can be used before it must be changed.
Answer: B.

36. The pwconv command is used to convert passwords from /etc/password entries into /etc/shadow entries.
Answer: A.

37. The primary GID number for root is 0.
Answer: A.

38. The chfn tool can be used to change CGOS values.
Answer: D.

39. The ldappaswd utility is used to change an LDAP password.
Answer: C.

40. By default, the bin account has a UID and GID of 1.
Answer: A.

41. The first field holds the login name.
Answer: A.

42. The /etc/default/useradd file holds default values assigned to newly created user accounts.
Answer: A.

43. The delgroup command-line utility can be used in Ubuntu to remove a group.
Answer: D.

44. The su utility resides beneath /bin.
Answer: A.

45. The pam_securetty.so module performs this function.
Answer: C.

46. The fourth field of an /etc/shadow entry – holding a “0” in this case – indicates the minimum number of days the
password has to be used before it can be changed.
Answer: A.

47. The pwck tool can be used to check the integrity of the passwd and shadow files.
Answer: A.

48. The pwunconv command is used to convert passwords from /etc/shadow entries into /etc/passwd entries.
Answer: B.

49. The fifth field is the GCOS (General Electric Comprehensive Operating System) field. It holds free text that is
identifies the user and is often used to return values with finger.
Answer: D.

50. By default, the special account uucp has the UID of 10. Answer: C.

Emmett Dulaney is the author of the several books on Linux/Unix and certification as well as a columnist for UnixReview.
Emmett’s blog can be found at http://edulaney.blogspot.com and he can be reached
(and welcomes your comments) at edulaney@insightbb.com.

http://www.kalamazoolinux.org/tech/find.html

http://www.kalamazoolinux.org/tech/find.html

Thursday, February 7, 2008

(Status ऑफ़ एकाच सोलारिस प्रोसस्सर ) psrinfo -v

Status of virtual processor 0 as of: 02/07/2008 16:40:50
on-line since 01/19/2008 05:39:05.
The sparcv9 processor operates at 900 MHz,
and has a sparcv9 floating point processor.
Status of virtual processor 1 as of: 02/07/2008 16:40:50
on-line since 01/19/2008 05:39:05.
The sparcv9 processor operates at 900 MHz,
and has a sparcv9 floating point processor.
Status of virtual processor 2 as of: 02/07/2008 16:40:50
on-line since 01/19/2008 05:39:05.
The sparcv9 processor operates at 900 MHz,
and has a sparcv9 floating point processor.
Status of virtual processor 3 as of: 02/07/2008 16:40:50
on-line since 01/19/2008 05:39:04.
The sparcv9 processor operates at 900 MHz,
and has a sparcv9 floating point processor.

Tuesday, February 5, 2008

What does “> /dev/null 2>&1″ mean?

What does “> /dev/null 2>&1″ mean?

./Script.sh > /dev/null 2>&1Output redirection
The greater-thans (>) in commands like these redirect the program’s
outputsomewhere. In this case, something is being redirected into /dev/null, and
something is being redirected into &1.

Standard in, out, and error
There are three standard sources of input and output for a program. Standard input usually comes from the keyboard if it’s an interactive program, or from
another program if it’s processing the other program’s output. The program usually prints to standard output, and sometimes prints to standard error. These three
file descriptors (you can think of them as “data pipes”) are often
called STDIN, STDOUT, and STDERR.

Sometimes they’re not named, they’re numbered! The built-in numberings for them
are 0, 1, and 2, in that order. By default, if you don’t name or number one explicitly, you’re talking about STDOUT.

Given that context, you can see the command above is redirecting standard output into /dev/null, which is a place you can dump anything you don’t want (often called the bit-bucket), then redirecting standard error into standard output (you have to put an & in front of the destination when you do this).

The short explanation, therefore, is “all output from this command should be shoved into a black hole.” That’s one good way to make a program be really quiet.

/dev/null

http://en.wikipedia.org/wiki/Data_sink

कोड to display, How can arguments be passed to a function in K SHELL script.

#!/usr/bin/ksh

## Code to display, How can arguments be passed to a function in K SHELL script.
## First $1 is the first input to this script. See below for passing on parameters to
## the functionA.
##
## Status: Tested.

xx=$1
yy=$1/logs/script.log

functionA()
{
a=$1
b=$2

echo $a
echo $b
}

functionA "Deepak" "Ranjan"
functionA $xx $yy

Saturday, February 2, 2008

http://en.wikiversity.org/wiki/User:Roadrunner

Folks interested in Financial Engineering/Quants/Trading algorithm development:

I was just Google'ing around on the subject and hit upon an interesting site:
http://en.wikiversity.org/wiki/User:Roadrunner

This seems to be owned by Joseph Wang, an Astrophysicist but works in Financial Engineering industry. Check this site out. Good for starters.....