 I got a question recently about how I do my terminal plots. In my mind, there's two ideas here. One is to make terminal graphics like you would see on Julia's Unicode plots. And the other is to make images like JPEGs or PNGs and push those to some kind of cloud server. The focus of this video is on that second option when you're in the terminal and you're working on a plot and you just want to see how it looks. You can look at it through your browser. And the way you do that is you push your plot to S3 buckets or Google Cloud Storage and you just refresh your browser after you push the image. So if you work for a large company, there's a good chance that there's a big security layer around some of the devices you might be using. So I mostly never work on my local machine. I'm usually working on an EC2 instance, a Linux instance. And the way I get into that EC2 is through a Bastion server. This is all pretty standard for large companies. On my local machine, I'll SSH to the Bastion and then SSH to the Linux instance. And so all I have is a terminal with my VIM configuration and I just get working. On that Linux instance, I'll output plots as JPEGs and use some kind of command utility if I'm using AWS or AWS utility to copy files from your computer to S3. If you're using Google Cloud Storage, it's a GSUtil and push those files to the Cloud Storage and then I can view those files in the Cloud Storage from my browser. An additional thing I'll be showing in this video is how to automate pushes when your image file changes and that's going to be done with Enter. I will note that AWS does have a sync option which allows you to sync a folder so when you make changes, it will update on the S3 bucket but I haven't had great luck with that and I searched the issues a little bit and found that there's a few other people struggling with it too. It's an open issue on GitHub and so I thought it'd be useful just to show how to do it with Enter so you don't have to rely on AWS to make sure their stuff is working. You can just take care of this kind of thing on your own. So the first thing is to curl the Google SDK and which is what I'm going to be using in this video and then unpack the tar file that you just curled with tar-xvzf. Once it's unpacked, you can go ahead and run the install script. You'll get a few prompts here. So for Google Cloud, the first thing you've got to run is gcloud init. What this is going to ask you to do is to log into your Google Cloud account. So this is a plot that I wanted to play around with. You don't need to know anything about the code or how this is generated. I'm just going to be editing the title of this plot and just showing how to move this plot around between the terminal and the browser. It looks like I don't have tidyverse installed. To install this, I run sudo apt install r-cran-tidyverse. If you don't have any r installed, you can run sudo apt install r-base with r-base-dev. So to push this, I just do gsutil and then use copy, just like the copy utility on Linux. So I'm copying my plot.jpg to the location shown in Google Cloud Storage. This shows that the copy worked so I can look at it in the browser. And that's really all there is to it. So when it comes down to it, it's just using gsutil to copy the file over to the browser and then you can refresh the browser to see your changes. So now for the cool part, this is the stuff I like, at least, is using enter ENTR. So with enter, what you can do is you can pass a file to enter and then it's going to look at that file. And anytime that file changes, run some kind of command. So the first thing is to apt install enter. I'm going to run a toy example here where I look for any file in the directory and run echo when that file changes. So here I'm just finding any final directory, passing it to enter. If you run a shell command, you just do sh-c and then echo. And so the first time you run this command, it runs. And so I'm going to go ahead and just edit a file here in the directory. And if it's successful, I should see update echoed. And I'm using a Tmux paints here. So you'll see that update worked. So with these Tmux paints, I've got one pane that's going to keep running enter in the background and one paint where I do all of my file editing. So in reality, I don't want enter to run when the script changes. I want it to run when the image changes. So here, what I'm going to do is I'm just going to make a change to the script, such as just adding this comment. And I should see that no update was made. Perfect. I worked exactly how I wanted it to. But now I'm going to change not just the file, but I want to change the image. So again, I'm just changing the title of this plot. I'm going to save and close this file and run the script, which will save the JPEG file. And you can see update there. So the update worked. So we know enter is working just exactly how we want. But we don't want enter just to print update. We want it to print update and to push the file to Google Cloud Storage. So that's what I'm going to be adding here is a command to push. And this is the same command that we used before. It's going to be gsutil and then copying the JPEG file up to the location in Google Cloud Storage. So enter went ahead and did its first run where it should have pushed the file up. So we can refresh and make sure that those edits were pushed. Now let's go ahead and edit this image again and see if this automation is working. And there it is. I'm going to make another change and save and rerun. The script is running and the plot completed. So enter should have pushed a new image. Perfect. And you can see all the updates that enter pushed. And that's all there is to it. A really nice way to push up plots that you're working on in the terminal in an automated way and view those updates as soon as you refresh your browser. Thanks for watching.