IT Questions and Answers :)

Friday, December 13, 2019

Which of the following is NOT one of the benefits of High-Level Languages (HLL)?

Which of the following is NOT one of the benefits of High-Level Languages (HLL)?

  • It is simple to debug.
  • It is easy to understand.
  • High level language is less memory efficient.
  • It is programmer friendly language.

EXPLANATION

The main advantage of high-level languages over low-level languages is that they are easier to read, write, and maintain. Ultimately, programs written in a high-level language must be translated into machine language by a compiler or interpreter.
The first high-level programming languages were designed in the 1950s. Now there are dozens of different languages, including Ada, Algol, BASIC, COBOL, C, C++, FORTRAN, LISP, Pascal, and Prolog.


Any human-friendly language is a programmer-friendly language because programmers are human!
A language is friendly because it’s easy to learn and easy to use. This minimizes the cognitive load on the programmer. This allows the programmer to be very productive.
So here are the Top 5 most programmer-friendly languages:
  1. Smalltalk! See Richard Kenneth Eng's answer to Why hasn't anyone made a programming language that has super simple syntax unlike our current programming languages (like Python or Java) which have more complicated syntax?
  2. Go
  3. Elixir
  4. Scheme (or Racket)
  5. Python
Ruby is often-touted as programmer-friendly, but it’s definitely not so human-friendly.
Share:

Which of the following conditions is used to transmit two packets over a medium at the same time?

Which of the following conditions is used to transmit two packets over a medium at the same time?

  • Collision
  • Asynchronous
  • Contention
  • Synchronous 

EXPLANATION

A collision is the event in which two or more bodies exert forces on each other in about a relatively short time. Although the most common use of the word collision refers to incidents in which two or more objects collide with great force, the scientific use of the term implies nothing about the magnitude of the force.
In a half duplex Ethernet network, a collision is the result of two devices on the same Ethernet network attempting to transmit data at exactly the same time. The network detects the "collision" of the two transmitted packets and discards them both. Collisions are a natural occurrence on Ethernets.
Share:

On Linux, in additon to root, which users can read /etc/passwd, the password file? Pick the best answer.

On Linux, in addition to root, which users can read /etc/passwd? Pick the best answer.

  • Each user, but only their own entry in the file.
  • All users in group "shadow".
  • All users in group "wheel".
  • All users.

EXPLANATION

/etc/passwd file stores essential information, which required during login. In other words, it stores user account information. The /etc/passwd is a plain text file. It contains a list of the system’s accounts, giving for each account some useful information like user ID, group ID, home directory, shell, and more. The /etc/passwd file should have general read permission as many command utilities use it to map user IDs to user names. However, write access to the /etc/passwd must only limit for the superuser/root account.



The /etc/passwd File. /etc/passwd is a text file that contains the attributes of (i.e., basic information about) each user or account on a computer running Linux or another Unix-like operating system. Each line in /etc/passwd represents a single user.

 Quoting:  https://linux.die.net/man/5/passwd

"Name
passwd - password file
Description
The /etc/passwd file is a text file that describes user login accounts for the system.  It should have read permission allowed for all users (many utilities, like ls(1) use it to map user IDs to usernames), but write access only for the superuser."
The /etc/shadow file, which stores hashed passwords, can only be read by owner root, (and maybe members of group shadow, in some distributions):
$ ls  -lL /etc/shadow
-rw-r----- 1 root shadow 1266 Dec 19  2017 /etc/shadow
The "passwd" utility allows non-privileged users to run the utility with an effective ID of the file's owner, in this case root.  This means that non-privileged users can read and update the /etc/shadow file, via the "passwd" binary, when they change passwords.
ls -l $(which passwd)
-rwsr-xr-x 1 root shadow 51200 Sep 27  2013 /usr/bin/passwd
   ^
## ^ 
## "s" is the setuid bit. 



The setuid bit allows non-privileged users to run /usr/bin/passwd as the file's owner, root.
Note that in modern versions of Linux and Unix, the password file, /etc/passwd, does not contain passwords.  Rather, the second field of each line will have an "x", indicating that a hashed password is stored in /etc/shadow

SOURCE

https://linux.die.net/man/5/passwd

 


Share:

A /27 in CIDR notation is equivalent to which of the following in decimal notation?

A /27 in CIDR notation is equivalent to which of the following in decimal notation?

  • 255.255.255.128
  • 255.255.255.254
  • 255.255.255.248
  • 255.255.255.224 
A /27 in CIDR notation is equivalent to which of the following in decimal notation?

EXPLANATION

There are two parts to an IP address, the network number and the host number. The subnet mask shows what part is which. /27 means that the first 27 bits of the IP address are part of the Network number (192.168.0) the last part is part of the host address (192.168.0.1 - 192.168.0.30).


AddressesHostsNetmaskAmount of a Class C
/3042255.255.255.2521/64
/2986255.255.255.2481/32
/281614255.255.255.2401/16
/273230255.255.255.2241/8
/266462255.255.255.1921/4
/25128126255.255.255.1281/2
/24256254255.255.255.01
/23512510255.255.254.02
/2210241022255.255.252.04
/2120482046255.255.248.08
/2040964094255.255.240.016
/1981928190255.255.224.032
/181638416382255.255.192.064
/173276832766255.255.128.0128
/166553665534255.255.0.0256

 











Share:

What are the National Cyber Security Centre guidelines on password Expiry?

What are the National Cyber Security Centre guidelines on password Expiry?

  • Don't enforce password expiry
  • 30 Days
  • 90 Days
  • 60 Days 

EXPLANATION

Change your passwords regularly” is a common piece of password advice, but it isn't necessarily good advice. You shouldn't bother changing most passwords regularly — it encourages you to use weaker passwords and wastes your time. Yes, there are some situations where you'll want to regularly change your passwords.

 Therefore, for decades, many security guidelines have recommended frequent password changes, usually between 30 and 180 days.

Share:

Popular Posts