IT Questions and Answers :)

Friday, December 22, 2017

Which of the following is a requirement of setting up SQL Server AlwaysOn High Availability?

Which of the following is a requirement of setting up SQL Server AlwaysOn High Availability?

  • Windows Server Failover Clustering (WSFC)
  • Network Load Balancing (NLB)
  • Windows Internal Database
  • Internet Information Services (IIS) 

EXPLANATION

AlwaysOn requires that failover clustering is installed on each node and that the nodes are joined to the cluster prior to enabling AlwaysOn High Availability on the SQL server. AlwaysOn has to be enabled through the SQL Server Configuration Manager prior to being configured in SQL Server Management Studio (SSMS).
Share:

Which of the following is another term for a botnet?

Which of the following is another term for a botnet?

  • Dead Spiceheads
  • Research Honeypot
  • Corpse Cluster
  • Zombie Army 
 
Which of the following is another term for a botnet?

EXPLANATION

The more popular term for a Zombie Army is a botnet. Botnet is a number of Internet computers (zombie computers) that have been compromised (unknown to owners) by hackers to forward transmissions to other computers that are connected to the internet.
http://searchsecurity.techtarget.com/definition/botnet
https://en.wikipedia.org/wiki/Zombie_(computer_science)
https://en.wikipedia.org/wiki/Botnet
 
Share:

Which one of these is not Linux terminal based text editor?

Which one of these is not Linux terminal based text editor?

  • Nano
  • Vi
  • AkelPad
  • Pico 
Which one of these is not Linux terminal based text editor?

 

EXPLANATION


Vi - is first linux editor, it is in every distribution and it is general command line editor.
Nano/Pico - are from same core text editors in Linux and they are second most used editor.
AkelPad is windows based text editor
References:https://en.wikipedia.org/wiki/AkelPad
http://www.linux.org/threads/text-editors.4104/
Share:

WPA Enterprise is also known as:

WPA Enterprise is also known as:

  • 802.11g
  • 802.11a
  • 802.1X
  • 802.1R 
WPA Enterprise is also known as:

EXPLANATION

WPA Enterprise is more properly known as 802.1X, the IEEE standard that specifies this port-based access control.
Share:

In telecommunications, the Megaco (H.248) call-control protocol communicates between which of the following?

In telecommunications, the Megaco (H.248) call-control protocol communicates between which of the following?

  • Contexts and call agents
  • A network and a subnetwork
  • Two peers
  • A gateway controller and a gateway 
 
In telecommunications, the Megaco (H.248) call-control protocol communicates between which of the following?

EXPLANATION

Megaco (media gateway control protocol architecture) is a a signaling protocol that enables switching of voice, fax and multimedia calls between the PSTN and IP networks. It is used between the Media Gateway and Media Gateway Controller in a VoIP network. Megaco is also known as H.248.
Share:

What two software components are required on a Windows VM to apply a Customization Specification when cloning a virtual machine in vCenter?

What two software components are required on a Windows VM to apply a Customization Specification when cloning a virtual machine in vCenter?

  • SysPrep and VMware Tools
  • SysPrep and PERL
  • VMware Tools and Java
  • PERL and SysPrep 
What two software components are required on a Windows VM to apply a Customization Specification when cloning a virtual machine in vCenter?

EXPLANATION

SysPrep and VMware Tools are required by vSphere to make changes to the guest operating system. These changes usually include setting a NETBIOS name (host name), IP, and join a domain. This operation saves a lot of time for a vCenter administrator, especially when deploying large numbers of identical virtual machines.
You can read more here: http://pubs.vmware.com/vsphere-60/index.jsp#com.vmware.vsphere.vm_admin.doc/GUID-E63B6FAA-8D35-428D-...

Share:

In Cisco IOS, how do you enter into Privileged EXEC mode?

In Cisco IOS, how do you enter into Privileged EXEC mode?

  • Login
  • Enable
  • Su
  • Exec 
In Cisco IOS, how do you enter into Privileged EXEC mode?

EXPLANATION

