Contributing?

I’m not sure what the best category is for this. I’ve been working through solutions to some things that I needed and ended up with some straight-forward instructions for things. I wonder if there’s any use for it somewhere here? For example I have something I’m working on to mount a remote file system and several of its directories. Its more the kind of thing that would serve as a particular example rather than a templated solution.

Is there a place or a use for something like that?

2 Likes

Thanks for the suggestion - it comes up now and then.

Yeah, perhaps we need a sub-category under Support and Help called community-guides?

I wrote Debugging Audio Issues a while back, which could fit in there. I can imagine others in there too.

Making it a sub-category keeps it here under Support and Help - where it makes sense, and would be easily linked to. If they are made “wiki” pages (i.e. editable by anyone with an account) then they could be improved over time, as things like versions and package names change. So they don’t rot and become less useful.

I’m gonna move this topic to the Site Feedback category, to get visibility among moderators.

5 Likes

I like this idea. At the least, clarifying what does and doesn’t belong in Tutorials and Documentation would go a long way in helping us answer questions like these.

I got to thinking on it a little and realized that - yes - you could turn a specific solution into a templated solution for [a / the] specific use case. It would still stand as an example (of that use case for what is being worked with) but be suitable to be implemented on anyone’s machine - well almost. Kind of like a middleware of documentation type of thing.

Would it be permissible to post something like that in an existing category for now? @popey if I snugged one up next to yours in the Help and Support category would I get in trouble for it? I’m just curious. :wink:

1 Like

We were just discussing something similar in our last Forums transition meeting. I think the Support and Help would probably make the most sense for it to live. If we find it’s something really universal that should be amplified, we could look at crafting it into a proper Tutorial.

3 Likes

If there is / were some kind of style guide that’s simple enough to understand and use I’d love to find it. That would be cool to keep things tight like that (well I’d go off of it anyway).

Absolutely!
The best place to find the general dos and dont’s for tutorials would be here in the Tutorials Guide.

3 Likes

@aaronprisk

Sweet!

I’m guessing that the way this post was done is that the op marks his / her first post as the solution (click the solution button on your own post)?

1 Like

Well its’ been a while (I got busy for a minute) but I didn’t forget. I needed to doctor up what I had so it was a little more universal. I’d love to share this with the community but I wonder if anyone would help me vett this? Or should I start a different thread for it? Here is what I have. Is there any chance someone could see if it works for them and if it seems sensible and correct what I have? Thanks.

Here it is…


Set Up Local Mounts for the MEGA Remote File System

Ubuntu Version: ubuntu 24.04.2
Kernel: 6.8.0-54-generic
Rclone Version: 1.69.1
Mega Version (web): 5.49.3

Mounts We Will Be Setting UP

We will be setting up a mount for the entire remote file system as well as mounting several directories in the remote file system with Mega (online storage). IF this fits your use case or you just want to try it this should work well for a proof of concept. The code examples given will insert the value for your home directory for you but if you experience any issues you can also replace $HOME with your actual username as you proceed. You can find it by using the whoami command - it will show the username you are currently logged in under.

- Mega Root Filesystem: Mounts to $HOME/Mega
- Mega Collections Directory: Mounts to $HOME/Collections
- Mega Obsidian Directory: Mounts to $HOME/Obsidian
- Mega Projects Directory: Mounts to $HOME/Projects

Official Ubuntu documentation (as of the time of this post) can be found here

Create Directories

First we need to make sure that the directories (folders) that we need are there for us when we move on the the steps that come after. Copy each of the lines below and execute them one-by-one on your command line to create the mount directories on your local machine as well as directories on the mega remote filesystem. This will enable each of the service files we have just created in the previous step.

Create mount directories on your local machine

mkdir $HOME/Mega
mkdir $HOME/Collections
mkdir $HOME/Obsidian
mkdir $HOME/Projects

Create directories on Mega

After you have successfully logged into the web interface perform the following steps in order to create each directory on the remote file system.

  1. Click the Cloud drive tab located in the left sidebar (expand the sidebar if it is collapsed).
  2. Right mouse click and select Create folder (or click the Create folder button in the top right hand corner area).
  3. Enter one of
  • Collections
  • Obsidian
  • Projects

Repeat steps 1, 2, and 3 for each of the directories we need to create.

Official Mega documentation (as of the time of this post) can be found here but it does not appear to have an article on this procedure that I can find at this time.

Remote Configuration With Rclone

First lets set up our rclone configuration and make sure it works.

Set up the rclone config for Mega

Assuming we are using rclone version 1.69.1

  1. Run the following command to start and create the rclone configuration:

    rclone config
    
  2. You will be prompted with the following options:

    e) Edit existing remote
    n) New remote
    d) Delete remote
    r) Rename remote
    c) Copy remote
    s) Set configuration password
    q) Quit config
    

Type n and press Enter to create a new remote.

  1. You will be asked to name the remote. Enter a name of your choice (e.g., Mega):

    name> Mega
    
  2. Next, you will see a list of storage types. Select Mega by typing 33 and pressing Enter:

    > Type of storage to configure.
    Choose a number from below, or type in your own value.
    ...
    33 / Mega
       \ (Mega)
    ...
    Storage> 33
    
  3. You will be prompted to enter your Mega username (email) and password:

    user> your_email@example.com
    pass> your_password
    
  4. If you want to use advanced settings, you can configure them now. Otherwise, press Enter to accept the defaults.

  5. Finally, confirm the configuration by typing y and pressing Enter:

    y) Yes this is OK
    e) Edit this remote
    d) Delete this remote
    y/e/d> y
    
  6. Our Mega remote is now set up and ready to use. You can quit this configuration by typing q and pressing Enter.

