Thursday, March 27, 2025

#2 DevOps Beginner's - Hands-on

 

DevOps Oru Saravedi! ๐Ÿ’ฅ๐Ÿš€

aurmc2024@gmail.com


Step 1: Git Anna Kitta Po! ๐ŸŽฉ

๐Ÿ‘‰ Mudhalil Git install pannunga, illa na code track panna mudiyadhu! ๐Ÿ˜ฑ Download inga

CMD la paarunga:

git --version

Output:

git version 2.49.0.windows.1

Indha output illa na, installation fail aayiduchu! ๐Ÿ˜ต


Step 2: GitHub Account Setup Pannu! ๐Ÿ› ๏ธ

โœ… GitHub.com pogi account create pannu! (Free dhan!)

๐ŸŽฉ Username Example: "Yazh24"

๐Ÿ“Œ Oru repo create pannunga DevOps

๐Ÿš€ Clone panna:

git clone https://github.com/Yazh24/devops.git

Step 3: Node.js - Idhu Illa Na Namma Saaapdave Mudiyadhu! ๐ŸŸข

๐Ÿ“ฅ Download Node.js

Install aagittadha check pannunga:

node -v

Output:

v22.14.0
npm -version

Output:

10.9.2

Yenna output varala na, sariyaa install aagala! ๐Ÿคจ


Step 4: VS Code - Developer Ungaloda Nallavan! ๐Ÿ’ป

๐Ÿ“ฅ Download VS Code

๐Ÿ“‚ Open panni DevOps folder select pannu

๐Ÿ‘€ Oru file irukkanum:

D:\Devops\README.md

Step 5: Oru Chinna Node.js Project ๐ŸŽญ

โœ… Terminal open panni:

npm init -y

Ithu package.json create pannum!

๐Ÿ“ฆ Express install pannunga:

npm install express

๐Ÿ“‘ package.json la main ah app.js a maathunga

๐Ÿ“ app.js ezhudhunga:

const express = require('express');
const app = express();
const PORT = process.env.PORT || 3000;
const name = "CodeTest";

app.get("/", (req, res) => {
    res.send(`Welcome to DevOps Easy from ${name}!`);
});

const server = app.listen(PORT, () => {
    console.log(`Server is running on port ${PORT}`);
});

module.exports = {app, server, name};

๐Ÿš€ Terminal la run pannunga:

node app.js

Browser la poi: localhost:3000 โžก๏ธ Aha! Adhirshtam! ๐ŸŽ‰


Step 6: Git Ah Marakkadhinga! ๐Ÿ“ค

๐Ÿ‘€ Status check pannunga:

git status

๐Ÿ“ .gitignore create pannunga:

node_modules/
.gitignore

โœ… Add & Commit:

git add .
git commit -m "Initial Commit: Basic express setup"
git push

๐ŸŽ‰ GitHub la poi check pannunga, ellam vandhirukkum!


Step 7: Testing Oru Must! ๐Ÿงช

๐Ÿ› ๏ธ Jest & Supertest install pannu:

npm install jest supertest --save-dev

๐Ÿ“œ package.json la scripts update pannu:

"scripts": {
  "test": "jest"
}

๐Ÿ“ test/app.test.js create pannu:

const request = require("supertest");
const {app, server} = require('../app');

describe('GET /', () => {
    it("should return 200 status and the correct msg", async () => {
        const response = await request(app).get("/");
        expect(response.status).toBe(200);
        expect(response.text).toBe('Welcome to DevOps Easy from CodeTest!');
    });
});

๐Ÿ› ๏ธ Test run pannu:

npx jest test/app.test.js

Green check mark vandha, neenga pass! โœ…


Step 8: CI/CD Setup Pannu! โœจ

๐Ÿ› ๏ธ .github/workflows/ci.yaml create pannu:

name: CI Pipeline

on:
  push:
    branches:
      - main

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v3

      - name: Setup Node.js
        uses: actions/setup-node@v3

      - name: Install Dependencies
        run: npm install

      - name: Run Tests
        run: npx jest test/app.test.js  

๐Ÿš€ Push pannunga, GitHub Actions la check pannunga! ๐ŸŽฉ


Conclusion: Neenga Oru DevOps Thalaivar! ๐Ÿ†๐Ÿ”ฅ

Ithula mudinja neenga DevOps expert aayachu! ๐ŸŽ‰

Ippoluthum unga GitHub repository full DevOps-ready irruku! ๐Ÿ’ช

Doubt irundha steps paarunga illa na Saarayam... illa illa, Coffee Kudinga! โ˜•๐Ÿ˜‚

Wednesday, March 26, 2025

#1 Basic form filling using selenium

Automate Google Form Filling Using Python and Selenium

Filling out forms manually is a tedious task, but with Python and Selenium, we can automate it in just a few steps! ๐Ÿš€

Step 1: Create a Google Form

  1. Head over to Google Forms and create a form similar to this:

    • Name (Short Answer)

    • Mobile Number (Short Answer)

    • Email (Short Answer)


  1. Publish your form and copy the form URL (e.g., https://forms.gle/ZVKdhTJYqeHT4W1o6).

  2. Open the form in Google Chrome.

  3. Right-click on each input field, select Inspect, then right-click on the <input> tag and select Copy XPath.

  4. Save the XPath values for later use.


Step 2: Automate Form Filling with Python

Install Dependencies

First, install Selenium:

pip install selenium

Also, ensure you have the Chrome WebDriver installed and placed in your system's PATH.

Create form_fill.py

Open Visual Studio Code and create a file named form_fill.py.

from selenium import webdriver
import time

# Initialize WebDriver
web = webdriver.Chrome()
web.get('https://forms.gle/ZVKdhTJYqeHT4W1o6')
web.maximize_window()

time.sleep(2)  # Allow the page to load

# Fill out the form
sname = "RM.Chandrasekaran"
name = web.find_element('xpath', '//*[@id="mG61Hd"]/div[2]/div/div[2]/div[1]/div/div/div[2]/div/div[1]/div/div[1]/input')
name.send_keys(sname)

time.sleep(2)

mobile = "999999999"
mobil = web.find_element('xpath', '//*[@id="mG61Hd"]/div[2]/div/div[2]/div[2]/div/div/div[2]/div/div[1]/div/div[1]/input')
mobil.send_keys(mobile)

time.sleep(2)

email = 'abc@a.com'
emai = web.find_element('xpath', '//*[@id="mG61Hd"]/div[2]/div/div[2]/div[3]/div/div/div[2]/div/div[1]/div/div[1]/input')
emai.send_keys(email)

time.sleep(2)

# Click Submit Button
submit = web.find_element('xpath', '//*[@id="mG61Hd"]/div[2]/div/div[3]/div[1]/div[1]/div/span/span')
submit.click()

time.sleep(5)  # Wait before closing the browser

print("Form Submitted Successfully! ๐ŸŽ‰")

# Close the browser
web.quit()

Step 3: Run the Script

Simply run the script using:

python form_fill.py

And just like that, your form gets submitted automatically! ๐Ÿ˜Ž


Conclusion

Automating repetitive tasks like form filling can save time and effort. This method can be expanded for bulk form submissions or integrated with databases to auto-fill dynamic values.

Happy Coding! ๐Ÿ’ปโœจ 

#2 DevOps Beginner's - Hands-on

  DevOps Oru Saravedi! ๐Ÿ’ฅ๐Ÿš€ aurmc2024@gmail.com Step 1: Git Anna Kitta Po! ๐ŸŽฉ ๐Ÿ‘‰ Mudhalil Git install pannunga, illa na code track panna...