Privileged EXEC mode is password protected, and allows the use of all EXEC mode commands available on the system. To enter privileged EXEC mode from user EXEC mode, use the enable command. Privileged EXEC mode allows access to global configuration mode through the use of the enable command. The privileged EXEC mode prompt consists of the devices's host name followed by the pound sign: Router# .
http://www.cisco.com/c/en/us/td/docs/ios/12_2/configfun/configuration/guide/ffun_c/fcf019.html

Share:

In Unix what program notifies the user of a new mail notification by sending an alert to the tty?

In Unix what program notifies the user of a new mail notification by sending an alert to the tty?

  • biff
  • squib
  • gnub
  • ding 

 
  In Unix what program notifies the user of a new mail notification by sending an alert to the tty?

EXPLANATION


When a new mail message is delivered, the program biff alerts the recipient so they can read it immediately. The alert is sent to the tty where the recipient is logged in, and contains the Subject, From line, and first few lines of the body of the new message. The alert also includes terminal beeps to guarantee quick attention.
Notification is enabled by the command
biff yand disabled by
biff n
https://en.wikipedia.org/wiki/Biff
Share:

What is the smallest data unit in quantum computing?

What is the smallest data unit in quantum computing?

  • 1 Cubik
  • 1 Cubit
  • 1 Qubit
  • 1 Quanbit 

 
What is the smallest data unit in quantum computing?

EXPLANATION

A qubit is a quantum bit , the counterpart in quantum computing to the binary digit orbit of classical computing. Just as a bit is the basic unit of information in a classical computer, a qubit is the basic unit of information in a quantum computer
In a quantum computer, a number of elemental particles such as electrons or photons can be used, with either their charge or polarization acting as a representation of 0 and 1. In a classical system, a bit would have to be in one state or the other. However, quantum mechanics allows the qubit to be in a superposition of both states at the same time, a property which is fundamental to quantum computing.
See wikipedia entry for more information:
https://en.wikipedia.org/wiki/Qubit

Share:

If you want to create a new login on SQL Server, what is the proper syntax?

If you want to create a new login on SQL Server, what is the proper syntax?

  • CREATE LOGIN login_id WITH PASSWORD = password
  • CREATE LOGIN login_id WITH USE = password
  • CREATE LOGIN login_id USE = password
  • USE LOGIN login_id WITH PASSWORD = password 

 
If you want to create a new login on SQL Server, what is the proper syntax?

EXPLANATION

Somebody on the Microsoft team decided that this syntax – create a login with this password – made sense. Even if it's arbitrary, you can't say it isn't intuitive.
https://msdn.microsoft.com/en-us/library/ms189751.aspx
Share:

Which of the following would NOT be an ideal route information sharing method in a mixed-brand networked environment?

Which of the following would NOT be an ideal route information sharing method in a mixed-brand networked environment?

  • Static
  • EIGRP
  • RIP
  • OSPF 
Which of the following would NOT be an ideal route information sharing method in a mixed-brand networked environment?

EXPLANATION

EIGRP is a Cisco proprietary protocol that often isn't supported by all other hardware vendors.
OSPF would be the best alternative if using mixed-brand equipment since it is universally well supported.
Share:

What is the minimum number of disks required for RAID1?

What is the minimum number of disks required for RAID1?

  • 2
  • 1
  • 4 or 5

 
What is the minimum number of disks required for RAID1?

EXPLANATION

RAID 1 (mirroring) – the basic idea of such a solution is the replication (mirroring) of two or more discs. It means that while using RAID 1, an exact copy (or mirror) is created on two or more discs. Such a solution gives good read performance and reliability, but storage capacity must be compartmentalized. The reason for this is that the total storage must be equal to the capacity of the smallest disk. i.e.: in the case of an array composed of 3 discs – 250GM, 500GB and 1TB – the usable space will be equal to 250GB.
Share:

You want to link your company's Microsoft Active Directory user accounts to your cloud provider for federated identity management. What type of configuration must you create within your company?

You want to link your company's Microsoft Active Directory user accounts to your cloud provider for federated identity management. What type of configuration must you create within your company?

  • Relying party trust
  • Identity trust
  • XML provider
  • JSON provider 

You want to link your company's Microsoft Active Directory user accounts to your cloud provider for federated identity management. What type of configuration must you create within your company?

EXPLANATION

Because your company is the identity provider, you must trust the relying party offering services, so you must configure a relying party trust. The cloud provider would deal with configuring an identity trust, not you. XML and JSON are not specifically related to configuring identity federation.
Share:

Which IRQ does COM1 commonly use?

Which IRQ does COM1 commonly use?

  • 8
  • 4
  • 6
Which IRQ does COM1 commonly use?

EXPLANATION

Interrupt request (IRQ) 4 is normally used for the first serial port, COM1. This is also the default interrupt for the third serial port.
In a computer, an interrupt request is a hardware signal sent to the processor that temporarily stops a running program and allows a special program, an interrupt handler, to run instead. Hardware interrupts are used to handle events such as receiving data from a modem or network card, key presses, or mouse movements.
Share:

Which of these is NOT an alternative to Microsoft Excel?

Which of these is NOT an alternative to Microsoft Excel?

  • LibreOffice Calc
  • GIMP
  • Gnumeric
  • Google Drive - Sheets
Which of these is NOT an alternative to Microsoft Excel?

EXPLANATION

GIMP is an image manipulation software for multiple platforms. WIkipedia describes it as a free and open-source raster graphics editor used for image retouching and editing, free-form drawing, resizing, cropping, photo-montages, converting between different image formats, and more specialized tasks. https://en.wikipedia.org/wiki/GIMP
It is more like an alternative to Adobe PhotoShop.
The other applications are actually alternatives to Microsoft Excel.
https://alternativeto.net/software/microsoft-excel/
Share:

In relation to Network Switches, what is the purpose of the spanning tree algorithm?

In relation to Network Switches, what is the purpose of the spanning tree algorithm?

  • To help ensure that messages will arrive over all possible paths.
  • To provide a path between every LAN segment.
  • To discover a "loop free" topology and provide, as possible, a path between every pair of LAN's
  • To keep routing updates from being transmitted onto the same port on which they were received. 

 
In relation to Network Switches, what is the purpose of the spanning tree algorithm?

EXPLANATION

The spanning tree algorithm is a requirement in meshed transparent bridging. As a transparently bridged frame contains no record of the path it has taken, and contains no mechanism for aging, any bridge loop will result in storms of packets continually circulating around the loop. By providing a loop-free path between any two points in the network, the spanning tree algorithm prevents these storms. A form of this algorithm is also used for Explorer control in source-route bridges.

Share:

In which of the following scenarios would you use a WORM backup tape?

In which of the following scenarios would you use a WORM backup tape?

  • When the tape data is overwritten at random.
  • When the tape data is written only once.
  • When the tape data is overwritten monthly.
  • When the tape or tapes are stored somewhere moist or dirty. 
In which of the following scenarios would you use a WORM backup tape?

EXPLANATION

WORM is an acronym for Write Once Read Many. WORM devices are physically designed to only ever be written to once but can be read from many times.

SOURCE

https://en.wikipedia.org/wiki/Linear_Tape-Open#WORM
Share:

Which of the following wildcard characters can be used in the Windows command line as a substitute for a single character in a file or directory name?

Which of the following wildcard characters can be used in the Windows command line as a substitute for a single character in a file or directory name?

  • *
  • ?
  • @

EXPLANATION

The question mark (?) character can be used as a substitute for a single character in a file or directory name. The asterisk (*) character can be used as a wildcard character to replace zero or more characters.
Share:

Thursday, December 21, 2017

In Windows, If you close a tab in Firefox/Chrome/IE, what key command will re-open it for you?

In Windows, If you close a tab in Firefox/Chrome/IE, what key command will re-open it for you?


  • Ctrl-Shift-T
  • Ctrl-T-O
  • Ctrl-Alt-T
  • Ctrl-Alt-O-T      
In Windows, If you close a tab in Firefox/Chrome/IE, what key command will re-open it for you?

EXPLANATION

When you realize you just closed that browser tab that you have kept open for the last 4 days... just in case. You can easily now just  type "Ctl - Shift - T" to get it back.

SOURCE

http://www.slate.com/blogs/future_tense/2013/08/22/keyboard_shortcut_helps_recover_lost_browser_tabs.html


       
Share:

drw-r-x-wx 2 terry staff 4096 Mar 10 14:29 Secret <== Based on permissions assigned to user (terry), group (staff), and other, which non-root users have permission to remove files in directory "Secret?"

drw-r-x-wx 2 terry staff 4096 Mar 10 14:29 Secret <== Based on permissions assigned to user (terry), group (staff), and other, which non-root users have permission to remove files in directory "Secret?"

  • Both owner "terry" and group "staff" members
  • Any user in "other"
  • The owner, user "terry"
  • Any member of group "staff" 
drw-r-x-wx 2 terry staff 4096 Mar 10 14:29 Secret <== Based on permissions assigned to user (terry), group (staff), and other, which non-root users have permission to remove files in directory "Secret?"

EXPLANATION

To remove a file, a user needs write and access (execute) permission on the directory. That is, -wx at minimum.
The user does not need read permission on the directory to remove a file if the name is known, but read permission on the directory would be required to discover the filename, for example, with "ls".
User "terry", the owner, does not have access to the directory (x is absent for user).

SOURCE

https://www.hackinglinuxexposed.com/articles/20030424.html
Share:

Wednesday, December 20, 2017

Which WMI class can you use to determine a system's last bootup time?

Which WMI class can you use to determine a system's last bootup time?


  • Win32_OperatingSystem
  • Win32_BootEvent
  • Win32_ComputerSystem
  • Win32_BIOS             
Which WMI class can you use to determine a system's last bootup time?

EXPLANATION

Win32_OperatingSystem includes a property called LastBootUpTime, which is the time when the system last booted up.
Win32_ComputerSystem and Win32_BIOS do not have any properties that can be used for this.
Win32_BootEvent does not exist.

Share:

Which encoding would allow you to transmit binary data over an ASCII-only communications channel?

Which encoding would allow you to transmit binary data over an ASCII-only communications channel?

  • Unicode
  • bytecode
  • Base64
  • ISO-8851-1 

 
Which encoding would allow you to transmit binary data over an ASCII-only communications channel?

EXPLANATION

Base64 is a format that encodes arbitrary binary data into ASCII characters (letters, digits and limited punctuation).  These characters then can be decoded back into binary at the other end.
  This allows transmitting binary data over channels that normally only allow ASCII (such as email or display terminals).  Base64 takes up 1/3 more space than the equivalent binary format.

SOURCE

https://en.wikipedia.org/wiki/Base64
Share:

Friday, December 15, 2017

In SCCM, which of the following can build and capture and subsequently deploy an OS image from a set of operating system installation files, install additional applications during the build-phase and capture and restore user state information?

In SCCM, which of the following can build and capture and subsequently deploy an OS image from a set of operating system installation files, install additional applications during the build-phase and capture and restore user state information?

  • Task Sequence
  • Task Scheduler
  • Task Manager
  • Tasklist 

 
In SCCM, which of the following can build and capture and subsequently deploy an OS image from a set of operating system installation files, install additional applications during the build-phase and capture and restore user state information?

EXPLANATION

System Center Configuration Manager uses task sequences to automatically install an operating system image on a destination computer. You create a task sequence that references a boot image used to start the destination computer, the operating system image that you want to install on the destination computer, and any other additional content, such as other applications or software updates, that

SOURCE

https://technet.microsoft.com/en-us/library/bb693631.aspx
Share:

Thursday, December 14, 2017

In order to SEND email reliably, a mailserver MUST meet the following DNS requirement:

In order to SEND email reliably, a mailserver MUST meet the following DNS requirement:

  • SPF and DKIM records
  • A valid MX record
  • A PTR record which matches the email domain
  • A valid PTR record 
 
In order to SEND email reliably, a mailserver MUST meet the following DNS requirement:

EXPLANATION

A sending mailserver shall have a valid PTR (reverse DNS lookup) record for its public IP address. That is, the PTR record must return the same IP address if submitted to a DNS lookup. If this is not the case, the recipient is likely to reject the mail as possible spam. (If IPv6 is used this also applies here, a point often overlooked)

MX records determine which computers accept inbound mail for

SOURCE

https://www.studiocoast.com.au/knowledgebase/194/email/support.aspx
Share:

Tuesday, December 12, 2017

In IT, the term kilobyte (KB) is traditionally used to connote which of the following?

In IT, the term kilobyte (KB) is traditionally used to connote which of the following?

  • 10000 bytes
  • 1024 bytes
  • 512 bytes
  • 2048 bytes 

 
In IT, the term kilobyte (KB) is traditionally used to connote which of the following?

EXPLANATION

Because computers are binary (base 2) instead of decimal (base 10), 1KB would be 2 to the 10th bytes, or 1024.

In fact, the definition of KB (kilobytes) was changed in 1998 to match up with SI units, the current term for 1024 bytes is Kibibyte (https://en.wikipedia.org/wiki/Kibibyte). That said, most IT pros still prefer the traditional definition of KB as 1024 bytes, since it's the most common way to refer to computing capacity.

For further information about these terms, see http://www.iec.ch/si/binary.htm andhttp://physics.nist.gov/cuu/Units/binary.html
Share:

Monday, December 11, 2017

What logic construct most efficiently allows you to execute one of a number of code blocks based on the value of a single variable?

What logic construct most efficiently allows you to execute one of a number of code blocks based on the value of a single variable?

  • while
  • if
  • switch
  • for 

What logic construct most efficiently allows you to execute one of a number of code blocks based on the value of a single variable?

EXPLANATION

You can supply a variable to a "switch" statement, and provide a code block for each possible value.
Example using PowerShell:
switch ($var) {
    1 { <# Executes if $var = 1 #> }
    2 { <# Executes if $var = 2 #> }
    3 { <# Executes if $var = 3 #> }
    4 { <# Executes if $var = 4 #> }
    default { <# Executes if $var doesn't match any other case #> }
}
A single "switch" can take the place of a chain of "if/elseif/else".
"for" and "while" are both loops.



Share:

Friday, December 8, 2017

What can be used to protect you from receiving email messages with a forged sender address?

What can be used to protect you from receiving email messages with a forged sender address?

  • SPF
  • Secure SMTP
  • Digital ID
  • IMAP 

 
What can be used to protect you from receiving email messages with a forged sender address?

EXPLANATION

Sender Policy Framework (SPF) is a simple email-validation system designed to detect email spoofing by providing a mechanism to allow receiving mail exchangers to check that incoming mail from a domain comes from a host authorized by that domain's administrators.[1] The list of authorized sending hosts for a domain is published in the Domain Name System (DNS) records for that domain in the form of a specially formatted TXT record. Email spam and phishing often use forged "from" addresses, so publishing and checking SPF records can be considered anti-spam techniques.
IETF publication RFC 7208 dated April 2014 defines Sender Policy Framework as "proposed standard".

SOURCE

https://en.wikipedia.org/wiki/Sender_Policy_Framework
Share:

Thursday, December 7, 2017

What is the command to force Knowledge Consistency Checker (KCC) on targeted domain controllers to immediately recalculate the inbound replication topology.

What is the command to force Knowledge Consistency Checker (KCC) on targeted domain controllers to immediately recalculate the inbound replication topology.

  • Repadmin -replicate
  • Repadmin -prp
  • Repadmin -showutdvec
  • Repadmin -kcc 
 
What is the command to force Knowledge Consistency Checker (KCC) on targeted domain controllers to immediately recalculate the inbound replication topology.

EXPLANATION

This command helps repair broken connections between domain controllers by rebuilding the active connection.

SOURCE

https://technet.microsoft.com/en-us/library/cc770963(v=ws.11).aspx



Share:

Wednesday, December 6, 2017

What is the difference between TACACS+ and RADIUS?

What is the difference between TACACS+ and RADIUS?

  •  TACACS+ encrypts the entire packet and RADIUS does not.
  • TACACS+ uses UDP transport protocol and RADIUS uses TCP.
  • RADIUS is defined by Cisco and TACACS+ is RFC 2865.
  • RADIUS encrypts the entire packet and TACACS+ does not. 
What is the difference between TACACS+ and RADIUS?

 

EXPLANATION


TACACS+ uses Transmission Control Protocol (TCP) port 49 to communicate between the TACACS+ client and the TACACS+ server. An example is a Cisco switch authenticating and authorizing administrative access to the switch’s IOS CLI. The switch is the TACACS+ client, and Cisco Secure ACS is the server.
One of the key differentiators of TACACS+ is its ability to separate authentication, authorization and accounting as separate and independent functions. This is why TACACS+ is so commonly used for device administration, even though RADIUS is still certainly capable of providing device administration AAA.
Device administration can be very interactive in nature, with the need to authenticate once, but authorize many times during a single administrative session in the command-line of a device. A router or switch may need to authorize a user’s activity on a per-command basis. TACACS+ is designed to accommodate that type of authorization need.   As the name describes, TACACS+ was designed for device administration AAA, to authenticate and authorize users into mainframe and Unix terminals, and other terminals or consoles.
TACACS+ communication between the client and server uses different message types depending on the function. In other words, different messages may be used for authentication than are used for authorization and accounting. Another very interesting point to know is that TACACS+ communication will encrypt the entire packet.

SOURCE

http://www.networkworld.com/article/2838882/radius-versus-tacacs.html
Share:

Tuesday, December 5, 2017

By default, which of the following is NOT a legitimate Linux run level?

By default, which of the following is NOT a legitimate Linux run level?

  • 6: Reboot system
  • 1: Single-user mode
  • 4: Normal mode
  • 3: Multi-user mode with networking 

By default, which of the following is NOT a legitimate Linux run level?

EXPLANATION

A Linux run level defines the state of the system after boot. Conventionally, seven run levels exist, numbered from zero to six. They include:
0: Halt system
1: Single-user mode
2: Basic multi-user mode without NFS
3: Multi-user mode with networking
4: Unused
5: Multi-user mode with GUI

6: Reboot system

Share:

Monday, December 4, 2017

Which of the following would provide secure communications if your organization uses an application that authenticates with Active Directory Domain Services (AD DS) through simple BIND?

Which of the following would provide secure communications if your organization uses an application that authenticates with Active Directory Domain Services (AD DS) through simple BIND?

  • SAML
  • XTACACS
  • TACACS+
  • Secure LDAP 

Which of the following would provide secure communications if your organization uses an application that authenticates with Active Directory Domain Services (AD DS) through simple BIND?

EXPLANATION

Secure LDAP, or LDAPS, protects authentication sessions when an application authenticates with AD DS through simple BIND.
Share:

Friday, December 1, 2017

Which of the following does a DNS MX record provide for a given domain?

Which of the following does a DNS MX record provide for a given domain?

  • The name of the inbound email server for that domain
  • The web server details of the domain
  • Outgoing email server for the domain
  • Microsoft Exchange related information for the domain 

 
Which of the following does a DNS MX record provide for a given domain?

EXPLANATION

Mail eXchanger (MX) records specify a mail server responsible for accepting email messages on behalf of a recipient's domain,
and a preference value used to prioritize mail delivery if multiple mail servers are available. The set of MX records of a domain name specifies how email should be routed with the Simple Mail Transfer Protocol (SMTP).

SOURCE

https://en.wikipedia.org/wiki/MX_record
Share:

What is the first program that the Linux kernel runs once it's booted in a normal boot process?

What is the first program that the Linux kernel runs once it's booted in a normal boot process?


  • init
  • dmesg
  • lilo
  • rc             
What is the first program that the Linux kernel runs once it's booted in a normal boot process?

EXPLANATION

The Linux kernel runs init as the first program; init then runs, via various scripts, other programs. The dmesg program is a user diagnostic and information tool not part of startup. The rc program is a script that some versions of init call during startup sequence but its not the first program the kernel runs. The lilo command installs the boot loader to MBR. The boot loader runs before the
Share:

In PowerShell, what is "splatting"?

Which of the following does a DNS MX record provide for a given domain?

  • The name of the inbound email server for that domain
  • The web server details of the domain
  • Outgoing email server for the domain
  • Microsoft Exchange related information for the domain 

 
In PowerShell, what is "splatting"?

EXPLANATION

When you have multiple parameters to give to a single cmdlet, you can use a "splat", also known as "splatting".  This is where you build a hash table where each key is a parameter name, and each key's value is the value that you will pass to that parameter.  Once created, you can pass the entire hash table to the cmdlet by calling it with @ instead of $.
Example:
$ADUserSplat = @{
    Department = "IT Department";
    Description = "Person in IT";
    City = "Awesometown";
}

Set-ADUser -Identity ituser @ADUserSplat
Since the splat is actually a hash table, it can be modified, added to, and removed from as a hash table, allowing more programmatic (logic based) constructions of commands, such as "only change the department if they're in one of these three groups", without having to have multiple calls to the same cmdlet in a complex if/elseif/else chain.
Share:

Wednesday, November 29, 2017

In PHP scripting, which expression will output $somestring to the browser, only if it contains a colon?

In PHP scripting, which expression will output $somestring to the browser, only if it contains a colon?


  • if (strpos($somestring,":")!==false) echo $somestring ;
  • if (strpos($somestring,":")==true) echo $somestring ;
  • if (strpos($somestring,":")!=false) echo $somestring ;
  • if (strpos($somestring,":")=true) echo $somestring ;             
In PHP scripting, which expression will output $somestring to the browser, only if it contains a colon?


EXPLANATION

The correct test is "!==false"
The strpos() function finds the position of the first occurrence of a string inside another string. In this example, it looks for the numeric position of the first occurrence of a colon if one is present, or a boolean false value if none is found.
PHP strings are zero-indexed, so a string starting with colon (:) will return a numeric zero from strpos(). However, as in most scripting languages, the variables are not strongly typed, zero and false being equivalent in logic tests.
Thus, a string starting with a colon would cause the zero output of strpos() to be interpreted as 'Not found' and nothing would be output to the browser.
The workaround is to use a literal boolean test, which is expressed with '===' or '!==' for equality or inequality as appropriate.
The '===' test cannot be used here, because a colon's presence is returned as an integer value, which is not literally a boolean value. Thus doing so would result in no output, ever. (False or an integer are never literally equal to true.)
The correct approach is therefore to ask, 'Is the value returned by strpos() NOT LITERALLY a BOOLEAN FALSE' -which yields true for colon present anywhere including first character, false for no colon. (Also false for a null string)
Incidentally, BASIC-like languages index strings from one, so the issue does not arise. Javascript indexes strings from zero, but search functions typically return -1 as the 'not found' response.
The lowdown:
if (strpos($somestring,":")!==false) echo $somestring ; // Yay! It worked. :)
if (strpos($somestring,":")=true) echo $somestring ;     // This is a syntax error.
if (strpos($somestring,":")===true) echo $somestring ; // Never outputs anything.
if (strpos($somestring,":")!=false) echo $somestring ;   // Fails if the colon is first char, otherwise works.
if (strpos($somestring,":")==true) echo $somestring ;   // Fails if the colon is first char, otherwise works.
Share:

In a Windows domain, using built in domain features, how can you easily stop malicious software/viruses/cryptolocker from running from the downloads folder, or temporary internet files?

In a Windows domain, using built in domain features, how can you easily stop malicious software/viruses/cryptolocker from running from the downloads folder, or temporary internet files?

  • Advanced Windows Firewall Settings
  • Fancy Antivirus Software
  • Train your users to be more careful
  • Apply a Software Restriction Policy GPO 
 
In a Windows domain, using built in domain features, how can you easily stop malicious software/viruses/cryptolocker from running from the downloads folder, or temporary internet files?

EXPLANATION

Using a software restriction Policy you can create a whitelist or blacklist policy of locations that software is allowed to launch from. This included applications, scripts and so on. You can easily block software from launching from anywhere within a users profile, including the downloads folder. If you want to get into the advanced settings, you can blacklist ALL software and provide a while list of hashes for applications on your domain. SRP is extremely powerful, and very user friendly to configure. It is a valuable tool to use in keeping your network safe.

SOURCE

https://technet.microsoft.com/en-us/library/cc786941(v=ws.10).aspx
Share:

Tuesday, November 28, 2017

How many channels are in a full T1 PRI trunk?

How many channels are in a full T1 PRI trunk?

  • 23
  • 6
  • 24
  • 32 

 

How many channels are in a full T1 PRI trunk?

 

EXPLANATION

T1 connections have 24 channels in total.

Typically, for T1 ISDN (CCS) protocols, 23 channels are used as B-channels and 1 channel is used as a D-channel. For this reason, the frame structure of a T1 PRI connection is said to be 23B+1D where the D-channel is located on timeslot 23 (channels numbered from 0 to 23) and the remaining channels are used as B-channels. Hence;
If you had an E1 PRI trunk, you would have 30 B channels and 2 D channels.

SOURCE

https://en.wikipedia.org/wiki/Primary_Rate_Interface
Share:

How do you delete a login on SQL Server?

How do you delete a login on SQL Server?

  • DISABLE LOGIN login_name
  • DELETE LOGIN login_name
  • A login cannot be deleted but only disabled
  • DROP LOGIN login_name

How do you delete a login on SQL Server?

EXPLANATION

In order to delete a login on SQL Server, you write "DROP LOGIN login_name."
Share:

Friday, November 24, 2017

What is the minimum size of the IPv6 packet header?

What is the minimum size of the IPv6 packet header?


  • 40 octets
  • 36 octets
  • 32 octets
  • 48 octets             
What is the minimum size of the IPv6 packet header?

EXPLANATION

The IPv6 packet header has a minimum size of 40 octets. Options are implemented as extensions. This provides the opportunity to extend the protocol in the future without affecting the core packet structure.
RFC 2460; Internet Protocol, Version 6 (IPv6) Specification, S. Deering, R. Hinden (December 1998)
https://en.wikipedia.org/wiki/IPv6
Share:

Many mobile devices use what to measure the pitch, roll, and yaw of the device?

Many mobile devices use what to measure the pitch, roll, and yaw of the device?

  • Piezometer
  • Barometer
  • Transducer
  • Gyroscope
Many mobile devices use what to measure the pitch, roll, and yaw of the device?

EXPLANATION

Many mobile devices include a gyroscope to add an extra dimension to the information supplied by the accelerometer. The gyroscope tracks rotation or twist, measuring the angular rotational velocity. This helps your device orient itself in space.
Share:

Thursday, November 23, 2017

Which of the following domain trust types does not extend beyond the trusted and trusting domains?

Which of the following domain trust types does not extend beyond the trusted and trusting domains?


  • Shortcut
  • Forest
  • Internet
  • External             
Which of the following domain trust types does not extend beyond the trusted and trusting domains?

EXPLANATION

An external trust provides access to resources located on an NT4 domain or a domain in a non-trusted forest. It is not transitive.
Forest trusts provide access to resources in any domain in the forest. Forest trusts are transitive.
Shortcut trusts are used to improve user login times between two domain in a forest. These trusts are also transitive.
Internet trusts do not exist

SOURCE

https://technet.microsoft.com/en-us/library/cc730798(v=ws.11).aspx
Share:

A static virtual local area network (VLAN) assigns VLANs to which of the following?

A static virtual local area network (VLAN) assigns VLANs to which of the following?

  • Trunks
  • Physical ports
  • IP addresses
  • MAC addresses 

 
A static virtual local area network (VLAN) assigns VLANs to which of the following?

EXPLANATION

Static VLANs assign VLANs to physical ports. Assigning each port to a VLAN means that whatever computer plugs into that port, it will always be a member of that port's VLAN.
Dynamic VLANs assign VLANs based on MAC addresses

Share:

What is the maximum length for a cat 5e cable run before experiencing packet loss or latency?

What is the maximum length for a cat 5e cable run before experiencing packet loss or latency?

  • 500 feet
  • 200 meters
  • 100 meters
  • 100 feet 

What is the maximum length for a cat 5e cable run before experiencing packet loss or latency?

EXPLANATION

The maximum length for a cable segment is 100 meters. If longer runs are required, the use of active hardware such as a repeater or network switch is necessary.
https://en.wikipedia.org/wiki/Category_5_cable
Share:

Popular Posts