A company wants to deploy a microservices architecture for their application. They are looking for a technology that can package each service with its dependencies and configuration in a reproducible way. Which technology would best fit this requirement?
- Docker
- Kubernetes
- Vagrant
- Helm
Docker is a technology that allows you to package applications and their dependencies into containers. It's an excellent choice for deploying microservices, as it ensures that each service is encapsulated with its dependencies and configurations, making it highly reproducible and scalable.
Which command tests for file types and compares values in Bash scripting?
- test
- eval
- exec
- check
In Bash scripting, the test command is used to test for file types and compare values. It is often used with conditional statements like if and elif to perform tests on files, strings, and other expressions. The test command is also equivalent to [ ] in Bash.
What is the primary purpose of the /home directory in Linux?
- Storing system binaries
- Storing system configuration files
- Storing temporary files
- Storing user home directories
The primary purpose of the /home directory in Linux is to store user home directories. Each user on a Linux system typically has a subdirectory within /home where their personal files and settings are stored.
In the context of VPNs in Linux, the _________ protocol is known for its speed and efficiency but may not be as secure as other options.
- PPTP
- OpenVPN
- IPsec
- L2TP
In the context of VPNs in Linux, the PPTP (Point-to-Point Tunneling Protocol) is known for its speed and efficiency but may not be as secure as other options. PPTP has known vulnerabilities, so it's not recommended for highly sensitive or secure communications.
To deny all incoming traffic by default and only allow specific traffic in iptables, one would set the default policy of the INPUT chain to ________.
- ACCEPT
- REJECT
- DROP
- ALLOW
To deny all incoming traffic by default and only allow specific traffic in iptables, one would set the default policy of the INPUT chain to DROP. This means that any incoming traffic that doesn't match an explicit rule will be dropped by default.
What is the primary purpose of QEMU in Linux virtualization?
- Emulation and virtualization
- Containerization
- Paravirtualization
- Hypervisor-based virtualization
QEMU's primary purpose in Linux virtualization is emulation and virtualization. It can emulate various hardware components and architectures, making it a versatile tool for running virtual machines and testing software on different platforms.
The ________ file in Linux contains the default boot entry and settings for the bootloader.
- grub.cfg
- /etc/passwd
- init.d
- /var/log/messages
The "grub.cfg" file in Linux contains the default boot entry and settings for the bootloader. GRUB (Grand Unified Bootloader) is a commonly used bootloader in Linux systems, and its configuration is stored in this file. It determines which operating system and kernel to boot.
If you want to store the exit status of a command in a variable, you would typically use the _________ built-in variable.
- $?
- $!
- $#
- $@
If you want to store the exit status of a command in a variable, you would typically use the $? built-in variable. The $? variable contains the exit status of the last command executed, where 0 usually indicates success, and non-zero values indicate an error or failure.
You've been tasked with writing a script that processes input arguments. How would you check if the number of arguments provided to the script is less than 3?
- if [ "$#" -lt 3 ]
- if [ "$#" -eq 3 ]
- if [ "$#" -gt 3 ]
- if [ "$#" -eq 0 ]
To check if the number of arguments provided to the script is less than 3, you would use if [ "$#" -lt 3 ]. This tests whether the number of script arguments, represented by $#, is less than 3. Option 2 checks if the number of arguments is exactly 3, and Option 3 checks if it's greater than 3. Option 4 checks if there are no arguments.
Which option with the ssh command specifies a different port for connection?
- -p
- -s
- -l
- -r
The correct option is -p. When using the ssh command, you can specify a different port for the connection using the -p option followed by the port number (e.g., ssh -p 2222 user@hostname). This is useful when an SSH server is configured to listen on a non-default port.