frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

God Sleeps in the Minerals

https://wchambliss.wordpress.com/2026/03/03/god-sleeps-in-the-minerals/
319•speckx•5h ago•72 comments

CPUs Aren't Dead. Gemma2B Out Scored GPT-3.5 Turbo on Test That Made It Famous

https://seqpu.com/CPUsArentDead/
29•fredmendoza•1h ago•12 comments

Google Broke Its Promise to Me. Now ICE Has My Data

https://www.eff.org/deeplinks/2026/04/google-broke-its-promise-me-now-ice-has-my-data
120•Brajeshwar•40m ago•7 comments

Open Source Isn't Dead. Cal.com Just Learned the Wrong Lesson

https://www.strix.ai/blog/cal-com-is-closing-its-code-due-to-ai-threats
184•bearsyankees•2h ago•113 comments

Want to Write a Compiler? Just Read These Two Papers (2008)

https://prog21.dadgum.com/30.html
373•downbad_•8h ago•114 comments

Fix monitor that goes black, off or blinks due to static electricity in chair

https://aalonso.dev/blog/2023/how-to-fix-monitor-that-goes-black-off-due-to-static-electricity-in...
23•cyclopeanutopia•3d ago•15 comments

Good Sleep, Good Learning (2012)

https://super-memory.com/articles/sleep.htm
281•downbad_•9h ago•133 comments

AI-Assisted Cognition Endangers Human Development

https://heidenstedt.org/posts/2026/ai-assisted-cognition-endangers-human-development/
5•i5heu•7m ago•0 comments

Adaptional (YC S25) Is Hiring Founding AI Engineers

https://www.ycombinator.com/companies/adaptional/jobs/k7W6ge9-founding-engineer
1•acesohc•1h ago

Show HN: Libretto – Making AI browser automations deterministic

https://github.com/saffron-health/libretto
31•muchael•2h ago•8 comments

Forcing an inversion of control on the SaaS stack

https://www.100x.bot/a/client-side-injection-inversion-of-control-saas
34•shardullavekar•5d ago•31 comments

Do you even need a database?

https://www.dbpro.app/blog/do-you-even-need-a-database
95•upmostly•5h ago•175 comments

The Future of Everything Is Lies, I Guess: New Jobs

https://aphyr.com/posts/419-the-future-of-everything-is-lies-i-guess-new-jobs
185•aphyr•4h ago•122 comments

Anna's Archive loses $322M Spotify piracy case without a fight

https://torrentfreak.com/annas-archive-loses-322-million-spotify-piracy-case-without-a-fight/
162•askl•10h ago•178 comments

Gemini Robotics-ER 1.6

https://deepmind.google/blog/gemini-robotics-er-1-6/
149•markerbrod•4h ago•45 comments

Kalshi CEO expects US DOJ to prosecute insider trading cases

https://www.semafor.com/article/04/15/2026/kalshi-ceo-tarek-mansour-expects-us-doj-to-prosecute-i...
13•thm•13m ago•0 comments

How do Wake-On-LAN works

https://blog.xaner.dev/post/wake-on-lan/
40•swq115•4d ago•13 comments

Costasiella kuroshimae – Solar Powered animals, that do indirect photosynthesis

https://en.wikipedia.org/wiki/Costasiella_kuroshimae
113•vinnyglennon•3d ago•48 comments

Wacli – WhatsApp CLI

https://github.com/steipete/wacli
206•dinakars777•11h ago•135 comments

Fixing a 20-year-old bug in Enlightenment E16

https://iczelia.net/posts/e16-20-year-old-bug/
234•snoofydude•13h ago•136 comments

Where did my taxes go?

https://wherethefuckdidmytaxesgo.com/
69•kacy•1h ago•102 comments

We ran Doom on a 40 year old printer controller (Agfa Compugraphic 9000PS) [video]

https://www.youtube.com/watch?v=cltnlks2-uU
45•zdw•4d ago•13 comments

Metro stop is Ancient Rome's new attraction

https://www.bbc.com/travel/article/20260408-a-150-metro-ticket-to-ancient-rome
88•Stevvo•5d ago•21 comments

Pretty Fish: A better mermaid diagram editor

https://pretty.fish/
93•pastelsky•5d ago•20 comments

Google Gemma 4 Runs Natively on iPhone with Full Offline AI Inference

https://www.gizmoweek.com/gemma-4-runs-iphone/
232•takumi123•13h ago•153 comments

Show HN: Every CEO and CFO change at US public companies, live from SEC

https://tracksuccession.com/explore
145•porsche959•5h ago•60 comments

Study: Back-to-basics approach can match or outperform AI in language analysis

https://www.manchester.ac.uk/about/news/back-to-basics-approach-can-match-or-outperform-ai/
28•giuliomagnifico•6h ago•11 comments

CRISPR takes a bold leap toward silencing Down syndrome's extra chromosome

https://medicalxpress.com/news/2026-04-crispr-bold-silencing-syndrome-extra.html
28•amichail•2h ago•27 comments

The tiniest e-reader in the world, and you can build one yourself

https://www.androidauthority.com/tiny-e-reader-diy-3657661/
25•Brajeshwar•1h ago•6 comments

AI ruling prompts warnings from US lawyers: Your chats could be used against you

https://www.reuters.com/legal/government/ai-ruling-prompts-warnings-us-lawyers-your-chats-could-b...
113•alephnerd•5h ago•68 comments
Open in hackernews

The lack of a good command line way to sort IPv6 addresses

https://utcc.utoronto.ca/~cks/space/blog/unix/SortingIPv6Addresses
37•zdw•11mo ago

Comments

sargstuff•11mo ago
IPv6 addresses are typically written in canonical text representation recommended by RFC 5952[0].

1) Regular expression / seamingly lost art of sprintf formatting are some methods to normalize 001:db8::2:1 to something usable for sorting aka 2001:db8:0000:0000:0000:0000:0002:0001. Perhaps restoring to rfc 5952 format when printing sorted results.

2) Modify hex to 'sortable utf-16 characters', modify back post sort[1]

3) avoid utf-8 / utf-16 issues, use relevant python libraries to handle ipv4/ipv6[2][3],[4]: ip2n < file | sort -n | n2ip

----------------------------

[0] : https://datatracker.ietf.org/doc/html/rfc5952

[1] : https://stackoverflow.com/questions/5797369/unix-sort-utilit...

[2] : https://stackoverflow.com/questions/75522231/how-to-sort-ipv...

[3] : https://www.geeksforgeeks.org/convert-ip-address-to-integer-...

[4] : https://ipfind.com/blog/how-to-convert-ip-address-to-integer...

0points•11mo ago
1. Convert to numeric representation

2. Sort

3. Convert back

schoen•11mo ago
Such a program in Python could be

  python3 -c 'import ipaddress, sys; print("\n".join(sorted(ipaddress.IPv6Address(x).exploded for x in sys.argv[1:])))'
It takes the IP addresses to be sorted on the command line.

Or, re-abbreviating them by removing zeroes and attempting to use :: where possible:

  python3 -c 'import ipaddress, sys; print("\n".join(str(ipaddress.IPv6Address(y)) for y in sorted(ipaddress.IPv6Address(x).exploded for x in sys.argv[1:])))'
Both of these versions will crash if given input that isn't syntactically valid as an IPv6 address.
fragmede•11mo ago
It's ipv6. Seems like the "standard" thing to do would be to write and name a utility called sort6 which properly handles ipv6 addresses.
Gabrys1•11mo ago
I imagine you wrote this sarcastically, but I do like this a lot!
fragmede•11mo ago
The original sort (and ping, and traceroute) could just have been updated to handle the newer format, rather than creating new utilities, was my non-sarcastic point. :)
thesuitonym•10mo ago
True of ping and traceroute, but sort is not a network utility, so editing it to specifically handle IPv6 addresses is kind of a weird idea. Not necessarily a bad idea, but it makes sense that nobody has done it.

Probably better in this case would be to have a small program that expands IPv6 addresses that you could then pipe into sort. That would be more in-keeping with the Unix Way™.

pantalaimon•10mo ago
How often do you need to sort IP addresses to begin with?
j16sdiz•10mo ago
When you have lots of addresses and subnets, and want to see which addresses goes into what subnet
fragmede•10mo ago
especially since ipv6 can be multi-homed. on corporate networks you ended up with difficult configurations and need to figure out why the packets are going the wrong way frequently.
Symbiote•10mo ago
It could be reasonable to extend sort to support a hexadecimal numeric sort. It already supports numeric (decimal) and human-readable with SI prefixes (2k, 1G).
thesuitonym•10mo ago
Hexadecimal sort is already the same as alphabetic sort. The main problem with IPv6 addresses is that zeroes get truncated all over the place. :: could mean :0000: or :0000:0000:0000:. It's not impossible to solve by any means, but pure hexadecimal sort wouldn't work.
fragmede•10mo ago
> Probably better in this case would be to have a small program that expands IPv6 addresses that you could then pipe into sort. That would be more in-keeping with the Unix Way™.

I went and wrote this and then realized you'd need two utilities. One to expand the addresses, and one to minify the addresses, so your pipeline would be:

    cat ipv6-addrs.txt | ipv6expand | sort -V | ipv6minify
vs

    cat ipv6-addrs.txt | sort -6
The unix philosphy is do one thing and do it well. Ideally sort does sorting very well, including sorting of ipv6 addresses. Ergo, sort should handle ipv6 address sorting.
blueflow•10mo ago
Usually ping6 and traceroute6 are symlinks to the regular util, not a different program.
hinkley•10mo ago
`sort -n` works remarkably well on `du`’s output
fragmede•10mo ago
there's sort -h for eg du -sch *'s output.
hinkley•10mo ago
Works great if the first column represents sizes. Not so great with IP addresses I suspect.
Ekaros•10mo ago
Isn't that Unix philosophy? Make tool that does one thing well. That is sort IPv6 addresses.
ggm•11mo ago
for all addresses, v4 and v6 this is what I used to do

  1) convert to a non-space-zeros-compressing hex string
  2) sort on the hex string
  3) convert back through inet_ntop()
Only a minor variant needed to deal with prefix/len sort order.
wpm•11mo ago
Almost as if using hex values for IP addresses was a bad idea.
oldnetguy•10mo ago
Agreed. By using decimal, you can explain to the average person what an address is and be able to work with them. IPv6 totally eliminates that. There is an argument that end users and consumers shouldn't need to concern themselves with this but in the field that this is not true.
fragmede•10mo ago
How often do consumers (ie not network professionals) need to do CIDR or anything more advanced than read off an address? Is reading 64512 colon 65152 colon colon 7237 that much easier over a bad phone connection than fc00:fe80::1c45? By the time you're that deep with someone non-technical having them read an address over the phone, you've already lost
miyuru•11mo ago
I don't think any IP version was made in with sorting as a feature, its just a by product of the representation.

This post also highlights a major thing I discovered when deploying and using IPv6, which is that you don't "Lift and shift" IPv4 to IPv6.

This is one of the reason its hard to deploy, because people cannot use the same IPv4 concepts to IPv6. For unknown reason they do, they will find the same problem they had with v4.

Ekaros•10mo ago
Also IPv4 does have some allowed weird notations. Like 127.1 is equal to 127.0.0.1 or can represent it as decimal number. Or hex notation. Or some tools support octal...

Which some also do not sort nicely. Specially when combined.

monster_truck•10mo ago
If you think these are weird I have bad news about ipv6
mystified5016•10mo ago
Anecdata but I have never seen shortened IPv4 notation. I've only ever seen the full decimal notation.
andix•10mo ago
Those representations for 127.0.0.1 work too, just try to ping them:

  0177.1 (octal, 2 stripped 0s, decimal one)
  017700000001 (octal)
  2130706433 (decimal)
  127.0.0x1
  0x7f.0x0.0x0.0x1
  127.000.000.001
nimbius•10mo ago
the sheer size of ipv6 alone means a lot of the 'old ways' get left behind.

"sorting by ip" for example is eschewed in favor of router advertisements where hosts pick their own subnet delegations.

one of the ways you track all of this is using a dhcp6 server with dns updates turned on. the subnet delegation is picked up by the client, which in turn pings dhcp6 and reports its IP for update in the DNS server.

kstrauser•10mo ago
Another is to use mDNS so that you can skip adding a service for something that’s automatic by default.
fragmede•10mo ago
> a dhcp6 server

If only it were that easy.

whalesalad•10mo ago
I have yet to use ipv6 and I will try to make it to my grave without adopting it.
neilalexander•10mo ago
Weird take, but you do you.
floating-io•10mo ago
Not really that odd. It's easy to live without IPv6 until someone creates the IPv6-only killer app, and that makes it... not worth the hassle for most folks.

I'm in a moderate-to-high technology area in the grand scheme. They laid fiber here roughly two years ago, and lit it about a year ago, whereupon I immediately subscribed.

They don't offer IPv6. At all. That should tell you just how unimportant IPv6 is perceived as outside of its core cadre of proponents. Note that this is not a commentary on how important it actually is; just on perception.

In short, nobody cares.

patchtopic•10mo ago
The 85% of French and 75% of India adopting it don't care, they just use it :-)

https://www.google.com/intl/en/ipv6/statistics.html#tab=per-...

dns_snek•10mo ago
More interestingly, it looks like a year from now IPv6 is going to make up the majority of Google's global traffic.

Cloudflare reports slightly lower 40% IPv6 adoption globally https://radar.cloudflare.com/adoption-and-usage

WorldMaker•10mo ago
Most consumer networks are IPv6 by default. Most cellular networks are IPv6-only/IPv6-native today with big DNS64/NAT64 gateways to the IPv4 web. Most consumers don't know or care, they just use IPv6, daily.

A lot of the holdouts on IPv4-only traffic are corporate traffic. A lot of corporate traffic acts like it wants a separate internet anyway, and a lot of companies hoarded IPv4 spaces for long enough that they don't see the increasing costs of IPv4 addresses hit their bottom lines yet enough to care. It's a fascinating dynamic. Maybe corporations will just buy the remaining IPv4 internet entirely and keep it as their own separate but not equal network.

pastage•10mo ago
It does not work like that, what you get is big deployments using ipv6 and some strange ipv4 setup so there are more and more clients using ipv6. On the server side you will start to see more and more clients using ipv6. About 40% of our customers use ipv6. They can still access ipv4 though it is just that their network provider prefers having them on ipv6.

Ip version is not a selling point, unless you are on the server.

WorldMaker•10mo ago
Not just a network provider preference. It is an OS-level preference in most consumer hardware today. (The "Happy Eyeballs" protocol, among other things. OSes will send IPv6 first, then after a delay send IPv4 and after that favor whichever one is "quickest"/"healthiest".) It's also a natural preference over things like STUN/"UPnP" to avoid NATs, especially CGNATs.
mrweasel•10mo ago
> It's easy to live without IPv6 until someone creates the IPv6-only killer app

This was a few years ago, but the majority of Danish ISP wasn't offering IPv6, because "there's is no demand from customers". Well, the customers also aren't demanding IPv4, they are demanding internet access. How you deliver it is not interesting to anyone but a small niche segment of the market. If you could somehow make it work over IPX, then 95% of customers would be fine with that, it's not something they care about.

dfc•10mo ago
Your cell provider is not using ipv6?
kstrauser•10mo ago
This is an odd website for bragging about avoiding common, widely used technology.
xnorswap•10mo ago
At least IPv6 addresses aren't "middle-endian" like UUIDs can be.
WorldMaker•10mo ago
UUID sort orders get wild indeed. I have been down that rabbit hole.
blueflow•10mo ago
This is not a UUID problem, this is a Microsoft problem from the 90s. Just don't use Microsoft software (</s>) and use big endian as specified by the standard.
WorldMaker•10mo ago
It is a general UUID specification problem. The dashes represent a struct breakdown. That struct has internal endian issues. That struct is also weirdly laid out in a "made sense at the v1 time way" that doesn't make sense for versions after 1. Why is the version number in the middle? Why is the relatively static "Machine ID" at the end? If you were trying to cluster your sort by machine, you have to sort things "backwards". That's what SQL Server did, and why you might blame it on being a Microsoft problem, trying to avoid clustered index churn by assuming GUIDs were inserted by static Machine IDs. That assumption broke hard in later Versions of UUID when "Machine ID" just became "random entropy". But the idea to sort like that in the first place wasn't wrong for v1, it had a good sense to it. Just like it makes sense to sort v7 UUIDs by timestamp to get mostly "log ordered" clustered indexes. At least there the sort data is all up front, but it crosses "struct field" boundaries if you are still relying on the v1 chunking.

(Ultimately UUID v1 was full of mistakes that we all will keep paying for.)

For the record it is Java with the worst possible UUID sort algorithm, sorting parts of it as signed numbers: https://devblogs.microsoft.com/oldnewthing/20190913-00/?p=10...

(Friends don't let friends use Java. /s)

zX41ZdbW•10mo ago
clickhouse-local is very handy for these tasks:

    $ echo "2a00:1450:400e:80c::200e
    2606:4700::6810:85e5
    2a03:2880:f145:82:face:b00c:0:25de
    2603:1030:c02:8::14
    2603:1030:20e:3::23c
    2603:1030:b:3::152
    2603:1020:201:10::10f
    2603:1010:3:3::5b" | ch --structure 'ip IPv6' --query "SELECT ip FROM table ORDER BY ip"

    2603:1010:3:3::5b
    2603:1020:201:10::10f
    2603:1030:b:3::152
    2603:1030:20e:3::23c
    2603:1030:c02:8::14
    2606:4700::6810:85e5
    2a00:1450:400e:80c::200e
    2a03:2880:f145:82:face:b00c:0:25de
yuliyp•10mo ago
If you're sorting data on a command line, you probably have some matter of control over how it's generated. So just fully-expand it and then text sorting just works. Pretty simple?
neuroelectron•10mo ago
Trivial Task Has No Standard
andix•10mo ago
I'm creating all those tiny shell helper scripts now with AI. One of the things AI is really good at.

prompt: create a bash command to sort a text file of ipv6 adresses per line. sort numerically (128 bit representation) but keep the full line as originally formatted

result:

  while read -r ip; do
    printf '%032x %s\n' \
      "$(python3 -c 'import ipaddress,sys; print(int(ipaddress.IPv6Address(sys.argv[1])))' "$ip")" \
      "$ip" 
  done < ipv6.txt | sort | cut -d' ' -f2-
kstrauser•10mo ago
That’s launching Python once per address. Why not just pipe it into a short Python script at that point?
andix•10mo ago
I know, this could be a follow-up prompt. But I tested it and it works well.

It's just to demonstrate how easy it is to solve those problems without spending an unnecessary amount of time on them.

kstrauser•10mo ago
Legit.