You are reading content from Scuttlebutt
@cel %NtmHQ30qqXTusRr9nfdXIplwjEQwcIgcZJJmFw7g1pc=.sha256

ssb-blob-path.c

Prints the path to a blob as a file on the local filesystem where scuttlebot/ssb-blobs would store it.

Build:
cc ssb-blob-path.c -o ssb-blob-path

Install:
sudo cp ssb-blob-path /usr/local/bin/

Usage:
ssb-blob-path <blob_id>

Example:

$ ssb-blob-path '&O2V61izsKwCsDJnuI43Gb39FTUxDNY0lsFM7gAKNCKI=.sha256'
/home/cel/.ssb/blobs/sha256/3b/657ad62cec2b00ac0c99ee238dc66f7f454d4c43358d25b0533b80028d08a2

#ssb #cli

User has not chosen to be hosted publicly
@kas %JIDt/yNF/g7dptZsFl1NmOtYd28/vPzUK4YknHJ8KC8=.sha256

Just for the exercise, here's a version of ssb-blob-path written in FiSH shell:

:paperclip: ssb-blob-path.fish

Requirements

  • fish (only tested with v2.7.1)
  • base64 (coreutils)
  • xxd (vim?)

Usage

  ssb-blob-path.fish [-h|--help] [BLOB_ID [BLOB_ID …]]

If not given on the command line, one or more BLOB_IDs can be read from standard input.

Examples

  $ ssb-blob-path.fish '&O2V61izsKwCsDJnuI43Gb39FTUxDNY0lsFM7gAKNCKI=.sha256'
  /home/kas/.ssb/blobs/sha256/3b/657ad62cec2b00ac0c99ee238dc66f7f454d4c43358d25b0533b80028d08a2
  $ echo '&O2V61izsKwCsDJnuI43Gb39FTUxDNY0lsFM7gAKNCKI=.sha256' | ssb-blob-path.fish
  /home/kas/.ssb/blobs/sha256/3b/657ad62cec2b00ac0c99ee238dc66f7f454d4c43358d25b0533b80028d08a2
@kas %ca13hFEOKfaSHw8CTjKzPT2ulKusn4kjbjIEWoPpJec=.sha256

And here's the set of complementary commands

:paperclip: ssb-blob-path.fish

:paperclip: ssb-path-blob.fish

$ ssb-blob-path.fish '&O2V61izsKwCsDJnuI43Gb39FTUxDNY0lsFM7gAKNCKI=.sha256'
/home/kas/.ssb/blobs/sha256/3b/657ad62cec2b00ac0c99ee238dc66f7f454d4c43358d25b0533b80028d08a2
$ ssb-path-blob.fish ~/.ssb/blobs/sha256/3b/657ad62cec2b00ac0c99ee238dc66f7f454d4c43358d25b0533b80028d08a2
&O2V61izsKwCsDJnuI43Gb39FTUxDNY0lsFM7gAKNCKI=.sha256

Requirements

  • fish (only tested with v2.7.1)
  • base64 (coreutils)
  • xxd
@cel %cqCvD8Oxodj3ZR+OgW5x3G80jprwf1PBvSB8dPPHQuY=.sha256
Voted And here's the set of **complementary commands** ## :paperclip: [ssb-blob-
Join Scuttlebutt now