Official Rclone documentation (as of the time of this post) can be found here

Testing the Connection to the Remote

  1. Test that the remote can be mounted (this verifies the rclone config and that the connection to mega is working).
rclone mount Mega:/ $HOME/Mega --allow-other --vfs-cache-mode writes

Creating and Enabling System Services with Systemd

Now its time to make things persistent. By doing these steps we will be able to retain the work we’ve done - even if the computer is shut off or rebooted. Lets create and Enable service files - one for each mount. We’re mounting remote directories; and, in one case, the whole thing).

Create the service file to mount the storage root (the entire mega remote file system)

nano ~/.config/systemd/user/mega-storage-root-mount.service

Service File Contents
Filename: mega-storage-root-mount.service

[Unit]
Description=Rclone Mount for Mega Root Filesystem
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
ExecStart=rclone mount Mega:/ $HOME/Mega \
--allow-other \
--vfs-cache-mode writes

ExecStop=/bin/fusermount -u $HOME/Mega
Restart=on-failure
RestartSec=10

[Install]
WantedBy=default.target

Check the contents of the service file

less ~/.config/systemd/user/mega-storage-root-mount.service

Create the service file to mount the Collections directory

nano ~/.config/systemd/user/mega-storage-collections-mount.service

Service File Contents
Filename: mega-storage-collections-mount.service

[Unit]
Description=Rclone Mount for Mega Collections Directory
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
ExecStart=rclone mount Mega:/Collections $HOME/Collections \
--allow-other \
--vfs-cache-mode writes

ExecStop=/bin/fusermount -u $HOME/Collections
Restart=on-failure
RestartSec=10

[Install]
WantedBy=default.target

Check the contents of the service file

less ~/.config/systemd/user/mega-storage-collections-mount.service

Create the service file to mount the Obsidian Directory
nano ~/.config/systemd/user/mega-storage-obsidian-mount.service

Service File Contents
Filename: mega-storage-obsidian-mount.service

[Unit]
Description=Rclone Mount for Mega Collections Directory
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
ExecStart=rclone mount Mega:/Obsidian $HOME/Obsidian \
--allow-other \
--vfs-cache-mode writes

ExecStop=/bin/fusermount -u $HOME/Obsidian
Restart=on-failure
RestartSec=10

[Install]
WantedBy=default.target

Check the contents of the service file

less ~/.config/systemd/user/mega-storage-obsidian-mount.service

Create the service file to mount the Projects Directory

nano ~/.config/systemd/user/mega-storage-projects-mount.service

Service File Contents
Filename: mega-storage-projects-mount.service

[Unit]
Description=Rclone Mount for Mega Projects Directory
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
ExecStart=rclone mount Mega:/Projects $HOME/Projects \
--allow-other \
--vfs-cache-mode writes

ExecStop=/bin/fusermount -u $HOME/Projects
Restart=on-failure
RestartSec=10

[Install]
WantedBy=default.target

Check the contents of the service file

less ~/.config/systemd/user/mega-storage-projects-mount.service

Add The Services To Systemd And Get Them Going

Reload the daemon

`systemctl --user daemon-reload`

Enable each service file

Copy each of the lines below and execute them one-by-one on your command line. This will enable each of the service files we have just created in the previous step.

systemctl --user enable mega-storage-root-mount
systemctl --user enable mega-storage-collections-mount
systemctl --user enable mega-storage-obsidian-mount
systemctl --user enable mega-storage

Start and check the status of each service file

systemctl --user start mega-storage-root-mount
systemctl --user status mega-storage-root-mount
systemctl --user start mega-storage-collections-mount
systemctl --user status mega-storage-collections-mount
systemctl --user start mega-storage-obsidian-mount
systemctl --user status mega-storage-obsidian-mount
systemctl --user start mega-storage-projects-mount
systemctl --user status mega-storage-projects-mount

Reboot your computer

Lets see by practical example whether it does what it’s supposed to?

Check in the file manager for the mount

Check it out - see if you can see and use it in your file manager?

Check the statuses of the service files again for a final confirmation

systemctl --user status mega-storage-root-mount
systemctl --user status mega-storage-obsidian-mount
systemctl --user status mega-storage-projects-mount

If everything has gone well you should have a working system of mounts that mount the mega remote file system (and a few directories in it) to your local machine.

Links

Official Ubuntu Documentation
Official Mega Documentation
Official Rclone Documentation

I was unaware of Mega and I have subscribed. I am subscribed to tresorit.com as a zerotrust vault and will now compare for my own needs.

This Mega introduction is an example of useful nuggets of learning information which get buried in the depths of discussion threads under vague headings … “Contributing?”. Might it be better holding it in a Mega vault … to be downloaded? Recycled.

I saw this time and time again on useful recurring themes in the old ubuntuforums forum.

Perhaps we need to leverage a vector database such as Milvus to search context of threads? Keywords would include “zerotrust”.

It is only by chance and curiosity that I landed in “Contributing?”.

Thanks. Glad you found it useful. In this thread I’m asking about how to contribute things like this here (just to let you know). Hope everything works out for you.

I’m hoping to move this to a better location but was seeking some input on what I have and make sure it’s - you know - readable, understandable, useful, actually works - that kind of stuff. :smile:

I will make one observation. I find it time consuming to go through such tutorials and copy and paste lines of code into my terminal. I argue that such contributions are smoother if presented in say Jupyter Notebook or https://quarto.org/.
Then the code can be run at each stage of the tutorial just by clicking a button.

1 Like

Ok - well - I put it here. hih.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.