Posts

[How To] Retrieve API keys in OpenClaw

Image
Agent and CLI tools often save the API credentials you sign in with to a hidden folder in your home directory. If you have been using the openclaw tool and need to find the Anthropic API key or Bearer token it stored, for example to reuse it elsewhere or to rotate it, you can locate it in a few seconds with grep . This short tutorial shows how. Note: "spi keys" in the URL is a typo for "api keys". Step 1: Go to the config directory openclaw keeps its per-agent configuration under a hidden .openclaw folder in your home directory: cd ~/.openclaw/ Step 2: List what is there List the contents, including hidden files, so you can see the agent folders: ls -loa Each agent typically has its own subfolder under agents/ , and the credentials live in an auth-profiles.json file inside it. Step 3: Search for the keys Rather than opening each file by hand, recursively grep the whole directory for the two token formats. Anthropic keys begin with sk-ant- , and OAuth-st...

[Fix] imsg: Bad CPU type in executable

Image
Terminal — fixing Bad CPU type $ arch i386 $ imsg .../libexec/imsg: Bad CPU type in executable $ make build Built bin/imsg (arm64 x86_64) universal imsg is a handy command line tool that reads the macOS Messages database so you can query your iMessages from the terminal. After installing it with Homebrew, you may hit this error the moment you run it: /usr/local/bin/imsg: line 2: /usr/local/Cellar/imsg/0.5.0/libexec/imsg: Bad CPU type in executable /usr/local/bin/imsg: line 2: /usr/local/Cellar/imsg/0.5.0/libexec/imsg: Undefined error: 0 This post explains what causes it and the fix that actually worked: building a universal binary from source. What "Bad CPU type in executable" means That error appears when the architecture of the binary does not match the architecture your shell is running under. On an Intel Mac, or on an Apple Silicon Mac running a terminal under Rosetta, the process expects an x86_64 binary, but the installed imsg binary was built only for arm64 (...

[How To] Take ICAO 630*810 Photo

Image
ICAO Passport Photo: 630 x 810 px 630 px 810 px Specification ✓ Format: JPG ✓ Dimensions: 630 x 810 pixels (7:9) ✓ File size: about 10 KB to 250 KB ✓ Background: plain, light, no shadow ✓ Face: centred, neutral, eyes open ✓ No glasses glare; remove if unsure iPhone → convert HEIC to JPG → crop in Paint → compress Several Indian government photo uploads, including Passport Seva and OCI services, expect a digital photograph that is exactly 630 x 810 pixels, follows ICAO face-geometry rules, and stays under a strict file-size limit. You do not need a studio or paid software for this. With a recent iPhone, a plain wall, and the built in Paint app on Windows, you can produce a compliant photo in a few minutes. This tutorial walks through the full process. What the photo has to satisfy Before editing, it helps to know the target. An ICAO-style passport photo for these portals generally needs to be 630 pixels wid...

RAG Architecture + Multi-GPU Training (DDP, FSDP, ZeRO)

Image
RAG Architecture + Multi-GPU Training (DDP vs FSDP vs ZeRO) – Complete Production Guide 2026 RAG Architecture + Multi-GPU Training: Complete Production Guide (2026) 🚀 This guide covers: RAG pipelines, LangChain + FAISS, DDP vs FSDP vs ZeRO, security defenses, and cloud deployment. What is Retrieval-Augmented Generation (RAG)? Retrieval-Augmented Generation (RAG) is a hybrid AI architecture that enhances Large Language Models (LLMs) by integrating external knowledge retrieval into the generation process. Instead of relying solely on pre-trained parameters, RAG dynamically fetches relevant information from a vector database at inference time. RAG significantly reduces hallucinations and enables real-time knowledge updates. A typical RAG system consists of three core stages: Ingestion: Documents are chunked, embedded, and stored in a vector database. Retrieval: Queries are embedded and matched using similarity search. Generation: Retriev...

(My)SQL Injection Attack [Tutorial]

Image
Imagine you're baking a delicious batch of cookies, following your grandma's secret recipe. But then, a mischievous squirrel sneaks in and replaces a pinch of cinnamon with a dash of…mystery powder! That's kind of like an SQL injection (SQLi) attack. Hackers, like mischievous squirrels, exploit website vulnerabilities by sneaking malicious code into user input fields. This "mystery powder" can trick the website's database (the oven) into baking something entirely different – maybe stealing your recipe, adding unwanted ingredients, or even burning the whole batch! Thankfully, website bakers have special tools like data validation and locking cabinets to keep their ovens squirrel-proof and cookies safe. So, next time you trust a website with your information, remember: just like you wouldn't share your grandma's secret recipe with a squirrel, be careful what you input online. Keep your digital cookies safe from sneaky squirrels! Let's crack open the...

[How To] Unfollow Non-followers on Instagram

Image
This tutorial walks you through the fastest and safest way to find and unfollow Instagram users who don't follow you back without logging in to third-party services, downloading browser extensions, or installing apps or software.  Following the 15 steps mentioned in this article, you will end up with the accounts you follow but who don't follow you back. You need to go to each profile manually to unfollow them. Step 1 - Go to  https://www.instagram.com/ and log in with your credentials. Step 2 - Go to " Profile " (button with your display picture) >> " Settings and privacy " (button with the gear icon) >> " See more in Accounts Center ."

Simplify Rational Numbers in Python

Image
Real Numbers Rational Numbers 7.92 2/5 1/2 Integers Numbers -3 -2 -9 -7 -10 Whole Numbers {0, 1, 2, 3, ...} Natural Numbers {1, 2, 3, 4, 5, ...} Irrational Numbers √10 π √2 φ The real number system: rational numbers (with natural, whole, and integers nested inside) alongside irrational numbers. What Is a Rational Number? A rational number is any number that can be expressed as a fraction of two integers, where the numerator is a whole number and the denominator is a non-zero integer. The decimal form of a rational number either ends (terminates) or repeats infinitely. [1, 2, 3, 4] Key Characteristics and Forms Rational numbers encompass a wide variety of numbers, which can always be categorized into these four main forms: Integers: All whole numbers, both positive and negative, are rational because they can be written as a fraction over 1 (e.g., 5 = 5/1, -3 = -3/1). Fractions: Any standard or mixed fraction where the top and bottom are integers (with a de...