Skip to content

Instantly share code, notes, and snippets.

View up1's full-sized avatar

Somkiat Puisungnoen up1

View GitHub Profile
@up1
up1 / 1.txt
Last active March 8, 2026 10:33
Install OpenClaw with Ollama
# 1. ติดตั้ง Ollama
$curl -fsSL https://ollama.com/install.sh | sh
# 2. Check version ต้องเป็น v 0.17 ขึ้นไปเท่านั้น
$ollama -v
ollama version is 0.17.7
# 3. ทำการติดตั้ง OpenClaw ผ่าน Ollama model
# โดยใช้งาน kimi model บน cloud
# https://ollama.com/library/kimi-k2.5
@up1
up1 / 1.txt
Last active March 8, 2026 06:45
Install openClaw
# ในการใช้งาน ไม่ควรใช้ root user นะครับ
# ดังนั้นให้ทำการสร้าง non-root user เข้ามาก่อนติดตั้ง เพื่อความปลอดภัย
$sudo adduser openclaw
$sudo usermod -aG sudo openclaw
$su openclaw
# NodeJS 22+
$npm install -g openclaw@latest
@up1
up1 / 1.txt
Last active March 4, 2026 15:38
Agent scan for MCP and Agent skill
$uvx snyk-agent-scan@latest --skills
Installed 53 packages in 72ms
Snyk Agent Scan v0.4.3
● Scanning ~/.codeium Unknown MCP config: ~/.codeium/windsurf/mcp_config.json
Skills dir ~/.codeium/windsurf/skills does not exist
● Scanning ~/.cursor The analysis server returned an error for your request: 429 - Too Many
Requests
@up1
up1 / 1.go
Last active March 2, 2026 08:06
Go fix 1.26
// Until Go 1.25
age := 42
p := &age
// Go 1.26 onwards
p := new(42)
// run go fix
$go fix -newexpr ./...
@up1
up1 / 1.txt
Last active February 28, 2026 08:56
Claude code 2.1.63
$❯ /simplify
⏺ Bash(git diff)
⎿  (No output)
⏺ Bash(git diff HEAD)
⎿  (No output)
@up1
up1 / read.py
Last active February 23, 2026 03:55
Try PageIndex
query = "What are the conclusions in this document?"
doc_id = "your doc id" # This is the doc_id for the same document in step-01.py. You can also use your own doc_id here.
tree = pi_client.get_tree(doc_id, node_summary=True)['result']
print('Simplified Tree Structure of the Document:')
utils.print_tree(tree)
# ตัวอย่างข้อมูล index tree
Simplified Tree Structure of the Document:
[{'title': 'Abstract', 'node_id': '0000', 'summary': 'This text discusses the challenge of gen...'},
{'title': '1 Introduction',
@up1
up1 / 1.txt
Last active February 21, 2026 15:46
MArkdown for Agents
$curl https://blog.cloudflare.com/markdown-for-agents/ \
-H "Accept: text/markdown"
---
description: The way content is discovered online is shifting, from traditional search engines to AI agents that need structured data from a Web built for humans. It’s time to consider not just human visitors, but start to treat agents as first-class citizens. Markdown for Agents automatically converts any HTML page requested from our network to markdown.
title: Introducing Markdown for Agents
image: https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6Df02zjRb4inGPazW51EyD/278afaa16719f1080f12936c35a6c0ef/BLOG-3162_OG.png
---
@up1
up1 / 1.txt
Last active February 17, 2026 13:11
Redis design 01
// ค้นหา word1 และ word 2
ZINCRBY search:freq:2026-02-17 1 "word1"
ZINCRBY search:freq:2026-02-17 1 "word1"
ZINCRBY search:freq:2026-02-17 1 "word2"
// ดูผลการค้นหา
ZREVRANGE search:freq:2026-02-17 0 4 WITHSCORES
// ผล
1) "word1"
@up1
up1 / 1.txt
Last active February 10, 2026 05:16
Agent Browser from Vercel
// ติดตั้ง ต้องใช้งานผ่าน NodeJS
$npm install -g agent-browser
// เปิด web
$agent-browser open https://seleniumbase.io/coffee/
✓ Coffee Cart
https://seleniumbase.io/coffee/
// ทำการดูว่าทั้ง page มี element อะไรบ้าง
$agent-browser snapshot
@up1
up1 / 1.txt
Last active February 3, 2026 07:11
Hello Kimi code
$curl -L code.kimi.com/install.sh | bash
$kimi
╭────────────────────────────────────────────────────────────────────────╮
│ │
│ ▐█▛█▛█▌ Welcome to Kimi Code CLI! │
│ ▐█████▌ Send /help for help information. │
│ │ │
│ Session: c23cbb12-a6da-402a-a4c5-0c346d77efd3 │
│ Model: not set, send /login to login │