The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 2,574 other followers

Archive for the ‘GoogleCloudShell’ Category

Google Cloud Shell: connecting to cloud storage buckets

Posted by jpluimers on 2021/09/28

One of the drawbacks of Google Cloud Shell is that it will delete the home directory after 120 days of not using it: [WayBack] Deletion notice for my Google Cloud Shell home directory – Stack Overflow

This is documented [WayBack] here:

If you do not access Cloud Shell for 120 days, we will delete your home disk. You will receive an email notification before we do so and simply starting a session will prevent its removal.

This only applies to the home directory of your Cloud Shell instance (you may want to store it on Cloud Storage anyway if you want to keep it). Any other Google services you use will be unaffected.

I hardly use the cloud shell, as it is a last resort to shell out from overly protected networks. Fewer and fewer environments restrict so much, so I’ve bumped into the home directory deletion a few times now.

I might use it more in the future, as I recently discovered there is a URL trick so you can start a cloud shell with parameters like an initial git repository: [WayBack] Open in Cloud Shell  |  Google Cloud

The Open in Cloud Shell feature allows you to publish a link that opens the Cloud Console and either automatically clones a Git repository into Cloud Shell or starts Cloud Shell with a custom image. It also allows for instructions to be printed to the terminal to help users interact with the content.

The Open in Cloud Shell feature helps developers experiment with code samples and APIs without having to worry about downloading Cloud SDK, installing required dependencies, or searching for relevant source files. This page explains how to add this feature to your Git repository.

Currently, only GitHub and Bitbucket repositories are whitelisted. If you would like to add a different repository, send feedback with the repository type you’d like to use with Open in Cloud Shell.

Setting up the home directory with my scripts can be a curse, so I have contemplated on these kinds of solutions:

  • store scripts in Google Drive, and mount part of Google Drive into the Cloud Shell
  • store scripts in Google Cloud Storage
  • script the setup of the home directory via a bash script in a gist

Some links that will hopefully help me with that:

  • [WayBack] Use the Google Cloud Shell to Upload files to Google Drive : DataHoarder
  • [WayBack] Open Your Repository In Google Cloud Shell – Daisuke Maki – Medium
  • [WayBack] gsutil – Google cloud storage – Download file from web – Stack Overflow

    mount the bucket in your Cloud Shell using gcsfuse:

    Create a directory in your Cloud Shell user home

     mkdir ~/mybucket
    

    Now mount your bucket in that directory using gcsfuse:

     gcsfuse bucket_name ~/mybucket
    

    Change the current directory to mount point directory:

     cd mybucket
    

    (if you want to have some fun run “df -h .” to see how much space you got in that mount point)

    seems to work for all file sizes:

     curl http://speedtest.tele2.net/10GB.zip | gsutil cp - gs://YOUR_BUCKET_NAME/10GB.zip
    

    Basically curl “streams” the data directly to the bucket.

  • [WayBack] Limitations and restrictions  |  Cloud Shell  |  Google Cloud

    Usage limits

    Cloud Shell inactivity: If you do not access Cloud Shell for 120 days, your home disk will be deleted. You will receive an email notification before its deletion and simply starting a session will prevent its removal. Please consider a different solution on Google Cloud storage for sensitive data you wish to store long term.

    Non-interactive usage: Cloud Shell is intended for interactive use only. Non-interactive sessions will be ended automatically after a warning. Note that Cloud Shell sessions are capped at 12 hours, after which sessions are automatically terminated. You can use a new session immediately after.

    Weekly usage: Cloud Shell also has weekly usage limits. If you reach your usage limit, you’ll need to wait until the specified time (listed under Usage Quota, found under the three dots menu icon) before you can use Cloud Shell again.

    Restoring a session after a service limit violation: If your session is terminated or cannot be established because you exceeded a service limit, Cloud Shell will display an error with a link to a form that allows you to appeal the limit violation. Click the feedback link and submit the form with more information about the tasks you were performing before your session was terminated.

–jeroen

Posted in bash, Development, Google, GoogleCloudShell, GoogleDrive, Power User, Scripting, Software Development | Leave a Comment »

Free Linux cloud shell for Gmail users – shell in the browser that works in all locations I’ve been so far

Posted by jpluimers on 2020/05/18

This is still so cool: [WayBack] Free Linux cloud shell for Gmail users … – Adrian Marius Popa – Google+:

Free Linux cloud shell for Gmail users

https://news.ycombinator.com/item?id=16247577

comments are more interesting

“If you want a free Linux box with a Public IP and SSH, I’d recommend spinning up an f1-micro VM. It’s part of the permanent free tier”

https://news.ycombinator.com/item?id=16248668

Even cooler is that you can use it both from a web browser and from your own console, more on that below.

Cloud Shell from the web

The above links:

Read the rest of this entry »

Posted in Google, GoogleCloudShell, Power User | Leave a Comment »

Need to research eternal “Establishing connection to your Google Cloud Shell”; gcp – Google Cloud Shell does not start – Stack Overflow

Posted by jpluimers on 2019/12/06

A while back I had a  after .

The problem is that after a successful “Provisioning your Google Cloud Shell machine”, the “Establishing connection to your Google Cloud Shell” did not go away, while the Cloud Shell Code Editor did work:

It was an awful situation, as the mobile reception was bad (so I could not start a hotspot), and the WiFi did not allow for SSH or VPN connections: exactly the situation where Google Cloud Shell is designed for.

A day later it was fine, so I am still not sure what went wrong, nor how I could get it to work if it ever fails again.

Anyone with an idea?

These are inconclusive:

It is a different problem than [WayBack] Google App Engine – cloud shell where both the shell and the code editor failed at the same time.

–jeroen

Read the rest of this entry »

Posted in Google, GoogleCloudShell, Power User | Leave a Comment »

 
%d bloggers like this: