frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Ask HN: What are you using to access x.com at the moment?

1•throwaw12•26s ago•0 comments

Bill Gates says world has "no plan" on AI in new essay

https://www.gatesnotes.com/a-turbulent-ai-era-and-critical-choices-to-make
2•aroman•2m ago•0 comments

S21

https://store.steampowered.com/app/4953120/S21/
2•ofrzeta•3m ago•1 comments

Dollywood

https://en.wikipedia.org/wiki/Dollywood
1•thunderbong•4m ago•0 comments

How to export Gemini chat to word without losing formatting [video]

https://www.youtube.com/watch?v=PZZGjJpPDM0
2•slimcrm•4m ago•0 comments

A joke for founders about the perfect startup geography [20 secs]

https://www.mangialardi.it/the-startup-paradox/
1•rm30•5m ago•1 comments

CSS Runtime Performance

https://nolanlawson.github.io/css-talk-2022/#1
1•luu•7m ago•0 comments

Show HN: Buslens – where can I get to by bus? (UK)

https://rupertlinacre.com/buslens/
1•RobinL•9m ago•0 comments

The Cowpox of Doubt (2014)

https://slatestarcodex.com/2014/04/15/the-cowpox-of-doubt/
1•pr337h4m•14m ago•0 comments

Disrupting a new covert influence campaign from Russia

https://openai.com/index/disrupting-malicious-uses-of-ai-influence-campaign-russia/
3•sam_lowry_•15m ago•0 comments

More than 100 suspicious images in Thermo Fisher antibody catalogue

https://www.nature.com/articles/d41586-026-01706-2
1•isaacfrond•17m ago•0 comments

Chinese regulators tell Tesla to fix nearly 3M cars

https://arstechnica.com/cars/2026/08/chinese-regulators-tell-tesla-to-fix-nearly-3-million-cars/
1•rbanffy•18m ago•1 comments

Global All Purpose Script

1•manesiro•19m ago•2 comments

World humanoid robot games show runners breaking records, bursting into flames

https://arstechnica.com/ai/2026/08/world-humanoid-robot-games-show-runners-breaking-records-burst...
2•robin_reala•26m ago•0 comments

NEET: Not in Education, Employment or Training. It's too late to fix this, but

https://www.virtueonline.org/post/neet-not-in-education-employment-or-trainingit-s-too-late-to-fi...
2•Michelangelo11•27m ago•0 comments

Show HN: Octomind Routines – scheduled agents on persistent cloud machines

https://octomind.run/blog/routines-scheduled-agents
1•donk8r•30m ago•0 comments

France, Saudi Arabia agree on €6B Dragon Ball Z theme park project near Paris

https://www.reuters.com/world/middle-east/france-saudi-arabia-agree-6-billion-dragon-ball-z-theme...
3•mmarian•30m ago•0 comments

Miroslav Tichý

https://en.wikipedia.org/wiki/Miroslav_Tich%C3%BD
2•Michelangelo11•34m ago•1 comments

Declinism

https://en.wikipedia.org/wiki/Declinism
3•soupspaces•35m ago•0 comments

A more nuanced view of LLMs

https://anarc.at/blog/2026-08-25-llm-nuance/
2•lumpa•36m ago•0 comments

Perplexity: A Local-First Agent for Private Knowledge Work

https://www.perplexity.ai/hub/blog/a-local-first-agent-for-private-and-cost-effective-knowledge-work
3•tosh•36m ago•0 comments

A Tour of Differentiable Rasterization

https://srush.github.io/DiffRast/
1•coffeeaddict1•39m ago•0 comments

Glyphcss › an ASCII render playground for 3D models (OBJ, glTF, STL, .vox)

https://glyphcss.com/gallery/
1•zakxxi•42m ago•0 comments

ArXiv: CTTE: An Open Dual-Protocol RISC-V Trace Encoder for N-Trace and E-Trace

