timmclean
Joined 14 years ago
Joined 14 years ago
[0] https://github.com/mozilla/cargo-vet
[1] https://opensource.googleblog.com/2023/05/open-sourcing-our-...
> The code in this repository is open-source under the Apache-2.0 license. The InternLM weights are fully open for academic research and also allow commercial use with written permission from the official team. For inquiries about commercial licenses and collaborations, please contact [email protected].
Cryptohipsters (can I coin this term?) should take a look at Skein (a third-round SHA-3 candidate), BLAKE2 (the successor of a third-round SHA-3 candidate), and Keccak (the SHA-3 winner). These hash functions have undergone much more analysis. Notably, BLAKE2 is faster than MD5 in many cases, but without the security problems of MD5.
FRUITS=$(cat input.json | jq '.models | map(select(.title == "fruits")) | .[0]')
FRUIT_NAME_KEY=$(echo "$FRUITS" | jq '.fields | map(select(.name == "Name")) | .[0].key')
FARMERS=$(cat input.json | jq '.models | map(select(.title == "farmers")) | .[0]')
FARMER_NAME_KEY=$(echo "$FARMERS" | jq '.fields | map(select(.name == "Full name")) | .[0].key')
FARMER_FRUITS_KEY=$(echo "$FARMERS" | jq '.fields | map(select(.name == "Fruits")) | .[0].key')
BOB=$(echo "$FARMERS" | jq '.entities | map(select(.['$FARMER_NAME_KEY'] == "Bob, the farmer")) | .[0]')
BOB_FRUIT_IDS=$(echo "$BOB" | jq '.['$FARMER_FRUITS_KEY'] | .[]' -r)
for BOB_FRUIT_ID in "$BOB_FRUIT_IDS"; do
echo "$FRUITS" | jq '.entities | map(select(._id == "'$BOB_FRUIT_ID'")) | .[0] | .['$FRUIT_NAME_KEY']'
done
There's a bit of bash boilerplate, but honestly it was about what I would expect, given a structure with so many layers of indirection.Pain points:
* Switching between bash and jq's filtering language led me to use string interpolation with bash variables. Malicious inputs can probably exploit this (and it was just awkward anyway).
* A "select one" filter would be nice, instead of select + get first element.
https://www.timmclean.net/
https://twitter.com/McLean0
[ my public key: https://keybase.io/timmclean; my proof: https://keybase.io/timmclean/sigs/3KHSzJ0uQlO-_Cr28YhnYsK9yIOfMTpXrEUuRbx4ed4 ]