0% found this document useful (0 votes)
18 views

Interview Task

The document provides a comprehensive guide on various technical tasks including Git branch deletion, sending emails in PHP using PHPMailer, and connecting MySQL databases to PHP. It also compares frontend frameworks Vue and React, lists essential Linux commands, and details Docker setups for multiple applications including WordPress, Flask, Django, Ruby on Rails, Rust, and Go. Each section includes specific commands and code snippets for implementation.

Uploaded by

gurijalapavan8
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

Interview Task

The document provides a comprehensive guide on various technical tasks including Git branch deletion, sending emails in PHP using PHPMailer, and connecting MySQL databases to PHP. It also compares frontend frameworks Vue and React, lists essential Linux commands, and details Docker setups for multiple applications including WordPress, Flask, Django, Ruby on Rails, Rust, and Go. Each section includes specific commands and code snippets for implementation.

Uploaded by

gurijalapavan8
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Boostr Netwave

Pre-Interview Task Assignment

1. Git & Version Control:

How to Easily Delete Git Branches: A Simple Guide for Everyone

To delete a local branch


• git branch -d branch_name

To force delete a local branch


• git branch -D branch_name

To delete a remote branch


• git push origin --delete branch_name

2.PHP & Database Management:

How to Send Emails in PHP Using PHPMailer Library:

• How to Send Emails in PHP Using PHPMailer Library

• Install PHPMailer via Composer: composer require phpmailer/phpmailer

• Include PHPMailer in PHP script.

• Configure SMTP settings (Gmail, SMTP server, etc.).

• Set email headers, recipient, and message body.

• Send email using $mail->send();

How to Connect MySQL Database to PHP Using MySQLi and PDO

MySQLi (Procedural & OOP)


$conn = new mysqli("localhost", "user", "password", "database");
if ($conn->connect_error) die("Connection failed: " . $conn->connect_error);

PDO
$dsn = "mysql:host=localhost;dbname=database";
$pdo = new PDO($dsn, "user", "password");

3. Frontend & Framework Comparison:

• Vue vs React – Which One is a Better Framework for Laravel?

• Vue.js: Seamless Laravel integration, simpler reactivity model, single-file components.


• React.js: Stronger ecosystem, virtual DOM efficiency, component-based architecture.

• Conclusion: Vue is better for Laravel due to ease of use, but React is preferable for large-scale
applications.

4. Linux & Server Management:

• Linux ls Command - How to List Files and Directories

ls: List files in a directory.

ls -l: Detailed file list.

ls -a: Show hidden files.

ls -lh: Human-readable file sizes.

ls -lt: Sort by modification time.

• Top 50 Linux Commands You Must Know as a Regular User

01. cd: Change directory


02. mkdir: Make a directory
03. rmdir: Remove a directory
04. rm: Remove a file or directory
05. cp: Copy a file or directory
06. mv: Move or rename a file or directory
07. ls: List files and directories
08. pwd: Print working directory
09. nano: Edit a file using the nano editor
10. vim: Edit a file using the vim editor
11. cat: View the contents of a file
12. less: View the contents of a file one page at a time
13. head: View the first few lines of a file
14. tail: View the last few lines of a file
15. uname: Display system information
16. hostname: Display the system hostname
17. uptime: Display the system uptime
18. whoami: Display the current username
19. groups: Display the groups the current user belongs to
20. id: Display user and group information
21. useradd: Add a new user
22. userdel: Delete a user
23. passwd: Change a user’s password
24. chage: Change a user’s password expiration date
25. groupadd: Add a new group
26. groupdel: Delete a group
27. ps: Display process information
28. top: Display system resource usage
29. kill: Kill a process
30. pkill: Kill a process by name
31. bg: Run a process in the background
32. fg: Bring a background process to the foreground
33. ping: Test network connectivity
34. ssh: Connect to a remote server using SSH
35. scp: Copy files over SSH
36. wget: Download a file from the internet
37. curl: Transfer data to or from a web server
38. apt-get: Manage packages on Debian-based systems
39. yum: Manage packages on RPM-based systems
40. pip: Manage Python packages
41. sudo: Run a command with superuser privileges
42. su: Switch to the superuser account
43. chmod: Change file permissions
44. chown: Change file ownership
45. ssh-keygen: Generate SSH keys
46. man: Display manual pages for a command
47. info: Display information about a command
48. history: Display command history
49. alias: Create an alias for a command
50. source: Reload shell configuration

• How to Set Up Java in a DigitalOcean Droplet

Install OpenJDK: sudo apt update && sudo apt install openjdk-21-jdk
Verify: java -version
Set environment variables in ~/.bashrc.

• How to Set Up Python in a DigitalOcean Droplet

Install Python: sudo apt install python3 python3-pip


Verify: python3 --version
Create a virtual environment: python3 -m venv myenv

6. Docker & Containerization:

1. Install WordPress With Docker Compose


version: ’3’

services:
db:
image: mysql:5.7
restart: always
environment:
MYSQL_ROOT_PASSWORD: rootpassword
MYSQL_DATABASE: wordpress
MYSQL_USER: user
MYSQL_PASSWORD: password
volumes:
- db_data:/var/lib/mysql

wordpress:
image: wordpress:latest
restart: always
ports:
- "8080:80"
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: user
WORDPRESS_DB_PASSWORD: password
WORDPRESS_DB_NAME: wordpress
volumes:
- wordpress_data:/var/www/html

volumes:
db_data:
wordpress_data:

RUN:
docker-compose up -d

2. Build and Deploy a Flask Application Using Docker

FROM python:3.9

WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
CMD ["python", "app.py"]
EXPOSE 5000

Build and Run

docker build -t flask-app .


docker run -p 5000:5000 flask-app

3. Build and Deploy a Django Application Using Docker

FROM python:3.9

WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]
EXPOSE 8000

Docker Compose
version: ’3’

services:
web:
build: .
ports:
- "8000:8000"

RUN:
docker-compose up

4. Containerizing a Ruby on Rails Application With Docker Compose

Dockerfile

FROM ruby:3.0
WORKDIR /app
COPY Gemfile Gemfile.lock ./
RUN bundle install
COPY . .
CMD ["rails", "server", "-b", "0.0.0.0"]
EXPOSE 3000

Dockercompose file

version: ’3’

services:
db:
image: postgres
environment:
POSTGRES_USER: user
POSTGRES_PASSWORD: password
POSTGRES_DB: mydb
web:
build: .
ports:
- "3000:3000"
depends_on:
- db

Run
docker-compose up -d

5. Set Up Rust Docker in a DigitalOcean Droplet

Dockerfile

FROM rust:latest
WORKDIR /app
COPY . .
RUN cargo build --release
CMD ["./target/release/rust-app"]

Build and Run:

docker build -t rust-app .


docker run -p 8080:8080 rust-app

Deploy to DigitalOcean

docker tag rust-app your-digitalocean-repo


docker push your-digitalocean-repo

6. Deploy a Go Web Application With Docker and Nginx on Ubuntu

Dockerfile

FROM golang:latest
WORKDIR /app
COPY . .
RUN go build -o main .
CMD ["./main"]
EXPOSE 8080

Configure nginx

server {
listen 80;
location / {
proxy_pass http://go-app:8080;
}
}

Docker-compose

version: ’3’

services:
go-app:
build: .
ports:
- "8080:8080"
nginx:
image: nginx:latest
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
ports:
- "80:80"

Run:
docker-compose up -d

You might also like