**Test tasks** ** \ Сollections** You need to write a collection class (which can be used in a foreach construct). The class inherits the iterator interface, that is, it necessarily implements methods: * __construct(array $items), * prev, * next, * current, * rewind (method rewind returns a pointer to the first element of the collection). Add an array [1,2,3,4,5,6,7,8,9,10] to the collection. In the loop, run through the collection and calculate the sum of the elements. **Students & classes** There are tables:
id First name Last name
1 Bob Biden
2 Joey Johnsen
3 Mike Buffollo
Classes:
id title
1 A
2 B
Students_Classes
id class_id student_id
1 1 1
2 1 2
3 2 3
You need to write a SQL query that displays the id of the class, its name and the number of students in the class, that is:
id title student_count
#### **API Development** **Task:** Create a simple REST API endpoint in PHP that returns a JSON response with a list of users from the `users` table. **Additional Test tasks** **Basic Node.js Knowledge** Create a Node.js application that serves a simple webpage. The webpage should display a list of users fetched from a JSON file. **Basic Understanding of Server Software (Apache, Nginx)** Write a basic configuration for an Nginx server with https redirect that serves a PHP application. **Basic Understanding of Linux Servers** This task will assess your fundamental knowledge of Linux server management, including basic command-line operations, file system navigation, user management, and basic network configuration. Give the list of bash commands for each subtask. ### **Task Instructions:** 1. **Connecting to a Linux Server:** * Use SSH to connect to a remote Linux server. Assume the server's IP address is `192.168.1.10` and the SSH port is the default one. 2. **File System Navigation:** * Once connected, navigate to the `/var/log` directory. * List all files and directories within `/var/log` and save the output to a file named `log_list.txt` in your home directory. 3. **User Management:** * Create a new user named `testuser` without a home directory. 4. **File Permissions:** * Create a directory named `testdir` in your home directory. * Change the permissions of `testdir` to allow read, write, and execute access only to the owner. 5. **Basic Network Configuration:** * Display the current network configuration, including IP addresses and network interfaces. 6. **Package Management:** * Update the package list on the server and install the `curl` package.