Skip to content

Instantly share code, notes, and snippets.

View bewithdhanu's full-sized avatar
😜
Focusing

Dhanu K bewithdhanu

😜
Focusing
View GitHub Profile
@bewithdhanu
bewithdhanu / aws_cli_setup.sh
Last active July 2, 2024 08:28
AWS CLI Setup Script
#!/bin/bash
# Update package list and install python3-pip
sudo apt update
sudo apt install -y python3-pip
# Install AWS CLI
pip3 install awscli --upgrade-strategy only-if-needed --break-system-packages
# Add the PATH update to .bashrc
@bewithdhanu
bewithdhanu / regenerate-ssl-godaddy-setup-ec2.md
Created June 24, 2024 14:26
Instructions to regenerate an SSL certificate from GoDaddy and set it up on an EC2 instance running Apache.

Documentation: Regenerate SSL Certificate from GoDaddy and Setup on EC2 Instance

This guide provides step-by-step instructions to regenerate an SSL certificate from GoDaddy and set it up on an EC2 instance running Apache.

Prerequisites

  • Access to your EC2 instance with root or sudo privileges.
  • OpenSSL installed on your EC2 instance.
  • An existing domain registered with GoDaddy.
  • Apache installed and running on your EC2 instance.
@bewithdhanu
bewithdhanu / upgrade_python_3.10_to_3.11.md
Last active January 12, 2024 15:23
Upgrade Python 3.10 to 3.11 on Ubuntu 22.04

Check python version use python and python3

The first comman will Not show version info.

The second one show 3.10 as version as it is provided by ubuntu as default

python --version
python3 --version

Add additional repository to download python 3.11

@bewithdhanu
bewithdhanu / laravel_server_setup.md
Last active January 3, 2024 08:19
This Gist provides a concise set of steps to set up a server for a Laravel-based web application. From cloning the repository to configuring Apache and running artisan commands, these steps guide you through a seamless server setup process.

Server Setup Gist:

  1. Open Server:

    • Access the server environment.
  2. Navigate to Root Directory:

    • Use the command: cd /var/www/html/ to reach the root directory.
  3. Clean Previous Files (Optional):

  • Delete any existing files in the directory with sudo rm -rf /var/www/html/* (Optional but recommended).
@bewithdhanu
bewithdhanu / script.js
Last active December 8, 2023 16:17
Google Map JS SDK - Convert window coordinates to LatLng
let x = 100; //relative left position of the point
let y = 200; //relative top position of the point
let projection = map.getProjection();
let scale = Math.pow(2, map.getZoom());
let topRight = projection.fromLatLngToPoint(map.getBounds().getNorthEast());
let bottomLeft = projection.fromLatLngToPoint(map.getBounds().getSouthWest());
const reversePoint = new google.maps.Point(
bottomLeft.x + (x / scale),
topRight.y + (y / scale)
);
@bewithdhanu
bewithdhanu / Laravel + UI Task.md
Created September 19, 2023 06:01
Laravel + UI Task

Task Description:

You are required to create a web application using Laravel that implements a dynamic registration form with form handling, validation, Google Autocomplete for address input, and AJAX form submission. The application should also include the functionality to save the form for later completion, display the saved forms using Bootstrap and DataTables with pagination.

Requirements:

  1. Dynamic Registration Form:
    • Generate the registration form dynamically based on a JSON data structure (Form should auto generate even if I add new sections or fields).
    {
@bewithdhanu
bewithdhanu / Laravel Task.md
Created September 18, 2023 14:22
Laravel Task

Task Description:

You are required to create a web application using Laravel (latest version), Bootstrap, and jQuery that incorporates the following features: dynamic form registration, user login, Google Autocomplete for address input, PostgreSQL database usage with foreign key relations, and address storage with latitude and longitude using geometry types.

Requirements:

  1. User Registration:
    • Implement a dynamic registration form using Laravel's built-in form handling and validation.
  • Generate the registration form dynamically based on a JSON data structure.
@bewithdhanu
bewithdhanu / WallPainting.md
Last active September 6, 2023 07:35
Room Wall Painting Application

Room Wall Painting Application

Objective:

Develop a web-based application using JavaScript technologies that allows users to virtually paint walls of an uploaded room image using polygons. The application should provide an eraser feature to remove painted portions, ensuring precision in areas like windows.

Features:

  1. Image Upload:
@bewithdhanu
bewithdhanu / android locations.md
Created September 4, 2023 12:19
Android - Approximate Location and Precise Location

Certainly! You can implement a settings screen where the user can choose between "Approximate Location" and "Precise Location". Based on their choice, you can then request the appropriate permission. Here's how you can achieve this:

1. Create a Settings Screen:

You can use SharedPreferences to store the user's choice. Provide two radio buttons or a switch/toggle for the user to select between "Approximate Location" and "Precise Location".

2. Check User's Choice:

Before requesting location, check the user's choice from SharedPreferences:

@bewithdhanu
bewithdhanu / task.md
Last active September 1, 2023 08:52
Interview Task

Task Description:

You are required to create a registration form using HTML, JavaScript/jQuery, and the provided JSON data. The JSON data includes all the necessary details for the form, such as fields, buttons, and their respective attributes.

JSON Data:

{
  "form": {