Categories
AI

List of AI Terminologies

  • Chainlit
  • Streamlit
  • Text generation web UI
  • Lang Flow

Middleware

  • LangChain
  • LangChain Visualizer

Images

  • wirestock.io

Plugins

  • https://ai-advantage.notion.site/ChatGPT-Plugins-81cc7cc2107a4065a8b0a0f3f73d9b19

Fine Tune

  • privateGPT

Other

  • https://github.com/nicknochnack/Nopenai
  • Fly.io
Categories
IaC

Create static website on GCP with CDN using Pulumi

import pulumi
import pulumi_gcp as gcp

# Create a Google Cloud Storage bucket to store the website content
website_bucket = gcp.storage.Bucket("websiteBucket",
                                    location="US",
                                    website={
                                        "mainPageSuffix": "index.html",
                                        "notFoundPage": "error.html"
                                    })

# Upload the website content to the bucket
index_html = gcp.storage.BucketObject("indexHtml",
                                      bucket=website_bucket.name,
                                      source=pulumi.FileAsset("index.html"),
                                      content_type="text/html")

# Create a backend bucket for the Google Cloud CDN
backend_bucket = gcp.compute.BackendBucket("backendBucket",
                                           bucket_name=website_bucket.name)

# Create a URL map to route incoming requests
url_map = gcp.compute.UrlMap("urlMap",
                             default_service=backend_bucket.self_link)

# Create a Cloud CDN-enabled HTTPS load balancer
cloud_cdn = gcp.compute.TargetHttpsProxy("cloudCdn",
                                         url_map=url_map.self_link,
                                         ssl_certificates=[<_ssl_certificate>])

# Export the Google Cloud Storage bucket URL
pulumi.export("bucket_url", website_bucket.url)

This program creates the following resources:

  1. A Google Cloud Storage bucket to store the website content, configured for static website hosting.
  2. A Google Cloud Storage bucket object to upload the index.html file. Replace this with your own static website content.
  3. A backend bucket for Google Cloud CDN.
  4. A URL map to route incoming requests.
  5. A Cloud CDN-enabled HTTPS load balancer.

Please note that you need to replace <your_ssl_certificate> with the SSL certificate resource link that you want to use for the HTTPS load balancer.

Also, note that you need to update the index.html source path to your actual file in the pulumi.FileAsset("index.html") line.

Categories
IaC

Static website on AWS with CloudFront CDN using Pulumi

import pulumi
import pulumi_aws as aws

# Create an S3 bucket to store the website content
website_bucket = aws.s3.Bucket("websiteBucket",
                                acl="private",
                                website={
                                    "index_document": "index.html",
                                    "error_document": "error.html"
                                })

# Upload the website content to the bucket
index_html = aws.s3.BucketObject("indexHtml",
                                 bucket=website_bucket.id,
                                 source=pulumi.FileAsset("index.html"),
                                 content_type="text/html")

# Create a CloudFront Origin Access Identity for private content
origin_access_identity = aws.cloudfront.OriginAccessIdentity("originAccessIdentity")

# Create an S3 bucket policy to grant CloudFront access to the content
bucket_policy_document = aws.iam.get_policy_document(statements=[
    {
        "actions": ["s3:GetObject"],
        "resources": [f"{website_bucket.arn}/*"],
        "principals": [{"type": "AWS", "identifiers": [origin_access_identity.iam_arn]}],
    },
])

bucket_policy = aws.s3.BucketPolicy("bucketPolicy",
                                    bucket=website_bucket.id,
                                    policy=bucket_policy_document.json)

# Create a CloudFront distribution to serve the static website
cloudfront_distribution = aws.cloudfront.Distribution("cloudfrontDistribution",
    default_cache_behavior={
        "target_origin_id": "websiteBucket",
        "viewer_protocol_policy": "redirect-to-https",
        "allowed_methods": ["GET", "HEAD", "OPTIONS"],
        "cached_methods": ["GET", "HEAD", "OPTIONS"],
        "forwarded_values": {
            "cookies": {"forward": "none"},
            "query_string": False,
        },
        "min_ttl": ,
        "default_ttl": 3600,
        "max_ttl": 86400,
    },
    viewer_certificate={
        "cloudfront_default_certificate": True,
    },
    origins=[{
        "origin_id": "websiteBucket",
        "domain_name": website_bucket.bucket_regional_domain_name.apply(lambda b: b),
        "s3_origin_config": {
            "origin_access_identity": origin_access_identity.cloudfront_access_identity_path,
        },
    }],
    restrictions={
        "geo_restriction": {
            "restriction_type": "none",
        },
    })

# Export the CloudFront domain name
pulumi.export("distribution_domain", cloudfront_distribution.domain_name)

This program creates the following resources:

  1. An S3 bucket to store the website content, configured for static website hosting.
  2. An S3 bucket object to upload the index.html file. Replace this with your own static website content.
  3. A CloudFront Origin Access Identity to restrict access to the content.
  4. An S3 Bucket Policy to grant CloudFront access to the content.
  5. A CloudFront Distribution to serve the static website. It is configured to redirect HTTP to HTTPS.
  6. Exports the CloudFront Distribution domain name.
Please note that in order to access the website via CloudFront distribution you will need to update the index.html source path to your actual file.


Categories
Other

Trident Calendar System

  1. Bullet Journal – Yearly view
  2. Digital Calendar – Weekly Plan
  3. Daily View
Categories
Kubernetes

Optimising Kubernetes control plane

Optimising the Kubernetes control plane for high load traffic involves several strategies. Here are some key points to consider:

  1. Multiple API Servers: You can run multiple instances of the API server and balance traffic between them. This can help distribute the load and increase the overall capacity of your control plane.
  2. Etcd Optimization: Etcd is a critical component of the Kubernetes control plane as it stores all cluster data. Make sure it’s configured properly for your workload. This might involve tuning parameters like heartbeat interval and election timeout, or running etcd on dedicated hardware.
  3. Enable Horizontal Pod Autoscaler (HPA): HPA automatically scales the number of pods in a replication controller, deployment, replica set, or stateful set based on observed CPU utilization or other select metrics.
  4. Enable Cluster Autoscaler: The Cluster Autoscaler adjusts the size of the Kubernetes cluster when there are pods that failed to run in the cluster due to insufficient resources or when there are nodes in the cluster that have been underutilized for an extended period of time and their pods can be placed on other existing nodes.
  5. Use Resource Quotas and Limit Ranges: These can help ensure that no single tenant can bring down the API server by creating too many objects.
  6. Tune Garbage Collection and Audit Logging: These can have a significant impact on API server performance. Make sure they’re configured appropriately for your workload.
  7. Network Policies: Implement network policies to control the traffic flow between pods, which can help manage the load on your services.

Here’s a diagram to illustrate this setup:

graph TB
    subgraph ControlPlane["Kubernetes Control Plane"]
        API["API Servers"]
        Etcd["Etcd"]
        ControllerManager["Controller Manager"]
        Scheduler["Scheduler"]
    end
    subgraph Cluster["Kubernetes Cluster"]
        Nodes["Nodes"]
        Pods["Pods"]
        HPA["Horizontal Pod Autoscaler"]
        CA["Cluster Autoscaler"]
    end
    API -->|Read/Write| Etcd
    ControllerManager -->|Control| Nodes
    Scheduler -->|Schedule| Pods
    Nodes -->|Report Status| API
    Pods -->|Report Status| API
    HPA -->|Scale| Pods
    CA -->|Scale| Nodes

This diagram represents a Kubernetes control plane with multiple API servers and an optimized etcd configuration. The control plane interacts with the nodes and pods in the Kubernetes cluster. The Horizontal Pod Autoscaler and Cluster Autoscaler are used to automatically adjust the number of pods and nodes based on the load.

Here is a diagram illustrating the setup of a Kubernetes control plane optimized for high load traffic:

graph TB
    subgraph ControlPlane["Kubernetes Control Plane"]
        API["API Servers"]
        Etcd["Etcd"]
        ControllerManager["Controller Manager"]
        Scheduler["Scheduler"]
    end
    subgraph Cluster["Kubernetes Cluster"]
        Nodes["Nodes"]
        Pods["Pods"]
        HPA["Horizontal Pod Autoscaler"]
        CA["Cluster Autoscaler"]
    end
    API -->|Read/Write| Etcd
    ControllerManager -->|Control| Nodes
    Scheduler -->|Schedule| Pods
    Nodes -->|Report Status| API
    Pods -->|Report Status| API
    HPA -->|Scale| Pods
    CA -->|Scale| Nodes

The Kubernetes Control Plane consists of multiple API Servers, Etcd, Controller Manager, and Scheduler. The API Servers interact with Etcd for read/write operations. The Controller Manager controls the Nodes, and the Scheduler schedules the Pods.

In the Kubernetes Cluster, Nodes and Pods report their status to the API Servers. The Horizontal Pod Autoscaler (HPA) and Cluster Autoscaler (CA) are used to automatically adjust the number of Pods and Nodes based on the load.

Remember, this is a high-level overview. The actual implementation may vary based on your specific requirements and Kubernetes best practices.

Categories
Kubernetes

Single Kubernetes cluster for lower environments

Setting up a single Kubernetes cluster for lower environments like Dev, Test, and Staging involves several steps and best practices. Here’s a high-level overview:

  1. Create a Kubernetes Cluster: You can use managed Kubernetes services like AWS EKS, Google GKE, or Azure AKS to create a Kubernetes cluster. Alternatively, you can set up your own cluster using tools like kops or kubeadm.
  2. Create Namespaces: Create separate namespaces for each environment. This provides isolation between the environments and helps manage resources for each environment.
  3. Deploy Applications: Deploy your applications in each namespace. You can use Kubernetes Deployments and Services for this. Deployments describe the desired state for your application, and Services provide network access to your application.
  4. Configure Networking: Set up networking for your applications. You can use Kubernetes Ingress to manage external access to services in the cluster.
  5. Manage Configuration and Secrets: Use ConfigMaps to manage application configuration and Secrets to manage sensitive data.
  6. Set Resource Limits: Set resource limits for each namespace to prevent one environment from using all the resources in the cluster.
  7. Implement CI/CD: Implement a CI/CD pipeline to automate the deployment of your applications to each environment.

Here’s a diagram to illustrate this setup:

graph TB
    subgraph Cluster["Kubernetes Cluster"]
        subgraph DevNamespace["Dev Namespace"]
            DevDeployment["Deployment"]
            DevService["Service"]
            DevIngress["Ingress"]
            DevConfigMap["ConfigMap"]
            DevSecret["Secret"]
        end
        subgraph TestNamespace["Test Namespace"]
            TestDeployment["Deployment"]
            TestService["Service"]
            TestIngress["Ingress"]
            TestConfigMap["ConfigMap"]
            TestSecret["Secret"]
        end
        subgraph StagingNamespace["Staging Namespace"]
            StagingDeployment["Deployment"]
            StagingService["Service"]
            StagingIngress["Ingress"]
            StagingConfigMap["ConfigMap"]
            StagingSecret["Secret"]
        end
    end
    DevDeployment --> DevService
    DevService --> DevIngress
    DevDeployment --> DevConfigMap
    DevDeployment --> DevSecret
    TestDeployment --> TestService
    TestService --> TestIngress
    TestDeployment --> TestConfigMap
    TestDeployment --> TestSecret
    StagingDeployment --> StagingService
    StagingService --> StagingIngress
    StagingDeployment --> StagingConfigMap
    StagingDeployment --> StagingSecret
graph TB
    subgraph Cluster["Kubernetes Cluster"]
        subgraph DevNamespace["Dev Namespace"]
            DevDeployment["Deployment"]
            DevService["Service"]
            DevIngress["Ingress"]
            DevConfigMap["ConfigMap"]
            DevSecret["Secret"]
        end
        subgraph TestNamespace["Test Namespace"]
            TestDeployment["Deployment"]
            TestService["Service"]
            TestIngress["Ingress"]
            TestConfigMap["ConfigMap"]
            TestSecret["Secret"]
        end
        subgraph StagingNamespace["Staging Namespace"]
            StagingDeployment["Deployment"]
            StagingService["Service"]
            StagingIngress["Ingress"]
            StagingConfigMap["ConfigMap"]
            StagingSecret["Secret"]
        end
    end
    DevDeployment --> DevService
    DevService --> DevIngress
    DevDeployment --> DevConfigMap
    DevDeployment --> DevSecret
    TestDeployment --> TestService
    TestService --> TestIngress
    TestDeployment --> TestConfigMap
    TestDeployment --> TestSecret
    StagingDeployment --> StagingService
    StagingService --> StagingIngress
    StagingDeployment --> StagingConfigMap
    StagingDeployment --> StagingSecret

This diagram represents a single Kubernetes cluster with different namespaces for each environment. Each namespace has its own deployments, services, ingress controllers, ConfigMaps, and Secrets. The arrows indicate the connection between the Deployment and the other components within the same namespace.

Each environment (Dev, Test, and Staging) has its own namespace within the Kubernetes cluster. Each namespace has its own Deployments, Services, Ingress, ConfigMaps, and Secrets. The arrows indicate the connection between the Deployment and the other components within the same namespace.

Categories
Other

Prompt Types

  1. Tone: Please specify the desired tone of the response (e.g., formal, casual, informative, persuasive).
  2. Format: Please define the preferred format or structure for the response (e.g., essay, bullet points, outline, dialogue).
  3. Act as: Please indicate the role or perspective I should adopt (e.g., expert, critic, enthusiast).
  4. Objective: Please state the goal or purpose of the response (e.g., inform, persuade, entertain).
  5. Context: Please provide any background information, data, or context that would be helpful for accurate content generation.
  6. Scope: Please define the scope or range of the topic.
  7. Keywords: Please list important keywords or phrases that should be included.
  8. Limitations: Please specify any constraints, such as word or character count.
  9. Examples: Please provide examples of the desired style, structure, or content.
  10. Deadline: Please mention any deadlines or time frames for time-sensitive responses.
  11. Audience: Please specify the target audience for tailored content.
  12. Language: Please indicate the language for the response, if different from the prompt.
  13. Citations: Please request the inclusion of citations or sources to support information.
  14. Points of view: Please ask me to consider multiple perspectives or opinions.
  15. Counterarguments: Please request addressing potential counterarguments.
  16. Terminology: Please specify any industry-specific or technical terms to use or avoid.
  17. Analogies: Please ask me to use analogies or examples to clarify concepts.
  18. Quotes: Please request the inclusion of relevant quotes or statements from experts.
  19. Statistics: Please encourage the use of statistics or data to support claims.
  20. Visual elements: Please inquire about including charts, graphs, or images.
  21. Call to action: Please request a clear call to action or next steps.
  22. Sensitivity: Please mention any sensitive topics or issues that should be handled with care or avoided.
Categories
Other

Habits to get more time

  • Turn on flight-mode
  • Make it a no-brainer
    • Micro habits – James Clear
      • All things you want to do are near you.
    • Motivation -> Discipline -> Will Power : Tie it with Something you would like to do (eg: Good Environment)
  • Time-blocking the night before
    • Creative items in the morning
    • Logical items in the evening
    • Hard tasks in the morning
  • Choose yourself first in regards to todo list

Categories
Other

Increase Subscribers

  1. Mere Exposure/ Consistency
    • “Insanity is doing the same thing over and over again and expecting different results.”
  2. Lean In to Yourself
    • What value you can bring to the world?
    • Bring your personality and mix in emotion – It’s unique and no one in the world has that uniqueness
      • Eg. What you do on a day to day basis
      • How you are earning money
      • What is your plan
      • How you are expecting your future to be
      • Mix your experience with things
  3. Valuable Content throughout
    • Will I sit and watch this video?
  4. Fix the Audio!
  5. Listen to Your Audience
  6. Find something YOU care about
    • Don’t do what you don’t like or passionate about ( if need passion increase that first ) Passion = Consistency + Action
      • If you do so, People will see through that your energy is getting drain in the video and
      • You are more likely to give up.
  7. Thumbnails
    • Brand it.
  8. Don’t chase the money
  9. Back up what you’re saying
  10. Get going!
    • Start!
Categories
Other

Launch Product

Castle Framework

StepTitleDescription
CConceptualizeGenerate business ideas, identify market demand, and develop a unique value proposition.
AAssembleCombine market demand with personal interest or expertise to refine the business idea.
SShapeCreate a Minimum Viable Product (MVP) to test the market, gather feedback, and validate the idea.
TTailorRefine the product or service based on customer feedback and prepare for a comprehensive launch.
LLaunchImplement marketing strategies, generate awareness, and execute a full-scale launch of the business.
EExpandIdentify opportunities for growth, such as expanding into new markets or locations.
Continuously ImproveSeek ongoing customer feedback, adapt to market changes, and focus on continuous improvement.

Restructured

StepTitleShort DescriptionAction Points
1IdeationGenerate multiple business ideas– Brainstorm and research potential business ideas.
– Identify the problem you want to solve.
– Develop a unique value proposition.
2Refine the IdeaCombine market demand with personal interest/expertise– Evaluate market potential for each idea.
– Consider personal interest and expertise.
– Use the Hedgehog Concept to find the intersection.
3Create a Minimum Viable Product (MVP)Build a basic version of the product/service for lead generation and feedback– Build a basic version of the product/service.
– Focus on lead generation and indicators of interest.
– Consider offering the MVP for free.
4Validate the IdeaTest the MVP with potential customers, gather feedback, and refine– Test the MVP with potential customers.
– Seek feedback and assess market response.
– Refine the product/service based on feedback.
5Refine and LaunchImprove the product/service based on feedback and prepare for a comprehensive launch– Incorporate feedback to improve the product/service.
– Develop marketing strategies.
– Plan for a comprehensive launch.
6ScaleIdentify expansion opportunities and develop growth strategies– Identify opportunities for expansion (e.g., new locations, markets).
– Develop growth strategies.
7Continuously ImproveSeek ongoing customer feedback, adapt to market changes, and focus on continuous improvement and growth– Seek ongoing customer feedback.
– Adapt to market changes and evolving needs.
– Focus on continuous improvement and growth.

Hedgehog Concept

  1. Focus on what you can be the best at.
  2. Understand what drives your economic engine.
  3. Find the intersection of passion, talent, and market demand.
  4. Narrow your focus and avoid distractions.
  5. Continuously refine and optimize your Hedgehog Concept.

Books

Certainly! Here’s the updated table with the additional column indicating at which step of the CASTLE method each book is useful:

Book TitleRatingShort DescriptionRelevant Step in CASTLE Method
“Over Subscribed”4.4/5Provides strategies for creating high demand and attracting customers to your business.Refine and Launch
“Good to Great”4.1/5Explores the factors that differentiate great companies from good ones for long-term success.Scale
“100 Million Dollar Offers”4.3/5Offers strategies for crafting compelling offers that drive revenue and business growth.Refine and Launch
“DotCom Secrets”4.6/5Reveals online marketing and sales strategies to create successful online businesses.Refine and Launch
“Scorecard Marketing”4.2/5Introduces the concept of scorecards for effective marketing and measuring business performance.Validate the Idea