GCP-CLI notebook
The First thing you need is, of course, to create a Google account and establish a cloud service.
On Windows
Assume than you install Ubuntu.
By WSL
- Install Linux subsystem.
- Install Ubuntu distro for WSL.
- Install Google Cloud CLI
By VirtualBox
If you don't feel like installing WSL, maybe VirtualBox is your friend.
- Download Ubuntu ISO.
- Install Ubuntu on VirtualBox by ISO file.
- Go Install Google Cloud CLI
Install Google Cloud CLI
- Wherever you install your Ubuntu, you should now be in a Ubuntu shell. If so, open the installation guide and select
Debian/Ubuntu
on the manual. - After installing, log in by Google Cloud CLI with your account. When login succussed and entered the cloud shell, exit.
- Now type
gcloud cloud-shell ssh --ssh-flag "-L 8080:localhost:80" --ssh-flag "-L 33306:localhost:3306" --ssh-flag "-L 2222:localhost:22"
Try Git and composer
There are two ways to upload/download files to Google Cloud Shell: Git or FTP. The former need to buy some books...
Actually, since the cloud shell SSH has installed git
and composer
, so...
How to Git
Test Git
git clone https://github.com/Azure-Samples/html-docs-hello-world.git
mv html-docs-hello-world html-test
- Access
http://127.0.0.1:8080/html-test/
You should see the "Azure App Service" page even though it's not.
Test composer
composer create-project laravel/laravel laravel-app --prefer-dist
cd laravel-app
sudo chmod -R ugo+rw storage
- Access
http://127.0.0.1:8080/laravel-app/
You should see a Laravel page.
Oh, by the way, you can upload/download indirectly by pushing your app to Github, then pulling it from your Google Cloud Shell.
References
- Quickstart: Install the Google Cloud CLI | Google Cloud CLI Documentation
- 研蘋果 - Google Cloud Shell
- Google Cloud Shell 與 XAMPP 的完美結合 – 研蘋果
- Basic Task List - Laravel 5.1 - The PHP Framework For Web Artisans
- php - How to fix Error: laravel.log could not be opened? - Stack Overflow
- laravel - The stream or file "/storage/logs/laravel.log" could not be opened in append mode: failed to open stream: Permission denied