IT Questions and Answers :)

Friday, March 29, 2019

What default port does SSH use?

What default port does SSH use?

  • Port 21
  • Port 80
  • Port 53
  • Port 22 

What default port does SSH use?

EXPLANATION


File Transfer Protocol
The File Transfer Protocol is a standard network protocol used for the transfer of computer files between a client and server on a computer network. FTP is on Port 21
Secure Shell
Secure Shell is a cryptographic network protocol for operating network services securely over an unsecured network. The best known example application is for remote login to computer systems by users.Secure Shell (SSH) uses TCP port 22.
Hypertext Transfer Protocol
The Hypertext Transfer Protocol is an application protocol for distributed, collaborative, and hypermedia information systems. HTTP is the foundation of data communication for the World Wide Web.Wikipedia Developed by:CERN HTTP is on Port 80
Domain Name System
The Domain Name System is a hierarchical decentralized naming system for computers, services, or other resources connected to the Internet or a private network. It associates various information with domain names assigned to each of the participating entities.Wikipedia DNS is on Port 53

SOURCE

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

Thursday, March 28, 2019

What Error code is given when a server is currently unavailable, this maybe due to an overloaded or maintenance is being carried out.

What Error code is given when a server is currently unavailable, this maybe due to an overloaded or maintenance is being carried out.

  • 503
  • 504
  • 502
  • 500 

 
What Error code is given when a server is currently unavailable, this maybe due to an overloaded or maintenance is being carried out.

EXPLANATION

1xx Informational Codes
100 Continue Server Code
100 continue server code basically means ‘Business as usual’. Essentially it relates to the fact that the request being made by the user is good and that the server is to continue with the request. This is only a temporary response code while the user waits for the final response code from the server, which occurs once the last data packet is sent.

When might this be used? – This is an internal code and sometimes it doesn’t even get generated if the user has already received some data from the server already. It’s kind of like saying that to the server that the connection is good and the door is open. Send in the data but don’t forget to close the door when you are done (with the final response code).
101 Switching Protocols
This is one of the simplest of the server error codes and it means the user has made a request to switch the type of protocols used on the web server and the server has agreed to do so.
When might this be used? – When switching to a new HTTP version from an older style protocol to a newer style that may be cleaner or have newer features. This is only done if it is in the best interest for the protocol to do so. i.e. an upgraded HTTP version is available.
102 Processing
As a WebDAV (Transfer Protocol) request may contain not just one request but lots of sub-requests involving file operations and it may take a long time to complete the request.
When might this be used? – This code is generated to indicate to the user that the server has received and is processing the request, but no response is available yet as it is taking time due to the nature of the request. This means that the client doesn’t time out automatically because it won’t assume the request was lost and that it should expect data soon.
2xx Success
This class of status codes indicates the action requested by the client was received, understood, accepted and processed successfully – job done!
200 OK
This code is probably the most widely used and known, conversely, it is probably the least seen due to its very nature. It basically means that the exchange between the user and the server is complete and everything went as it should.
When might this be used? – Ideally all the time!
201 Created
The request has been fulfilled and resulted in a new resource being created. For example, a request from the user has resulted in the creation of a new resource, like a new page. The origin server must create the resource before sending the 201 code. If the resource cannot be generated at that time then the server should show a 202 (accepted) code instead.
202 Accepted
The request has been accepted for processing, but the processing has not been completed for whatever reason. The request may or may not eventually be acted upon depending on whether it is disallowed when processing actually takes place.
When might this be used? – When the server cannot complete the request at the time it is made. The response is intentionally non-committal as it is simply used to stop the user from persisting with the request for a 201 code when the server cannot complete the action there and then.
203 Non-Authoritative Information
The server successfully processed the request, but is returning information that may be from a third party source rather than the original server. It is pretty much identical to a 200 code in nature, but indicated the source is not from the requested server.
When might this be used? – This code may be used in place of 200 when the sender has a reason to believe that the information in the response’s entity headers is different from what the origin server would send.
204 No Content
Not ideal. This code is a response sent by the server to say that the request was received and understood but there is no data to send back to the user. This is mainly to allow for scripts without changing the document at the same time. This code must not contain a message body and is included in the first empty line of code after the header fields.
When might this be used? – The code is primarily given to allow for input or actions to take place without causing changes to the user agent’s active view, although any new information should be applied to the document currently in view.
205 Reset Content
The server successfully processed the request, but is not returning any content. Unlike a 204 response, this response requires that the requester reset the document view.
When might this be used? – This is usually seen when a user completes a form and the server sends a request to the browser to clear the form. It is similar to a 204 code but asks the user to reset the document view after completion, for example clearing an HTML form after submission.
206 Partial Content
The server is delivering only part of the resource due to a range header sent by the client. This is usually used by advanced caching tools when the user only requests part of or a small section of content on a page and the server responds by showing only that selection.
When might this be used? – This code is usually given as a result of an If-Range request that is used in a strong cache validator. The request is also required to include the range header area, which is used to set the parameters for what content is displayed.
207 Multi-Status
The message body that follows is an XML message and can contain a number of separate response codes, depending on how many sub-requests were made.
3xx Redirection
This class of status code indicates that further action needs to be taken by the user agent to complete the request. The action may be carried out by the user or may include a different request to the server.
300 Multiple Choices
Very basically, this code tells the user that the resource has been moved and the server responds with a list of alternate location options where the user agent can select the most appropriate resource.
When might this be used? – Typically this might be seen when the server thinks that the URL provided by the user (i.e. the browser) is not specific enough and further selection needs to be made from additional choices. This usually happens where a URL is requested that is for a high level directory where a user must select the specific file to access.
301 Moved Permanently
This is a hugely common and widely used request. It means that requests for that resource and all future requests should be directed to the new given URI.
When might this be used? – When a page no longer exists or a link provided from a third party is ‘broken’ or incomplete. The 301 response tells the user that the given resource is moved to the stated source (usually handled in the .htaccess file on apache servers).
302 Found
This code essentially tells the user that the location of the resource that was requested has been temporarily moved to a new location and the 302 response should include the new location the user should request.
When might this be used? – This has quite a few uses, many of which are not what the code was originally intended for. It was originally intended as a primary way of creating a temporary redirect; however there are other ethical and unethical uses for these codes.
303 See Other
This code indicates to the user that the requested resource can be found at a URL other than the one requested. It doesn’t mean that anything has been moved necessarily it is just specifying the address where the response should be requested.
When might this be used? – This method exists primarily to allow the output of a POST-activated script to redirect the user agent to a selected resource.
304 Not Modified
This code means that the user has requested a document/resource only if it has been modified since the last cache date of the document stored by the user.
When might this be used? – If the response from the server says that the documents’ If-Modified-Since or If-Match is the same as that of the cached copy that the user has a cached version of there is no need to re-send the resource and thus a 304 Not modified code is used.
305 Use Proxy
This code tells the user that access to the requested resource is only available through a proxy which is specified in the response.
When might this be used? – This code is often presented in relation to security considerations that govern access to the requested URL resources.
306 Switch Proxy
This code originally meant “Subsequent requests should use the specified proxy” but is no longer used and is reserved.
307 Temporary Redirect
This code is returned when a resource is temporarily available at a different URL which is also returned. There is little difference between this and a 302 code other than that this code was created as a less ambiguous version of the 302.
When might this be used? – In much the same ways as he 302 code and the user should continue to request the original URL for future requests or until a new response code is applied.
4xx Client Error
The 4xx class of status code is intended for cases in which the client seems to have made a mistake or the location never existed/no longer exists but is yet to have a 3xx code applied. These status codes are applicable to any request method.
400 Bad Request
The request cannot be fulfilled due to bad syntax.
When might this be used? – When the user requests information but in doing so disobeys the rules regarding the hypertext transfer protocol. The request should not be repeated without modification to the syntax.
401 Unauthorized
This code is in relation to a request for a resource that requires user authentication. A 401 response indicates that the authorisation had been refused for the credentials that the user provided.
When might this be used? – When the user makes a server request using the wrong credentials (username and/or password)
402 Payment Required
Reserved for future use. However the original intention was that this code might be used as part of some form of digital cash or micropayment scheme, but that has not happened, and this code is not usually used.
When might this be used? – Apple’s old MobileMe service generated a 402 error if the MobileMe account was misusing the service. In addition, YouTube uses this status if a particular IP address has made excessive requests, and requires the person to enter a CAPTCHA.
403 Forbidden
The user is attempting to request a resource that it does not have access to and authentication will not change this.
When might this be used? – Basically, if the user’s request is valid but the server doesn’t allow access to the resource for some reason. Usually because the resource is not meant for public access.
404 Not Found
We all know what these are right? This means that the resource requested cannot be found but may be accessible in the future. Subsequent requests by the client are permissible; however in most cases a 3xx code is applied to redirect the resource to the present the user with an alternate location or resource.
When might this be used? – Quite often when a page is removed or a link to an old page is left without a 3xx redirect. Usually in this case a custom page is generated through the server error handling code that will show the user a standard 404 error page.
405 Method Not Allowed
The method by which you are making your resource request is not allowed. E.g. Using GET on a form which requires data to be presented via POST, or using PUT on a read-only resource.
When might this be used? – 405 errors are presented in relation to particular objects on a web site that is requested, for example the request line on a script is different to that of the user request that is asking to use the script.
406 Not Acceptable
The requested resource is only able to generate content that is not acceptable to that of the Accept headers in the request itself. The browser can indicate to the server the data characteristics that the data will accept from the server.
When might this be used? – If the file format of the resource requested is not in a format that the user is capable of understanding. We are talking about coding language here not French!
407 Proxy Authentication Required
Similar to a 401 code, a 407 code means that the client must first authenticate itself with the proxy. To do this and pass authentication the proxy must return a Proxy-Authenticate header field that meets the challenge presented by the server.
When might this be used? – When the server thinks that the data request from the client was correct but access to the resource is only available through a proxy server authentication. Typically a log in challenge on a proxy server first.
408 Request Timeout
The server timed out waiting for the request from the user that failed to respond in the time allowed by the server.
When might this be used? – According to W3 HTTP specifications: “The client did not produce a request within the time that the server was prepared to wait. The client MAY repeat the request without modifications at any later time.”
409 Conflict
Indicates that the request could not be processed because of conflict in the request, such as an edit conflict.
When might this be used? – You may receive this code when uploading a file to a web server that is older than the one already there causing a conflict in version control.
410 Gone
Indicates that the resource requested is no longer available and will not be available again either through deletion or access removal. The user should not make a request for this location again.
When might this be used? – If a resource is no longer available at the server and no forwarding address is known and the server does not know or is unable to tell if the 404 code should be used.
411 Length Required
The request did not specify the length of its content, which is required by the requested resource.
When might this be used? – The browser did not define the requested content’s length in the request header. The server won’t accept a request without a valid Content-Length header field.
412 Precondition Failed
The server does not meet one of the preconditions that the requester put on the request. In other words; one or more of the request headers responded with a ‘false’ attribute.
When might this be used? – If the header request that is making a valid request of the resource that specific request is not acceptable for that specific resource.
413 Request Entity Too Large
A 413 code is presented when the request that was sent to the server is larger than the server is willing or able to process.
When might this be used? – When using the POST method on a form the content is larger than the server can process due to constraints either physically or by design.
414 Request-URI Too Long
This code it given by a server when the URL requested by the user is longer than the server is bale to process.
When might this be used? – When a POST request is converted to a GET request. A POST request allows for unlimited amounts of data to be sent by tagging it to the request itself; however if this request were to be converted into a GET request then the request allows the form data to be appended to the URL, which can make it longer than is accepted.
415 Unsupported Media Type
A 415 response is sent to indicate that a server has noticed that part of the request was made in an unsupported format that the server is expecting based on requested resource.
When might this be used? – When the request didn’t specify any media types that the resource or server supports. For example, the user requests an image with a file extension that the server doesn’t support. The server knows what is being asked for but it doesn’t understand the format that it is being asked to provide the resource.
416 Requested Range Not Satisfiable
This response code is presented to the user when a request for a portion of the resource is requested when that portion cannot be supplied.
When might this be used? – When the server is asked for the XXX – YYY bytes of a resource but the resource is smaller than that of the request.
417 Expectation Failed
The server cannot meet the requirements of the Expect request-header field.
When might this be used? – Quite self-explanatory; One of the request headers sent to the server, the ‘Expect’ header indicated an expectation that the server could not meet.
418 I’m a teapot
This code was defined in 1998 as one of the traditional IETF April Fools’ jokes, in RFC 2324, Hyper Text Coffee Pot Control Protocol, and is not expected to be implemented by actual HTTP servers.
When might this be used? – For a nerdy laugh almost 15 years ago.
422 Unprocessable Entity
The request was well-formed but was unable to be followed due to semantic errors.
When might this be used? – This error condition may occur if an XML request body contains well-formed (i.e., syntactically correct), but semantically erroneous, XML instructions.
423 Locked
The resource that is being accessed is locked. The lock must be released or proper identification given before the resource can be accessed.
When might this be used? – When the resource is exactly that. Locked. Usually for security.
424 Failed Dependency
Indicates the method was not executed on a particular resource within its scope because some part of the method’s execution failed causing the entire method to be aborted.
425 Unordered Collection
This code is presented when a resource is defined in drafts of “WebDAV Advanced Collections Protocol”, but not present in “Web Distributed Authoring and Versioning Ordered Collections Protocol”.
426 Upgrade Required
This code will be reported to the user when it should switch to a different, newer protocol.
When might this be used? – Usually when a browser is using older protocols than that of the server handling the requests.
428 Precondition Required
The origin server requires the request to be conditional. Intended to prevent “the ‘lost update’ problem, where a client GETs a resource’s state, modifies it, and PUTs it back to the server, when meanwhile a third party has modified the state on the server, leading to a conflict.”
When might this be used? – By requiring requests to be conditional, the server can ensure that clients are working with the correct copies. If they aren’t, the user will receive a 428 code.
429 Too Many Requests
This is a response set by the server in an attempt to limit request rates.
When might this be used? – When the user has sent too many requests in a given amount of time this code is reported.
431 Request Header Fields Too Large
The server is unwilling to process the request because either an individual header field, or all the header fields collectively, are too large.
When might this be used? – Basically, when the request header from the user is larger than the server is able or willing to handle. The request may be resubmitted after reducing the size of the request header fields.
444 No Response
Used in Nginx logs to indicate that the server has returned no information to the client and closed the connection.
When might this be used? – Usually used as a deterrent to malware.
449 Retry With (Microsoft)
A Microsoft extension that states a request should be retried after performing the appropriate action.
When might this be used? – This code is often generated when a set of parameters are not appropriate to the action requested. Usually in a custom application or basic search engine.
450 Blocked by Windows Parental Controls (Microsoft)
A Microsoft extension. This error is given when Windows Parental Controls are turned on and are blocking access to the given webpage.
When might this be used? – When parents (who know about this feature) use parental control and access id being requested to a blocked resource. Bad kids!
451 Unavailable For Legal Reasons
“A New HTTP Status Code for Legally-restricted Resources” .Intended to be used when resource access is denied for legal reasons, e.g. censorship or government-mandated blocked access.
5xx Server Error
The server failed to fulfil an apparently valid request.
These server responses are often shown when the user makes a request that the server is incapable of completing for whatever reason. The server should include a message for the browser to display to the user, showing the code and explaining whether or not the error is temporary or permanent.
500 Internal Server Error
A 500 Error message is a generic error message that is given when no more specific message is suitable.
When might this be used? – When a resource or link is created on the server (like a calendar resource in a booking system) that technically doesn’t exist as a link or an accessible resource yet appears as a link to the user.
internal-server-error

501 Not Implemented
The server either does not understand the request method, or it doesn’t have the ability to complete the request.
When might this be used? – You may see this when the server doesn’t support the normal request protocols such as GET, OPTIONS, HEAD and POST etc.
502 Bad Gateway
A 502 response is shown when the server was acting as a gateway or proxy and received an invalid response from the upstream server.
When might this be used? – Usually when the upstream server and the proxy/gateway do not agree on the protocols in the request and as a result generate an error when exchanging data.
503 Service Unavailable
The server is currently unavailable because it is overloaded or down for maintenance. Generally, this is a temporary state.
When might this be used? – When a site is experiencing a high level of demand that its servers cannot handle.
504 Gateway Timeout
When exchanging data with a proxy/gateway server the gateway fails to respond to a request in the pre-defined timeframe.
When might this be used? – When using a proxy/gateway server to exchange data and the two servers are waiting for responses.
505 HTTP Version Not Supported
The server does not support the HTTP protocol version used in the request.
When might this be used? – Exactly as it says above! When the HTTP protocol is older than the server likes and no longer supports.
506 Variant Also Negotiates
This indicates that the server has an internal configuration issue and a transparent content negotiation for the request that has no end point.
When might this be used? – When the server is not set up correctly to handle the request and a negotiation loop ensues.
507 Insufficient Storage
The server is unable to store the data from the user needed to complete the request fully.
When might this be used? – When the server is already at capacity and the user makes a request for a resource that the server has stored. The issue is that the server does not have the storage to store the data that is sent in the request to then send the requested resource.
509 Bandwidth Limit Exceeded


This status code, while used by many servers, is not specified in any RFCs and requires the correct implementation on apache servers.
When might this be used? – When the correct extension is implemented to an apache server and bandwidth set by the ISP is soon to be exceeded. There are different threshold settings to chose from.
510 Not Extended
Further extensions to the request are required for the server to complete the request.
When might this be used? – When the server requires more information from the request than is given.
511 Network Authentication Required
The user needs authentication to gain network access. Intended for use by intercepting proxies that control access to the network.
When might this be used? – When the user is required to agree to Terms of Service before granting full Internet access via a Wi-Fi hotspot or third party network.
Loads aren’t there! I hope this list is a useful resource to you all and if I have missed any off (I think there are one or two that are completely useless or so out of date that I don’t know of them) please feel free to add them in the comments section below. Please share this post with your colleagues as it might help them too!
Image Credits:

 

503 Service Unavailable.

The server is currently unable to handle the request due to a temporary overloading or maintenance of the server. The implication is that this is a temporary condition which will be alleviated after some delay. If known, the length of the delay MAY be indicated in a Retry-After header. If no Retry-After is given, the client SHOULD handle the response as it would for a 500 response.
Note: The existence of the 503 status code does not imply that a server must use it when becoming overloaded. Some servers may wish to simply refuse the connection.

SOURCE

https://www.restapitutorial.com/httpstatuscodes.html
Share:

Wednesday, March 27, 2019

In MYSQL, what is the command used to reload the grant tables?

In MYSQL, what is the command used to reload the grant tables?

  • PRIVILEGES RELOAD;
  • FLUSH PRIVILEGES;
  • RELOAD GRANT;
  • UPDATE PRIVILEGES; 

 

EXPLANATION


Privileges assigned through GRANT option do not need FLUSH PRIVILEGES to take effect - MySQL server will notice these changes and reload the grant tables immediately.
From MySQL documentation:
If you modify the grant tables directly using statements such as INSERT, UPDATE, or DELETE, your changes have no effect on privilege checking until you either restart the server or tell it to reload the tables. If you change the grant tables directly but forget to reload them, your changes have no effect until you restart the server. This may leave you wondering why your changes seem to make no difference! 


To tell the server to reload the grant tables, perform a flush-privileges operation. This can be done by issuing a FLUSH
PRIVILEGES statement or by executing a mysqladmin flush-privileges or mysqladmin reload command.

SOURCE

https://dev.mysql.com/doc/refman/8.0/en/privilege-changes.html
Share:

Tuesday, March 26, 2019

What is the primary difference between LED and an LCD monitor?

What is the primary difference between LED and an LCD monitor?

  • Doesn't last as long as plasma displays
  • screen size
  • Backlighting source
  • price 

 
What is the primary difference between LED and an LCD monitor?

EXPLANATION

LCD
LCD is the abbreviation of Liquid Crystal display. There are two layers of glass in this technology that are joined together with liquid crystals in between. These crystals help pass or block the light. However, crystals do not produce any light and it comes through fluorescent lamps (CCFL) situated at the back of the screen.
LED
The technology in LED TV’s is much the same with the difference being the source of light at the back of the screen. Whereas it is CCFL in the case of LCD, there is Light emitting Diodes (LED’s) in the case of LED TV’s.
http://www.differencebetween.com/difference-between-lcd-and-vs-led-monitor/
http://www.diffen.com/difference/LCD_TV_vs_LED_TV

Share:

Monday, March 25, 2019

Hard links in Linux are directory entries that refer to the same inode number within the same filesystem. What is the minimum link count for a directory name on a Linux system?

Hard links in Linux are directory entries that refer to the same inode number within the same filesystem. What is the minimum link count for a directory name on a Linux system?

  • 4 The directory, a hard link to itself, a hard link to its parent, and hard link from its parent.
  • 3 The directory name itself, a hard link to itself named " ." and the hard link ".." to its parent.
  • 0 Because users cannot hard link additional names to a directory name.
  • 2 The directory name itself, and a hard link to itself (named "."), within the directory. 


EXPLANATION

Users cannot hard link directories:
$ mkdir This_dir
$ ln This_dir That_dir
ln: ‘This_dir’: hard link not allowed for directory
But the system makes two hard links within a directory when it is created.  One of these is named "." and it is a link to the newly created directory itself, so the new directory will have a link count of 2, which is the minimum link count for a directory.
The other is named ".." and it is a link to  the parent directory, and will add to the parent's link count.
$ ls -ild Link.test    ## list "i"node, "l"ong list, for the "d"irectory itself.
ls: cannot access Link.test: No such file or directory
 
$ mkdir Link.test      ## make the directory.

$ ls -ild Link.test   
2238981 drwxr-xr-x 2 dan users 4096 Dec 26 13:53 Link.test
$ #Link count......^ The newly created directory has 2 hard links.
 
$ ls -ild "Link.test"  "Link.test/."  #Quoting not required, but more readable
2238981 drwxr-xr-x 2 dan users 4096 Dec 26 13:53 Link.test
2238981 drwxr-xr-x 2 dan users 4096 Dec 26 13:53 Link.test/.
When making a new directory, the system will also create a link to the parent directory named  ".."
So every time a directory is created, the link count of the parent directory increases by 1.
$ pwd
/home/dan/Test.link.dir




$ ## List inode numbers in a long listing, directory only, for "Link.test" and "Link.test/."

$ ls -ild "Link.test"   "Link.test/."
2238981 drwxr-xr-x 2 dan users 4096 Dec 26 13:53 Link.test
2238981 drwxr-xr-x 2 dan users 4096 Dec 26 13:53 Link.test/.
$ #................^ Link count is 2 for each entry and inode numbers are identical, 2238981.

$ mkdir Link.test/subdir  ## make a subdirectory under "Link.test".

$ ## Now check the link count, including the newly created subdirectory's parent, " .. "

$ ls -ild   "Link.test/"   "Link.test/."   "Link.test/subdir/.."
2238981 drwxr-xr-x 3 dan users 4096 Dec 26 15:55 Link.test/
2238981 drwxr-xr-x 3 dan users 4096 Dec 26 15:55 Link.test/.
2238981 drwxr-xr-x 3 dan users 4096 Dec 26 15:55 Link.test/subdir/..
$ #................^ Link count has increased from 2 to 3 after creating "subdir".
$ #+ The 3 names above, "Link.test", "Link.test/." and "Link.test/subdir/.." reference
$ #+ the same inode, 2238981.  
c.f.  https://www.tldp.org/LDP/gs/node5.html
"... a directory is actually just a file containing information about link-to-inode associations. Also, every directory contains at least two hard links: ``.'' (a link pointing to itself), and ``..'' (a link pointing to the parent directory)."
The root directory of a filesystem does not have a parent directory, so "/" and  "/."  and "/.."  all reference the same inode.  That is, the parent directory of root, "/..", is  "/"
E.g.
$ ls -ild  "/"   "/."   "/.."
2 drwxr-xr-x 32 root root 4096 Oct 26 13:54 /
2 drwxr-xr-x 32 root root 4096 Oct 26 13:54 /.
2 drwxr-xr-x 32 root root 4096 Oct 26 13:54 /..
$ #..........^^ Note that this link count also includes parent references (..) from subdirectories. 

See also:  http://teaching.idallen.com/cst8207/13w/notes/notes/450_file_system.html

SOURCE

https://www.tldp.org/LDP/gs/node5.html
Share:

Friday, March 22, 2019

What is the scripting language that is taking over what Batch and VBS scripts used to do?

What is the scripting language that is taking over what Batch and VBS scripts used to do?

  • Java
  • C++
  • Powershell
  • VBS.Net 

 
What is the scripting language that is taking over what Batch and VBS scripts used to do?

EXPLANATION

First there were batch files, then VBscript (VBS) and now PowerShell. Sure, there have been some others along the way but, for the most part, good ol' batch, VBS and PowerShell have been the mainstays. Over the years, scripts have become not only easier to write but more powerful as well.

Anything that can be done in Batch and VBS scripts can now be done with Powershell, and more!  Check out the Powershell scripting center for numerous scripts to try out and then visit the Active Directory & GPO group to see how many Spiceheads implement them

Share:

You have two very fast servers and need to transfer a 10 Gigabyte file from one server to the other. You have a 10/100 switch to connect these servers. Which of the following transfer time estimates is the most accurate?

You have two very fast servers and need to transfer a 10 Gigabyte file from one server to the other. You have a 10/100 switch to connect these servers. Which of the following transfer time estimates is the most accurate?

  • 15 Seconds
  • 3 Minutes
  • 3 Seconds
  • 15 Minutes 


EXPLANATION

The maximum transfer rate of the switch is 100 megabit per second, not megabyte per second.  Odds are the switch will be the bottleneck between these two servers.  Many people mistakenly think a gigabit switch can transfer one gigabyte per second. 

A 100 Mbps switch will transfer approximately 12.5 Megabytes of information per second. 


1024 * 10 = 10240MB
10240 / 12.5 = 819.2 seconds
819.2 / 60 = 13.65333 minutes.
Round up, and it'll take about 15 minutes.

To do the math Another way
10 GB * 1024 MB/GB = 10240 MB
10240 MB * 8 Bits/Byte = 81920 megabits
81920 megabits / 100 megabits/Second = 819.2 seconds
819.2 seconds / 60 seconds/minute = 13.65 minutes
Share:

Thursday, March 21, 2019

What does a "Framebuffer" do?

What does a "Framebuffer" do?

  • It allows for smoother frame rates whilst in an active remote session by using a portion of RAM
  • It stores an in-memory bitmap for conversion to a video signal that can be displayed
  • It renders bitmap images in a dot matrix data format, displaying a rectangular grid of pixels
  • It stores and displays a graphical image as a rectangular array of pixel colour values. 

What does a "Framebuffer" do?

EXPLANATION

A framebuffer (frame buffer, or sometimes framestore) is a portion of RAM containing a bitmap that drives a video display.
It is a memory buffer containing a complete frame of data. Modern video cards contain framebuffer circuitry in their cores.

SOURCE

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

Wednesday, March 20, 2019

What settings in VMware would you use to keep VMs together or separate?

What settings in VMware would you use to keep VMs together or separate?

  • VDS
  • Affinity rules
  • NSX
  • Snapshots 

 
What settings in VMware would you use to keep VMs together or separate?

EXPLANATION


An affinity rule is a setting that establishes a relationship between two or more VMware virtual machines (VMs) and hosts.
Affinity rules and anti-affinity rules tell the vSphere hypervisor platform to keep virtual entities together or separated. The rules, which can be applied as either required or preferred, help reduce traffic across networks and keep the virtual workload balanced on available hosts. If two virtual machines communicate frequently and should share a host, the VMware admin can create a VM-VM affinity rule to keep them together. Conversely, if two resource-hungry VMs would tax a host, an anti-affinity rule will keep those VMs from sharing a host.
Affinity rules and anti-affinity rules can be applied between VMs and hosts as well, and a VM can be subject to VM-VM affinity rules and VM-Host affinity rules at the same time. Affinity and anti-affinity rules in a vSphere environment can conflict with one another. For example, two VMs with an anti-affinity relationship may both be linked to a third VM via an affinity rule, but they cannot share a host. Optional affinity rule violation alarms can alert administrators to these events.

SOURCE

https://searchvmware.techtarget.com/definition/affinity-rules
Share:

Tuesday, March 19, 2019

What default port does HTTP use?

What default port does HTTP use?

  • Port 22
  • Port 8080
  • Port 80
  • Port 21 

What default port does HTTP use?

EXPLANATION

Secure Shell Port 22 
Secure Shell is a cryptographic network protocol for operating network services securely over an unsecured network. The best known example application is for remote login to computer systems by users. 
 
Port 8080
PortTCP/UDP - EMC2 (Legato) Networker or Sun Solcitice Backup (Official) [7937-9936]
TCP - HTTP alternate (http_alt)—commonly used for Web proxy and caching server, or for running a Web server as a non-root user (Official)
TCP - Apache Tomcat (Unofficial)
UDP - FilePhile Master/Relay (Unofficial)
The primary protocol and port used by HTTP is TCP port 80. 
Port 80 is the port number assigned to commonly used internet communication protocol, Hypertext Transfer Protocol (HTTP). It is the port from which a computer sends and receives Web client-based communication and messages from a Web server and is used to send and receive HTML pages or data
Port 21 File Transfer Protocol
The File Transfer Protocol is a standard network protocol used for the transfer of computer files between a client and server on a computer network.
Share:

Friday, March 15, 2019

drwxr-xr-x 3 root root 73728 Dec 26 08:39 /usr/bin/ <=== This directory file on an ext4 filesystem is listed in long format (ls -ld). The value of the fifth field, 73728, reports the size of what?

drwxr-xr-x 3 root root 73728 Dec 26 08:39 /usr/bin/ <=== This directory file on an ext4 filesystem is listed in long format (ls -ld). The value of the fifth field, 73728, reports the size of what?

  • The exact size of the directory file, in bytes.
  • The disk usage, in blocks, of the directory and all of its subdirectories.
  • The size in bytes of the total blocks in use by the directory file. [ (bytes/block) * blocks ]
  • The disk usage, in blocks, of the top level of the directory. 

 
drwxr-xr-x 3 root root 73728 Dec 26 08:39 /usr/bin/ <=== This directory file on an ext4 filesystem is listed in long format (ls -ld). The value of the fifth field, 73728, reports the size of what?

EXPLANATION

A directory file contains a list of names and corresponding inodes. 
A newly created directory file on an ext4 filesystem will have only 2 entries, dot "." and dot dot ".."  
The size of the new directory file will be 4096 bytes.  As additional entries are made to the directory, the reported size will remain at 4096 until additional bytes are required for the next directory entry.  At that point, additional blocks will be allocated to the directory and the reported directory file size will increase.
As directory entries are removed, the blocks already allocated to the directory file do not decrease, but allocated blocks are freed for future use by new entries in the directory.
https://unix.stackexchange.com/questions/234065/why-size-reporting-for-directories-is-different-than-other-files#
https://superuser.com/questions/142893/why-is-the-size-of-a-directory-always-4096-bytes-in-unix/1428...
http://www.linfo.org/directory.html
Note that when the same "ls" command is used on a regular file, the size field will report the actual file size in bytes, which is stored in the inode.  The " -s " option to "ls" will report allocated blocks, in addition to actual file size.

SOURCE

https://superuser.com/questions/142893/why-is-the-size-of-a-directory-always-4096-bytes-in-unix/142895
Share:

Thursday, March 14, 2019

What is the unique identifier for network hardware called?

What is the unique identifier for network hardware called?

  • Gettysburg address
  • MAC address
  • IP address
  • Network address 

 
What is the unique identifier for network hardware called?

EXPLANATION

A media access control (MAC) address is a unique identifier associated with network hardware for communicating on the physical network.
A media access control address of a device is a unique identifier assigned to a network interface controller for communications at the data link layer of a network segment. MAC addresses are used as a network address for most IEEE 802 network technologies, including Ethernet and Wi-Fi. In this context, MAC addresses are used in the medium access control protocol sublayer.
Share:

One of your users can receive mail but can't send any. You notice that the "Type of Outgoing Mail Server" field is blank in the mail application. Which of the following protocols will you most likely enter as a value in this field?

One of your users can receive mail but can't send any. You notice that the "Type of Outgoing Mail Server" field is blank in the mail application. Which of the following protocols will you most likely enter as a value in this field?

  • IMAP
  • POP3
  • NMP
  • SMTP

One of your users can receive mail but can't send any. You notice that the "Type of Outgoing Mail Server" field is blank in the mail application. Which of the following protocols will you most likely enter as a value in this field?

EXPLANATION

 

POP In computing, the Post Office Protocol is an application-layer Internet standard protocol used by e-mail clients to retrieve e-mail from a server in an Internet Protocol network. POP version 3 is the most recent level of development in common use. POP has largely been superseded by the Internet Message Access Protocol.
 
IMAP In computing, the Internet Message Access Protocol is an Internet standard protocol used by email clients to retrieve email messages from a mail server over a TCP/IP connection. IMAP is defined by RFC 3501.
  SMTP is used to send email and is a protocol within the TCP/IP protocol suite. POP3 and IMAP are email retrieval protocols, not protocols for sending email.

 
Share:

Wednesday, March 13, 2019

Linux and Unix systems typically track 3 timestamps in file inodes: atime, ctime, and mtime. The "a" in atime means access. The "m" in mtime means modify. What does the "c" in ctime mean?

Linux and Unix systems typically track 3 timestamps in file inodes: atime, ctime, and mtime. The "a" in atime means access. The "m" in mtime means modify. What does the "c" in ctime mean?

  • cache
  • create
  •  change
  • copy-on-write 

 
Linux and Unix systems typically track 3 timestamps in file inodes: atime, ctime, and mtime. The "a" in atime means access. The "m" in mtime means modify. What does the "c" in ctime mean?

EXPLANATION

"c" in ctime means change.  Specifically, a change to the inode's status, eg, permissions, ownership, link count, file size, etc.
http://man7.org/linux/man-pages/man7/inode.7.html
"Last status change timestamp (ctime) stat.st_ctime; statx.stx_ctime"

http://www.linux-mag.com/id/8658/
"Timestamps telling when the inode itself was last change (ctime, changing time), the file content was last modified (mtime or modification time), and when the file was last accessed (atime or access time)"

SOURCE

http://man7.org/linux/man-pages/man7/inode.7.html
Share:

Tuesday, March 12, 2019

When it comes to SNMP technology, what is the range of the "Counter32" parameter?

When it comes to SNMP technology, what is the range of the "Counter32" parameter?

  • 0 to 4294967295
  • 0 to 1099511627776
  • 32 to 272
  • -100 to 100 

 
When it comes to SNMP technology, what is the range of the "Counter32" parameter?

EXPLANATION

The Counter32 class allows all the functionality of unsigned integers but is recognized as a distinct SMI type, which specifies a value that represents a count.
The range is 0 to 4294967295

https://www.webnms.com/snmp/help/snmpapi/snmpv3/using_mibs_in_applns/countr32.html

Share:

Monday, March 11, 2019

What is the fastest back-end database for OpenLDAP ?

What is the fastest back-end database for OpenLDAP ?

  • hdb
  • sql
  • mdb
  • bdb 

 

EXPLANATION

  • A file with the MDB file extension is a Microsoft Access Database file that literally stands for Microsoft Database. ...
  • MDB files contain database queries, tables, and more that can be used to link to and store data from other files, like XML and HTML, and applications, like Excel and SharePoint.

 

http://www.openldap.org/pub/hyc/mdm-paper.pdf

SOURCE

http://www.openldap.org/pub/hyc/mdm-paper.pdf
Share:

Which of these is NOT a use case of Microsoft Azure Stack?

Which of these is NOT a use case of Microsoft Azure Stack?

  • Update and extend legacy applications with modern Azure services on-premise
  • Address latency and connectivity requirements for edge and disconnected solutions
  • Develop applications and deploy in Azure or on-premises to meet regulatory and policy requirements
  • The next-gen Hyper-V platform for you to migrate your current workloads on your existing hardware 

Which of these is NOT a use case of Microsoft Azure Stack?

EXPLANATION

If you answered "next-gen Hyper-V platform for you to migrate..." then yes you're correct - that is NOT the intended use case of Microsoft Azure Stack.  Microsoft Windows Server Software Defined (WSSD)
is a better solution to implement virtualization in scale within your datacenter.   Azure Stack's three primary use cases can be found at the link provided to learn more.

SOURCE

https://azure.microsoft.com/en-us/overview/azure-stack/
Share:

Friday, March 8, 2019

CPUs have a NX flag/bit to segregate areas of memory for process instruction or data. What does NX stand for?

CPUs have a NX flag/bit to segregate areas of memory for process instruction or data. What does NX stand for?

  • NineX
  • Non-Existent
  • No-Execute
  • Near-Exact 
CPUs have a NX flag/bit to segregate areas of memory for process instruction or data. What does NX stand for?

EXPLANATION


The NX bit (no-execute) is a technology used in CPUs to segregate areas of memory for use by either storage of processor instructions (code) or for storage of data, a feature normally only found in Harvard architecture processors. However, the NX bit is being increasingly used in conventional von Neumann architecture processors, for security reasons.
An operating system with support for the NX bit may mark certain areas of memory as non-executable. The processor will then refuse to execute any code residing in these areas of memory. The general technique, known as executable space protection, is used to prevent certain types of malicious software from taking over computers by inserting their code into another program's data storage area and running their own code from within this section; one class of such attacks is known as the buffer overflow attack.
Intel markets the feature as the XD bit (execute disable). Advanced Micro Devices (AMD) uses the marketing term Enhanced Virus Protection (EVP). The ARM architecture refers to the feature, which was introduced in ARMv6, as XN (execute never).[1] The term NX bit itself is sometimes used to describe similar technologies in other processors.

SOURCE

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

You are getting a DNS lookup error when trying to access any webpage that your local DNS server has no record for, what should you check?

You are getting a DNS lookup error when trying to access any webpage that your local DNS server has no record for, what should you check?

  • The Forwarders on your DNS server
  • The Reverse Lookup Zones on your DNS server
  • The CNAME records on your DNS server for your host
  • The Forward Lookup Zones on your DNS 

 
You are getting a DNS lookup error when trying to access any webpage that your local DNS server has no record for, what should you check?

EXPLANATION

In Domain Name System (DNS) terms, a DNS forwarder is a DNS server that is used to forward DNS queries for external DNS names to DNS servers outside that network. It does it to DNS queries that it cannot resolve locally, meaning DNS queries
that it has no personal knowledge of. By using DNS forwarders you can improve the efficiency of name resolution for the computers in your network that query for DNS names outside your network (such as names on the Internet).

SOURCE

https://www.petri.com/best-practices-for-dns-forwarding
Share:

Thursday, March 7, 2019

What type of attack has a program running on your server that bypasses authorization?

What type of attack has a program running on your server that bypasses authorization?

  • Backdoor
  • DDoS
  • Phishing
  • DoS 

 
What type of attack has a program running on your server that bypasses authorization?

EXPLANATION

When a program running on a server bypasses authorization, it is obvious that a back door attack is in progress.
Key Takeaway: In a back door attack, a program or service is placed on a server to bypass normal security procedures. A back door is a program that is designed to hide itself inside a target host. It allows the installing user access to the system at a later time without using normal authorization or vulnerability exploitation.

http://www.hbs.net/blog/december-2016/bypassing-security-controls-cyber-crime
https://www.incapsula.com/web-application-security/backdoor-shell-attack.html
Share:

Wednesday, March 6, 2019

Which of the following is an IPSLA option?

Which of the following is an IPSLA option?

  • Object-tracking
  • Reachability
  • Icmp-probing
  • IGMP-Snooping 

 
Which of the following is an IPSLA option?

EXPLANATION

The correct option is reachability.  This option permits the cisco device to track connectivity to an object, and change routes
accordingly based upon failure of the primary path.

SOURCE

http://www.firewall.cx/cisco-technical-knowledgebase/cisco-routers/813-cisco-router-ipsla-basic.html
Share:

In T-SQL, which of the following is NOT a requirement to define a table expression?

In T-SQL, which of the following is NOT a requirement to define a table expression?

  • All columns must have a name
  • Column names must be unique
  • Must be preceded by WITH
  • Cannot use ORDER BY to guarantee presentation order 

 
In T-SQL, which of the following is NOT a requirement to define a table expression?

 

EXPLANATION

Table expressions in SQL Server are named query expressions that represent a valid relational table. SQL Server supports four types of table expressions: Common Table Expressions (CTEs), Derived Tables, Views and In-line Table-Valued Functions. Only a CTE definition needs to be preceded by WITH.

T-SQL allows the ORDER BY clause in conjunction with TOP, OFFSET or FOR XML for processing purposes, but this does not guarantee presentation order in an outer query that references the table expression.


SOURCE

https://www.microsoftpressstore.com/articles/article.aspx?p=2233323
Share:

What's the basic unit of virtualization that contains an OS, its apps, and resources?

What's the basic unit of virtualization that contains an OS, its apps, and resources?

  • Virtual app
  • Virtual machine
  • Virtual reality
  • Virtual OS 

 
What's the basic unit of virtualization that contains an OS, its apps, and resources?

EXPLANATION

A virtual machine (VM) is a type of container you can assign resources to, like processing cores, memory, and storage. You can install an operating system in a VM and the OS will behave as if it's actually running on a physical computer.

Virtual machines

Another form of virtual machine is one that allows us to run multiple operating systems concurrently, sharing access to the physical machine resources. With this for of virtual machine, we can partition one computer to act like several computers, each with its own operating system (and IP address on the network). We can also migrate an entire OS (along with all of its applications) from one machine to another.
To understand how this form of virtualization works, we need to consider what an operating system does. Basically, it provides a set of interfaces (system calls) that applications use to access system resources (file system, network, semaphores, etc.). The operating system is just a program. It spends its time doing table look-ups, copying blocks of data, formatting network packet headers, and other mundane tasks. Every once in a while, however, it needs to access system hardware: to configure the memory management unit, set a timer, set the task register, and perform certain types of input and output. These instructions are called privileged instructions, in contrast to all the other instructions on the processor, which are unprivileged. To execute them, the operating system kernel runs in privileged, or supervisor mode, while regular processes do not. If a regular application attemts to execute a privileged instruction, it will generate a trap on many architectures.

Share:

Friday, March 1, 2019

Which statement is not true about SQL Injection?

Which statement is not true about SQL Injection?

  • Boosts database performace.
  • The placement of malicious code in SQL statements
  • A code injection technique that might destroy your database.
  • One of the most common web hacking techniques. 

 
Which statement is not true about SQL Injection?

EXPLANATION

SQL Injection does not boost database performance.

SQL injection is the placement of malicious code in SQL
statements, via web page input. SQL in Web Pages SQL injection usually occurs when you ask a user for input, like their username/userid, and instead of a name/id, the user gives you an SQL statement that you will unknowingly run on your database.

SOURCE

https://www.w3schools.com/sql/sql_injection.asp
Share:

What port is recommended for secure SMTP communications between client and mailserver.

What port is recommended for secure SMTP communications between client and mailserver.

  • 587
  • 965
  • 465
  • 25 

 
What port is recommended for secure SMTP communications between client and mailserver.

EXPLANATION

Port 465 was never recognized by the IETF (Internet Engineering Task Force), as an official port for SMTP and has been assigned to another service.
Port 25 can be used but alot of ISP's block this due to the prevalence of unsecured mail servers on this port and the spam sending capabilities this exposes. Port 965 is your POP3 (receive) port, so while it is the correct POP3 port it shouldn't be used for SMTP (send).

SOURCE

https://www.jscape.com/blog/smtp-ports
Share:

Popular Posts