Skip to content

Commit

Permalink
Update oafp-examples and add network-related commands
Browse files Browse the repository at this point in the history
  • Loading branch information
nmaguiar committed Sep 21, 2024
1 parent 8e204f5 commit 0035204
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion oafp-examples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -834,4 +834,14 @@ data:
s: Tunnelblink
d: In a Mac OS with Tunnelblink, if you want to copy all your OpenVPN configurations into ovpn files.
e: |-
oafp in=ls data="$HOME/Library/Application Support/Tunnelblick/Configurations" path="[?filename=='config.ovpn'].insert(@,'name',replace(filepath,'.+\/([^\/]+)\.tblk\/.+','','\$1'))" lsrecursive=true out=cmd outcmdtmpl=true outcmd="cp \"{{filepath}}\" output/\"{{name}}.ovpn\""
oafp in=ls data="$HOME/Library/Application Support/Tunnelblick/Configurations" path="[?filename=='config.ovpn'].insert(@,'name',replace(filepath,'.+\/([^\/]+)\.tblk\/.+','','\$1'))" lsrecursive=true out=cmd outcmdtmpl=true outcmd="cp \"{{filepath}}\" output/\"{{name}}.ovpn\""
- c: Network
s: ASN
d: Retrieve the list of ASN number and names from RIPE and transforms it to a CSV.
e: |-
oafp url="https://ftp.ripe.net/ripe/asnames/asn.txt" in=lines linesjoin=true path="[?length(@)>'0'].split(@,' ').{asn:[0],name:join(' ',[1:])}" out=csv
- c: Network
s: ASN
d: Retrieve an IP to ASN list list and converts it to ndjson
e: |-
oafp cmd="curl https://api.iptoasn.com/data/ip2asn-combined.tsv.gz | gunzip" in=lines linesjoin=true path="[?length(@)>'0'].split(@,'\t').{start:[0],end:[1],asn:[2],area:[3],name:[4]}" out=ndjson

0 comments on commit 0035204

Please sign in to comment.