Skip to content

Instantly share code, notes, and snippets.

@apeckham
Last active April 24, 2024 04:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save apeckham/037b155c8abea13c7f56f54f5b3e86ea to your computer and use it in GitHub Desktop.
Save apeckham/037b155c8abea13c7f56f54f5b3e86ea to your computer and use it in GitHub Desktop.
mount bucket on a remote instance and run filebrowser via port forward
gcloud compute instances stop "instance-xxx" --zone="zzz" --project="project-yyy"
gcloud beta compute instances set-scopes "instance-xxx" --scopes=storage-full --zone="zzz" --project="project-yyy"
gcloud compute instances start "instance-xxx" --zone="zzz" --project="project-yyy"
gcloud compute ssh --zone "zzz" "instance-xxx" --project "project-yyy" -- -L 8080:localhost:8080
# on the remote machine
gcloud init
export GCSFUSE_REPO=gcsfuse-`lsb_release -c -s`
echo "deb https://packages.cloud.google.com/apt $GCSFUSE_REPO main" | sudo tee /etc/apt/sources.list.d/gcsfuse.list
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
sudo apt-get update
sudo apt-get install fuse gcsfuse
gcsfuse -v
mkdir "$HOME/mount-folder"
gcsfuse bucket-zzz "$HOME/mount-folder"
ls mount-folder/
curl -fsSL https://raw.githubusercontent.com/filebrowser/get/master/get.sh | bash
filebrowser -r mount-folder
open http://localhost:8080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment