### Quick Start: Setup and Common Commands Source: https://github.com/rand/cc-polymath/blob/main/skills/rust/pyo3-testing-debugging/resources/examples/README.md Provides essential commands for setting up any example directory, including creating virtual environments, installing dependencies (Maturin, Pytest), building the extension, and running tests. ```bash # Navigate to example directory cd # Create virtual environment python -m venv .venv # Activate virtual environment source .venv/bin/activate # On Windows: .venv\Scripts\activate # Install dependencies pip install maturin pytest # Build and install the PyO3 extension maturin develop # Run Rust tests # cargo test # Run Python tests # pytest tests/ -v ``` -------------------------------- ### Manual Setup: Wait for Services Source: https://github.com/rand/cc-polymath/blob/main/skills/rust/pyo3-dspy-rag-pipelines/resources/examples/production-rag/QUICKSTART.md Pauses execution for 5 seconds to allow Qdrant and Redis services to start up properly before proceeding with further setup steps. ```bash sleep 5 ``` -------------------------------- ### Make Setup Command Source: https://github.com/rand/cc-polymath/blob/main/skills/rust/pyo3-dspy-rag-pipelines/resources/examples/production-rag/QUICKSTART.md Runs the 'setup' target in the Makefile, which typically automates the entire setup process including infrastructure, dependencies, and build. ```bash make setup ``` -------------------------------- ### Manual Setup: Start Infrastructure Source: https://github.com/rand/cc-polymath/blob/main/skills/rust/pyo3-dspy-rag-pipelines/resources/examples/production-rag/QUICKSTART.md Starts Qdrant and Redis services in detached mode using Docker Compose. These are essential for the RAG system's operation. ```bash docker-compose up -d qdrant redis ``` -------------------------------- ### Project Setup: Install Testing Frameworks (Bash) Source: https://github.com/rand/cc-polymath/blob/main/skills/engineering/test-driven-development/resources/examples/workflows/tdd-workflow.md Commands to install common testing frameworks and their extensions for Python, TypeScript/JavaScript. Includes options for pip and uv for Python, and npm for JS/TS. ```bash # Python pip install pytest pytest-cov pytest-watch # or with uv: uv add --dev pytest pytest-cov pytest-watch # TypeScript/JavaScript npm install --save-dev jest @types/jest ts-jest # or npm install --save-dev vitest # Rust # Already included in cargo # Go # Already included in go toolchain ``` -------------------------------- ### Initial Tailscale Setup and Status Source: https://github.com/rand/cc-polymath/blob/main/skills/networking/tailscale-vpn.md Commands to start Tailscale, authenticate the connection by opening a browser, check the connection status, and retrieve the Tailscale IP address. ```bash # Start tailscale sudo tailscale up # Authenticate (opens browser) # Follow link to authenticate with your account # Check status tailscale status # Get your IP tailscale ip -4 ``` -------------------------------- ### Bash Script Examples for Running Services and Infrastructure Source: https://github.com/rand/cc-polymath/blob/main/skills/observability/distributed-tracing.md Provides bash commands for running the example services and the necessary tracing infrastructure. Includes commands to start Python, TypeScript, and Go services, as well as instructions to launch the Docker Compose setup for Jaeger and the OpenTelemetry Collector. ```bash # Run example services python examples/python/otel_fastapi_tracing.py ts-node examples/typescript/otel_express_tracing.ts go run examples/go/otel_http_tracing.go # Start tracing infrastructure using Docker Compose docker-compose -f examples/docker/jaeger-compose.yml up -d # Access Jaeger UI after starting infrastructure # Open your browser to: http://localhost:16686 ``` -------------------------------- ### Setup PyO3 Debugging Environment Source: https://github.com/rand/cc-polymath/blob/main/skills/rust/pyo3-testing-debugging/resources/examples/08_debugging_setup/README.md This snippet shows the initial setup for debugging PyO3 extensions. It involves creating a Python virtual environment, activating it, installing the 'maturin' build tool, and then running 'maturin develop' which defaults to a debug build. This prepares the project for debugging with tools like GDB or LLDB. ```bash python -m venv .venv source .venv/bin/activate pip install maturin maturin develop # Debug build by default ``` -------------------------------- ### Alembic Migrations Setup Example (Python) Source: https://github.com/rand/cc-polymath/blob/main/skills/database/postgres-migrations.md This example provides a complete Alembic setup for managing Python database migrations. It includes configuration files (`alembic.ini`, `env.py`) and example migration scripts for initializing the schema and adding tables, along with instructions for setup and usage. ```python # alembic.ini example snippet [alembic] script_location = alembic db_url = postgresql://user:password@host:port/database # env.py example snippet from logging.config import fileConfig from sqlalchemy import engine_from_config from sqlalchemy import pool from alembic import context # this is the Alembic Config object, which provides # access to the values within the .ini file relative to \n# the 'here' directory. config = context.config # Interpret the config file for Python logging. # This line sets up loggers basically. \nif config.config_file_name is not None: fileConfig(config.config_file_name) # add your model's MetaData object here # for 'autogenerate' support # from myapp import mymodel # target_metadata = mymodel.Base.metadata target_metadata = None # Replace with your MetaData object # other values from the config, defined by the needs of env.py, \n# can be acquired: \n# my_important_option = config.get_main_option("my_important_option") # ... etc. def run_migrations_offline(): """Run migrations in 'offline' mode. \n This configures the context with just a URL and not an Engine, though an Engine is acceptable here as well for streaming migrations using databases like MySQL to the script output. """ url = config.get_main_option("sqlalchemy.url") context.configure( url=url, target_metadata=target_metadata, literal_binds=True, dialect_opts={"paramstyle": "named"}, ) with context.begin_transaction(): context.run_migrations() def run_migrations_online(): """Run migrations in 'online' mode. \n In this scenario we need to create an Engine and associate a connection with the context. """ connectable = engine_from_config( config.get_section(config.config_file_name, "alembic:"), prefix="sqlalchemy. திராட்சை", poolclass=pool.NullPool, ) with connectable.connect() as connection: context.configure( connection=connection, target_metadata=target_metadata ) with context.begin_transaction(): context.run_migrations() if context.is_offline_mode(): run_migrations_offline() else: run_migrations_online() # Example migration file (versions/xxxxxxxxx_initial_schema.py) """Initial schema""" from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'xxxxxxxxxxxx' down_revision = None revisable_by = None def upgrade(): op.create_table( 'users', sa.Column('id', sa.Integer, primary_key=True), sa.Column('name', sa.String(50), nullable=False) ) op.create_table( 'posts', sa.Column('id', sa.Integer, primary_key=True), sa.Column('user_id', sa.Integer, sa.ForeignKey('users.id')), sa.Column('title', sa.String(100), nullable=False) ) def downgrade(): op.drop_table('posts') op.drop_table('users') ``` -------------------------------- ### PyPI Server Setup and Usage for Python Source: https://github.com/rand/cc-polymath/blob/main/skills/engineering/dependency-management/resources/REFERENCE.md Installation and running commands for `pypi-server` to host a private Python package registry. Includes commands for uploading packages and configuring pip. ```bash # Install pip install pypiserver # Run pypi-server -p 8080 /path/to/packages # Upload package twine upload --repository-url http://localhost:8080 dist/* ``` ```ini [global] index-url = http://localhost:8080/simple/ trusted-host = localhost ``` -------------------------------- ### Automated Setup Script Source: https://github.com/rand/cc-polymath/blob/main/skills/rust/pyo3-dspy-rag-pipelines/resources/examples/production-rag/QUICKSTART.md Executes the setup script to automate the process of starting infrastructure, creating collections, installing dependencies, and building the Rust application. ```bash ./scripts/setup.sh ``` -------------------------------- ### Install Sphinx and Build HTML Documentation Source: https://github.com/rand/cc-polymath/blob/main/skills/rust/pyo3-packaging-distribution/resources/examples/10_production_release/README.md This demonstrates how to install necessary Sphinx dependencies and build the HTML documentation locally. ```bash # Install dependencies pip install sphinx sphinx-rtd-theme # Build HTML cd docs make html # View locally open _build/html/index.html ``` -------------------------------- ### Manual Setup: Install Python Dependencies Source: https://github.com/rand/cc-polymath/blob/main/skills/rust/pyo3-dspy-rag-pipelines/resources/examples/production-rag/QUICKSTART.md Installs Python dependencies listed in 'python/requirements.txt' using pip3. This is necessary for the Python components of the RAG system. ```bash pip3 install -r python/requirements.txt ``` -------------------------------- ### Verdaccio Private npm Registry Setup and Usage Source: https://github.com/rand/cc-polymath/blob/main/skills/engineering/dependency-management/resources/REFERENCE.md Installation and running commands for Verdaccio, a self-hosted npm registry. Includes configuration example and usage for setting registry, login, and publishing. ```bash # Install npm install -g verdaccio # Run verdaccio # Configure verdaccio --config /path/to/config.yaml ``` ```yaml storage: /path/to/storage auth: htpasswd: file: /path/to/htpasswd uplinks: npmjs: url: https://registry.npmjs.org/ packages: '@myorg/*': access: $authenticated publish: $authenticated unpublish: $authenticated '**': access: $all publish: $authenticated proxy: npmjs logs: - { type: stdout, format: pretty, level: http } ``` ```bash # Point npm to registry npm set registry http://localhost:4873/ # Login npm login --registry http://localhost:4873/ # Publish npm publish --registry http://localhost:4873/ ``` -------------------------------- ### Install and Initialize Step CA Source: https://github.com/rand/cc-polymath/blob/main/skills/cryptography/pki-fundamentals/resources/REFERENCE.md This snippet covers the installation of the Step CA CLI and its initialization to create a new Certificate Authority. It includes downloading the package, installing it, and then running the `step ca init` command with specified parameters for naming, DNS, address, and provisioner. ```bash # Install wget https://dl.step.sm/gh-release/cli/docs-ca-install/v0.24.4/step-cli_0.24.4_amd64.deb dpkg -i step-cli_0.24.4_amd64.deb # Initialize CA step ca init --name="Example CA" \ --dns="ca.example.com" \ --address=":443" \ --provisioner="admin@example.com" ``` -------------------------------- ### Bash Commands for Development Environment Setup and Run Source: https://github.com/rand/cc-polymath/blob/main/skills/rust/pyo3-dspy-rag-pipelines/resources/examples/production-rag/PROJECT_SUMMARY.md Commands to set up the development environment and run the application in release mode. Includes running a setup script and then starting the server. ```bash ./scripts/setup.sh cargo run --release ``` -------------------------------- ### Quick Start: Basic Type Conversion Example Source: https://github.com/rand/cc-polymath/blob/main/skills/rust/pyo3-fundamentals/resources/examples/README.md A quick start guide to running the first PyO3 example, demonstrating a basic type conversion (doubling an integer) between Python and Rust. ```python # Try the first example cd 01_basic_types maturin develop python -c "import basic_types; print(basic_types.double_integer(21))" ``` -------------------------------- ### Install Dependencies and Build Project Source: https://github.com/rand/cc-polymath/blob/main/skills/rust/pyo3-web-frameworks/resources/examples/10_production_api/README.md Installs necessary Python packages for the FastAPI application and builds the Rust extensions using Maturin. ```bash pip install maturin fastapi uvicorn pydantic pytest httpx maturin develop ``` -------------------------------- ### Handle Optional Python Dependencies Source: https://github.com/rand/cc-polymath/blob/main/skills/rust/pyo3-packaging-distribution/resources/examples/05_dependencies/README.md Provides a Python code example demonstrating how to check for the optional availability of a library like Matplotlib and raise an informative error if it's not installed, guiding the user on how to install it. ```python # In your Python code try: import matplotlib HAS_MATPLOTLIB = True except ImportError: HAS_MATPLOTLIB = False def plot_data(data): if not HAS_MATPLOTLIB: raise ImportError("Install with: pip install package[viz]") # Use matplotlib ``` -------------------------------- ### Install Dependencies and Run QA System Source: https://github.com/rand/cc-polymath/blob/main/skills/ml/resources/dspy/examples/production-qa/README.md This snippet shows how to install project dependencies using pip, set necessary environment variables for API keys and Redis, and run the FastAPI server locally or deploy it using Modal. It also includes an example of how to test the system with a curl command. ```bash # Install dependencies pip install -r requirements.txt # Set environment variables export OPENAI_API_KEY="your-key" export REDIS_URL="redis://localhost:6379" # Run locally python server.py # Or deploy to Modal modal deploy server.py # Test curl -X POST http://localhost:8000/ask \ -H "Content-Type: application/json" \ -d '{"question": "What is Python?"}' ``` -------------------------------- ### Heroku Add-on Provisioning Command Example Source: https://github.com/rand/cc-polymath/blob/main/skills/deployment/heroku-addons.md Demonstrates the basic command for creating a Heroku add-on. This example shows how an add-on automatically creates a configuration variable, which can then be inspected. ```bash # Add-on creates config var automatically heroku addons:create heroku-postgresql:essential-0 # Check created config vars heroku config | grep DATABASE_URL # DATABASE_URL: postgres://user:pass@host:5432/dbname ``` -------------------------------- ### GET /health Source: https://github.com/rand/cc-polymath/blob/main/skills/rust/pyo3-dspy-production/resources/examples/prometheus-metrics/QUICKSTART.md Checks the health status of the demo server. ```APIDOC ## GET /health ### Description Checks the health status of the demo server. This endpoint can be used for monitoring and readiness checks. ### Method GET ### Endpoint /health ### Response #### Success Response (200) - **status** (string) - Indicates the health status, typically 'ok'. #### Response Example ```json { "status": "ok" } ``` ``` -------------------------------- ### Test Wheel Installation and Import (Bash & Python) Source: https://github.com/rand/cc-polymath/blob/main/skills/rust/pyo3-packaging-distribution/resources/examples/09_multi_platform/README.md Tests the installation of a specific wheel file into a clean virtual environment and verifies that the package can be imported and its version accessed. This ensures the wheel is functional on the target platform. ```bash python -m venv test_env source test_env/bin/activate pip install dist/multi_platform-*-cp311-*-$(python -c "import sysconfig; print(sysconfig.get_platform().replace('-', '_').replace('.', '_'))").whl python -c "import multi_platform; print(multi_platform.__version__)" ``` -------------------------------- ### Kubernetes Tailscale Operator Installation Source: https://github.com/rand/cc-polymath/blob/main/skills/networking/tailscale-vpn.md This command installs the Tailscale operator in a Kubernetes cluster, enabling automatic Tailscale integration for services. ```bash kubectl apply -f https://github.com/tailscale/tailscale/releases/latest/download/operator.yaml ``` -------------------------------- ### Verify PyPI Package Installation and Version Source: https://github.com/rand/cc-polymath/blob/main/skills/rust/pyo3-packaging-distribution/resources/examples/10_production_release/README.md These commands verify that your package has been uploaded to PyPI, can be installed, and reports the correct version. ```bash # Check on PyPI pip search production_release # Install from PyPI pip install production_release==1.0.0 # Verify python -c "import production_release; print(production_release.__version__)" ``` -------------------------------- ### Makefile to CMake Migration Example Source: https://github.com/rand/cc-polymath/blob/main/skills/build-systems/build-system-selection.md Demonstrates the migration from a simple Makefile to a CMakeLists.txt file. The CMake example shows how to define an executable and specify include directories, offering better cross-platform support and dependency management than Make. ```bash # Before (Makefile) gcc -o myapp main.c utils.c -I./include # After (CMakeLists.txt) add_executable(myapp main.c utils.c) target_include_directories(myapp PRIVATE include) ``` -------------------------------- ### Install Tailscale Source: https://github.com/rand/cc-polymath/blob/main/skills/networking/tailscale-vpn.md Installs Tailscale on macOS using Homebrew, on Ubuntu/Debian via a script (with security recommendations), or pulls the official Docker image. ```bash # macOS brew install tailscale ``` ```bash # Ubuntu/Debian # Download script first curl -O https://tailscale.com/install.sh # Verify checksum sha256sum install.sh # Review content less install.sh # Then execute bash install.sh ``` ```bash # Docker docker pull tailscale/tailscale ``` -------------------------------- ### GET /metrics Source: https://github.com/rand/cc-polymath/blob/main/skills/rust/pyo3-dspy-production/resources/examples/prometheus-metrics/QUICKSTART.md Retrieves Prometheus metrics exposed by the demo server. ```APIDOC ## GET /metrics ### Description Retrieves Prometheus metrics exposed by the demo server. These metrics provide insights into prediction counts, cache performance, errors, and latency. ### Method GET ### Endpoint /metrics ### Response #### Success Response (200) - **metrics** (string) - A text-based response containing Prometheus-formatted metrics. #### Response Example ```text # HELP dspy_predictions_total Total number of predictions made # TYPE dspy_predictions_total counter dspy_predictions_total{prediction_type="cot",service="dspy_demo",status="success"} 152 # HELP dspy_prediction_duration_seconds Prediction duration in seconds # TYPE dspy_prediction_duration_seconds histogram dspy_prediction_duration_seconds_bucket{prediction_type="cot",service="dspy_demo",le="0.1"} 89 dspy_prediction_duration_seconds_bucket{prediction_type="cot",service="dspy_demo",le="0.25"} 152 dspy_prediction_duration_seconds_sum{prediction_type="cot",service="dspy_demo"} 18.4 dspy_prediction_duration_seconds_count{prediction_type="cot",service="dspy_demo"} 152 ``` ``` -------------------------------- ### Build and Run Rust Qdrant Integration Example Source: https://github.com/rand/cc-polymath/blob/main/skills/rust/pyo3-dspy-rag-pipelines/resources/examples/qdrant-integration/README.md Builds the Rust project in release mode and then runs the main example. This demonstrates the Rust client's capabilities for interacting with Qdrant. ```bash cargo build --release cargo run --release ``` -------------------------------- ### HashiCorp Vault: Setup and Initialize Source: https://github.com/rand/cc-polymath/blob/main/skills/cryptography/key-management/resources/REFERENCE.md Provides bash commands for setting up and initializing HashiCorp Vault. Includes starting a development server for testing, configuring a production server, initializing the operator, and unsealing the Vault. ```bash # Start Vault dev server (testing only) vault server -dev # Production setup vault server -config=vault.hcl # Initialize vault operator init # Unseal (required after restart) vault operator unseal vault operator unseal vault operator unseal ``` -------------------------------- ### Get API Metrics (Bash) Source: https://github.com/rand/cc-polymath/blob/main/skills/rust/pyo3-dspy-rag-pipelines/resources/examples/production-rag/QUICKSTART.md Fetches performance metrics from the running application by sending an HTTP GET request to the `/metrics` endpoint on localhost:8080. ```bash curl http://localhost:8080/metrics ``` -------------------------------- ### Node.js gRPC: Install, Server, and Client Source: https://github.com/rand/cc-polymath/blob/main/skills/protocols/grpc-implementation/resources/REFERENCE.md Guides users through setting up gRPC in Node.js, covering package installation, and providing examples for both server and client implementations using `@grpc/grpc-js` and `@grpc/proto-loader`. ```bash npm install @grpc/grpc-js @grpc/proto-loader ``` ```javascript const grpc = require('@grpc/grpc-js'); const protoLoader = require('@grpc/proto-loader'); const packageDefinition = protoLoader.loadSync('users.proto'); const proto = grpc.loadPackageDefinition(packageDefinition); const server = new grpc.Server(); server.addService(proto.users.v1.UserService.service, { getUser: (call, callback) => { callback(null, { user: { id: '123', name: 'Alice' } }); } }); server.bindAsync('0.0.0.0:50051', grpc.ServerCredentials.createInsecure(), () => { server.start(); }); ``` ```javascript const client = new proto.users.v1.UserService( 'localhost:50051', grpc.credentials.createInsecure() ); client.getUser({ id: '123' }, (err, response) => { console.log(response.user.name); }); ``` -------------------------------- ### Copy Example Nginx Configuration Source: https://github.com/rand/cc-polymath/blob/main/skills/proxies/nginx-configuration.md This command copies a pre-defined example Nginx configuration file from the project's examples directory to the Nginx configuration path. ```bash # 5. Use example configurations cp skills/proxies/nginx-configuration/resources/examples/reverse-proxy/nginx.conf \ /etc/nginx/nginx.conf ``` -------------------------------- ### Install Optional Python Dependencies (Bash) Source: https://github.com/rand/cc-polymath/blob/main/skills/rust/pyo3-packaging-distribution/resources/examples/05_dependencies/README.md Demonstrates how to install the Python package with specific optional dependency groups using pip. ```bash pip install dependencies_example[dev] pip install dependencies_example[viz] pip install dependencies_example[all] ``` -------------------------------- ### Install Tailscale in a Dockerfile Source: https://github.com/rand/cc-polymath/blob/main/skills/networking/tailscale-vpn.md Provides a Dockerfile to install Tailscale within a Ubuntu-based container. It includes steps for downloading the installer script and executing it, with a note on security best practices for production environments. ```dockerfile FROM ubuntu:22.04 # Install Tailscale RUN apt-get update && apt-get install -y \ curl \ iptables \ iproute2 # Download script first RUN curl -O https://tailscale.com/install.sh && \ sha256sum install.sh && \ less install.sh && \ bash install.sh ``` -------------------------------- ### Git Hook Setup with Frameworks Source: https://github.com/rand/cc-polymath/blob/main/skills/engineering/git-workflows.md Explains the concept of Git hooks and provides setup examples using popular frameworks like `pre-commit` (Python) and `husky` (Node.js). It also shows a sample configuration for `pre-commit` hooks. ```bash # Using pre-commit (Python) pip install pre-commit # .pre-commit-config.yaml in repo root pre-commit install ``` ```bash # Using husky (Node) npx husky init ``` ```yaml repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.5.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer - id: check-yaml - id: no-commit-to-branch args: ['--branch', 'main'] ``` -------------------------------- ### Setup Script Execution (Bash) Source: https://github.com/rand/cc-polymath/blob/main/skills/rust/pyo3-dspy-rag-pipelines/resources/examples/production-rag/QUICKSTART.md Executes a setup script named `setup.sh` located in the project's root directory. This script likely performs initial project configuration or setup tasks. ```bash ./scripts/setup.sh ``` -------------------------------- ### heaptrack: Installation and Profiling on Linux Source: https://github.com/rand/cc-polymath/blob/main/skills/engineering/resources/performance-profiling/REFERENCE.md Provides installation commands for heaptrack on Ubuntu and CentOS, along with instructions for profiling applications and analyzing the results using `heaptrack_gui` or `heaptrack_print`. ```bash sudo apt-get install heaptrack heaptrack-gui # Ubuntu sudo yum install heaptrack heaptrack-gui # CentOS # Record heap allocations heaptrack ./myapp arg1 arg2 # Analyze with GUI heaptrack_gui heaptrack.myapp.12345.gz # Print summary heaptrack_print heaptrack.myapp.12345.gz ``` -------------------------------- ### Create and Run Expo Managed Project Source: https://github.com/rand/cc-polymath/blob/main/skills/mobile/react-native-setup.md This snippet demonstrates how to create a new React Native project using the Expo managed workflow with TypeScript, install dependencies, start the development server, and run it on an iOS simulator. It's ideal for rapid prototyping and apps not requiring custom native modules. ```bash npx create-expo-app@latest MyApp --template blank-typescript cd MyApp npm install npx expo start npx expo start --ios npx expo install expo-camera expo-location ``` -------------------------------- ### Build and Run Rust Examples Source: https://github.com/rand/cc-polymath/blob/main/skills/rust/pyo3-dspy-async-streaming/resources/examples/token-streaming/README.md Illustrates the cargo commands to build the Rust project in release mode and run all examples, or specific example modes. ```bash # Build the project cargo build --release # Run all examples cargo run --release # Run specific example modes cargo run --release -- --mode simple cargo run --release -- --mode concurrent cargo run --release -- --mode aggregate cargo run --release -- --mode recovery ``` -------------------------------- ### Check System Metrics Source: https://github.com/rand/cc-polymath/blob/main/skills/rust/pyo3-dspy-rag-pipelines/resources/examples/production-rag/QUICKSTART.md Retrieves system metrics by sending a GET request to the /metrics endpoint. Filters for metrics starting with 'rag_' to view RAG-specific performance data. ```bash curl http://localhost:8080/metrics | grep rag_ ``` -------------------------------- ### Run the FastAPI Server Source: https://github.com/rand/cc-polymath/blob/main/skills/rust/pyo3-web-frameworks/resources/examples/10_production_api/README.md Starts the Uvicorn server to run the FastAPI application on the specified host and port. ```bash python app.py ``` -------------------------------- ### Go.sum Example (Go) Source: https://github.com/rand/cc-polymath/blob/main/skills/engineering/dependency-management/resources/REFERENCE.md Demonstrates the format of a go.sum file, which Go uses to verify the integrity of module dependencies. It contains checksums and module versions to ensure that builds are reproducible and secure. ```go github.com/gin-gonic/gin v1.9.0 h1:OjyFBKICoexlu99ctXNR2gg+c5pKrKMuyjgARg9qeY8= github.com/gin-gonic/gin v1.9.0/go.mod h1:W1Me9+hsUSyj3CePGrd1/QrKJMSJ1Tu/0hFEH89961k= ``` -------------------------------- ### Pnpm-lock.yaml Example Source: https://github.com/rand/cc-polymath/blob/main/skills/engineering/dependency-management/resources/REFERENCE.md Presents an example of a pnpm-lock.yaml file, which is used by pnpm to manage project dependencies. It includes the versions, resolved locations, and integrity hashes of all dependencies, ensuring consistent installations. ```yaml lockfileVersion: 5.4 specifiers: express: ^4.18.0 dependencies: express: 4.18.2 packages: /express/4.18.2: resolution: {integrity: sha512-...} dependencies: body-parser: 1.20.1 ``` -------------------------------- ### Install DSPy Framework Source: https://github.com/rand/cc-polymath/blob/main/skills/ml/dspy-setup.md Installs the DSPy framework using pip or uv. Includes commands for the latest stable release, development version, and optional dependencies for various language model providers and integrations. ```bash # Latest stable release pip install dspy-ai # Or with uv (recommended) uv add dspy-ai # Development/latest version pip install git+https://github.com/stanfordnlp/dspy.git # Optional dependencies # For specific LM providers uv add openai anthropic cohere litellm # For HuggingFace uv add huggingface-hub transformers # For Modal integration uv add modal # For RAG and vector search uv add chromadb weaviate-client qdrant-client # For evaluation and metrics uv add datasets evaluate ``` -------------------------------- ### Setup AWS CloudHSM Client Source: https://github.com/rand/cc-polymath/blob/main/skills/cryptography/pki-fundamentals/resources/REFERENCE.md These commands install and configure the AWS CloudHSM client on an EC2 instance. It involves downloading an RPM package, installing it using yum, configuring the cluster by providing an HSM IP address, and starting the CloudHSM client service. ```bash # Install CloudHSM client wget https://s3.amazonaws.com/cloudhsmv2-software/CloudHsmClient/EL7/cloudhsm-client-latest.el7.x86_64.rpm yum install -y cloudhsm-client-latest.el7.x86_64.rpm # Configure cluster /opt/cloudhsm/bin/configure -a # Start client systemctl start cloudhsm-client ``` -------------------------------- ### Check API Health (Bash) Source: https://github.com/rand/cc-polymath/blob/main/skills/rust/pyo3-dspy-rag-pipelines/resources/examples/production-rag/QUICKSTART.md Checks the health status of the application by sending an HTTP GET request to the `/health` endpoint on localhost:8080. ```bash curl http://localhost:8080/health ``` -------------------------------- ### Idempotent HTTP Methods: GET, PUT, DELETE Examples Source: https://github.com/rand/cc-polymath/blob/main/skills/api/rest-api-design.md Provides examples of idempotent HTTP methods (GET, PUT, DELETE) and explains their behavior. GET requests should always return the same data, PUT requests should result in the same state regardless of how many times they are called, and DELETE requests, while potentially returning different status codes (e.g., 204 vs. 404), achieve the same end state of resource deletion. ```http GET /users/42 # Always returns same user (if unchanged) PUT /users/42 {"name": "Alice"} # Setting name to "Alice" multiple times = same result DELETE /users/42 # First: 204 No Content DELETE /users/42 # Second: 404 Not Found (idempotent result) ``` -------------------------------- ### Start Step CA Server and Issue Certificate Source: https://github.com/rand/cc-polymath/blob/main/skills/cryptography/pki-fundamentals/resources/REFERENCE.md This snippet shows how to start the Step CA server using its configuration file and how to issue a new certificate for a given domain. It assumes the CA has already been initialized. ```bash # Start CA server step-ca $(step path)/config/ca.json # Issue certificate step ca certificate www.example.com www.example.com.crt www.example.com.key ``` -------------------------------- ### AWS CodeArtifact Setup for npm Source: https://github.com/rand/cc-polymath/blob/main/skills/engineering/dependency-management/resources/REFERENCE.md Commands for logging into AWS CodeArtifact and configuring npm to use it as a private registry, including getting the repository endpoint. ```bash # Login aws codeartifact login --tool npm --domain my-domain --repository my-repo # Get endpoint aws codeartifact get-repository-endpoint \ --domain my-domain \ --repository my-repo \ --format npm ``` ```ini registry=https://my-domain-111122223333.d.codeartifact.us-east-1.amazonaws.com/npm/my-repo/ //my-domain-111122223333.d.codeartifact.us-east-1.amazonaws.com/npm/my-repo/:always-auth=true ``` -------------------------------- ### Kubernetes ConfigMap Creation Examples Source: https://github.com/rand/cc-polymath/blob/main/skills/cloud/kubernetes-deployment/resources/REFERENCE.md Demonstrates various methods for creating Kubernetes ConfigMaps. This includes defining ConfigMaps directly in YAML with key-value pairs, multi-line strings, JSON, and binary data, as well as creating them from files, directories, and literal values using kubectl. ```yaml apiVersion: v1 kind: ConfigMap metadata: name: app-config namespace: default data: # Simple key-value ENV: production LOG_LEVEL: info # Multi-line value app.yaml: | server: port: 8080 host: 0.0.0.0 database: host: db.example.com port: 5432 name: myapp # JSON configuration features.json: | { "feature_a": true, "feature_b": false, "beta_features": ["feature_c", "feature_d"] } binaryData: # Binary data (base64 encoded) logo.png: iVBORw0KGgoAAAANSUhEUgAAA... ``` ```bash # From file kubectl create configmap app-config --from-file=config.yaml # From directory kubectl create configmap app-config --from-file=configs/ # From literal values kubectl create configmap app-config \ --from-literal=ENV=production \ --from-literal=LOG_LEVEL=info ``` -------------------------------- ### Generated Rust Type Example Source: https://github.com/rand/cc-polymath/blob/main/skills/rust/pyo3-dspy-type-system/resources/examples/codegen-workflow/QUICKSTART.md Shows an example of a Rust struct generated from a simple signature ('question -> answer'). The generated struct includes fields corresponding to the input and output, along with necessary derives for serialization and debugging. ```rust # Input signature: # question -> answer #[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] pub struct QuestionToAnswer { pub question: String, pub answer: String, } ``` -------------------------------- ### YubiHSM 2 Setup and Connection Source: https://github.com/rand/cc-polymath/blob/main/skills/cryptography/resources/hsm-integration/REFERENCE.md Steps to set up the YubiHSM 2, including downloading and installing the SDK, starting the connector service, testing the connection with yubihsm-shell, and changing the default authentication key. ```bash # 1. Install YubiHSM software wget https://developers.yubico.com/YubiHSM2/Releases/yubihsm2-sdk-2023-01-ubuntu2004-amd64.tar.gz tar xzf yubihsm2-sdk-*.tar.gz sudo dpkg -i yubihsm2-sdk/*.deb # 2. Start connector service sudo systemctl start yubihsm-connector sudo systemctl enable yubihsm-connector # 3. Test connection yubihsm-shell --connector http://127.0.0.1:12345 # 4. Change default authentication key yubihsm> connect yubihsm> session open 1 password yubihsm> put authkey 0 0 new-auth-key 1 all all all all password:new-password yubihsm> session close ``` -------------------------------- ### Install Parca (Kubernetes/Binary) Source: https://github.com/rand/cc-polymath/blob/main/skills/engineering/resources/performance-profiling/REFERENCE.md Provides instructions for installing Parca, an eBPF-based profiling system. It includes commands for Kubernetes deployments and for downloading and running the binary directly. ```bash # Kubernetes kubectl apply -f https://github.com/parca-dev/parca/releases/latest/download/kubernetes-manifest.yaml # Binary curl -sL https://github.com/parca-dev/parca/releases/latest/download/parca_Linux_x86_64.tar.gz | tar xvfz - ./parca ``` -------------------------------- ### Redis CLI: Get Key Value Source: https://github.com/rand/cc-polymath/blob/main/skills/rust/pyo3-dspy-rag-pipelines/resources/examples/production-rag/QUICKSTART.md Retrieves the value associated with a specific key in Redis, such as 'emb:some-key'. Used for inspecting cached data. ```redis GET emb:some-key ```