Sunday, 25 February 2024

Visual Studio Code | You don't have permissions to push username/repository on GitHub

If you get the following error message when you are trying to commit code from Visual Studio Code to GitHub Repo. The following is an easy fix:

[Step # 1] Go to your control panel -> Credential Manager:


[Step # 2] remove all the GitHub related credentials.

[Step # 3] Then go back to Visual Studio Code and try to commit your code again.

[Step # 4] You will be given a pop-up screen to login to GitHub. Do it and it will solve this problem. 


Saturday, 11 February 2023

Microsoft Azure | Key Phrase Extraction using Azure.AI.TextAnalytics;

Problem Statement:  Extract key phrases from a sentence or a paragraph.

Solution:

Azure documentation link : What is key phrase extraction in Azure Cognitive Service for Language? - Azure Cognitive Services | Microsoft Learn

(Step-1) In Azure Portal create a 'Language Service' under 'cognitive services'.


(Step-2) Select 'Custom text classification & Custom names entity recognition' as shown above.

(Step-3) Create a service.

(Step-4) When the services is created extract the key & uri:


(Step-5) Use the following C# code, insert the key, URI and a sentence. [I used visual studio and installed all the right packages]. That's it :)


using Azure;
using System;
using Azure.AI.TextAnalytics;

namespace KeyPhraseExtractionExample
{
    class Program
    {
        private static readonly AzureKeyCredential credentials = new AzureKeyCredential(<<INSERT KEY>>);
        private static readonly Uri endpoint = new Uri(<<INSERT URI>>);

        // Example method for extracting key phrases from text
        static void KeyPhraseExtractionExample(TextAnalyticsClient client)
        {
            try
            {
                var response = client.ExtractKeyPhrases(<<INSERT SENTENSE>>);
            
                // Printing key phrases
                Console.WriteLine("Key phrases:");

                foreach (string keyphrase in response.Value)
                {
                    Console.WriteLine($"\t{keyphrase}");
                }
            }
            catch (RequestFailedException e)
            {
                Console.WriteLine(e);
            }
        }

        static void Main(string[] args)
        {
            var client = new TextAnalyticsClient(endpoint, credentials);
            KeyPhraseExtractionExample(client);

            Console.Write("Press any key to exit.");
            Console.ReadKey();
        }

    }
}

Wednesday, 30 September 2020

Personal Camping/Tent Checklist

Tent Essentials:

1. Under tent ground cover

2. Tent

3. Tent poles

4. Tent pegs

5. Tent hammer

6. Tent mats

7. Sleeping bags

8. Tent chairs

9. Tent tables

10. Power cable

11. Power extension

12. Tent light

13. Tent fan

14. Tent heater

15. Mosquito repellent

16. Stove

17. Stove refills

18. Sunscreen

19. Torch

20. First aid kit

21. Power extension switchboard

Technology Essentials:

1. Mobile phones chargers

2. Mobile Phones

3. Kids iPads

4. Watch

5. Watch Charger

Cooking Essentials:

1. Electric kettle

2. Frying pan

3. Match

4. BBQ Accessories

Sports Essentials:

1. Soccer ball

2. Tennis rackets

3. Tennis Balls

4. Swimming Cloths

5. Swimming Goggles

6. Snorkeling Kits

7. Golf set

8. Golf balls

9. Basketball

10. Runnings shoes

11. Runnings bag-pack

12. Fishing Stuff

Sleeping Essentials:

1. Sleeping pillows

2. Quilt

Other Essentials:

1. Tissues

2. Clothes

3. Food

4. Books

5. Cards / Board games

Shower Essentials:

1. Towels

2. Soap / Shower Gel

3. Shampoo

4. Shower gloves

5. Toothpaste

6. Toothbrush

Travel Essentials:

1. Back support

2. Massage ball

3. Snacks

4. Water bottles

Medical Essentials:

1. Asthma puffer

2. Other medicines

Tuesday, 12 March 2019

Installing Ansible on Ubuntu

Follow the following commands:

$sudo apt-get update
$sudo apt-get upgrade -y
$sudo apt-add-repository ppa:ansible/ansible
$sudo apt-get update
$sudo apt-get install ansible -y
$sudo apt-get install python -y

Removing exicting python and installing python 3.7 for ansible:
$sudo apt autoremove python
$sudo apt install python3.7

Azure OpenAI Architecture Patterns & Deployment Patterns

Sharing some useful links that will help customers architect Azure OpenAI solution using the best practices: (1) Azure OpenAI Landing Zone r...