Skip to content

Instantly share code, notes, and snippets.

View pritpalp's full-sized avatar

Pritpal Panesar pritpalp

View GitHub Profile
@pritpalp
pritpalp / chatgpt-idempotence-terraform.md
Last active May 2, 2023 08:53
ChatGPT idempotence description for PaaS with Terraform example

Sure, let's start with explaining idempotence in the context of Platform as a Service (PaaS) systems.

In a PaaS system, developers typically deploy their applications to a platform managed by a cloud provider. The platform takes care of provisioning and managing resources such as virtual machines, containers, and databases, allowing developers to focus on writing code and building their applications.

When deploying an application to a PaaS system, developers often use automation tools like Terraform to define the desired state of the infrastructure and the application itself. Terraform is a tool for infrastructure as code that allows you to define, manage, and version your infrastructure in a declarative way.

The idempotent nature of Terraform comes from its ability to track the state of the infrastructure and detect changes between the desired state and the actual state. When Terraform is run, it compares the desired state defined in the Terraform configuration files with the current state of the infrastr

@pritpalp
pritpalp / chatgpt-inheritance-description.md
Last active May 2, 2023 08:54
ChatGPT description of inheritance for beginners

Sure! Inheritance is a feature of object-oriented programming (OOP) that allows you to create a new class based on an existing class. The new class is called the "child" class or "subclass," and the existing class is called the "parent" class or "superclass." The child class inherits all the attributes and methods of the parent class, and can also add its own attributes and methods or modify the ones inherited from the parent class.

Here's a simple example of inheritance in Python:

class Animal:
    def __init__(self, name, age):
        self.name = name
        self.age = age
@pritpalp
pritpalp / chatgpt-how-its-useful-for-dev
Created May 2, 2023 08:42
ChatGPT's summary of how it can help a developer
As a language model, I can be a useful tool for developers in a variety of ways. Here are some examples of what I can do:
1. Natural language processing (NLP): I can help developers with NLP tasks such as text classification, sentiment analysis, named entity recognition, and machine translation. For example, if a developer wants to build a chatbot that can understand and respond to customer inquiries, they can use my NLP capabilities to analyze and interpret the text.
2. Text generation: I can generate human-like text based on a given prompt or topic. For example, if a developer wants to create an AI writer that can generate news articles or product descriptions, they can use my text generation capabilities.
3. Machine learning: I can be used for various machine learning tasks, such as image classification, object detection, and speech recognition. For example, a developer can use my machine learning capabilities to build a self-driving car that can recognize and avoid obstacles.
4. Data analysis: I can h
@pritpalp
pritpalp / bard-response-copy-kv.md
Last active May 2, 2023 10:14
Bard response to copying secrets and renaming them from one keyvault to another

Sure, here are the steps on how to copy secrets from one keyvault to another, renaming the secrets:

  1. Sign in to the Azure portal.
  2. Go to the Key Vaults blade.
  3. Select the source key vault.
  4. Click the Secrets tab.
  5. Select the secrets that you want to copy.
  6. Click the Copy button.
  7. In the Copy Secret dialog box, specify the following:
    • Destination Key Vault: The name of the destination key vault.
@pritpalp
pritpalp / chatgpt-kv-copy-response.md
Created April 28, 2023 15:52
ChatGPT response for copying and renaming values from one keyvault to another

To copy secrets from one key vault to another, you can use the Azure CLI or Azure PowerShell. Here are the steps to copy the secrets and rename them:

Azure CLI

  1. Login to your Azure account and select the subscription and the resource group containing the source and destination key vaults.

  2. Open a terminal and login to Azure CLI using the following command:

az login

- script: "dotnet add package coverlet.collector"
displayName: 'Install the coverlet collector'
- script: "dotnet tool install dotnet-reportgenerator-globaltool --global"
displayName: 'Install the report generator tool'
- script: dotnet test UnitTests/UnitTests.csproj --logger "trx;LogFileName=testresults.trx" --collect:"XPlat Code Coverage" && reportgenerator "-reports:UnitTests/TestResults/*/coverage.cobertura.xml" "-targetDir:UnitTests/TestResults/Coverage/Reports" -tag:$(Build.BuildNumber) -reportTypes:htmlInline
workingDirectory: UnitTests
displayName: 'Run dotnet test and ReportGenerator on results'

Keybase proof

I hereby claim:

  • I am pritpalp on github.
  • I am pritpalp1 (https://keybase.io/pritpalp1) on keybase.
  • I have a public key ASBxQ7Kl6HP9Y_WYGFZ6pRfs-eqU9qkNrAJFnq1_e1F_Igo

To claim this, I am signing this object:

@pritpalp
pritpalp / centos7_source_ami.json
Created May 31, 2018 13:47
Search for CentOS 7 ami block for Packer, use instead of hard coding CentOS ami id
"source_ami_filter": {
"filters": {
"virtualization-type": "hvm",
"name": "CentOS Linux 7 x86_64 HVM EBS *",
"root-device-type": "ebs"
},
"owners": [
"679593333241"
],
"most_recent": "true"