https://arxiv.org/abs/2608.18170
1•xlbxrt•42m ago•0 comments

The tech community has lost an icon

https://twitter.com/RonConway/status/2092269443653181673
1•tosh•42m ago•0 comments

Addressing a sticking point in sustainable adhesives

https://www.technologyreview.com/2026/08/25/1140902/addressing-a-sticking-point-in-sustainable-ad...
1•joozio•44m ago•0 comments

Running as good as a nap to help cope with sleep deprivation

https://www.thetimes.com/life-style/health-fitness/article/exercise-nap-memory-sleep-deprivation-...
5•petethomas•45m ago•0 comments

Blink and you'll miss it: dogs may send humans subtle eye signals

https://www.thetimes.com/uk/science/article/dogs-blink-humans-owners-blzmx0j00
1•petethomas•47m ago•0 comments

Find Git Commits by Commit Message Text

https://hamvocke.com/blog/git-revisions-by-text/
2•rahmanism•50m ago•0 comments

What Makes a Great Investor?

https://economist.com/finance-and-economics/2026/08/25/what-makes-a-great-investor
2•andsoitis•50m ago•0 comments
Open in hackernews

Show HN: Hostflip – a macOS /etc/hosts switcher that detects external edits

https://github.com/heronapp/hostflip
1•heroncoder•1h ago
Hi HN — I built hostflip, a native macOS menu bar app for switching /etc/hosts profiles. It is free and open source under the MIT license.

The problem I wanted to solve was not just editing hosts entries. It was sharing /etc/hosts with Docker Desktop, VPN clients, scripts, and manual edits without one writer silently erasing another's changes.

On first run, hostflip captures a read-only baseline (called Base Hosts) from the existing file and keeps the untouched original as hosts.orig. Active profiles are appended after the baseline in a clearly marked block.

Writes are still atomic whole-file replacements under the hood. Before each write, the daemon hashes the live file and compares it with the expected hash. If they differ, it refuses the write; the app shows a diff and asks the user to reconcile the change first.

A few other details:

- Profiles can live in groups. At most one profile per group is active, while active profiles from different groups and standalone profiles stack together.

- After a one-time approval in System Settings, subsequent switches no longer prompt for a password. The root helper is registered through SMAppService and exposes a single XPC operation: atomically replace the hosts file with merged content. The app and daemon verify each other's signing identity.

- The bundled CLI shares the same workspace as the app and supports structured JSON output. hostflip doctor dev.example.com traces a hostname from profiles through the merged output and the live /etc/hosts file to the system resolver.

- Remote profiles can refresh from HTTPS sources on a schedule. There is also an importer for existing SwitchHosts configurations.

- The editor has cross-profile hostname/IP search, comment toggling, basic validation for malformed hosts lines, and stays responsive with large remote profiles.

The app is built with Swift and SwiftUI, distributed through Homebrew or a signed and notarized DMG, and currently requires macOS 14 or later on Apple silicon. Intel, Windows, and Linux are not supported.

I would especially like feedback on the conservative drift behavior: if another process changes /etc/hosts, hostflip blocks further writes to the system file until the user reviews the diff. How do you handle multiple writers to the hosts file, and would you expect a different reconciliation model?

Comments

heroncoder•49m ago
Author here. One implementation detail that may be interesting: the drift check is enforced inside the privileged write transaction, not just by the UI watcher.

The daemon receives the fully rendered hosts content, its target hash, the expected hash of the live /etc/hosts file, and a merge ID. Under a transaction lock, it hashes the live file and rejects the request if the expected hash no longer matches. It writes and fsyncs a temporary file, then rereads /etc/hosts immediately before rename; if the bytes changed between those two reads, it aborts instead of overwriting them. Only then does it atomically rename the temporary file and flush DNS.

The daemon exposes only that merge operation over XPC, and the app and daemon verify each other's signing identity. I'm happy to discuss the TOCTOU/drift tradeoffs, SMAppService, or the packaging and notarization side.