惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Secure Thoughts
雷峰网
雷峰网
罗磊的独立博客
T
The Blog of Author Tim Ferriss
阮一峰的网络日志
阮一峰的网络日志
量子位
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
云风的 BLOG
云风的 BLOG
人人都是产品经理
人人都是产品经理
GbyAI
GbyAI
Cisco Talos Blog
Cisco Talos Blog
Engineering at Meta
Engineering at Meta
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
A
About on SuperTechFans
D
Darknet – Hacking Tools, Hacker News & Cyber Security
The Cloudflare Blog
Know Your Adversary
Know Your Adversary
T
Threat Research - Cisco Blogs
Spread Privacy
Spread Privacy
D
DataBreaches.Net
T
The Exploit Database - CXSecurity.com
K
Kaspersky official blog
Cyberwarzone
Cyberwarzone
爱范儿
爱范儿
U
Unit 42
Security Latest
Security Latest
M
MIT News - Artificial intelligence
月光博客
月光博客
Scott Helme
Scott Helme
G
Google Developers Blog
有赞技术团队
有赞技术团队
T
Tor Project blog
宝玉的分享
宝玉的分享
Y
Y Combinator Blog
博客园 - Franky
H
Hackread – Cybersecurity News, Data Breaches, AI and More
aimingoo的专栏
aimingoo的专栏
The GitHub Blog
The GitHub Blog
V
V2EX
B
Blog
Apple Machine Learning Research
Apple Machine Learning Research
S
Securelist
博客园 - 三生石上(FineUI控件)
Blog — PlanetScale
Blog — PlanetScale
TaoSecurity Blog
TaoSecurity Blog
Stack Overflow Blog
Stack Overflow Blog
P
Proofpoint News Feed
腾讯CDC
D
Docker
Google Online Security Blog
Google Online Security Blog

Stonecharioteer on Tech

I Traced My Traffic Through a Home Tailscale Exit Node What Was I Reading Last? In Three Not-So-Easy Pieces Dogfooding Is Hard Code blocks in your books, finally GoForGo v0.9.0 Merrilin - We built an app to read books I use a Macbook now Data Structures & Algorithms - Preparing for Interviews Using a local DNS namespace for local service discovery Direction KOllector - Publishing KOReader Highlights gbt: branches touched in the last 24 hours A Soiree into Symbols in Ruby Some Smalltalk about Ruby Loops Ruby Blocks Returning from Ruby Blocks, Procs and Lambdas My Linux Laptop Finally Works: How Claude Helped Me Fix Years of Annoyances TIL: Watchexec - Modern File Watching for Development Workflows A Less Busy Mind GoForGo - Learn Go through live examples Migrating My Old Blog to Hugo with Claude The Qtile Window Manager: A Python-Powered Tiling Experience Read the RFCs that Built the Internet Py-x-Protobuf - Or How I Learned to Stop Worrying and Love Protocol Buffers Python Reverse a List New Beginnings Leaving ChainSafe Systems Screen Lock for Cinnamon Desktop using Zenity and Terminal Commands Crews Not Teams A System for Getting Better at LeetCode So Far So Rust Retrying HTTP Requests with Rust A Primer on Control Charts Learning Rust Explicit is Better than Implicit: Rust for Pythonistas Using Custom Delimiters in Jinja Templates TIL: Creating Fixed Length Iterables in Python Documentation Without Assumption Vagrant Python - A Reflection in 2022 Learning Golang No, A Virtual Machine Is Not Enough: Why Developers Need Native Linux Empathy in Tech For Those Who Came in Late A Weekend With PostgreSQL TIL: Gooey and Python Fire for Quick GUIs and CLIs TIL: 2ality - Dr. Axel Rauschmayer's JavaScript Blog TIL: MassDNS - High-Performance Bulk DNS Lookups TIL: Matomo Analytics, Google Tech Writing, Memory Programming, and NES TV Signals TIL: MontyDB - MongoDB Implemented in Python Returning to the Craft of Programming TIL: CPUFetch, OneFetch, and Learn CSS TIL: DNS Performance Testing and Pi-hole with Unbound TIL: Eli Bendersky's Blog, Awesome By Example, NoCoDB, and Martin Kleppmann TIL: CRDTs, Extreme HTTP Performance, and BYTEPATH Game TIL: AutoInvent, ASGI, Python Packaging, RAPIDS GPU Computing, and FlaskCon TIL: MangaDesk - Terminal Client for MangaDex TIL: McFly - Smart Shell History Search TIL: Siege Load Testing and Awesome FastAPI Resources TIL: Ventoy Bootable USB and Justniffer Network Analysis TIL: CLI Code Review, Git Split Diffs, and Internal Combustion Engine TIL: Benford's Law, Web Security Headers, Event Sourcing, and Mozilla Security Guidelines How to Write Documentation - The README.md File The Importance of Documentation TIL: NNgroup UX Research, SponsorBlock, and Labella Python Library TIL: The Little Book of Rust Macros and Rust Performance Book TIL: Git-Bug Distributed Issue Tracker and Omni Kubernetes Monitoring TIL: Zellij - Modern Terminal Multiplexer TIL: How Discord Handles 2.5 Million Concurrent Voice Users TIL: Volumio - The Audiophile Music Player TIL: Areopagitica - Milton's Defense of Free Speech TIL: Fast Node Manager, Zoxide Smart CD, Technical Writing, PyO3, and Qubes OS TIL: Slurm Workload Manager for HPC Clusters TIL: Data Visualization Guide and Oso Authorization Academy TIL: CORS Deep Dive, Piku Tiny PaaS, Rust Strings, and Deno Standard Library TIL: Raspberry Pi OS Development, Vim Beginner Guide, Password Management, and QueryBook TIL: uBlock Origin Performance Optimization on Firefox TIL: Breaking PostgreSQL at Scale and LeetCode Problem Patterns TIL: Awesome Tmux Resources for Terminal Multiplexing TIL: Grit - A Multitree-Based Personal Task Manager TIL: Lens 4.2 Kubernetes IDE, Shell Scripting Guide, and Dark HTTP Server Do The Job You Hate So You Won't Hate The Job You Love TIL: Innernet VPN Solution and NoteCalc Calculator App TIL: Argo CD for GitOps and Lens Kubernetes IDE TIL: Modern Rust CLI Tools - System Monitoring, HTTP Requests, and DNS TIL: tz - A Time Zone Helper Tool TIL: Distributed Systems Education, Fallacies, and Self-Hosted Internet Archiving TIL: Real-Time Voice Cloning Technology TIL: ChartMuseum for Helm, AMD's Corporate Journey, and Kubernetes Pod Scaling TIL: Docker and Kubernetes Tools - Whaler, Descheduler, and Dive TIL: Post-Mortem Collection, Terminal Plotting, and Technical Twitter TIL: Dark Mode Toggle Web Component by Google Chrome Labs TIL: Python eval(), exec(), and compile() Functions TIL: Camelot PDF Tables, PostgreSQL Row Level Security, Zerodha Varsity, and Write Yourself a Git TIL: fuser Command for Process and File Investigation TIL: i Hate Regex - The Ultimate Regex Cheat Sheet TIL: Dolt - Git for Data and Database Version Control TIL: x86 Assembly Programming and SafeEyes Break Reminder TIL: Comprehensive Distributed Systems Reading List TIL: Cosmopolitan C Library, Distributed Systems Book, High Performance Browser Networking, and Rust Roguelike Tutorial
TIL: Modern Web Development Tools and Command-Line Utilities
2019-01-01 · via Stonecharioteer on Tech

Today I discovered an impressive collection of modern development tools and command-line utilities that represent significant improvements over traditional Unix tools, showcasing how modern languages like Rust are revolutionizing developer tooling.

HTTPie - Human-Friendly HTTP Client

HTTPie positions itself as “HTTP for Humans” and dramatically simplifies API testing and HTTP requests:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# Simple GET request
http GET https://api.github.com/users/stonecharioteer

# POST with JSON data
http POST https://httpbin.org/post name=John age:=30 active:=true

# Authentication
http GET https://api.github.com/user Authorization:"token YOUR_TOKEN"

# File uploads
http --form POST https://httpbin.org/post [email protected]

# Custom headers and cookies
http GET https://example.com X-Custom-Header:value Cookie:session=abc123

# Pretty-print JSON responses (default)
http GET https://api.github.com/repos/python/cpython | jq '.stargazers_count'

HTTPie vs Curl Comparison

Curl: curl -X POST -H "Content-Type: application/json" -d '{"name":"John","age":30}' https://api.example.com/users

HTTPie: http POST https://api.example.com/users name=John age:=30

HTTPie’s syntax is more intuitive and requires less boilerplate for common operations.

FZF - Fuzzy Finder Revolution

FZF transforms command-line history and file searching with fuzzy matching:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# Install fzf
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install

# Basic file search
fzf

# Search command history
history | fzf

# Search and edit files
vim $(find . -type f | fzf)

# Git integration
git log --oneline | fzf

# Process search and kill
ps aux | fzf | awk '{print $2}' | xargs kill

Advanced FZF Integration

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Add to .bashrc or .zshrc for enhanced functionality

# Better cd with fuzzy search
cdf() {
    local dir
    dir=$(find ${1:-.} -path '*/\.*' -prune \
          -o -type d -print 2> /dev/null | fzf +m) &&
    cd "$dir"
}

# Fuzzy git branch checkout
fgb() {
    local branches branch
    branches=$(git branch -vv) &&
    branch=$(echo "$branches" | fzf +m) &&
    git checkout $(echo "$branch" | awk '{print $1}' | sed "s/.* //")
}

# Fuzzy kill process
fkill() {
    local pid
    pid=$(ps -ef | sed 1d | fzf -m | awk '{print $2}')
    if [ "x$pid" != "x" ]; then
        echo $pid | xargs kill -${1:-9}
    fi
}

FZF Productivity Boost

FZF integrates with:

  • Shell history: Ctrl+R for fuzzy history search
  • File navigation: Ctrl+T for file picker
  • Directory jumping: Alt+C for directory picker
  • Vim integration: Fuzzy file finding in editors
  • Git workflows: Branch switching, log browsing

Bat - Enhanced Cat with Syntax Highlighting

Bat provides beautiful syntax highlighting and Git integration:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
# Install bat
cargo install bat
# or
brew install bat

# Basic usage with syntax highlighting
bat main.py

# Show line numbers and git changes
bat --number --show-all src/app.rs

# Use as pager replacement
export PAGER="bat --plain --paging=always"

# Combine with other tools
curl -s https://raw.githubusercontent.com/rust-lang/rust/master/README.md | bat -l md

# Configuration file
bat --config-file

Ripgrep - Grep on Steroids

Ripgrep offers blazing-fast text search with intelligent defaults:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Basic search
rg "TODO"

# Case insensitive search
rg -i "error"

# Search in specific file types
rg "function" --type py
rg "impl" --type rust

# Search with context lines
rg "error" -C 3

# Regular expressions
rg "fn\s+\w+\(" --type rust

# Exclude directories
rg "pattern" --glob '!target/' --glob '!node_modules/'

# Replace mode (preview)
rg "old_function" --replace "new_function" --type py

# JSON output for scripting
rg "pattern" --json | jq '.data.lines.text'

Ripgrep Performance

Ripgrep is significantly faster than grep, ack, or ag because:

  • Parallelization: Uses multiple threads by default
  • Optimized algorithms: Boyer-Moore string searching
  • Smart filtering: Respects .gitignore and binary file detection
  • Memory efficiency: Streaming search without loading entire files

Development Utilities and Automation

Python HTTP Server

The built-in Python HTTP server is perfect for quick local development:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Python 3 (current)
python -m http.server 8000

# Python 2 (legacy)
python -m SimpleHTTPServer 8000

# Serve specific directory
python -m http.server 8000 --directory /path/to/files

# Bind to specific interface
python -m http.server 8000 --bind 127.0.0.1

This needs no additional dependencies and is available everywhere Python is installed.

Live-Server for Frontend Development

Live-Server provides automatic browser refresh for static HTML development:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# Install globally
npm install -g live-server

