Pages

Showing posts with label explanations. Show all posts
Showing posts with label explanations. Show all posts

Monday, 12 June 2023

A Dummies Guide to RClone (rclone?)

Situation: you have to download everything on a Google Drive before a deadline.

Problem #1: when Google Drive zips large folders, it doesn't include all files in them (it's a major wtf but it's true)

Solution #1: rclone

Problem #2: you have no idea how to use rclone and that website is designed for people who know how to use it (it's a major wtf but I believe that's true)

Solution #2: my dummies guide to rclone. 


If that's you, welcome. Let's start.


Installing rclone

I can't actually remember how to do this. Hopefully it's pretty straightforward. If it's not, here's the video I had to watch way too much of to re-learn the very basic things I wanted to do. Only watch the download section because the rest of it will put you wrong.


Using rclone

Rclone is a tool you use through the command line/terminal/powershell interface. What you want to do is go to the folder you installed rclone in and type cmd into the directory bar: this opens the terminal in that folder.

Creating a "Remote" (link to your Google Drive)

The next thing you want to do is set up the link between your machine (where you installed rclone) and your Google Drive (rclone handles lots of other cloud storage services as well). This is actually explained in a reasonably straightforward way by rclone itself. My headline is this: for a general purpose user all you want to do is type this stuff (hit enter each line):

rclone config (to access the menu to create a new link)

n (to create the new link)

main (to create a link named main; obviously you can name it anything... the advice is to make it short; I'd also avoid spaces, slashes etc because computers often hate spaces, slashes etc, but that is a guess)

18 (this is the number that tells rclone you want to make the link to Google Drive)

(press enter)

(press enter)

1 (you'll want as much as possible, I imagine)

(press enter)

n (you're a dummy; you can't do anything advance)

y (this will open a tab in your default browser with a list of all your Google Accounts, choose the one whose drive you're interested in and then accept)

n (unless you want a shared drive)

y (to keep the hard work you've just done)

q (unless you want to set up another link, say to a shared drive)

What if you want to download from a shared drive?

The good news is that it's almost identical in process. For simplicity's sake, I have copied and pasted the above up until the divergence point:

rclone config (to access the menu to create a new link)

n (to create the new link)

shared1 (to create a link named shared1; obviously you can name it anything... the advice is to make it short; I'd also avoid spaces, slashes etc because computers often hate spaces, slashes etc, but that is a guess)

18 (this is the number that tells rclone you want to make the link to Google Drive)

(press enter)

(press enter)

1 (you'll want as much as possible, I imagine)

(press enter)

n (you're a dummy; you can't do anything advance)

y (this will open a tab in your default browser with a list of all your Google Accounts, choose the one whose drive you're interested in and then accept)

y (because we want a shared drive)

1 (I'm not sure how it works if you've only got one shared drive; I have several so I enter the number 1 for the first one, 2 for the second one and so forth)

y (to keep your hard work)

q (unless you want to do another drive)

Doing the Downloading

The basic tool here is "copy". Warning: it doesn't download duplicate files. Alas, if you go to rclone's copy help page on its website what you get is basically:

rclone copy source:sourcepath dest:destpath

That is not very helpful, right?

What you want to do is this:

rclone copy main: C:\Users\heast\Downloads\SharedDrives -P

  • "main:" identifies the link (remote/drive) that I want to copy from. 
  • "C:\..." identifies the folder I want to send the copied files to
  • -P tells rclone to give me a constantly updating progress bar
And that's it! All you have to do is wait. It's actually pretty bloody quick so it shouldn't take too long.

Warning: if your folder has a space in its name, rclone will throw a hissy fit. That's why I've called my folder SharedDrives not Shared Drives. Obviously you can just rename the folder how you want after rclone's finished.

Doing Literally Anything Else

I believe you now know enough about how to use rclone that you can make sense of the documentation pages on rclone's website for the various functionalities it provides.

Saturday, 15 April 2017

The Zombie's Guide to Installing R on Ubuntu

There is a how-to in this post, scroll down until the other bolded heading or ctrl-F for guide. If you're wondering what the rest of this blog is like, read the whole thing.

https://linuxconfig.org/rstudio-on-ubuntu-18-04-bionic-beaver-linux

Paperweights : Misadventures in Consuming and "Computing"

Just after we moved house at the end of 2015 I decided that I should get another laptop. Not a new laptop but another laptop.

You see, the major issue with the laptop that I had at the time was that it was fairly big and heavy, i.e. impractical when I wanted (on those rare occasions) to bring it in with me to uni. (Incidentally, this was why my granfather had given me the laptop in the first place.) Thus, what was needed was something pretty small and lightweight. It would also need to have an hdmi port so we could use it to watch television (this was envisioned as the primary function).

Now, you might remember that I have taken a couple of marketing papers and one of the big things in marketing is the notion of involvement. Specifically, with high involvement purchasing* like what happens when buying a laptop is that you do some research. Basically this involves shopping around and trying to find the best product-as-solution to a perceived problem. The thing is that I am a very price conscious consumer and I had the terrible luck to start my search on the same day as a one-off sale. And like the dweebish consumer I am, the one-off sale convinced me into making a decision I should have deferred. I bought an HP Stream pre-loaded with Windows 10. (Apple was never in the running.) We got it a few days later.

These laptops are pretty small (11" or thereabouts) and come in bright colours. They also have next to no hard-drive space (like 28 GB) and are thus designed entirely for the Cloud. This stuff is all fine although I didn't really appreciate it until after I bought it. After all, what I wanted was something that I could use occasionally for uni work (i.e. just needed enough space for Word and R/RStudio) and which could use the internet to watch stuff. And so life was good, for a time. I even called the computer Light Blue, which I thought was hilarious. (And it was.)

After a few months or whatever I started getting memory warnings. Somehow there was less than a GB of space left? It didn't make any sense. But it turns out to be a pretty common issue. Whether or not I would have thought to check for known memory issues prior to my experiences with Light Blue is definitely a question to ask, but I feel like maybe I could have saved myself the memory trouble if I had started the search even a day later. Anyway, I found a solution... but I forget what it was.

Life went on and Light Blue was pretty much used exclusively to watch the great many different things we watch on things like TVNZ On Demand or play Youtube videos when we've been cooking. But then, after some months, I became aware that the memory was filling up again. And this time I couldn't find a way out of the fix. This was, I guess, when I resolved to install Ubuntu.

I've been aware of Linux generally and Ubuntu specifically for some years now. This is because on some of the websites I visit some of the other users are Ubuntu-ites and they talk about this in OS threads. However, I had never really met anyone who used Linux except this one dude who I don't know very well and who I haven't seen for over a year anyway. So, I decided to do some research about Christmas-time last year (I think I had finally decided to actually go ahead with my plan rather than having conceived it then). The results were clear. I needed to get two USB sticks and I should use them to install Ubuntu (as opposed to a different Linux system).

The idea was pretty simple. I would back up Light Blue as a Windows system on one of the data sticks and the other would be used to install Ubuntu. But I didn't do anything. That is, until today... the first weekend of the holidays and a few days after persistent crashes related to memory shortages. But it turned out that installing Ubuntu was the easy part (although I did have to do it twice, but this took like thirty minutes).

The truth is that I haven't changed what I need from a computer much in the last two years. Basically, LinuxBlue (I changed the name) needs to do exactly the same stuff as before. Luckily, Libre Office comes with Ubuntu and doesn't seem to have any major compatibility issues with Word (and if it does... copy and paste, am I right?). R doesn't come with Ubuntu as such, though. And installing it was a bit complex.

If you don't know what R is, you should find out. But basically, it's a statistical computing language (think like Python or Fortran but just for stats) based on S Plus, developed at the University of Auckland that is completely free. It represents the sum total of all my "coding" knowledge... and obviously I am a newbie when it comes to Ubuntu to Linux. Sadly, I think most people who want to use R on a Linux system aren't as end-usery as me... which meant it wasn't really clear how to get R onto the machine (RStudio was no problem, though). In fact, it was more troublesome than getting Ubuntu in the first place! Which brings me to the useful part of this blog:

A Beginner's Guide to Installing R on Ubuntu, by A Noob

Basically, we'll be following exactly what I did. So, start by following this link. All the stuff we'll be mindlessly typing was sourced from that helpful page.

The second thing is to go here and install RStudio. Don't try and open it because we haven't installed R yet so it won't work. Actually, you probably should try and open it (from "files") because that's what I did and this is a zombie's guide so we should probably follow the formula I used even if it is illogical. This is also your caution. Imagine that I am a moron. That's the level of expertise that went into the process you're about to follow (or read).

Next, go to the "search your computer" thing and find the terminal. Open it and type in, from the link:

sudo echo "deb http://cran.rstudio.com/bin/linux/ubuntu xenial/" | sudo tee -a /etc/apt/sources.list
Now, you can probably change the url but, as I said, I'm a noob, so I wouldn't try when I can tell you for a fact that just mindlessly typing the stuff in works.

That being said, you need to type in your password at this point. If nothing shows up and you're randomly bashing keys, just press enter and then type your password and imagine that asterisks are popping up.  Then hit enter and mindlessly type the following:

 gpg --keyserver keyserver.ubuntu.com --recv-key E084DAB9
then:

 gpg -a --export E084DAB9 | sudo apt-key add -

At this point I got a warning message. I ignored it.

sudo apt-get update
sudo apt-get install r-base r-base-dev

After the first one I got a bunch of prompts so just read those and always go with the yes option.

After the second one I wasn't sure if it had actually finished working or not, so I decided to open RStudio... which worked this time. I then installed s20x and R330 because they're packages I remember using from courses I have taken.

Hope this helps!

(And I am hopeful my decision to explore Ubuntu resolves the memory issue that looked as if it was creating a $300 paperweight.)

*See my recent blog post here for why this is a problematic concept . If you're wondering why it seems so much more pro than my usual stuff that's because it is actually just an essay I handed in last year that I couldn't be bothered copying from to explain involvement properly for readers of this post.