Monday, June 10, 2024

Python Virtual Environment

 python -m venv my_env

source my_env\bin\activate

pip install jupyter

jupyter notebook


Google Collaborator:

!pip install -q langchain


Secrets:

from google.colab import userdata

api_key = userdata.get('API_KEY')


Gemini: ai.google.dev/available_regions

VPN: protonvpn


Installing google gen ai: pip install -q google-generativeai

pip install --upgrade -q google-generativeai
pip show google-generativeai

pip install python-dotenv


import google.generativeai as genie

import os

from dotenv import load_dotenv, find_dotenv

load_dotenv(find_dotenv(), override=True)

# os.environ.get("GOOGLE_API_KEY")

genie.configure(api_key=os.environ.get("GOOGLE_API_KEY"))

for m in genie.list_models():

    if 'generateContent' in m.supported_generation_methods:

        print(m.name)



Accessing Google AI Studio: ai.google.dev

Saturday, April 27, 2024

Docker

 Docker virtualizes Application Layer of an Operating System.

It runs on top of the native Operating System Kernel layer. In this way, Docker images are entirely running in the application space.


Commands

  1. Find Docker images on the local machine: docker images
  2. Find Docker containers running on the local machine: docker ps
  3. Download image version from DockerHub: docker pull nginx:1.23
  4. Download latest image from DockerHub: docker pull nginx
  5. Run image of specific version: docker run nginx:1.23
  6. Run container in the background: docker run -d nginx:1.23
  7. Print container logs to terminal: docker logs <containerid>