# Serve current directory with live reload
live-server

# Custom port and browser
live-server --port=3000 --browser=firefox

# Serve specific directory
live-server --root=./dist

# Proxy API requests
live-server --proxy=/api:http://localhost:3000

Pre-commit Hooks Management

Pre-commit standardizes and automates code quality checks:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# .pre-commit-config.yaml
repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v4.4.0
    hooks:
      - id: trailing-whitespace
      - id: end-of-file-fixer
      - id: check-yaml
      - id: check-added-large-files

  - repo: https://github.com/psf/black
    rev: 22.10.0
    hooks:
      - id: black
        language_version: python3

  - repo: https://github.com/pycqa/flake8
    rev: 5.0.4
    hooks:
      - id: flake8

  - repo: https://github.com/pycqa/isort
    rev: 5.10.1
    hooks:
      - id: isort
        args: ["--profile", "black"]
1
2
3
4
5
6
7
8
9
# Install and setup
pip install pre-commit
pre-commit install

# Run on all files
pre-commit run --all-files

# Update hook versions
pre-commit autoupdate

Cookiecutter - Project Templating

Cookiecutter uses Jinja2 templates to generate project scaffolding:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# Install cookiecutter
pip install cookiecutter

# Create project from template
cookiecutter https://github.com/cookiecutter/cookiecutter-django

# Use local template
cookiecutter /path/to/my-template

# Create custom template structure
my-template/
├── cookiecutter.json
├── {{cookiecutter.project_name}}/
│   ├── README.md
│   ├── setup.py
│   └── {{cookiecutter.module_name}}/
│       └── __init__.py

Template configuration:

1
2
3
4
5
6
7
{
  "project_name": "My Project",
  "module_name": "{{ cookiecutter.project_name.lower().replace(' ', '_') }}",
  "author_name": "Your Name",
  "version": "0.1.0",
  "license": ["MIT", "BSD", "GPL"]
}

YouTube-DL - Media Download Utility

YouTube-DL enables downloading and converting media from numerous platforms:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# Install
pip install youtube-dl

# Basic download
youtube-dl "https://www.youtube.com/watch?v=VIDEO_ID"

# Download audio only
youtube-dl -x --audio-format mp3 "URL"

# Download best quality
youtube-dl -f "best[height<=720]" "URL"

# Download playlist
youtube-dl -i "PLAYLIST_URL"

# Extract metadata
youtube-dl --get-title --get-duration "URL"

# Custom filename format
youtube-dl -o "%(uploader)s - %(title)s.%(ext)s" "URL"

Code Analysis and Metrics

CLOC - Count Lines of Code

CLOC provides detailed code statistics:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# Install
brew install cloc
# or
sudo apt install cloc

# Count lines in current directory
cloc .

# Specific languages
cloc --include-lang=Python,JavaScript .

# Exclude directories
cloc --exclude-dir=node_modules,target .

# Compare two codebases
cloc --diff version1/ version2/

# Output formats
cloc --json .
cloc --csv .

Tokei - Modern Code Counter

Tokei offers faster, more accurate line counting:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# Install
cargo install tokei

# Basic usage
tokei

# Specific languages
tokei --languages rust,python

# Sort by lines
tokei --sort lines

# Output formats
tokei --output json
tokei --output yaml

Modern Web Frameworks

FastAPI - Async Flask Alternative

FastAPI provides high-performance async Python web APIs:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
from fastapi import FastAPI, HTTPException, Depends
from pydantic import BaseModel
from typing import List, Optional
import asyncio

app = FastAPI(title="Modern API", version="1.0.0")

class User(BaseModel):
    id: int
    name: str
    email: str
    is_active: bool = True

class UserCreate(BaseModel):
    name: str
    email: str

# Async endpoint with automatic OpenAPI documentation
@app.get("/users/{user_id}", response_model=User)
async def get_user(user_id: int):
    if user_id < 1:
        raise HTTPException(status_code=404, detail="User not found")

    # Simulate async database call
    await asyncio.sleep(0.1)
    return User(id=user_id, name="John Doe", email="[email protected]")

