今日已更新 35 条资讯 | 累计 37284 条内容
关于我们

标签:#shell

找到 22 篇相关文章

AI 资讯

0 of 3 Articles Published for 3 Days Straight: The 41-Second Timeout Margin That Killed My Automation

For three mornings in a row, my audit log printed the same line: published today: 0 / target: 3 . Nothing crashed. The scripts ran, exited, and produced nothing. The entire cause turned out to be a 41-second margin — a 300-second timeout against a process that actually takes 259 seconds. Changing one number to 600 turned 0/3 into 3/3 the next morning. Some background: I went from earning 100k yen a month as a university student to 600k a month juggling multiple gigs, then lost all of it overnight to a company-initiated layoff. Over the following six months I built an autonomous Claude Code environment, and I'm now above 1.2M yen in monthly revenue. At the core of it is a system that publishes three affiliate articles every morning without a human touching anything. Why this system works The difference between people who keep earning from affiliate marketing and people who drop out is not writing skill, and not a nose for picking products. It's whether you can keep going . Articles that tend to earn on Rakuten Affiliate share a common pattern: spec-comparison articles about home appliances and gadgets priced above 50,000 yen, with lots of reviews and in stock. Robot vacuums, portable power stations, heat-pump washer-dryers, fully automatic coffee makers. The search intent is "I want to compare before I buy," so product link click-through is high and it fits the structure of affiliate marketing well. The problem is cost. Researching the specs of a high-ticket appliance on the web, building a comparison table, and finishing an article good enough to include the "honestly weak points" section takes 30 to 40 minutes. Three articles is close to two hours. Almost nobody has the willpower to repeat that 365 days a year. I don't either. What you need here isn't "trying harder" — it's an environment that keeps running even when you don't try hard . Once the system is built, the running cost is just API calls. The affiliate-factory I built is a simple structure made of four sh

2026-08-15 原文 →
AI 资讯

I Spent 4 Hours Fighting PowerShell 5.1 Quoting Hell to Make Exa MCP Work. Here is the 10-Line Fix That Saved Me

Everything looked perfect. I had mcporter 0.7.3 configured with the Exa MCP server: mcporter list exa # ✅ exa (2 tools) — "Search the web for any topic..." Healthy. Ready. Then I made the first real call: mcporter call "exa.web_search_exa(query: \" ollama cloud models\ ", numResults: 5)" JSON parse error at position 1. Every. Single. Time. I tried every quoting trick known to PowerShell: Backslash escaping --% stop-parsing operator cmd /c wrapper Single-quoted outer strings Same error. The shell was eating my quotes before mcporter ever saw them. This is the full story of how I debugged it, verified on Windows PowerShell 5.1 on July 31, 2026. Chapter 1: The Root Cause - PowerShell 5.1's Dirty Secret PowerShell 5.1 strips ALL embedded double-quotes at the native-argument boundary when passing args to external programs. There is no $PSNativeCommandArgumentPassing in 5.1. That is a PowerShell 7.3+ feature. So this: mcporter call --args '{"query":"test"}' Literally becomes this before Node.js even starts: { query:test } The JSON is destroyed. No shell-level trick can fix it. Stop fighting the shell. Chapter 2: The Hero - A 10-Line Node.js Spawn Wrapper The fix is to bypass the shell entirely with spawn(..., { shell: false }) . Node passes a real argv array, no re-quoting happens. Create mcporter_exa.js : // mcporter_exa.js - The hero const { spawn } = require ( ' node:child_process ' ); const args = process . argv . slice ( 2 ); // --tool <tool> <base64Json> mode, or default web_search_exa const tool = args [ 0 ] === ' --tool ' ? args [ 1 ] : ' exa.web_search_exa ' ; const payload = args [ 0 ] === ' --tool ' ? args [ 2 ] : JSON . stringify ({ query : args [ 0 ], numResults : Number ( args [ 1 ] || 5 ) }); const child = spawn ( process . execPath , [ require . resolve ( ' mcporter/dist/cli.js ' ), ' call ' , tool , ' --args ' , payload ], { shell : false , stdio : ' inherit ' }); child . on ( ' exit ' , ( code ) => process . exit ( code ?? 0 )); Usage: # Web search - que

2026-08-01 原文 →
开源项目

🔥 zhaoxuya520 / reverse-skill - Reverse Engineering / Authorized Penetration Testing / Secur

GitHub热门项目 | Reverse Engineering / Authorized Penetration Testing / Security Research Skill Router Pack AI-powered routing + On-demand toolchain bootstrapping + Self-evolving knowledge base Supports Claude Code, Kiro, Cursor, Cline, and other AI coding clients 逆向/渗透/安全技能路由包 - AI 自动路由 + 按需自举工具链 + 自动进化经验库 | 支持 Claude Code / Kiro / Cursor / Cline 等代码 AI 客户端 | Stars: 10,112 | 612 stars today | 语言: PowerShell

2026-07-31 原文 →
AI 资讯

Auto-Generating an Index of Your Claude Code Custom Agents from Their Frontmatter

This is a continuation of my "Claude Code environment" series. In the previous post, Automatically thinning conversation logs to prevent bloat , I introduced the basic pattern for scheduled launchd jobs. This time I'm using that same mechanism to automatically maintain a list of the custom agents in ~/.claude/agents/ . Dropping a single .md file into ~/.claude/agents/ adds a custom agent, but before long you lose track of how many you have, what model each one uses, and which tools each is allowed to touch. That's exactly what happened to me with the 27 agents I now have. I tried writing an INDEX.md by hand to manage them, and of course within a few days it had drifted from reality. The problem: the index rots Manually updating INDEX.md every time you add a custom agent is not sustainable. You forget you added one and leave it out You change a model later and never reflect it in INDEX.md You typo a name or description and never notice I concluded there was no sustainable way to manage this other than "generate it automatically," so I wrote agents-index.sh . The output: a real INDEX.md Here's how the top of my current ~/.claude/agents/INDEX.md looks. <!-- AUTO-GENERATED by ~/.claude/scripts/agents-index.sh — DO NOT EDIT MANUALLY --> # Agents Index (27 agents · 2026-07-28 02:02) | Name | Model | Description | Tools | |------|-------|-------------|-------| | `architect` ( [ architect.md ]( ./architect.md ) ) | opus | Software architecture specialist ... | ["Read", "Grep", "Glob"] | | `build-error-resolver` ( [ build-error-resolver.md ]( ./build-error-resolver.md ) ) | sonnet | Build and TypeScript error resolution specialist ... | ["Read", "Write", "Edit", "Bash", "Grep", "Glob"] | | `doc-updater` ( [ doc-updater.md ]( ./doc-updater.md ) ) | haiku | Documentation and codemap specialist ... | ["Read", "Edit", "Bash", "Grep", "Glob"] | Four columns: Name, Model, Description, and Tools. You can see at a glance how the models break down across opus / sonnet / haiku , and i

2026-07-29 原文 →
AI 资讯

How Claude Code Detects Its Own Weekly Rot and Repairs Itself

Your Claude Code setup doesn't break in one dramatic moment — it degrades a few bytes at a time, and by the time you notice, you've been paying a context tax for weeks. In a previous post I covered running an unattended daily health check with launchd. This one is the follow-up: a three-layer loop that detects that quiet degradation weekly and hands the repair job to claude -p itself. The problem: environments rot quietly if you leave them alone Some things in a Claude Code environment grow just from doing your normal work. ~/.claude/rules/ and MEMORY.md keep getting appended to, until context injection quietly crosses 40KB Experimental agent definition .md files never get archived, leaving dozens to nearly a hundred files under ~/.claude/agents/ permanently loaded Stop hooks fire over and over, creating a hook spam condition Frustration-signaling words pile up in conversation logs and nobody notices A performance audit on 2026-07-11 revealed that "agents I thought I'd archived were still being injected — 99 of them," and that turned out to be the main cause of the degraded experience. That led to the question "so do I have to go check this every week myself?" — and the answer was to automate it , which is what cc-self-audit.sh does. Five degradation metrics and their thresholds The script measures five metrics and flags "red" when any of them crosses its threshold. # 閾値(env変数で上書き可) TH_INJECT_BYTES = " ${ SELF_AUDIT_TH_INJECT :- 40000 } " # rules+CLAUDE.md+MEMORY.md 合計バイト TH_AGENTS = " ${ SELF_AUDIT_TH_AGENTS :- 60 } " # ~/.claude/agents 配下 .md 総数(再帰) TH_STOPSPAM = " ${ SELF_AUDIT_TH_STOPSPAM :- 15 } " # 監査hook発火/週 TH_FRUSTRATION = " ${ SELF_AUDIT_TH_FRUST :- 8 } " # 不満ワード/週 TH_TOOLERR = " ${ SELF_AUDIT_TH_TOOLERR :- 400 } " # tool失敗/週 The first three are static metrics (state at this exact moment); the last two are dynamic metrics (trends since the previous run). That distinction maps directly onto how each one is measured, as described below. Overall design: a thr

2026-07-26 原文 →
AI 资讯

Creating my own shell for unix

Building Astra: A Modern Shell in Rust I've been working on a personal project called Astra , an interactive shell written in Rust. The goal isn't to replace every existing shell overnight. Instead, I'm building a clean, modular foundation that's easy to understand, extend, and contribute to. Some of the features currently in development include: Interactive shell loop Customizable prompt system TOML-based configuration Built-in themes Git-aware prompt Command history Tab completion Alias support Plugin framework (early development) Alongside the shell itself, I'm also putting together the surrounding ecosystem—documentation, packaging, examples, tests, and GitHub automation—so contributors have a solid starting point. This project has been a chance to learn more about Rust, shell design, and how larger open-source projects are organized. It's still early, but it's reached the point where the foundation is in place and I'm beginning to focus on expanding features, improving reliability, and increasing test coverage. Check out the project here: astra-shell / astra-shell A custom shell for mac OS! █████████████░░░░░░░░ 65% Astra Shell A modern shell built in Rust for Unix-like systems, with macOS as the primary development platform. Astra is an interactive command-line environment focused on a clean interface, customization, and a better terminal experience. It combines the power of traditional Unix shells with a modern prompt system, configuration, and extensibility. Warning Astra Shell has not gone through extensive testing yet. Wait until the first stable release before using it as your primary shell. Table of Contents Features Screenshots Installation Requirements Usage Themes Why Astra? Contributing License Status Features Interactive Rust shell Configurable prompt engine Multiple built-in themes Git-aware prompt information Command history Tab completion Alias support TOML configuration Built-in shell commands Modular architecture Plugin framework (in developmen

2026-07-26 原文 →
AI 资讯

How to Actually Protect Yourself From wp2shell (Not Just "Update WordPress")

Everyone's telling you the same thing right now: update WordPress. Which is, fine, yes, obviously but that's not enough. Patching closes the hole. What is someone is already In your system? So let's actually walk through this properly what to do right now, what to do if you can't patch immediately, and what to do if you think you were already hit. Need more context? I wrote a summarising one here. wp2shell: The Bug That Turned an Empty WordPress Install Into a Shell Aditya Pidurkar Aditya Pidurkar Aditya Pidurkar Follow Jul 22 wp2shell: The Bug That Turned an Empty WordPress Install Into a Shell # wordpress # wp2shell # cybersecurity # cve Add Comment 4 min read S1: Stop assuming you're patched. Go check. WordPress flipped on forced automatic background updates for this one because of how serious it is. That's great, except "forced" doesn't mean "guaranteed", VERIFY IT. Go look at your actual running version right now: In the dashboard: wp-admin > Updates Via WP-CLI, if you have shell access: wp core version You want to see 7.0.2 if you're on the 7.0 line, or 6.9.5 if you're on 6.9. If you see anything else — 6.9.0 through 6.9.4, or 7.0.0/7.0.1 — you're still exposed. Update it now!! Come back when done. A few situations where the forced update quietly doesn't happen, in what I read on internet: Managed hosting environments where the host controls the update pipeline and hasn't pushed it yet Sites with a "disable auto-updates" plugin installed months ago for stability reasons and never revisited wp-config.php with WP_AUTO_UPDATE_CORE explicitly set to false Staging or dev environments nobody thinks of as "production" but that are still internet-facing If any of that describes you, don't wait on the automation. Update manually. S2: If you genuinely can't update right now, here's your stopgap aybe you're facing a compatibility issue, a change freeze, or a custom plugin that isn't ready yet. It happens. If you need a little more time before applying the real fix, here'

2026-07-23 原文 →
科技前沿

How to align columnar output in the terminal

In bioinformatics we are handling a lot of tabular data. Be it VCF files, tabular Blast output, or just creating a CSV or TSV samplesheet. Actually, one of my favorite tabular formats is by using SeqKit to convert Fasta or FastQ files to tabular format, as this allows to do various filtering operations by row , using standard unix tools if so wished. Scrolling through this type of data in the terminal can be messy to say the least though. Although CSVs can of course be imported into a spreadsheet software for viewing, it would be very powerful to be able to view them comfortably right from the terminal, isn't it? To take one example that fits within the code window of a blog post, let's take a selected set of columns from the CSV output from the Mykrobe tool. And to make it emulate another common problem with many csv formats, let's also use tr to convert the _ :s in the headers into real spaces (Mykrobe does not do this, but many other tools do): $ cat SOME_SAMPLE.csv | cut -d , -f 2,3,10,14,15,17,18 | tr '_' ' ' > selection.csv $ cat selection.csv "drug" , "susceptibility" , "kmer size" , "phylo group per covg" , "species per covg" , "phylo group depth" , "species depth" "Amikacin" , "S" , "21" , "99.672" , "98.428" , "372" , "347" "Capreomycin" , "S" , "21" , "99.672" , "98.428" , "372" , "347" "Ciprofloxacin" , "S" , "21" , "99.672" , "98.428" , "372" , "347" "Delamanid" , "S" , "21" , "99.672" , "98.428" , "372" , "347" "Ethambutol" , "S" , "21" , "99.672" , "98.428" , "372" , "347" "Ethionamide" , "S" , "21" , "99.672" , "98.428" , "372" , "347" "Isoniazid" , "R" , "21" , "99.672" , "98.428" , "372" , "347" "Kanamycin" , "S" , "21" , "99.672" , "98.428" , "372" , "347" "Levofloxacin" , "S" , "21" , "99.672" , "98.428" , "372" , "347" "Linezolid" , "S" , "21" , "99.672" , "98.428" , "372" , "347" "Moxifloxacin" , "S" , "21" , "99.672" , "98.428" , "372" , "347" "Ofloxacin" , "S" , "21" , "99.672" , "98.428" , "372" , "347" "Pyrazinamide" , "S" , "21" , "99.672"

2026-07-07 原文 →
AI 资讯

Most AI dev tools assume you have a repo. Ops engineers have a broken node and a 3am page.

Most AI coding tools assume you're sitting in front of a repo. There's a working directory, some source files, tests, maybe a CI pipeline. The AI reads your code, suggests changes, ru****ns tests. Great model — if you're a developer writing code on a Tuesday afternoon. Now picture the other scenario. It's 2am. PagerDuty fires. You SSH into a box you haven't touched in three months. Something is broken, you're not sure what, and the runbook was last updated by someone who left the company in 2022. You're not thinking about repos. You're thinking: what OS is this thing running? What just failed? Is it safe to restart that service or will I make it worse? These are two fundamentally different workflows. But almost every AI terminal tool I've seen is built for the first one. The 30 minutes nobody builds for There's a ton of tooling for the world before you log into the box: Prometheus, Grafana, PagerDuty, incident.io, runbooks, dashboards. All useful. No complaints. But there's this practical 30-minute window after you SSH in where you're basically doing archaeology with journalctl and grep. You check systemd. You look at disk. You read logs that were clearly written by someone who hated future-you. You copy-paste terminal output into Slack so your teammate can squint at it from a different timezone. This is where I think AI could actually help. Not by replacing Grafana. Not by building another dashboard. Just by being present in the shell while you're debugging. Please, for the love of uptime, don't replace my shell I've seen a few AI terminal projects that basically build an entire new terminal experience from scratch. New keybindings, new UI, new everything. Here's the thing: ops people have muscle memory. We have aliases we wrote in 2019 and forgot about. We have tmux configs we'd defend with our lives. We SSH through jump hosts with key forwarding chains that barely work but have worked for years so nobody touches them. If your AI tool requires me to abandon all of

2026-06-19 原文 →
AI 资讯

I stopped trusting curl | sh — so I built a tool that reads the script first

Every developer has done it. You hit a README, you see the install command: curl -fsSL https://example.com/install.sh | sh And you run it. Maybe you skim the script first. Maybe you don't. But you run it. I've been doing this for years. And each time, a small voice in the back of my head says: you have no idea what that script actually does. You just piped a stranger's code straight into your shell. Eventually I got tired of ignoring that voice. What the pattern actually is curl | sh is not a bad pattern — it's a fast, convenient pattern with a real trust gap. The script runs with your permissions, in your shell, right now. It can: Install something with sudo Delete files with rm -rf Write to your disk with dd Access your SSH keys or .env files Set up a cron job or a systemd service that runs again next reboot Decode and run a payload with base64 | eval Most install scripts do none of these things maliciously. But many do several of them legitimately — and you wouldn't know which ones until something went wrong. --- ## What I built instead I'm a solo founder based in Ouagadougou, Burkina Faso. I build with heavy AI pairing — I'm not a trained engineer, I work with Claude, review the output, and ship. This tool ( peek ) was AI-paired and reviewed by me before release. peek is a ~130-line POSIX shell script that sits in front of the pattern: # Instead of: curl -fsSL https://example.com/install.sh | sh # Do: peek https://example.com/install.sh Before anything runs, peek: Fetches the script Scans it for risky patterns Prints a risk score and the exact dangerous lines Asks you to confirm — and refuses to auto-run a HIGH-RISK script unless you type RUN You can also pipe into it, or run it in analysis-only mode: curl -fsSL https://example.com/install.sh | peek # analyze from a pipe peek --print ./downloaded.sh # never runs, analysis only What it flags (and what it doesn't) The patterns peek checks: Root escalation — sudo , running as root Destructive file ops — rm -rf , fi

2026-06-17 原文 →
开发者

一個很小但很好用的 zsh 技巧:修改上一個指令

有時候我剛跑完一個指令,馬上發現其實只需要改其中一小部分。 例如我剛用 ffmpeg 轉了一個影片: ffmpeg -i calligraphy01.mp4 -c :v libx264 -c :a aac calligraphy_good_01.mp4 然後我想用同樣的指令處理下一個檔案: ffmpeg -i calligraphy02.mp4 -c :v libx264 -c :a aac calligraphy_good_02.mp4 如果用傳統方法,我可能會按上箭頭,然後手動把兩個地方的 01 改成 02 。 但在 zsh 裡,可以直接輸入: !! :gs/01/02/ 意思是: 拿上一個指令,把所有的 01 都換成 02 ,然後執行。 所以這個: !! :gs/01/02/ 會展開成: ffmpeg -i calligraphy02.mp4 -c :v libx264 -c :a aac calligraphy_good_02.mp4 語法是什麼意思? !! 代表「上一個指令」。 :gs/01/02/ 代表「把所有 01 全部替換成 02 」。 所以完整的: !! :gs/01/02/ 意思就是: 使用上一個指令,把所有 01 改成 02 ,然後執行。 先預覽,不要馬上執行 有時候我不想讓它立刻執行,尤其是指令比較長、比較重要,或者執行成本比較高的時候。 這時可以加上 :p : !! :gs/01/02/:p 它會只印出修改後的指令,不會執行: ffmpeg -i calligraphy02.mp4 -c :v libx264 -c :a aac calligraphy_good_02.mp4 如果看起來沒問題,就按一下 上箭頭 ,把剛剛印出的指令帶回命令列,再檢查一次,然後按 Enter 執行。 比較安全的流程就是: !! :gs/01/02/:p 確認輸出結果後: 上箭頭 → 再看一次 → Enter 這對比較長、比較容易打錯、或不想立刻執行的指令很有用。 只替換第一個地方 如果你只想替換第一個出現的地方,也可以用: ^01^02 不過像上面的 ffmpeg 例子,輸入檔名和輸出檔名裡都有 01 ,所以通常會比較適合用: !! :gs/01/02/ 這種小技巧每次可能只省幾秒鐘,但如果你常常在 command line 裡重複處理檔案、日期、編號、影片、圖片或 migration,累積起來真的會讓工作順很多。

2026-06-13 原文 →
AI 资讯

I built a Brave debloater that refuses to brick your browser

(yes, its open source. link at the bottom, if u want to skip ahead!) Most "debloat scripts" are a pile of registry edits you run as admin and pray. No preview, no undo, and half of them happily disable Safe Browsing or updates for "performance." For your browser, the most security-sensitive app you run, that's reckless. So I built BraveDebloater with one rule: never make Brave less safe. It clears out the noise like Rewards, Wallet, VPN nags, Leo AI prompts, News, and telemetry such as P3A, Web Discovery, and Chromium metrics. But it flat-out refuses to disable Shields, weaken Safe Browsing, turn off updates, or touch your hosts file. That isn't a README promise. It's enforced in the tool itself. A few things that make it trustworthy: Dry-run by default. Nothing changes until you explicitly apply. Official Brave/Chromium enterprise policies, so every change is visible and auditable in brave://policy instead of hidden. Automatic backups before any change, written safely so you never end up with a corrupted file. Validated restore that checks the backup before writing anything and only touches Brave's own policy and profile files. Doctor mode, a read-only health check of your current policy state with no writes. It's MIT-licensed, PowerShell 5.1 compatible, and has a few beginner-friendly issues open. If you care about privacy or Windows tooling, I'd love a star and a PR. Check it out at: https://github.com/osfv/BraveDebloater

2026-06-04 原文 →