Be Your Own Cloud code · PART 5 — GOING FURTHER

Chapter 23 Using AI Without Handing Over Your Life: A Practical Framework

1 block · p. 105 in the paperback

Sanitising Before You Paste

# p. 105

Run Terminal, any Linux or macOS machine
sed -E \
  -e 's/[[:alnum:]._-]+@[[:alnum:].-]+\.[[:alpha:]]+/REDACTED-EMAIL/g' \
  -e 's/([A-Za-z0-9_]+_(KEY|TOKEN|SECRET|PASSWORD))[[:space:]]*=.*/\1=REDACTED/g' \
  -e 's/([0-9]{1,3}\.){3}[0-9]{1,3}/REDACTED-IP/g' \
  -e 's/[[:alnum:].-]+\.(com|net|org|io|dev|xyz)\b/REDACTED-DOMAIN/g' \
  yourfile.txt > sanitized.txt

Reproduced exactly from Be Your Own Cloud, Chapter 23. The book explains what each line does and what to do when it doesn't work. About the book

Something here not working as the book describes? Tell the author.