@app.post("/users/", response_model=User)
async def create_user(user: UserCreate):
    # Auto-validation from Pydantic model
    new_user = User(id=123, **user.dict())
    return new_user

# Dependency injection
async def get_current_user() -> User:
    return User(id=1, name="Current User", email="[email protected]")

@app.get("/me", response_model=User)
async def read_users_me(current_user: User = Depends(get_current_user)):
    return current_user

# Run with: uvicorn main:app --reload

FastAPI Benefits

  • Automatic OpenAPI/Swagger docs at /docs
  • Type hints for automatic validation
  • Async support for high concurrency
  • Dependency injection system
  • OAuth2 integration built-in
  • WebSocket support for real-time features
  • Background tasks for async processing

Go Web Frameworks

Revel Framework

Revel provides a full-stack web framework for Go:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
package controllers

import (
    "github.com/revel/revel"
)

type App struct {
    *revel.Controller
}

func (c App) Index() revel.Result {
    return c.Render()
}

func (c App) Hello(myName string) revel.Result {
    c.Viewargs["name"] = myName
    return c.Render()
}

// Routes (conf/routes)
// GET     /                                       App.Index
// GET     /hello/:myName                          App.Hello

Bandit - Python Security Scanner

Bandit identifies common security issues in Python code:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# Install
pip install bandit

# Scan current directory
bandit -r .

# Skip test files
bandit -r . --skip B101

# Output formats
bandit -r . -f json
bandit -r . -f html -o security-report.html

# Configuration file
bandit -r . -c bandit.conf

Responses - Mock HTTP Requests

Responses enables safe mocking of HTTP requests in tests:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import responses
import requests

@responses.activate
def test_api_call():
    # Mock the API response
    responses.add(
        responses.GET,
        "https://api.example.com/users/1",
        json={"id": 1, "name": "John Doe"},
        status=200
    )

    # Make the request
    resp = requests.get("https://api.example.com/users/1")

    # Test the response
    assert resp.status_code == 200
    assert resp.json()["name"] == "John Doe"

# Dynamic responses
@responses.activate
def test_dynamic_response():
    def request_callback(request):
        return (200, {}, '{"dynamic": "response"}')

    responses.add_callback(
        responses.GET,
        "https://api.example.com/dynamic",
        callback=request_callback
    )

Development Productivity Insights

Tool Selection Criteria

When choosing modern development tools, key factors include:

Tool Evaluation Framework

  1. Performance: Measurably faster than alternatives
  2. Ergonomics: Better default behavior and user experience
  3. Integration: Works well with existing workflows
  4. Maintenance: Actively maintained with good documentation
  5. Cross-platform: Consistent behavior across operating systems
  6. Community: Strong ecosystem and community support

Command-Line Productivity Multipliers

The modern command-line tools demonstrate several important patterns:

  1. Intelligent Defaults: Tools like rg and bat make smart assumptions
  2. Better Output: Syntax highlighting and structured display improve usability
  3. Performance Focus: Rust-based tools leverage systems programming for speed
  4. Integration-First: Designed to work with pipes, scripts, and other tools
  5. Configuration: Reasonable defaults with extensive customization options

Migration Strategy

Gradually Adopting Modern Tools

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Create aliases for gradual adoption
alias cat='bat'
alias grep='rg'
alias find='fd'  # fd is another excellent Rust-based find replacement

# Add to .bashrc/.zshrc
export PAGER="bat --plain --paging=always"

# Customize fzf key bindings
export FZF_DEFAULT_COMMAND='rg --files'
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"

Migration Considerations

When adopting new tools:

  • Script Compatibility: Some scripts may depend on specific output formats
  • Team Alignment: Ensure team members can use the same tools
  • Learning Curve: Budget time for learning new command syntax
  • Fallback Plans: Keep traditional tools available for compatibility

This exploration of modern development tools showcases how thoughtful tool selection can dramatically improve developer productivity and code quality.


These modern development tools from my archive demonstrate the ongoing evolution of developer tooling, with languages like Rust enabling a new generation of fast, reliable, and user-friendly command-line utilities.