Last active

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

This script creates one fuse filesystem with one file, cat.jpg, with a random kitten image (from thecatapi.com)

View README
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
NEW! you can install via cpan: https://metacpan.org/release/PACMAN/Acme-CatFS-0.001
 
1. you should install LWP::Simple and Fuse:Simple - use cpan or cpanm
2. you should configure the local fuse install to run as root or as common user
3. don't forget 'fusermount -u <mountpoint>' after finish the script
 
to install dependencies
 
you can use regular cpan OR cpanminus ( http://search.cpan.org/~miyagawa/App-cpanminus-1.7001/lib/App/cpanminus.pm )
 
$ cpan LWP::Simple
$ cpan Fuse:Simple ( maybe you need install via apt-get libfuse-dev too )
 
the difference is: cpanminus is more indicate if you want install something without change the default perl instalation in your operational system. 90% of the cases you can install with regular cpan ( built in ).
 
to test
 
$ chmod +x cats.pl
$ mkdir catfs
$ ./cats.pl catfs
 
# in other terminal
 
$ ls catfs
cat.jpg
 
$ gimp catfs/cat.jpg # will open a different kitten pic each time
 
# after finish the script
$ fusermount -u catfs
 
Fork if you want:
 
https://github.com/peczenyj/catfs
View README
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#!/usr/bin/env 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
Something went wrong with that request. Please try again.