### Install example program Source: https://git.lunarwing.org/lunarwing/lunarwing2/blob/master/ic/vendor/cpp_demangle/README.md Install the c++filt clone example locally using cargo. ```bash cargo install cpp_demangle --example cppfilt ``` -------------------------------- ### Run HTTP/0.9 Server Example Source: https://git.lunarwing.org/lunarwing/lunarwing2/blob/master/ic/vendor/quinn/examples/README.md Starts the server example to serve files from the specified directory. ```text $ cargo run --example server ./ ``` -------------------------------- ### Common tenant creation examples Source: https://git.lunarwing.org/lunarwing/lunarwing2/blob/master/docs/guides/CREATE_TENANT_NEW_SCRIPT.md Examples showing various configurations for tenant provisioning, including full setups and minimal deployments. ```bash # Full tenant: core daemon, Pebble worker, and WASM extensions sudo ic/scripts/create-tenant.sh acme # Skip the Pebble worker sudo ic/scripts/create-tenant.sh acme --no-pebble # Core daemon without Pebble or Docker-group membership sudo ic/scripts/create-tenant.sh scratch --minimal # Preview every current option and environment override bash ic/scripts/create-tenant.sh --help ``` -------------------------------- ### Configure and start init system services Source: https://git.lunarwing.org/lunarwing/lunarwing2/blob/master/projects/voice-sidecar/PODMAN_DEPLOYMENT.md Installs and enables the service for either systemd or OpenRC. ```bash # systemd sudo install -o root -g root -m 0644 \ systemd/voice-sidecar.service /etc/systemd/system/ sudo systemctl daemon-reload sudo systemctl enable --now voice-sidecar.service # OpenRC (Gentoo) sudo install -o root -g root -m 0755 \ init.d/voice-sidecar /etc/init.d/voice-sidecar sudo rc-update add voice-sidecar default sudo rc-service voice-sidecar start ``` -------------------------------- ### Run project example Source: https://git.lunarwing.org/lunarwing/lunarwing2/blob/master/ic/vendor/pgvector/README.md Commands to navigate to the example directory, create a database, and execute the example code. ```sh cd examples/loading createdb pgvector_example cargo run ``` -------------------------------- ### Setup Virtual Environment and Dependencies Source: https://git.lunarwing.org/lunarwing/lunarwing2/blob/master/lunarwing_mt_onboard/NOTE.md Commands to initialize a virtual environment and install required packages directly. ```bash cd /path/to/lunarwing python3 -m venv .venv-mt-onboard . .venv-mt-onboard/bin/activate python -m pip install rich questionary sudo .venv-mt-onboard/bin/python -m lunarwing_mt_onboard ``` -------------------------------- ### Run client example Source: https://git.lunarwing.org/lunarwing/lunarwing2/blob/master/ic/vendor/hyper-rustls/README.md Executes the client example to fetch a specific URL. ```bash cargo run --example client "https://docs.rs/hyper-rustls/latest/hyper_rustls/" ``` -------------------------------- ### Run server example Source: https://git.lunarwing.org/lunarwing/lunarwing2/blob/master/ic/vendor/hyper-rustls/README.md Executes the server example provided in the crate. ```bash cargo run --example server ``` -------------------------------- ### Run the render-input-markdown example Source: https://git.lunarwing.org/lunarwing/lunarwing2/blob/master/ic/vendor/termimad/examples/render-input-markdown/README.md Execute the example using cargo. ```bash cargo run --example render-input-markdown ``` -------------------------------- ### Create a basic Axum web server Source: https://git.lunarwing.org/lunarwing/lunarwing2/blob/master/ic/vendor/axum/README.md Demonstrates setting up a router with GET and POST routes, using extractors for JSON parsing, and starting the server with a TCP listener. ```rust use axum::{ routing::{get, post}, http::StatusCode, Json, Router, }; use serde::{Deserialize, Serialize}; #[tokio::main] async fn main() { // initialize tracing tracing_subscriber::fmt::init(); // build our application with a route let app = Router::new() // `GET /` goes to `root` .route("/", get(root)) // `POST /users` goes to `create_user` .route("/users", post(create_user)); // run our app with hyper, listening globally on port 3000 let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await.unwrap(); axum::serve(listener, app).await.unwrap(); } // basic handler that responds with a static string async fn root() -> &'static str { "Hello, World!" } async fn create_user( // this argument tells axum to parse the request body // as JSON into a `CreateUser` type Json(payload): Json, ) -> (StatusCode, Json) { // insert your application logic here let user = User { id: 1337, username: payload.username, }; // this will be converted into a JSON response // with a status code of `201 Created` (StatusCode::CREATED, Json(user)) } // the input to our `create_user` handler #[derive(Deserialize)] struct CreateUser { username: String, } // the output to our `create_user` handler #[derive(Serialize)] struct User { id: u64, username: String, } ``` -------------------------------- ### Run Client Example Source: https://git.lunarwing.org/lunarwing/lunarwing2/blob/master/ic/vendor/tokio-rustls-0.25.0/README.md Command to execute the provided client example program. ```sh cargo run --example client -- hsts.badssl.com ``` -------------------------------- ### Create a basic Axum web server Source: https://git.lunarwing.org/lunarwing/lunarwing2/blob/master/ic/vendor/axum-0.6.20/README.md Demonstrates setting up a router with GET and POST routes, using extractors for JSON payloads, and starting the server with hyper. ```rust use axum::{ routing::{get, post}, http::StatusCode, response::IntoResponse, Json, Router, }; use serde::{Deserialize, Serialize}; use std::net::SocketAddr; #[tokio::main] async fn main() { // initialize tracing tracing_subscriber::fmt::init(); // build our application with a route let app = Router::new() // `GET /` goes to `root` .route("/", get(root)) // `POST /users` goes to `create_user` .route("/users", post(create_user)); // run our app with hyper // `axum::Server` is a re-export of `hyper::Server` let addr = SocketAddr::from(([127, 0, 0, 1], 3000)); tracing::debug!("listening on {}", addr); axum::Server::bind(&addr) .serve(app.into_make_service()) .await .unwrap(); } // basic handler that responds with a static string async fn root() -> &'static str { "Hello, World!" } async fn create_user( // this argument tells axum to parse the request body // as JSON into a `CreateUser` type Json(payload): Json, ) -> (StatusCode, Json) { // insert your application logic here let user = User { id: 1337, username: payload.username, }; // this will be converted into a JSON response // with a status code of `201 Created` (StatusCode::CREATED, Json(user)) } // the input to our `create_user` handler #[derive(Deserialize)] struct CreateUser { username: String, } // the output to our `create_user` handler #[derive(Serialize)] struct User { id: u64, username: String, } ``` -------------------------------- ### Run the inputs example Source: https://git.lunarwing.org/lunarwing/lunarwing2/blob/master/ic/vendor/termimad/examples/inputs/README.md Execute the example application using cargo. ```bash cargo run --example inputs ``` -------------------------------- ### Install and Enable Systemd Services Source: https://git.lunarwing.org/lunarwing/lunarwing2/blob/master/ic/docs/LUNARWING_XMPP_TESTING.md Copies service files to the system directory and enables them to start on boot. ```bash sudo install -o root -g root -m 0644 systemd/xmpp-bridge.service /etc/systemd/system/xmpp-bridge.service sudo install -o root -g root -m 0644 systemd/lunarwing.service /etc/systemd/system/lunarwing.service sudo systemctl daemon-reload sudo systemctl enable --now xmpp-bridge.service sudo systemctl enable --now lunarwing.service ``` -------------------------------- ### Clone and Setup Project Source: https://git.lunarwing.org/lunarwing/lunarwing2/blob/master/ic/CONTRIBUTING.md Initializes the development environment by cloning the repository and running the setup script. ```bash git clone https://git.lunarwing.org/lunarwing/lunarwing2.git cd lunarwing2 ./scripts/dev-setup.sh ``` -------------------------------- ### Install and Start LunarWing Service Source: https://git.lunarwing.org/lunarwing/lunarwing2/blob/master/docs/guides/MIGRATE_IRONCLAW_TO_LUNARWING.md Commands to install, start, and verify the status of the LunarWing service using the built-in service manager. ```bash lunarwing service install lunarwing service start lunarwing service status ``` -------------------------------- ### Run the high compatibility example Source: https://git.lunarwing.org/lunarwing/lunarwing2/blob/master/ic/vendor/termimad/examples/high-compatibility/README.md Execute the provided example using cargo to observe different skin configurations. ```bash cargo run --example high-compatibility ``` -------------------------------- ### Install and Enable Cronie Source: https://git.lunarwing.org/lunarwing/lunarwing2/blob/master/docs/guides/FEDORA_PACKAGE_LIST.md Installs and starts the cronie daemon required for health check scheduling. ```bash sudo dnf install cronie sudo systemctl enable --now crond ``` -------------------------------- ### Folder Description JSON-LD Example Source: https://git.lunarwing.org/lunarwing/lunarwing2/blob/master/ic/vendor/readabilityrs/tests/test-pages/ietf-1/expected.html Example of a JSON-LD document returned by a successful GET request to a folder. ```json { "@context": "http://remotestorage.io/spec/folder-description", "items": { "abc": { "ETag": "DEADBEEFDEADBEEFDEADBEEF", "Content-Type": "image/jpeg", "Content-Length": 82352 }, "def/": { "ETag": "1337ABCD1337ABCD1337ABCD" } } } ``` -------------------------------- ### HTTP GET Response for Folder Source: https://git.lunarwing.org/lunarwing/lunarwing2/blob/master/ic/vendor/readabilityrs/tests/test-pages/ietf-1/expected.html Example of a successful GET response for a folder, returning a JSON-LD folder description. ```http HTTP/1.1 200 OK Access-Control-Allow-Origin: https://drinks-unhosted.5apps.com Content-Type: application/ld+json Content-Length: 171 ETag: "1382694048000" Expires: 0 {"@context":"http://remotestorage.io/spec/folder-version","ite\ ms":{"test":{"ETag":"1382694048000","Content-Type":"application/json; \ charset=UTF-8","Content-Length":106}}} ``` -------------------------------- ### Build and start the tenant Source: https://git.lunarwing.org/lunarwing/lunarwing2/blob/master/docs/guides/TENANT_KNOWLEDGE_SEED.md Standard commands to build and start the tenant after initial configuration. ```bash sudo ic/scripts/lunarwing-mt-admin.sh build-tenant sudo ic/scripts/lunarwing-mt-admin.sh start-tenant ``` -------------------------------- ### HTTP GET Response for Document Source: https://git.lunarwing.org/lunarwing/lunarwing2/blob/master/ic/vendor/readabilityrs/tests/test-pages/ietf-1/expected.html Example of a successful GET response for a document, including ETag and JSON content. ```http Access-Control-Allow-Origin: https://drinks-unhosted.5apps.com Content-Type: application/json; charset=UTF-8 Content-Length: 106 ETag: "1382694048000" Expires: 0 {"name":"test", "updated":true, "@context":"http://remotestora\ ge.io/spec/modules/myfavoritedrinks/drink"} ``` -------------------------------- ### Execute Busybox Install Option Source: https://git.lunarwing.org/lunarwing/lunarwing2/blob/master/ic/vendor/clap/examples/multicall-busybox.md Shows the behavior of the --install option when invoked without proper setup. ```console $ busybox --install ? failed ... ``` -------------------------------- ### GET Request Response Examples Source: https://git.lunarwing.org/lunarwing/lunarwing2/blob/master/ic/vendor/readabilityrs/tests/test-pages/ietf-1/source.html Examples of HTTP responses for successful document retrieval, folder listing, and non-existent resources. ```http Access-Control-Allow-Origin: https://drinks-unhosted.5apps.com Content-Type: application/json; charset=UTF-8 Content-Length: 106 ETag: "1382694048000" Expires: 0 {"name":"test", "updated":true, "@context":"http://remotestora\ ge.io/spec/modules/myfavoritedrinks/drink"} ``` ```http HTTP/1.1 200 OK Access-Control-Allow-Origin: https://drinks-unhosted.5apps.com Content-Type: application/ld+json Content-Length: 171 ETag: "1382694048000" Expires: 0 {"@context":"http://remotestorage.io/spec/folder-version","ite\ ms":{"test":{"ETag":"1382694048000","Content-Type":"application/json; \ charset=UTF-8","Content-Length":106}}} ``` ```http HTTP/1.1 404 Not Found Access-Control-Allow-Origin: https://drinks-unhosted.5apps.com ``` -------------------------------- ### Setup development environment Source: https://git.lunarwing.org/lunarwing/lunarwing2/blob/master/ic/vendor/pgvector/README.md Commands to clone the repository, create a test database, and run the full test suite. ```sh git clone https://github.com/pgvector/pgvector-rust.git cd pgvector-rust createdb pgvector_rust_test cargo test --all-features ``` -------------------------------- ### Build the shared-library example Source: https://git.lunarwing.org/lunarwing/lunarwing2/blob/master/ic/vendor/jni/README.md Navigate to the example directory and execute the make command to build the shared library. ```shell cd crates/jni/mylib-example make ``` -------------------------------- ### Run MIO TLS Server Example Source: https://git.lunarwing.org/lunarwing/lunarwing2/blob/master/ic/vendor/rustls/README.md Command to start the MIO-based TLS echo server and interact with it using openssl or the client example. ```bash $ cargo run --bin tlsserver-mio -- --certs test-ca/rsa-2048/end.fullchain --key test-ca/rsa-2048/end.key -p 8443 echo & $ echo hello world | openssl s_client -ign_eof -quiet -connect localhost:8443 depth=2 CN = ponytown RSA CA verify error:num=19:self signed certificate in certificate chain hello world ^C $ echo hello world | cargo run --bin tlsclient-mio -- --cafile test-ca/rsa-2048/ca.cert --port 8443 localhost hello world ^C ``` -------------------------------- ### Run Minimal QUIC Connection Example Source: https://git.lunarwing.org/lunarwing/lunarwing2/blob/master/ic/vendor/quinn/examples/README.md Executes the minimal connection example to establish a simple QUIC connection. ```text $ cargo run --example connection ``` -------------------------------- ### GET /health Response Source: https://git.lunarwing.org/lunarwing/lunarwing2/blob/master/projects/ocr-sidecar/README.md Example response for the health check endpoint. ```json { "status": "ok", "tesseract_version": "tesseract 5.3.1", "uptime_secs": 0, "vl_available": false } ``` -------------------------------- ### Run Client and Server Examples Source: https://git.lunarwing.org/lunarwing/lunarwing2/blob/master/ic/vendor/tokio-rustls/README.md Commands to execute the provided client and server example programs. ```sh cargo run --example client -- hsts.badssl.com ``` ```sh cargo run --example server -- 127.0.0.1:8000 --cert certs/cert.pem --key certs/cert.key.pem ``` -------------------------------- ### GET /vision/metrics Response Source: https://git.lunarwing.org/lunarwing/lunarwing2/blob/master/projects/ocr-sidecar/README.md Example response for the JSON operational metrics endpoint. ```json { "total_requests": 1523, "ocr_requests": 987, "vision_requests": 536, "cache_hits": 342, "cache_misses": 194, "rate_limited": 12, "cache_hit_rate": 0.638, "avg_latency_ms": 245 } ``` -------------------------------- ### WebFinger Request Source: https://git.lunarwing.org/lunarwing/lunarwing2/blob/master/ic/vendor/readabilityrs/tests/test-pages/ietf-1/source.html An example of an HTTP GET request to the WebFinger endpoint using XMLHttpRequest and CORS. ```http GET /.well-known/webfinger?resource=acct:michiel@michielbdejon\ g.com HTTP/1.1 Host: michielbdejong.com ``` -------------------------------- ### Example ProjectDirs Initialization Source: https://git.lunarwing.org/lunarwing/lunarwing2/blob/master/ic/vendor/directories-next/README.md Demonstrates how to initialize ProjectDirs with specific organization and application identifiers. ```rust ProjectDirs::from("org" /*qualifier*/, "Baz Corp" /*organization*/, "Foo Bar-App" /*application*/) ``` -------------------------------- ### Build and run examples Source: https://git.lunarwing.org/lunarwing/lunarwing2/blob/master/ic/vendor/mach2/README.md Commands to build and execute the dump_process_registers example, which requires elevated privileges. ```bash cargo b --example dump_process_registers ``` ```bash sudo ./target/debug/examples/dump_process_registers ``` -------------------------------- ### Install OpenRC Service Source: https://git.lunarwing.org/lunarwing/lunarwing2/blob/master/projects/ocr-sidecar/PODMAN_DEPLOYMENT.md Configures and starts the OCR sidecar service on Gentoo using OpenRC. ```bash sudo cp ../../ic-infrastructure-health-check/init-templates/ocr-sidecar \ /etc/init.d/ocr-sidecar sudo chmod 0755 /etc/init.d/ocr-sidecar sudo install -m 0644 /dev/null /etc/conf.d/ocr-sidecar sudo rc-update add ocr-sidecar default sudo rc-service ocr-sidecar start sudo rc-service ocr-sidecar status ``` -------------------------------- ### Minimal OCR-Only Setup Source: https://git.lunarwing.org/lunarwing/lunarwing2/blob/master/projects/ocr-sidecar/DOCUMENTATION.md Starts the service with default settings, excluding authentication and Vision-Language features. ```bash # Just OCR, no auth, no VL OCR_PORT=8088 cargo run ``` -------------------------------- ### Setup E2E Test Environment Source: https://git.lunarwing.org/lunarwing/lunarwing2/blob/master/ic/tests/e2e/README.md Install the necessary Python dependencies and the Playwright Chromium browser. ```bash cd tests/e2e pip install -e . playwright install chromium ``` -------------------------------- ### Run Quinn Server and Client Examples Source: https://git.lunarwing.org/lunarwing/lunarwing2/blob/master/ic/vendor/quinn/README.md Commands to launch the example HTTP 0.9 server and client using Cargo. ```sh $ cargo run --example server ./ $ cargo run --example client https://localhost:4433/Cargo.toml ``` -------------------------------- ### Nested struct with cloning behavior Source: https://git.lunarwing.org/lunarwing/lunarwing2/blob/master/ic/vendor/pyo3/guide/src/faq.md Example of a struct where #[pyo3(get)] causes cloning of the inner field. ```rust # use pyo3::prelude::*; #[pyclass(from_py_object)] #[derive(Clone)] struct Inner {/* fields omitted */} #[pyclass] struct Outer { #[pyo3(get)] inner: Inner, } #[pymethods] impl Outer { #[new] fn __new__() -> Self { Self { inner: Inner {} } } } ``` -------------------------------- ### Starting the WebSocket Adapter Source: https://git.lunarwing.org/lunarwing/lunarwing2/blob/master/docs/internal/history/proposals/WEECHAT_LOCAL_WS_ADAPTER_ISSUE.md Commands to load the tenant environment and launch the adapter using the configured port. ```bash source /home//lunarwing/env/lunarwing.env python3 ws_adapter.py --port $WEECHAT_ADAPTER_PORT ``` -------------------------------- ### Automated setup script Source: https://git.lunarwing.org/lunarwing/lunarwing2/blob/master/ic/vendor/pyo3/README.md A single bash script to initialize, install, and build a new PyO3 project. ```bash mkdir string_sum && cd "$_" python -m venv .env source .env/bin/activate pip install maturin maturin init --bindings pyo3 maturin develop ``` -------------------------------- ### Run Server Example Source: https://git.lunarwing.org/lunarwing/lunarwing2/blob/master/ic/vendor/tokio-rustls-0.25.0/README.md Command to execute the provided server example program with certificate and key arguments. ```sh cargo run --example server -- 127.0.0.1:8000 --cert mycert.der --key mykey.der ``` -------------------------------- ### Start Tenant Services Source: https://git.lunarwing.org/lunarwing/lunarwing2/blob/master/docs/ops/MULTITENANCY-PRODUCTION.md Initializes tenant services, including SSH key staging and daemon synchronization. ```bash sudo ic/scripts/lunarwing-mt-admin.sh start-tenant ruffles sudo ic/scripts/lunarwing-mt-admin.sh start-tenant miyuki sudo ic/scripts/lunarwing-mt-admin.sh start-tenant sparkie sudo ic/scripts/lunarwing-mt-admin.sh start-tenant starforce ``` -------------------------------- ### Deploy Voice Sidecar on Bare Metal Source: https://git.lunarwing.org/lunarwing/lunarwing2/blob/master/docs/proposals/lunarvoice-onnx-proposal-2.0.6.0.md Commands to install and start the voice sidecar service on Gentoo using OpenRC. ```bash sudo cp init.d/voice-sidecar /etc/init.d/ sudo chmod +x /etc/init.d/voice-sidecar sudo rc-update add voice-sidecar default sudo rc-service voice-sidecar start ``` -------------------------------- ### Folder Description JSON-LD Format Source: https://git.lunarwing.org/lunarwing/lunarwing2/blob/master/ic/vendor/readabilityrs/tests/test-pages/ietf-1/source.html Example of a JSON-LD document returned by a successful GET request to a folder, containing items and their metadata. ```json { "@context": "http://remotestorage.io/spec/folder-description", "items": { "abc": { "ETag": "DEADBEEFDEADBEEFDEADBEEF", "Content-Type": "image/jpeg", "Content-Length": 82352 }, "def/": { "ETag": "1337ABCD1337ABCD1337ABCD" } } } ```