Skip to content

Instantly share code, notes, and snippets.

View yokawasa's full-sized avatar
:octocat:
debugging

Yoichi Kawasaki yokawasa

:octocat:
debugging
View GitHub Profile
@yokawasa
yokawasa / setup-iam-role-bedrock-agentcore-runtime.sh
Last active September 7, 2025 06:37
IAM role for Bedrock Agent Runtime
# This is fully refered by https://qiita.com/inoue_d/items/e38940fff7a31b8fc7c7
# リージョンは us-east-1 を指定する。As of 2025-09-07 US East (N. Virginia), US West (Oregon), Europe (Frankfurt), Asia Pacific (Sydney) are avaiable
set -e -x
export AWS_REGION=us-east-1
# アカウントIDの取得
export AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text)
# 信頼関係
@yokawasa
yokawasa / ai-agent-architecture.md
Last active September 6, 2025 00:49
AI Agent System Architecture Overview

アーキテクチャ概要

graph TD
  subgraph クライアント
    APP[PC/Mobileアプリ]
  end
  APP --> GW[APIゲートウェイ]
  GW --> ORCH[Agent Orchestrator]
 ORCH --> POL[ポリシー/ガードレール]
@yokawasa
yokawasa / postman-cli-env-bar.md
Last active September 6, 2025 00:50
Postman CLIでPostmanコレクションまたはフォルダーレベルのテスト実行時にクレデンシャル情報をenv-bar経由で渡す方法

Postman CLIのenv-barオプションについて

Postman CLIでは、コレクション(or フォルダ)配下のテスト実行時に次のように--env-barオプションで環境変数の情報を指定できる

postman login --with-api-key <postman-api-key>
postman collection run <Collection ID> -i <Folder ID> --env-var key=value

この機能を利用すれば、もしあるAPIリクエスト設定で秘匿情報を扱う必要がある場合、その秘匿情報(ここではAPIキー)を次のように変数化({{api-key}})しておけば、実行時に秘匿情報を外部から注入が可能となる

@yokawasa
yokawasa / awk-tree
Created July 19, 2025 23:04
AWK version of tree command
#!/bin/sh
# ディレクトリが指定されていればそれを使用、なければ現在のディレクトリを使用
[ -d "$1" ] && DIR=$1 && shift || DIR=.
# ディレクトリを絶対パスに変換
(cd ${DIR}; pwd)
# ディレクトリ内のファイルとサブディレクトリをリストアップし、ツリー形式で表示
find "${DIR}" | \
awk -v dir="${DIR}" '
function is_dir(path, cmd, result) {
cmd = "test -d \"" dir path "\" && echo 1 || echo 0"
@yokawasa
yokawasa / update-postman-collection.yml
Last active June 21, 2025 23:07
GitHub Actions that update Postman Collection based upon OpenAPI Spec using openapi-to-postman
name: Update Postman Collection
on:
pull_request:
branches: [main]
types: [opened, synchronize]
env:
# OpenAPI file path
OPENAPI_FILE: oas/openapi.yaml
@yokawasa
yokawasa / github-markdown-sandbox.md
Created April 13, 2025 02:50
GitHub markdown sandbox
@yokawasa
yokawasa / sample-openapi.yaml
Last active March 4, 2025 17:19
Simple samples of Postman Collection and OpenAPI (3.0 format). Both are minimal examples focused on the function of "getting user information".
openapi: 3.0.3
info:
title: Sample API
version: 1.0.0
servers:
- url: https://api.example.com
paths:
/users:
get:
summary: Get all users
@yokawasa
yokawasa / openai-realtime-agents.md
Last active January 18, 2025 18:00
OpenAI Realtime Agents Samples
@yokawasa
yokawasa / PerformanceTesting.postman_collection.json
Last active December 16, 2024 22:52
Postman Collection for Performance testing demo
{
"info": {
"_postman_id": "cedf3ee2-a25e-4f23-ad84-faab47425225",
"name": "PerformanceTesting",
"description": "# About this collection\n\nThis collection is designed to help you test the performance of your API endpoints with varying sizes of query parameters. The collection contains pre-built requests that simulate large and small query parameters to assess how well your API handles different loads.\n\nUsing this collection, you can identify potential bottlenecks or performance issues in your API, enabling you to optimize and enhance the overall performance.\n\n## **Using the collection**\n\n**Step 1:** Replace the placeholders in the URLs and parameters with your own API base URLs and relevant query parameters.\n\n**Step 2 (optional):** Modify the sizes of the query parameters to reflect your specific use case better. You can create multiple requests with varying parameter sizes to test your API's performance thoroughly.\n\n**Step 3:** Run the collection using Postman's Collection Runner or Postman
@yokawasa
yokawasa / api-contract-samples.md
Created November 18, 2024 22:34
API Contract Samples

OpenAPI Spec

openapi: "3.0.0"
info:
  title: Sample API
  version: "1.0"
paths:
  /user/{id}:
    get: