Shell file redirection truncates the destination file immediately when a pipeline starts, before any data is written. This creates a risk of data loss if the pipeline fails midway — for example, overwriting a valid database backup with an empty or partial file. The safe pattern is to redirect output to a temporary file first, then use mv to atomically rename it to the final destination (ensuring both files are on the same filesystem). The post uses strace to verify the truncation behavior and confirm atomic renames via renameat2 syscalls.
Nguồn: https://nickjanetakis.com/blog/watch-out-for-data-loss-when-redirecting-to-a-file-in-a-shell-script. 8sync News chỉ tóm tắt và dẫn link; bản quyền nội dung thuộc tác giả và nguồn gốc.
Microsoft vừa phát hành Intelligent Terminal phiên bản 0.1.1 với nhiều cải tiến mới. Tính năng phát hiện và đề xuất sửa lỗi tự động giờ đây hỗ trợ Bash và WSL Bash, ngoài PowerShell. Bản cập nhật bổ sung lệnh /fix để người dùng chủ động yêu cầu trợ giúp khi lệnh thất bại, cùng /model picker để chuyển đổi mô hình AI giữa phiên. Giao diện agent được tùy biến thành Profile với tùy chọn font, màu sắc và độ mờ, đồng thời hỗ trợ Windows 10 từ bản dựng 19041 trở lên. Ngoài ra, phiên bản này cũng khắc phục các sự cố quản lý phiên, hiển thị agent trống sau lần đăng nhập đầu tiên, trạng thái tab lỗi thời khi đóng pane và đường dẫn thực thi agent.

Khi dùng hệ thống quản lý phiên bản jj, gõ nhầm thêm jj trong dòng lệnh sẽ gây lỗi. Cách khắc phục sạch là tạo alias jj trong config của jj, trỏ đến jj util exec -- jj, dùng -- để ngăn phân tích cú pháp và truyền toàn bộ tham số phía sau trực tiếp đến lệnh jj lồng bên trong, giúp xử lý nhiều tiền tố jj lặp lại một cách chính xác.
Lập trình viên nên đọc bài này để tránh lỗi nhầm lẫn và tự động hóa các trường hợp nhập sai lệnh trong GitHub JJ, tiết kiệm thời gian và tránh rắc rối khi làm việc với hệ thống quản lý phiên bản.

A practical guide to identifying which regular expression features work across multiple tools — specifically sed, awk, grep, and Emacs. The strictest portable subset includes only literals, character classes, and basic special characters. Using GNU versions with the -E flag expands compatibility, with awk serving as the lowest common denominator. Emacs is the main oddball, requiring backslashes before metacharacters like +, ?, (, ), {, }, and | and using different whitespace class syntax. A consolidated list of features that work across all four tools is provided, including dot, anchors, character classes, quantifiers, alternation, capturing groups, backreferences, and word boundary markers — with a caveat about gawk's backreference support.

Using plain text files as a lightweight user interface for CLI programs sits between simple argument-passing and building a full TUI. The approach leverages the $EDITOR environment variable pattern (familiar from git commit, crontab -e, visudo) to let users edit a persistent text file that a script then reads and acts on. Two concrete examples are shown: a Ruby-based image gallery ingestion tool that reads an inbox.txt for metadata, and a yt-dlp wrapper that opens a settings file in Vim pre-populated with available subdirectories as comments. Key advantages include zero UI programming, editor-agnostic design, persistent input history via undo, and reuse of previous settings across runs.
A practical guide to applying LUT (Look-Up Table) color grading to Log video footage using ffmpeg's built-in lut3d filter, avoiding the need to open DaVinci Resolve or Final Cut Pro. Covers the full ffmpeg command with Apple hardware H.265 encoding flags, explains the -vf "lut3d=file.cube" filter, and includes a bash script for batch-converting entire folders of Log MP4 files. Also touches on the lack of a universal LUT sidecar standard across camera manufacturers.
A walkthrough of a custom Lua script for mpv that enables visual video clip creation using chapter markers and FFmpeg. The script adds four key bindings to set start/end markers, create clips, and clear markers. FFmpeg handles the actual clip extraction without re-encoding. Quality-of-life features include auto-pausing after setting the end mark, on-screen timestamp display, safe auto-incrementing file names, and preserving the original file's modification timestamp.