Create a gist now

Instantly share code, notes, and snippets.

@peczenyj /README
Last active Aug 29, 2015

What would you like to do?
This script creates one fuse filesystem with one file, cat.jpg, with a random kitten image (from
NEW! you can install via cpan:
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 ( )
$ 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
$ mkdir catfs
$ ./ catfs
# in other terminal
$ ls catfs
$ gimp catfs/cat.jpg # will open a different kitten pic each time
# after finish the script
$ fusermount -u catfs
Fork if you want:
#!/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;
mountpoint => $mountpoint,
"/" => {
'cat.jpg' => sub {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment