ip addresses with recfiles

This commit is contained in:
Malin Freeborn 2025-02-13 17:39:38 +01:00
parent 0abc2818e8
commit eaec01076b
Signed by: andonome
GPG Key ID: 52295D2377F4D70F
2 changed files with 17 additions and 0 deletions

View File

@ -44,6 +44,7 @@ recset -f "$new_field" --delete $database
- [Extended example](recfiles/extended.md)
- [Playing with board games data](recfiles/Board_Games.md)
- [Playing with IP addresses](recfiles/IP_ASN.md)
- [Fixes](recfiles/recfixes.md)
# Resources

16
data/recfiles/IP_ASN.md Normal file
View File

@ -0,0 +1,16 @@
---
title: "IP Addresses with Recfiles"
tags: [ "data", "recfiles", "games" ]
requires: "Recfiles"
---
## Download the Database
Download the csv data, and separate the ipv4 data from the ipv6.
```sh
curl -Lo ips.zip 'https://www.kaggle.com/api/v1/datasets/download/ipinfo/ipinfo-country-asn'
unzip -p ips.zip country_asn.csv | csv2rec | recsel -e "start_ip ~ '\.'" > ipv4.rec
unzip -p ips.zip country_asn.csv | csv2rec | recsel -e "start_ip ~ '::'" > ipv6.rec
```