Skip to content

Instantly share code, notes, and snippets.

@peczenyj
Last active August 29, 2015 13:57
Show Gist options
  • Select an option

  • Save peczenyj/9725430 to your computer and use it in GitHub Desktop.

Select an option

Save peczenyj/9725430 to your computer and use it in GitHub Desktop.
This script creates one fuse filesystem with one file, cat.jpg, with a random kitten image (from thecatapi.com)
#! perl
use strict;
use warnings;
use LWP::Simple;
use Fuse::Simple qw(main);
my $mountpoint = $ARGV[0];
die "usage: $0 <directory>\n" if ! defined $mountpoint || ! -d $mountpoint;
main(
mountpoint => $mountpoint,
"/" => {
'cat.jpg' => sub {
get('http://thecatapi.com/api/images/get?format=src&type=jpg');
},
},
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment